@import url('./fonts/pretendardvariable-dynamic-subset.css');

/* Design tokens: docs/DESIGN.md. Do not add new colors. */
:root {
  --paper: #ffffff;
  --ink: #000000;
  --sub: #767676;
  --line: #e4e4e4;
  --fill: #f2f2f2;
  --card: #f6f6f6;
  --card-line: #d9d9d9;
  --alert: #d93025;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Hiragino Sans', 'PingFang SC', 'Noto Sans KR', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000; --ink: #ffffff; --sub: #8f8f8f; --line: #262626;
    --fill: #1a1a1a; --card: #121212; --card-line: #303030; --alert: #ff6b5f;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
:lang(ko) body, body:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }

.num { font-variant-numeric: tabular-nums; letter-spacing: -0.05em; font-weight: 800; }
.sub { color: var(--sub); }
.small { font-size: 13px; }
.h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; margin: 0; }
.h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.error { color: var(--alert); font-size: 13px; min-height: 1.5em; margin: 6px 2px 0; }

/* Buttons: pill shape */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px;
  font-weight: 700; font-size: 15px;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-secondary { background: var(--fill); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-text { background: transparent; color: var(--sub); padding: 0 8px; }
.btn-block { width: 100%; height: 56px; font-size: 17px; }

.input {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1.5px solid transparent; border-radius: 14px;
  background: var(--fill); font-size: 17px; outline: none;
}
.input:focus { border-color: var(--ink); }
.label { display: block; font-size: 13px; color: var(--sub); margin: 0 2px 6px; }

.card {
  border-radius: 22px; background: var(--card); border: 1px solid var(--card-line);
  padding: 18px 20px;
}

/* Language tabs */
.langs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; }
.langs button {
  border: 0; background: transparent; border-radius: 999px;
  height: 30px; min-width: 36px; padding: 0 9px;
  font-size: 13px; font-weight: 700; color: var(--sub); cursor: pointer;
}
.langs button[aria-pressed='true'] { background: var(--fill); color: var(--ink); }

