/* Wattle & Stone demo — flat, geometric, calm.
   Rules of the house: no shadows, no gradients, solid colour only,
   borders do the separating, colour carries meaning:
   wattle yellow = action · gum green = good news · clay = attention · grey = off */

:root {
  --paper: #FAF5EC;
  --card: #FFFDF8;
  --ink: #2A2721;
  --ink2: #6E665A;
  --line: #E6DECD;
  --line-strong: #CFC4AC;
  --wattle: #F0B429;
  --wattle-deep: #8C6110;
  --wattle-wash: #FBEBC5;
  --gum: #5E7A5E;
  --gum-wash: #E9EFE6;
  --clay: #C4703F;
  --clay-wash: #F6E7DB;
  --stone: #8A8171;
  --sold: #A69D8C;
  --r: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--wattle-deep); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- shell ---------- */
.shell { max-width: 520px; margin: 0 auto; min-height: 100vh; }
@media (min-width: 560px) {
  body.customer { background: #F1EADC; }
  body.customer .shell { background: var(--paper); border-left: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong); }
}

/* ---------- header ---------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 14px; border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 44px; height: 44px; flex: none; }
.brand h1 { font-size: 19px; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 10px; letter-spacing: 0.14em; color: var(--ink2); margin-top: 3px; }

.chip {
  border: 2px solid var(--ink); border-radius: 999px; padding: 8px 14px;
  font-weight: 600; font-size: 14px; background: var(--card); white-space: nowrap;
}
.chip.unset { border-color: var(--clay); color: var(--clay); }

/* ---------- loyalty teaser ---------- */
.teaser {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 16px 0; padding: 10px 14px;
  background: var(--wattle-wash); border-radius: var(--r);
  font-size: 13px; color: var(--ink);
}
.teaser .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--wattle); flex: none; }

/* ---------- category nav ---------- */
.catnav {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 8px;
  overflow-x: auto; padding: 12px 16px; background: var(--paper);
  border-bottom: 1.5px solid var(--line); scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }
.catnav button {
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  padding: 7px 14px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  background: var(--card); color: var(--ink2);
}
.catnav button.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- menu ---------- */
.menu { padding: 4px 16px 120px; }
.cat-head {
  display: flex; align-items: center; gap: 10px; margin: 26px 0 4px;
  scroll-margin-top: 64px;
}
.cat-head svg { width: 22px; height: 22px; color: var(--ink); flex: none; }
.cat-head h2 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.cat-head::after { content: ""; flex: 1; border-top: 1.5px solid var(--line-strong); }

