:root {
  --bg: #f6f3ee; --card: #fff; --ink: #2b2420; --sub: #8a7f76; --line: #e7e0d7;
  --brand: #6b4a35; --brand-ink: #fff; --ok: #2f7d4f; --warn: #c2571a; --bad: #b3261e;
  --soft: #f0e9e1;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1816; --card: #262220; --ink: #f2ece6; --sub: #a59a90; --line: #3a3430;
    --brand: #c99a75; --brand-ink: #1b1816; --soft: #322c28; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
main { max-width: 480px; margin: 0 auto; padding: 24px 18px calc(40px + env(safe-area-inset-bottom)); }
h1 { font-size: 22px; margin: 4px 0 2px; }
.sub { color: var(--sub); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-top: 16px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=tel], input[type=text], input[type=number], textarea {
  width: 100%; font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
textarea { font-size: 15px; min-height: 90px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; font-size: 26px; }
.stepper output { font-size: 28px; font-weight: 700; min-width: 70px; text-align: center; }
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--soft);
  color: var(--ink); border-radius: 12px; padding: 10px 14px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; }
button:disabled { opacity: .5; }
.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.big { width: 100%; padding: 16px; font-size: 18px; margin-top: 18px; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--sub); }
.agree input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 10px; }
.hidden, [hidden] { display: none !important; }

/* 손님 대기 화면 */
.ticket { text-align: center; padding: 28px 18px; }
.ticket .num { font-size: 64px; font-weight: 800; line-height: 1.1; color: var(--brand); }
.ticket .ahead { font-size: 22px; font-weight: 700; margin-top: 10px; }
.ticket.called { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.ticket.called .num { color: var(--brand-ink); }
.ticket.called .sub { color: inherit; opacity: .85; }
.note { font-size: 14px; color: var(--sub); margin-top: 14px; text-align: center; }
.link { background: none; border: none; color: var(--sub); text-decoration: underline; font-weight: 400; width: 100%; margin-top: 18px; }

/* 사장님 화면 */
.admin main { max-width: 640px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.toggle { padding: 8px 12px; border-radius: 999px; font-size: 14px; }
.toggle.on { background: var(--ok); color: #fff; border-color: var(--ok); }
.toggle.off { background: var(--bad); color: #fff; border-color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--sub); }
.tabs { display: flex; gap: 8px; margin-top: 16px; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 10px; }
.entry.called { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; }
.entry .row1 { display: flex; align-items: baseline; gap: 10px; }
.entry .no { font-size: 24px; font-weight: 800; }
.entry .who { font-size: 17px; font-weight: 600; }
.entry .meta { margin-left: auto; color: var(--sub); font-size: 14px; text-align: right; }
.entry .tag { font-size: 13px; color: var(--warn); font-weight: 600; margin-top: 4px; }
.entry .acts { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.entry .acts .btn, .entry .acts button { padding: 12px 6px; font-size: 15px; }
.entry .call { background: var(--warn); color: #fff; border-color: var(--warn); }
.entry .seat { background: var(--ok); color: #fff; border-color: var(--ok); }
.entry.done { opacity: .75; }
.entry.done .acts { grid-template-columns: 1fr; }
.empty { text-align: center; color: var(--sub); padding: 40px 0; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
dialog { border: none; border-radius: 18px; padding: 20px; width: min(92vw, 420px); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.4); }
.dlg-acts { display: flex; gap: 10px; margin-top: 18px; }
.dlg-acts button { flex: 1; padding: 14px; }
.mt { margin-top: 14px; }
.nomt { margin-top: 0; }

/* 공개 상태 */
.pub { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pub .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sub); flex: none; }
.pub.on .dot { background: var(--ok); }
.pub .grow { flex: 1; }
.pub .warn { color: var(--bad); }
select { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
input[type=time] { width: 100%; font: inherit; font-size: 18px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* 입구 QR 인쇄 */
.qrpage { background: #fff; color: #000; }
.qrbar { display: flex; justify-content: space-between; padding: 14px; max-width: 520px; margin: 0 auto; }
.poster { max-width: 520px; margin: 0 auto; text-align: center; padding: 30px 20px; }
.poster-cafe { font-size: 22px; letter-spacing: .1em; }
.poster-title { font-size: 46px; font-weight: 800; margin: 6px 0 24px; }
.poster-qr { width: 78%; max-width: 380px; aspect-ratio: 1; }
.poster-step { font-size: 22px; font-weight: 600; margin-top: 22px; line-height: 1.5; }
.poster-sub { font-size: 16px; color: #555; margin-top: 10px; }
@media print {
  .noprint { display: none !important; }
  .poster { padding-top: 60px; }
  @page { size: A4; margin: 15mm; }
}
.ticket .nick { font-size: 18px; font-weight: 600; margin-top: 4px; }
label .sub { font-weight: 400; }
