:root {
  --glass: #e4ebf0;
  --leather: #241c18;
  --brass: #a6843d;
  --brass-deep: #7c6230;
  --pole: #9e2a2b;
  --paper: #f7f5f2;
  --ink: #1c1917;
  --steel: #5c6b73;
  --line: #d5dee4;
  --ok: #1f6b4a;
  --shadow: 0 12px 28px rgba(36, 28, 24, 0.08);
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Figtree", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--glass);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass-deep); outline-offset: 2px; }
a { color: var(--brass-deep); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(247, 245, 242, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.brand strong {
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  line-height: 0.9;
  font-weight: 700;
}
.brand span { color: var(--steel); font-size: 0.78rem; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.92rem;
}
.nav a[aria-current="page"] {
  background: var(--leather);
  color: var(--paper);
}

main { padding: 28px 22px 64px; }
.wrap { max-width: 1120px; margin: 0 auto; }
.narrow { max-width: 440px; margin: 0 auto; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0.03em; margin: 0; }
h1 { font-size: 3rem; line-height: 0.9; }
h2 { font-size: 2rem; line-height: 0.95; }
.lede { color: var(--steel); margin: 8px 0 0; }

.ticket {
  background: var(--paper);
  border-top: 8px solid var(--leather);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 16px;
}
.ticket header, .ticket .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.chair-no {
  font-family: var(--display);
  font-size: 1.8rem;
  color: var(--brass-deep);
  line-height: 0.9;
}
.muted { color: var(--steel); font-size: 0.88rem; }
.price { font-family: var(--mono); font-size: 0.92rem; }

.choice, .slot, .btn, .btn-quiet, .btn-danger {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
}
.choice, .slot { text-align: left; width: 100%; }
.choice { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.choice[aria-pressed="true"], .slot[aria-pressed="true"], .addon[aria-pressed="true"] {
  border-color: var(--leather);
  background: #f3ead7;
}
.slot-grid, .addon-row { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { width: auto; min-width: 108px; }
.addon { border: 1px dashed var(--brass); background: transparent; border-radius: 999px; padding: 6px 10px; }
.btn, .btn-quiet, .btn-danger { width: auto; margin-top: 8px; font-weight: 650; }
.narrow .btn, .narrow .btn-quiet, .narrow .btn-danger,
.panel .btn, .panel .btn-quiet,
.drawer .btn, .drawer .btn-quiet, .drawer .btn-danger { width: 100%; }
.btn { background: var(--leather); color: var(--paper); border-color: var(--leather); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-danger { background: var(--pole); color: white; border-color: var(--pole); }
label { display: block; font-size: 0.82rem; color: var(--steel); margin: 12px 0 4px; }
input, select {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.steps { display: flex; gap: 8px; margin: 18px 0; }
.steps span {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--steel);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.steps span.on { color: var(--ink); border-color: var(--pole); }

.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: end; flex-wrap: wrap; }
.date-nav { display: flex; align-items: center; gap: 8px; }
.date-nav button { width: auto; margin: 0; padding: 8px 12px; }

.board-scroll { overflow-x: auto; margin-top: 18px; }
.board {
  display: grid;
  grid-template-columns: 64px repeat(4, minmax(180px, 1fr));
  min-width: 860px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--line);
}
.chair-head, .time-gutter, .chair-col { border-right: 1px solid var(--line); }
.chair-head {
  background: var(--leather);
  color: var(--paper);
  padding: 12px;
  position: sticky;
  top: 58px;
  z-index: 2;
}
.chair-head .chair-no { color: var(--brass); }
.time-gutter { position: relative; background: rgba(255,255,255,0.55); }
.time-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--steel);
}
.chair-col { position: relative; background: repeating-linear-gradient(to bottom, transparent, transparent 68px, rgba(213, 222, 228, 0.7) 69px); }
.appt {
  position: absolute;
  left: 6px;
  right: 6px;
  overflow: hidden;
  padding: 6px 8px;
  background: var(--paper);
  border-left: 4px solid var(--ok);
  box-shadow: var(--shadow);
  text-align: left;
}
.appt.IN_CHAIR { border-left-color: var(--pole); }
.appt.PENDING_HOLD { border-left-color: var(--brass); background: #f8f1df; }
.appt.COMPLETED, .appt.EXPIRED, .appt.CANCELLED, .appt.NO_SHOW { opacity: 0.55; border-left-color: var(--steel); }
.appt strong { display: block; font-size: 0.92rem; }
.appt em { font-style: normal; color: var(--steel); font-size: 0.75rem; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100%);
  height: 100vh;
  background: var(--paper);
  border-left: 1px solid var(--line);
  padding: 22px;
  z-index: 30;
  overflow: auto;
  box-shadow: var(--shadow);
}
.backdrop { position: fixed; inset: 0; background: rgba(36, 28, 24, 0.35); z-index: 25; }

.kiosk-grid { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
body.page-kiosk { background: var(--leather); color: var(--paper); }
body.page-kiosk .topbar { background: #1a1412; border-bottom-color: #3a312c; color: var(--paper); }
body.page-kiosk .brand span, body.page-kiosk .muted { color: #c8beb4; }
body.page-kiosk .nav a { color: var(--paper); }
body.page-kiosk .nav a[aria-current="page"] { background: var(--brass); color: var(--leather); }
body.page-kiosk .ticket { color: var(--ink); }
body.page-kiosk .panel {
  background: #1a1412;
  border: 1px solid #3a312c;
  padding: 18px;
}
body.page-kiosk input, body.page-kiosk select { background: #2a221e; border-color: #3a312c; color: var(--paper); }
.queue-list { display: flex; flex-direction: column; gap: 12px; }
.queue-ticket { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.queue-pos {
  font-family: var(--display);
  font-size: 4.5rem;
  line-height: 0.8;
  color: var(--leather);
}
.queue-ticket.NOTIFIED { border-top-color: var(--pole); }
body.lobby .checkin, body.lobby .topbar .nav { display: none; }
body.lobby .kiosk-grid { grid-template-columns: 1fr; }
body.lobby .queue-pos { font-size: 7rem; }

.split { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.phone {
  background: var(--leather);
  color: var(--paper);
  min-height: 560px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble { max-width: 90%; padding: 10px 12px; border-radius: 12px; }
.bubble.shop { background: #3a312c; }
.bubble.caller { background: var(--brass); color: var(--leather); margin-left: auto; }
.log {
  background: #172026;
  color: #d5e4ea;
  min-height: 420px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: pre-wrap;
}
.log .tool { color: #e7c98a; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat { background: var(--paper); padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--display); font-size: 2.2rem; line-height: 0.9; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; background: var(--paper); }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--steel); }

#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.toast { background: var(--leather); color: var(--paper); padding: 10px 14px; max-width: 320px; }

@media (max-width: 860px) {
  h1 { font-size: 2.4rem; }
  .kiosk-grid, .split, .stats { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  main { padding: 18px 14px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