.item-row {
  display: flex; width: 100%; text-align: left; gap: 12px; align-items: baseline;
  padding: 13px 2px; border-bottom: 1.5px solid var(--line);
}
.item-row:last-child { border-bottom: none; }
.item-main { flex: 1; min-width: 0; }
.item-name { font-weight: 650; font-size: 15.5px; display: inline; }
.item-desc { color: var(--ink2); font-size: 13px; margin-top: 2px; }
.item-price { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag {
  display: inline-block; vertical-align: 2px; margin-left: 6px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  border: 1.5px solid var(--gum); color: var(--gum);
  border-radius: 5px; padding: 0.5px 4px;
}
.item-row.sold { color: var(--sold); }
.item-row.sold .item-name, .item-row.sold .item-desc { color: var(--sold); }
.item-row.sold .tag { border-color: var(--sold); color: var(--sold); }
.soldchip {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; white-space: nowrap;
  background: var(--line); color: var(--ink2); border-radius: 5px; padding: 3px 7px;
}
.item-row .soldchip { display: none; }
.item-row.sold .soldchip { display: inline-block; }
.item-row.sold .item-price { display: none; }

/* ---------- bottom bar ---------- */
.cart-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(520px, 100%); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 2px solid var(--ink); z-index: 30;
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; border-radius: var(--r);
  font-weight: 700; font-size: 16px; padding: 8px 18px;
}
.btn-primary { background: var(--wattle); color: var(--ink); }
.btn-primary:active { background: #DDA31F; }
.btn-primary:disabled { background: var(--line); color: var(--ink2); cursor: default; }
.btn-ghost { border: 2px solid var(--ink); background: var(--card); }
.btn .amt { font-variant-numeric: tabular-nums; }
.btn .count-dot {
  background: var(--ink); color: var(--wattle); border-radius: 999px;
  min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; padding: 0 7px;
}

/* ---------- sheet ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(42, 39, 33, 0.42); z-index: 40;
}
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(520px, 100%); max-height: 88vh; overflow-y: auto; z-index: 41;
  background: var(--paper); border-top: 2.5px solid var(--ink);
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  animation: rise 0.18s ease-out;
}
@keyframes rise { from { transform: translate(-50%, 24px); opacity: 0.6; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 4px; }
.sheet-head h3 { font-size: 20px; }
.sheet-head .item-price { font-size: 16px; padding-top: 3px; }
.sheet-desc { color: var(--ink2); font-size: 13.5px; margin-bottom: 6px; }
.x {
  width: 34px; height: 34px; border: 2px solid var(--line-strong); border-radius: 999px;
  display: flex; align-items: center; justify-content: center; flex: none;
  font-size: 16px; font-weight: 700; color: var(--ink2); margin-left: auto;
}
.sheet .x { position: absolute; top: 14px; right: 14px; }
.sheet-head { padding-right: 44px; }

.modgroup { margin-top: 16px; }
.modgroup h4 {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2);
  margin-bottom: 6px;
}
.opt {
  display: flex; align-items: center; gap: 11px; padding: 10px 4px;
  border-bottom: 1.5px solid var(--line); font-size: 15px;
}
.opt:last-child { border-bottom: none; }
.opt input { width: 19px; height: 19px; accent-color: var(--gum); flex: none; }
.opt .delta { margin-left: auto; color: var(--ink2); font-variant-numeric: tabular-nums; font-size: 13.5px; }

.sheet-foot { display: flex; gap: 12px; margin-top: 20px; }
.stepper {
  display: flex; align-items: center; border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--card); flex: none;
}
.stepper button { width: 44px; min-height: 48px; font-size: 20px; font-weight: 700; }
.stepper .qty { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper button:disabled { color: var(--line-strong); cursor: default; }
.stepper.small button { width: 34px; min-height: 34px; font-size: 16px; }
.stepper.small { border-width: 1.5px; border-color: var(--line-strong); border-radius: 9px; }

/* table picker */
.table-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.table-grid button {
  border: 2px solid var(--ink); border-radius: var(--r); background: var(--card);
  min-height: 54px; font-weight: 700; font-size: 16px;
}
.table-grid button.away { grid-column: span 4; background: var(--wattle-wash); }

/* ---------- cart view ---------- */
.page { padding: 18px 16px 140px; }
.backlink { display: inline-flex; gap: 6px; font-weight: 650; color: var(--ink2); font-size: 14px; padding: 2px 0 14px; }
.page h2.big { font-size: 24px; margin-bottom: 4px; }
.page .sub { color: var(--ink2); font-size: 14px; margin-bottom: 14px; }

.cart-line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1.5px solid var(--line); }
.cart-line .item-main { padding-top: 3px; }
.cart-mods { color: var(--ink2); font-size: 12.5px; margin-top: 2px; }
.cart-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-line .item-price { font-size: 15px; }
.cart-line.sold-flag .item-name { text-decoration: line-through; color: var(--sold); }

.field { margin-top: 16px; }
.field label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 2px solid var(--line-strong); border-radius: var(--r);
  background: var(--card); padding: 12px 14px; font-size: 15px;
}
.field input:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
.field .hint { font-size: 12px; color: var(--ink2); margin-top: 5px; }
.field textarea { resize: none; min-height: 58px; }

.stampline { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.stampline .mini { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.stampline .mini.f { background: var(--wattle); border-color: var(--wattle); }

.totals { margin-top: 20px; border-top: 2px solid var(--ink); padding-top: 12px; }
.trow { display: flex; justify-content: space-between; font-size: 15px; padding: 3px 0; }
.trow.grand { font-size: 19px; font-weight: 750; }
.gst { color: var(--ink2); font-size: 12.5px; margin-top: 4px; }

/* ---------- done view ---------- */
.done { text-align: center; padding: 34px 24px 60px; }
.done .cup { width: 130px; height: 130px; margin: 6px auto 18px; display: block; }
.done h2 { font-size: 26px; }
.done .ordno { font-size: 15px; font-weight: 700; letter-spacing: 0.06em; margin-top: 6px; }
.done .say { color: var(--ink2); margin-top: 10px; font-size: 15px; }

.stampcard {
  margin: 26px auto 0; max-width: 330px; text-align: left;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--card); padding: 18px;
}
.stampcard h3 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.stampcard .why { color: var(--ink2); font-size: 12.5px; margin-top: 3px; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 14px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line-strong); }
.stamp.f { background: var(--wattle); border-color: var(--wattle); }
.stamp-note { margin-top: 12px; font-size: 13.5px; }
.stamp-note.win { background: var(--gum-wash); color: var(--gum); font-weight: 700; border-radius: 9px; padding: 9px 12px; }
.done .btn { max-width: 330px; margin: 28px auto 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 14px);
  background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 11px 20px; font-size: 14px; font-weight: 600; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s;
  max-width: min(440px, 88vw); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= counter ================= */