/* Customer page */
.page { max-width: 440px; margin: 0 auto; padding: 14px 20px 40px; min-height: 100dvh; }
.top { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.store { margin: 22px 0 4px; }
.home-title { margin-bottom: 22px; white-space: pre-line; }
.now-card .row { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.now-card .big { font-size: 44px; line-height: 1.1; }
.now-card .unit { font-size: 19px; font-weight: 800; }
.field { margin-top: 22px; }
.note { margin: 4px 2px 18px; }
.closed-card { margin-top: 12px; }
.closed-card p { margin: 4px 0 0; }
.find { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.find .row { display: flex; gap: 8px; }
.find .row .btn { height: 52px; flex: none; }

.sound-btn { margin: 6px 0 16px; }

/* Polaroid card: the only decoration in the service, used on the "my turn" screen only. */
.polaroid {
  background: #ffffff; color: #000000;
  border: 1px solid var(--card-line); border-radius: 6px;
  padding: 14px 14px 0;
  margin: 10px auto 0; max-width: 340px;
}
.photo {
  aspect-ratio: 1; border-radius: 2px; background: #f2f2f2; color: #000000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background-color 0.4s ease, color 0.4s ease;
}
.photo .label-in { font-size: 15px; font-weight: 700; color: #767676; transition: color 0.4s ease; }
.photo .number { font-size: clamp(96px, 34vw, 150px); line-height: 1; margin-top: 4px; }
.polaroid.on .photo { background: #000000; color: #ffffff; }
.polaroid.on .photo .label-in { color: #ffffff; }
.caption {
  display: flex; justify-content: space-between; align-items: center;
  height: 64px; padding: 0 4px; font-size: 15px; font-weight: 700;
}
.caption .time { color: #767676; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .photo, .photo .label-in { transition: none; }
  .btn { transition: none; }
}

.status { margin-top: 26px; }
.status .desc { margin: 6px 0 0; font-size: 17px; }
.status .meta { margin-top: 4px; }
.keep-on { margin-top: 18px; font-weight: 700; }
.keep-on p { margin: 2px 0 0; font-weight: 500; }
.actions { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.confirm { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.confirm p { width: 100%; text-align: center; margin: 0 0 4px; }

/* ---------- Staff page (store PC, 1280 wide; must not break on tablet/phone) ---------- */
.staff-body { min-height: 100dvh; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 6px; }
.login-box .h1 { margin: 6px 0 18px; }
.pin { font-size: 24px; letter-spacing: 0.3em; text-align: center; }

.staff-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 28px; border-bottom: 1px solid var(--line);
}
.staff-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.staff-nav { display: flex; gap: 8px; flex-wrap: wrap; }
a.btn { text-decoration: none; }
.pill {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700;
}
.pill.off { background: var(--fill); color: var(--alert); }

.staff-main {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px;
  padding: 28px 28px 120px; max-width: 1400px; margin: 0 auto;
}
@media (max-width: 860px) {
  .staff-main { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 20px 16px 120px; }
  .staff-top { padding: 14px 16px; }
}

.calling { border-radius: 22px; background: var(--card); border: 1px solid var(--card-line);
  padding: 18px 20px; }
.call-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 6px; }
.call-row + .call-row { border-top: 1px solid var(--line); padding-top: 12px; }
.call-info { display: flex; align-items: center; gap: 16px; }
.call-num { font-size: 48px; line-height: 1; }
.call-meta { display: flex; flex-direction: column; }
.call-phone { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.call-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { margin: 10px 0 4px; }

.next-btn { width: 100%; height: 72px; font-size: 22px; margin-top: 18px; }
.next-hint { margin: 10px 4px 0; min-height: 1.5em; }
.kbd { display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--fill);
  color: var(--ink); font-weight: 700; margin-right: 6px; }

.stats { display: flex; gap: 32px; flex-wrap: wrap; margin: 28px 4px 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-size: 13px; color: var(--sub); }
.stats dd { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rows { list-style: none; margin: 10px 0 0; padding: 0; }
.row { display: flex; align-items: center; gap: 18px; padding: 14px 4px;
  border-bottom: 1px solid var(--line); }
.row-num { font-size: 34px; min-width: 2.2ch; line-height: 1; }
.row-info { flex: 1; min-width: 0; }
.row-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-phone { font-weight: 700; font-variant-numeric: tabular-nums; }
.tag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--fill); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 8px 8px 8px 22px; min-height: 56px; font-weight: 700;
}
.btn-outline-inv { background: transparent; color: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--paper); flex: none; }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4);
  display: grid; place-items: center; padding: 16px; z-index: 10; }
.sheet-box { width: 100%; max-width: 420px; background: var(--paper); border-radius: 22px;
  padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.sheet-box .label { margin-top: 8px; }
.lang-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- QR print (A5) ---------- */
.qr-body { background: var(--fill); }
.qr-tools { display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
  gap: 8px; padding: 16px; }
.qr-tools .error:empty { display: none; }
.qr-sheet {
  width: 148mm; min-height: 210mm; margin: 0 auto 32px; padding: 14mm 14mm 10mm;
  background: #ffffff; color: #000000;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.qr-head { width: 100%; display: flex; align-items: baseline; justify-content: space-between; }
.qr-brand { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.qr-store { font-size: 15px; font-weight: 700; color: #767676; }
.qr-title { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3;
  margin: 12mm 0 8mm; word-break: keep-all; }
.qr-code { width: 72mm; height: 72mm; padding: 4mm; border: 1px solid #d9d9d9; border-radius: 4mm; }
.qr-code svg { width: 100%; height: 100%; display: block; }
.qr-lines { list-style: none; padding: 0; margin: 9mm 0 0; display: flex; flex-direction: column;
  gap: 2.5mm; font-size: 14px; font-weight: 600; }
.qr-lines li:first-child { font-size: 16px; font-weight: 800; }
.qr-url { margin-top: auto; padding-top: 8mm; font-size: 12px; color: #767676; }
@page { size: A5 portrait; margin: 0; }
@media print {
  .qr-body { background: #ffffff; }
  .qr-tools { display: none; }
  .qr-sheet { margin: 0; width: 148mm; height: 210mm; overflow: hidden; }
}
