:root {
  --brand: #1f3a8a;
  --brand-2: #2b52c7;
  --in: #16a34a;
  --out: #dc2626;
  --bg: #f3f5fa;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #6b7385;
  --line: #e3e7ef;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.top {
  display: flex; justify-content: space-between; align-items: center;
  height: 56px; padding-top: env(safe-area-inset-top);
}
.company { font-weight: 700; color: var(--brand); }
.link { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 8px; cursor: pointer; }

.title { font-size: 26px; margin: 40px 0 6px; }
.sub { color: var(--muted); margin: 0 0 28px; }
.form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.form select, .form input {
  display: block; width: 100%; margin-top: 6px; height: 52px; padding: 0 14px;
  font-size: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text);
}
.form input:focus, .form select:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
.btn {
  height: 50px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.block { width: 100%; margin-top: 8px; }
.error { color: var(--out); min-height: 20px; font-size: 14px; }

.hello { margin: 8px 0 0; color: var(--muted); }
.hello b { color: var(--text); }
.clock { text-align: center; margin: 28px 0 12px; }
.clock-date { color: var(--muted); font-size: 15px; }
.clock-time { font-size: 52px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.status { text-align: center; min-height: 24px; font-size: 15px; color: var(--muted); }
.status .badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; margin-right: 6px; }
.badge.on { background: #dcfce7; color: var(--in); }
.badge.off { background: #eef1f6; color: var(--muted); }

.punch {
  display: block; width: 200px; height: 200px; margin: 24px auto; border-radius: 50%;
  border: 0; color: #fff; font-size: 26px; font-weight: 800; cursor: pointer;
  box-shadow: 0 12px 30px rgba(31, 58, 138, .25); transition: transform .08s;
}
.punch:active { transform: scale(.96); }
.punch:disabled { opacity: .6; }
.punch.in { background: linear-gradient(160deg, #22c55e, var(--in)); box-shadow: 0 12px 30px rgba(22, 163, 74, .3); }
.punch.out { background: linear-gradient(160deg, #f87171, var(--out)); box-shadow: 0 12px 30px rgba(220, 38, 38, .3); }
.punch small { display: block; font-size: 14px; font-weight: 500; opacity: .9; margin-top: 6px; }

.place-hint { text-align: center; font-size: 13px; color: var(--muted); margin: -8px 0 20px; }
.place-hint.blocked { color: var(--out); font-weight: 600; }

.card { background: var(--card); border-radius: 14px; padding: 16px 18px; border: 1px solid var(--line); }
.week { display: flex; justify-content: space-between; align-items: center; }
.week b { font-size: 20px; color: var(--brand); }

.section-title { font-size: 16px; margin: 28px 0 10px; }
.recent { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.recent li { display: flex; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.recent li:last-child { border-bottom: 0; }
.recent .d { color: var(--muted); }
.recent .t { font-variant-numeric: tabular-nums; }
.recent .open { color: var(--in); font-weight: 600; }
.recent .missing { color: var(--out); }
.recent .empty { color: var(--muted); justify-content: center; }

.help-link { text-align: center; margin: 24px 0 0; font-size: 14px; }
.help-link a { color: var(--muted); }

.sheet { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet-body { background: var(--card); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-body p { font-size: 18px; text-align: center; margin: 4px 0 20px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -20px); opacity: 0;
  background: #111827; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 15px;
  transition: all .2s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