body.counter { background: var(--paper); }
.counter-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 2px solid var(--ink); position: sticky; top: 0;
  background: var(--paper); z-index: 20;
}
.counter-head .brand h1 { font-size: 17px; }
.counter-head .spacer { flex: 1; }
.seg { display: flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { padding: 9px 18px; font-weight: 700; font-size: 14px; color: var(--ink2); }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg button .n {
  background: var(--wattle); color: var(--ink); border-radius: 999px; font-size: 12px;
  padding: 1px 7px; margin-left: 6px;
}
.soundbtn { border: 2px solid var(--line-strong); border-radius: 999px; padding: 9px 16px; font-weight: 650; font-size: 14px; color: var(--ink2); background: var(--card); }
.soundbtn.on { border-color: var(--gum); color: var(--gum); }

.board { padding: 18px 20px 80px; }
.lane-note { color: var(--ink2); font-size: 14px; padding: 30px 0; text-align: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }

.ocard { border: 2px solid var(--line-strong); border-radius: 14px; background: var(--card); padding: 14px 16px; }
.ocard.new { border-color: var(--wattle); border-width: 2.5px; }
.ocard.ready { border-color: var(--gum); }
.ocard.land { animation: land 0.7s ease-out; }
@keyframes land { from { background: var(--wattle-wash); } to { background: var(--card); } }
.ocard-top { display: flex; align-items: baseline; gap: 10px; }
.ocard-top .tbl { font-size: 21px; font-weight: 800; letter-spacing: 0.02em; }
.ocard-top .meta { color: var(--ink2); font-size: 13px; margin-left: auto; text-align: right; }
.status-chip {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.09em;
  border-radius: 6px; padding: 3px 8px; margin-top: 2px;
}
.status-chip.new { background: var(--wattle); color: var(--ink); }
.status-chip.preparing { background: var(--clay-wash); color: var(--clay); }
.status-chip.ready { background: var(--gum-wash); color: var(--gum); }
.status-chip.done { background: var(--line); color: var(--ink2); }

.olines { margin: 12px 0 4px; }
.oline { display: flex; gap: 10px; padding: 7px 0; border-top: 1.5px solid var(--line); font-size: 15px; }
.oline .q { font-weight: 800; min-width: 26px; font-variant-numeric: tabular-nums; }
.oline .m { color: var(--ink2); font-size: 12.5px; margin-top: 1px; }
.onote { background: var(--clay-wash); color: var(--ink); border-radius: 9px; padding: 9px 12px; font-size: 13.5px; margin-top: 8px; }
.onote b { color: var(--clay); letter-spacing: 0.08em; font-size: 10.5px; }
.ocard-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ocard-foot .tot { font-weight: 750; font-variant-numeric: tabular-nums; }
.ocard-foot .adv { margin-left: auto; width: auto; min-height: 44px; font-size: 14.5px; padding: 6px 18px; }

/* 86 board */
.eblock { max-width: 640px; }
.eb-cat { margin-top: 24px; }
.eb-cat h3 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2); margin-bottom: 4px; }
.eb-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1.5px solid var(--line); }
.eb-row .nm { font-weight: 600; }
.eb-row.off .nm { color: var(--sold); text-decoration: line-through; }
.eb-row .soldchip { margin-left: 6px; }

.switch { margin-left: auto; position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .trk {
  position: absolute; inset: 0; border-radius: 999px; background: var(--gum);
  transition: background 0.15s; pointer-events: none;
}
.switch .trk::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--paper); transition: transform 0.15s;
}
.switch input:not(:checked) + .trk { background: var(--line-strong); }
.switch input:not(:checked) + .trk::after { transform: translateX(22px); }
.switch input:focus-visible + .trk { outline: 3px solid var(--wattle-deep); outline-offset: 2px; }

.counter-foot { padding: 26px 20px 40px; }
.resetbtn { color: var(--stone); font-size: 13px; font-weight: 600; border: 1.5px solid var(--line-strong); border-radius: 8px; padding: 8px 14px; background: none; }

/* ================= QR page ================= */
.qr-wrap { max-width: 900px; margin: 0 auto; padding: 20px; }
.qr-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 16px 0 22px; }
.qr-controls .field { margin: 0; flex: 1; min-width: 240px; }
.qr-controls .btn { width: auto; min-height: 46px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.qr-card {
  border: 2.5px solid var(--ink); border-radius: 16px; background: #fff;
  padding: 18px; text-align: center; break-inside: avoid;
}
.qr-card .tno { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; }
.qr-card svg.code { width: 100%; height: auto; margin: 10px 0 6px; display: block; }
.qr-card .scanline { font-size: 15px; font-weight: 700; }
.qr-card .cafeline { font-size: 11px; color: var(--ink2); letter-spacing: 0.1em; margin-top: 3px; }
@media print {
  body { background: #fff; }
  .site-head, .qr-controls, .noprint { display: none !important; }
  .qr-wrap { max-width: none; padding: 0; }
  .qr-grid { grid-template-columns: repeat(2, 1fr); gap: 10mm; }
}
