:root {
  --bg: #120e0a;
  --bg-2: #1b1510;
  --bg-3: #241c14;
  --gold: #e6c36a;
  --gold-2: #f3d98a;
  --gold-dim: #b8923c;
  --honey: #c9922a;
  --cream: #f6ead3;
  --text: #f4ead6;
  --muted: #b6a585;
  --line: rgba(230, 195, 106, 0.22);
  --wait: #e6c36a;
  --next: #f0c24b;
  --chair: #d9893b;
  --done: #8fad6e;
  --noshow: #c46b5c;
  --danger: #c45c4a;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: Outfit, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(230, 195, 106, 0.14), transparent 60%),
    radial-gradient(600px 400px at 100% 100%, rgba(201, 146, 42, 0.08), transparent 50%),
    var(--bg);
  padding: calc(12px + var(--safe-top)) 14px calc(92px + var(--safe-bottom));
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath fill='none' stroke='%23e6c36a' stroke-width='1' d='M28 2l24 14v28L28 58 4 44V16zM28 58l24 14v28L28 114 4 100V72z'/%3E%3C/svg%3E");
  z-index: 0;
}
.app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
header.brand {
  text-align: center;
  padding: 8px 8px 18px;
}
header.brand.compact {
  padding: 0 8px 12px;
}
header.brand.compact .logo { width: 40px; height: 40px; margin-bottom: 2px; }
header.brand.compact h1 { font-size: 24px; }
header.brand.compact .eyebrow { display: none; }
.logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  filter: drop-shadow(0 6px 16px rgba(230, 195, 106, 0.28));
}
.eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--gold);
  font-weight: 600;
}
h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 1.1;
  color: var(--cream);
}
.date-line { color: var(--muted); font-size: 13px; margin-top: 4px; }
.panel {
  background: linear-gradient(180deg, rgba(36, 28, 20, 0.96), rgba(22, 17, 12, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 20px;
  box-shadow: var(--shadow);
}
h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 4px;
}
.sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-2);
  margin: 12px 0 6px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="text"], input[type="tel"], input[type="time"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  appearance: none;
  background: #100c08;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
  font: inherit;
  font-size: 16px;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.choice {
  border: 1px solid var(--line);
  background: #100c08;
  color: var(--text);
  border-radius: 14px;
  padding: 14px 10px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.choice.active {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1208;
  border-color: var(--gold);
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 6px;
  color: var(--cream);
  font-size: 14px;
}
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--gold); flex: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 16px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.btn-gold {
  margin-top: 16px;
  background: linear-gradient(180deg, #f4d78c, #d4a63a);
  color: #1a1208;
  box-shadow: 0 8px 20px rgba(201, 146, 42, 0.28);
}
.btn-gold:active { transform: translateY(1px); }
.btn-ghost, .btn-tiny, .btn-status {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}
.btn-ghost { padding: 12px; font-size: 14px; margin-top: 8px; }
.btn-danger { color: #f0c0b8; border-color: rgba(196, 92, 74, 0.45); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row .btn { width: auto; flex: 1; min-width: 0; padding: 11px 8px; font-size: 13px; }
.wait-note {
  margin-top: 10px;
  text-align: center;
  color: var(--gold-2);
  font-size: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: #100c08;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.stat b { display: block; font-size: 22px; color: var(--gold-2); }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.card {
  background: #100c08;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.client-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
}
.meta { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.meta-line { display: block; }
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid currentColor;
}
.chip.waiting { color: var(--wait); background: rgba(230, 195, 106, 0.1); }
.chip.up-next { color: #1a1208; background: var(--next); border-color: var(--next); }
.chip.in-chair { color: #1a1208; background: var(--chair); border-color: var(--chair); }
.chip.done { color: var(--done); background: rgba(143, 173, 110, 0.12); }
.chip.no-show { color: var(--noshow); background: rgba(196, 107, 92, 0.12); }
.btn-status { padding: 8px 8px; font-size: 12px; font-weight: 600; border-radius: 10px; width: auto; flex: 1; }
.btn-status.active-status { background: var(--gold); color: #1a1208; border-color: var(--gold); }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 10px;
}
.banner-stack { position: relative; z-index: 5; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.banner {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  animation: pop 0.35s ease;
}
.banner b { display: block; font-size: 15px; margin-bottom: 2px; }
.banner.due { background: linear-gradient(180deg, #f4d78c, #e0b34a); color: #1a1208; }
.banner.next { background: #2a2214; color: var(--gold-2); border: 1px solid var(--line); }
.banner.lead { background: #2a2214; color: var(--cream); border: 1px solid var(--line); }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: rgba(18, 14, 10, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.nav button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 4px 4px;
  cursor: pointer;
}
.nav button.active { color: var(--gold-2); }
.nav .count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1208;
  font-size: 10px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--cream);
  color: #1a1208;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  z-index: 20;
  box-shadow: var(--shadow);
  display: none;
}
.toast.show { display: block; }
.help {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.help h3 { color: var(--gold-2); font-size: 14px; margin: 0 0 8px; font-weight: 600; }
.help p + p { margin-top: 8px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #100c08;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}
.pill button {
  border: 0;
  background: transparent;
  color: var(--noshow);
  cursor: pointer;
  font-size: 14px;
}
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; }
.add-row .btn { width: auto; padding: 12px 14px; font-size: 14px; }
.toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--cream);
}
.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: none;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0;
  background: #3a3024;
  border-radius: 999px;
  cursor: pointer;
}
.switch span::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; top: 3px;
  background: var(--cream);
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::after { transform: translateX(20px); background: #1a1208; }
.hidden { display: none !important; }
.notes { margin-top: 6px; font-size: 13px; color: var(--cream); font-style: italic; }
@media print {
  body { background: #fff; color: #111; padding: 16px; }
  body::before, .nav, .toast, .btn, .btn-row, .banner-stack, .help, #view-signin, #view-settings, .stats { display: none !important; }
  #view-queue { display: block !important; }
  .panel, .card { background: #fff; border-color: #ccc; box-shadow: none; color: #111; }
  .client-name, h1, h2, .meta, .sub, .date-line { color: #111; }
  .chip { border: 1px solid #333; color: #111 !important; background: #fff !important; }
  header.brand { text-align: left; }
}

/* ---- Synced version additions ---- */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(16, 12, 8, 0.7);
}
.sync-pill::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.sync-pill.live { color: var(--done); }
.sync-pill.live::before { background: var(--done); box-shadow: 0 0 0 3px rgba(143, 173, 110, 0.18); }
.sync-pill.offline { color: #f0c0b8; }
.sync-pill.offline::before { background: var(--noshow); }
.sync-pill.connecting::before { background: var(--gold); }
.pin-input {
  text-align: center;
  font-size: 28px !important;
  letter-spacing: 0.5em;
  padding: 16px 12px !important;
}
.error-text { color: #f0c0b8; font-size: 14px; margin-top: 10px; text-align: center; min-height: 20px; }
.confirm-panel { text-align: center; }
.confirm-panel .big-check {
  width: 72px; height: 72px; margin: 6px auto 12px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 36px;
  color: #1a1208;
  background: linear-gradient(180deg, #f4d78c, #d4a63a);
}
.confirm-panel .confirm-time {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px; color: var(--gold-2); margin: 8px 0 4px;
}
.nav.kiosk { grid-template-columns: 1fr 1fr; }
.staff-only { }
body.kiosk-mode .staff-only { display: none !important; }
.staff-link {
  background: transparent; border: 0; color: var(--muted);
  font: inherit; font-size: 13px; text-decoration: underline;
  margin-top: 14px; cursor: pointer; width: 100%;
}
body:not(.kiosk-mode) .kiosk-only { display: none !important; }
