/* Nongkrong - one stylesheet, one system.
   Warm paper background, white surfaces, ink text, one terracotta accent, kopitiam green for voice.
   Type: DM Serif Display for names of places and tables, IBM Plex Sans for everything else.
   Spacing steps: 4 8 12 16 20 24 32. Radii: 8 (small), 12 (controls, cards), 16 (panels), 999 (pills). */

:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --sunk: #f2efe8;
  --ink: #1f1e1c;
  --muted: #5f5b55;
  --line: #e4e0d7;
  --line-strong: #cfc9bd;
  --accent: #a63d24;
  --accent-ink: #ffffff;
  --accent-soft: #f6e7e1;
  --tile: #2d4a3e;
  --tile2: #f7f5f0;
  --marble: #f1efe9;
  --vein: #d9d5cb;
  --rim: #3b3a38;
  --seat: #ffffff;
  --seat-line: #a8a296;
  --shadow: 0 1px 2px rgba(31, 30, 28, .05), 0 2px 8px rgba(31, 30, 28, .04);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151816; --card: #1d211e; --sunk: #191c1a; --ink: #ece8df; --muted: #aaa59a; --line: #323833; --line-strong: #4a514b;
    --accent: #e0866a; --accent-ink: #1a1310; --accent-soft: #3a2a24; --tile: #3f6b59; --tile2: #151816;
    --marble: #d9d5cb; --vein: #b9b4a8; --rim: #0d0f0e; --seat: #2a2f2b; --seat-line: #7d786e;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151816; --card: #1d211e; --sunk: #191c1a; --ink: #ece8df; --muted: #aaa59a; --line: #323833; --line-strong: #4a514b;
  --accent: #e0866a; --accent-ink: #1a1310; --accent-soft: #3a2a24; --tile: #3f6b59; --tile2: #151816;
  --marble: #d9d5cb; --vein: #b9b4a8; --rim: #0d0f0e; --seat: #2a2f2b; --seat-line: #7d786e;
  --shadow: none; color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 "IBM Plex Sans", system-ui, sans-serif; min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; margin: 0; letter-spacing: -.005em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }
.checker { height: 6px; background: repeating-conic-gradient(var(--tile) 0 25%, var(--tile2) 0 50%) 0 0 / 12px 12px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 16px; padding: 12px 32px; flex-wrap: wrap;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-family: "DM Serif Display", Georgia, serif; font-size: 26px; color: var(--ink); text-decoration: none; line-height: 1; margin-right: 8px; }
.brand span { color: var(--accent); }
.place { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-select select {
  appearance: none; border: 1px solid var(--line); border-radius: 10px; background-color: var(--card); min-height: 40px;
  padding: 6px 34px 6px 12px; cursor: pointer; font-weight: 500;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.pill-select select:hover { border-color: var(--line-strong); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status { font-size: 13px; color: var(--muted); margin-right: 4px; }
.status[data-level="warn"] { color: var(--accent); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line-strong); background: var(--card); border-radius: 10px; padding: 8px 16px; min-height: 44px;
  font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.on { background: var(--tile); border-color: var(--tile); color: #fff; }
.btn.small { min-height: 40px; padding: 6px 12px; }
/* a status, not an action: e.g. voice is unavailable in the offline demo */
.btn.note, .btn.note:disabled { background: transparent; border-style: dashed; border-color: var(--line-strong); color: var(--ink); font-weight: 500; cursor: default; opacity: 1; }
.btn.note:hover { border-color: var(--line-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--sunk); }
.btn.wide { width: 100%; }
.btn:disabled { cursor: not-allowed; }
#voiceBtn:disabled { color: var(--ink); background: var(--sunk); border-color: var(--line-strong); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 12px 20px; text-align: left; min-height: 44px; font-size: 13px; font-weight: 500; }
.link:hover { color: var(--ink); text-decoration: underline; }

/* ---------- places in this city ---------- */
.venues { display: flex; gap: 4px; padding: 12px 32px 0; overflow-x: auto; scrollbar-width: thin; max-width: 1440px; margin: 0 auto; }
.venue {
  border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 8px 14px; min-height: 44px;
  cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; font-weight: 500; color: var(--muted);
}
.venue:hover { color: var(--ink); background: var(--sunk); }
.venue[aria-current="true"] { background: var(--card); color: var(--ink); font-weight: 600; border-color: var(--line); box-shadow: inset 0 -2px 0 var(--accent), var(--shadow); }
.venue .n {
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--sunk); color: var(--muted); text-align: center;
}
.venue[aria-current="true"] .n { background: var(--ink); color: var(--bg); }

.switch { display: none; }

/* ---------- layout ---------- */
main { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 24px; padding: 16px 32px 40px; max-width: 1440px; margin: 0 auto; }
.floor:focus { outline: none; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.intro h1 { font-size: 40px; line-height: 1.05; }
.intro p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.clock { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.clock b { display: block; font-size: 26px; font-weight: 500; color: var(--ink); line-height: 1.1; }

/* the counter strip only shows when there is no 3D view */
.counter {
  display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius);
  background: repeating-linear-gradient(90deg, #8a5a3b 0 22px, #7d5134 22px 44px); color: #fbf3e8;
}
.counter-label { font-family: "DM Serif Display", Georgia, serif; font-size: 18px; flex: none; }
#counterText { font-size: 14px; }

/* ---------- 3D stage ---------- */
.stage {
  position: relative; height: min(58vh, 600px); min-height: 360px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: #cfe0e3; margin-bottom: 24px; box-shadow: var(--shadow);
}
.world-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
.world-canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.stage-tip {
  position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 6px 12px; border-radius: 8px;
  background: rgba(31, 30, 28, .78); color: #fff; font-size: 12px; font-weight: 500; pointer-events: none; max-width: calc(100% - 24px);
  transition: opacity .4s ease;
}
.stage.tip-done .stage-tip { opacity: 0; }

/* ---------- tables ---------- */
.go-title { display: none; }
main.has-world .counter { display: none; }
main.has-world .go-title { display: block; font-size: 22px; margin: 0 0 12px; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.t {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 16px; cursor: pointer;
  display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; box-shadow: var(--shadow);
  transition: border-color .15s;
}
.t:not(.full):not(.mine):hover, .t:not(.full):not(.mine):focus-visible { border-color: var(--ink); }
.t.mine { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.t.full { cursor: default; }
.t .tn { display: none; }
.t .cap { font-size: 13px; color: var(--muted); }
.t .names { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t .cap.free {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; font-weight: 600; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card);
}
.t .cap.free.join { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.t:not(.full):not(.mine):hover .cap.free:not(.join) { border-color: var(--ink); }
.t:not(.full):not(.mine):hover .cap.free.join { filter: brightness(1.06); }
.plate { position: relative; display: grid; place-items: center; }
.top-r {
  border-radius: 50%; border: 6px solid var(--rim); display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #ffffff 0, var(--marble) 60%, var(--vein) 100%);
}
.top-l {
  border-radius: 14px; border: 6px solid var(--rim); width: 168px; height: 64px; display: grid; place-items: center;
  background: linear-gradient(160deg, #ffffff 0, var(--marble) 55%, var(--vein) 100%);
}
.top-r b, .top-l b { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; font-size: 24px; color: #222120; }
.stool {
  position: absolute; width: 30px; height: 30px; border-radius: 50%; background: var(--seat); border: 2px solid var(--seat-line);
  font-size: 11px; font-weight: 600; display: grid; place-items: center; transform: translate(-50%, -50%); line-height: 1;
}
.stool.taken { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.stool.me { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stool.voice { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--tile); }
.stool.speaking { animation: talk 1s ease-in-out infinite; }
@keyframes talk { 50% { box-shadow: 0 0 0 3px var(--card), 0 0 0 8px var(--tile); } }
@media (prefers-reduced-motion: reduce) { .stool.speaking { animation: none; box-shadow: 0 0 0 3px var(--card), 0 0 0 7px var(--tile); } }
.hint { color: var(--muted); margin-top: 16px; }

/* with the 3D view, tables become a compact list of cards under it */
.tables.chips { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tables.chips .plate { display: none; }
.tables.chips .t { justify-items: start; text-align: left; gap: 2px; padding: 12px 14px 14px; }
.tables.chips .t .tn { display: block; font-family: "DM Serif Display", Georgia, serif; font-size: 20px; line-height: 1.15; }
.tables.chips .t .names { color: var(--muted); }
.tables.chips .t .cap { margin-top: 8px; }

/* ---------- the table panel ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column;
  min-height: 560px; max-height: calc(100vh - 120px); position: sticky; top: 16px; overflow: hidden; box-shadow: var(--shadow);
}
.empty { padding: 24px; }
.empty h2 { font-size: 28px; }
.empty p { color: var(--muted); margin: 8px 0 0; }
.how { padding-left: 20px; margin: 20px 0; display: grid; gap: 10px; }
.fine { font-size: 13px; color: var(--muted); }

/* the privacy line: same words in the panel, on the floor ring and in the welcome text */
.private {
  margin: 12px 0 0; padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  background: var(--accent-soft); color: var(--ink); font-size: 13px; line-height: 1.45;
}
.empty .private { margin-top: 12px; }

.seated { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ph { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.ph h2 { font-size: 28px; line-height: 1.1; }
.ph > p:not(.private):not(.voice-note) { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.actions .btn { min-height: 40px; }
.actions #muteBtn:not([hidden]) ~ #leaveBtn { grid-column: 1 / -1; }
.voice-note { font-size: 13px; margin: 8px 0 0; color: var(--muted); }

.members { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 2px; }
.members li { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 36px; padding: 2px 4px; border-radius: 8px; }
.members li:hover { background: var(--sunk); }
.members .av {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sunk); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink);
}
.members li.me .av { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.members li.in-voice .av { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--tile); }
.members .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members .tag { font-size: 12px; color: var(--muted); }
.members button {
  background: none; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer;
  font-size: 12px; font-weight: 500; min-height: 28px; padding: 0 8px;
}
.members button:hover { color: var(--ink); border-color: var(--line); background: var(--card); }

.log { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; background: var(--sunk); min-height: 160px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 8px 12px; max-width: 86%; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: transparent; border-radius: 12px 12px 4px 12px; }
.msg .n { font-size: 12px; font-weight: 600; color: var(--accent); }
.msg .tm { font-size: 12px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.msg p { margin: 2px 0 0; white-space: pre-wrap; }
.sys { font-size: 12px; color: var(--muted); text-align: center; }
.say { display: flex; gap: 8px; padding: 12px 20px 4px; border-top: 1px solid var(--line); background: var(--card); }
.say input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 14px; min-height: 44px; background: var(--card); }
.say input::placeholder { color: var(--muted); }
.say .btn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--card); color: var(--ink); width: min(480px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(31, 30, 28, .18); }
dialog::backdrop { background: rgba(21, 24, 22, .55); }
dialog form { padding: 28px; display: grid; gap: 16px; }
dialog h2 { font-size: 32px; }
dialog p { margin: 0; color: var(--muted); }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.field input, .field select { border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; min-height: 44px; background: var(--card); font-weight: 400; font-size: 15px; min-width: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: calc(100vw - 32px); }
.noscript { padding: 20px 32px; }


/* ---------- roles: guest, barista, owner (and CrewCup home) ---------- */
.roles { display: flex; gap: 8px; padding: 12px 32px 0; max-width: 1440px; margin: 0 auto; overflow-x: auto; scrollbar-width: thin; }
.role {
  display: grid; gap: 1px; text-align: left; min-height: 48px; padding: 6px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); min-width: 140px;
}
.role b { font-size: 15px; font-weight: 600; }
.role span { font-size: 12px; color: var(--muted); }
.role:hover { border-color: var(--line-strong); }
.role[aria-selected="true"] { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }

main[data-role="barista"] .floor, main[data-role="barista"] .panel,
main[data-role="owner"] .panel,
main[data-role="home"] .floor, main[data-role="home"] .panel { display: none; }
main[data-role="owner"] { grid-template-columns: minmax(0, 1fr) 460px; }
main[data-role="barista"] .switch, main[data-role="owner"] .switch { display: none; }
.barview:not([hidden]) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
.homeview:not([hidden]) { grid-column: 1 / -1; display: grid; gap: 20px; }

/* ---------- the bar ---------- */
.bar-stage {
  position: relative; height: min(72vh, 720px); min-height: 440px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: #2b2620; box-shadow: var(--shadow);
}
.bar-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.bar-hud { position: absolute; left: 12px; right: 12px; top: 12px; display: grid; gap: 8px; pointer-events: none; }
.hud-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hud-top b, .hud-top span {
  background: rgba(31, 30, 28, .82); color: #fbf6ec; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.hud-top span:empty { display: none; }
.hud-steps { list-style: none; margin: 0; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; justify-self: start; background: rgba(31, 30, 28, .55); border-radius: 12px; }
.hud-steps li {
  display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(31, 30, 28, .6); color: #e9e2d6;
}
.hud-steps li.done { background: rgba(45, 74, 62, .92); color: #fff; }
.hud-steps li.now { background: #fbf6ec; color: #222120; }
.hud-steps i { font-style: normal; font-weight: 500; opacity: .85; }
.hud-bottom {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(560px, calc(100% - 24px));
  display: grid; gap: 8px; justify-items: center;
}
.hud-hint { margin: 0; padding: 6px 12px; border-radius: 8px; background: rgba(31, 30, 28, .82); color: #fbf6ec; font-size: 14px; text-align: center; }
.hud-hint:empty { display: none; }
.gauge {
  position: relative; width: 100%; height: 22px; border-radius: 999px; background: rgba(31, 30, 28, .78); overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .25);
}
.gauge i { position: absolute; top: 0; bottom: 0; }
.gauge .zone { background: rgba(60, 138, 90, .8); border-left: 2px solid #b9e6c8; border-right: 2px solid #b9e6c8; z-index: 1; }
.gauge .zone::after { content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; }
.gauge .fill { left: 0; background: #e9d9c7; opacity: .6; transition: width .05s linear; z-index: 2; }
.gauge.in .fill { background: #8fd1a6; }
.gauge span { position: absolute; z-index: 3; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.btn.hold { min-width: 200px; min-height: 56px; font-size: 17px; user-select: none; -webkit-user-select: none; touch-action: none; }
.btn.hold.on { background: var(--tile); border-color: var(--tile); }
.bar-empty {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); margin: 0; max-width: 420px; text-align: center;
  background: rgba(31, 30, 28, .86); color: #fbf6ec; padding: 14px 18px; border-radius: 12px; font-size: 15px;
}
.bar-side {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column;
  gap: 12px; box-shadow: var(--shadow); align-self: start; position: sticky; top: 16px;
}
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 9px; min-height: 40px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); padding: 0 6px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.bar-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-title { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.tk-title span { font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 13px; font-weight: 600; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 1px 9px; }
.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tickets li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.tickets li.now { border-color: var(--accent); background: var(--accent-soft); }
.tickets li.taken { opacity: .75; }
.tickets li.empty { display: block; color: var(--muted); font-size: 14px; }
.tk-main { display: grid; min-width: 0; }
.tk-main b { font-size: 14px; }
.tk-main span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-wait { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- order card at the table ---------- */
.order-card { padding: 14px 20px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.oc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.oc-head h3 { font-size: 18px; }
.oc-where { font-size: 12px; color: var(--muted); text-align: right; }
.oc-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.oc-item {
  display: grid; text-align: left; gap: 1px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; min-height: 48px;
}
.oc-item:hover { border-color: var(--ink); }
.oc-item b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.oc-item span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.oc-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; }
.oc-paybtn { display: grid; text-align: left; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--sunk); cursor: pointer; min-height: 44px; }
.oc-paybtn b { font-size: 12px; }
.oc-paybtn span { font-size: 12px; color: var(--muted); }
.oc-paybtn[aria-checked="true"] { border-color: var(--ink); background: var(--card); box-shadow: inset 3px 0 0 var(--accent); }
.oc-paynote { font-size: 13px; color: var(--muted); }
.link.inline { padding: 6px 0; min-height: 32px; color: var(--accent); }
.run-btn { min-height: 40px; }
.oc-run { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); }
.oc-run p { margin: 0; font-size: 13px; }
.oc-mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.oc-mine li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.oc-mine span { color: var(--muted); }

/* ---------- owner dashboard ---------- */
.ownerview:not([hidden]) { display: grid; gap: 14px; align-content: start; }
.ow-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ow-head h2 { font-size: 28px; line-height: 1.1; }
.ow-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ow-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ow-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.ow-stat span { font-size: 12px; color: var(--muted); }
.ow-stat b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ow-stat i { font-style: normal; font-size: 12px; color: var(--muted); }
.ow-stat.neg b { color: var(--accent); }
.ow-chart { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 64px; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ow-chart i { flex: 1; min-height: 2px; background: var(--tile); border-radius: 2px 2px 0 0; opacity: .75; }
.ow-chart i.now { background: var(--accent); opacity: 1; }
.ow-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--muted); pointer-events: none; }
.ow-queue { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.ow-grid { display: grid; gap: 12px; }
.ow-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.ow-card h3 { font-size: 18px; }
.ow-note { margin: 0; font-size: 12px; color: var(--muted); }
.ow-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ow-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; }
.ow-rows li > :last-child { grid-row: 1 / span 2; grid-column: 2; }
.ow-rows li.low .ow-meta { color: var(--accent); font-weight: 600; }
.ow-name { font-size: 14px; font-weight: 600; }
.ow-meta { font-size: 12px; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); cursor: pointer; font-size: 18px; line-height: 1; }
.stepper b { min-width: 86px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.ow-hire { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hire { display: grid; gap: 1px; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line-strong); background: var(--sunk); cursor: pointer; min-height: 48px; }
.hire b { font-size: 13px; }
.hire span { font-size: 12px; color: var(--muted); }
.ow-ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.ow-ledger li { display: flex; justify-content: space-between; gap: 10px; }
.ow-ledger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ow-ledger b { font-variant-numeric: tabular-nums; font-weight: 600; }
.ow-ledger b.neg { color: var(--accent); }

/* ---------- CrewCup home ---------- */
.cc-hello h2 { font-size: 36px; line-height: 1.1; }
.cc-hello p { margin: 6px 0 0; color: var(--muted); }
.cc-kicker { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cc-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); }
.cc-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.cc-big { font-size: 24px; font-weight: 600; line-height: 1.2; }
.cc-sub { font-size: 13px; color: var(--muted); }
.cc-bar { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.cc-bar i { display: block; height: 100%; background: var(--accent); }
.cc-recent { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.cc-recent ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.cc-recent li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; font-size: 14px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-left: 8px; white-space: nowrap; }

/* CrewCup shell: its own neutral, office palette */
body[data-host="crewcup"] {
  --bg: #f5f6f8; --card: #ffffff; --sunk: #f2f4f7; --ink: #101828; --muted: #5d6676; --line: #e4e7ec; --line-strong: #c9ced6;
  --accent: #8a4f22; --accent-soft: #f6efe8; --accent-ink: #ffffff; --tile: #1f2937;
  font-family: "Segoe UI Variable Text", "Segoe UI", "IBM Plex Sans", system-ui, sans-serif;
}
body[data-host="crewcup"] .checker { display: none; }
body[data-host="crewcup"] h1, body[data-host="crewcup"] h2, body[data-host="crewcup"] h3, body[data-host="crewcup"] .brand {
  font-family: "Segoe UI Variable Display", "Segoe UI", "IBM Plex Sans", system-ui, sans-serif; font-weight: 600; letter-spacing: -0.01em;
}
body[data-host="crewcup"] .top { background: #ffffff; border-bottom: 1px solid var(--line); }
body[data-host="crewcup"] .brand span { color: var(--accent); }
body[data-host="crewcup"] .roles { padding-top: 14px; }
body[data-host="crewcup"] .role { border-radius: 8px; }
body[data-host="crewcup"] .role[aria-selected="true"] { background: var(--tile); border-color: var(--tile); color: #fff; box-shadow: none; }
body[data-host="crewcup"] .role[aria-selected="true"] span { color: #d0d5dd; }

/* ---------- phone and narrow screens ---------- */
@media (max-width: 900px) {
  .top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 8px; align-items: center; padding: 12px 16px; }
  .top-right { display: contents; }
  .brand { grid-column: 1; grid-row: 1; }
  #nameBtn { grid-column: 2; grid-row: 1; max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #themeBtn { grid-column: 3; grid-row: 1; }
  .place { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; }
  .pill-select select { width: 100%; }
  .status { grid-column: 1 / -1; grid-row: 3; margin: 0; }
  .status:not([data-level="warn"]) { display: none; }
  .venues { padding: 10px 16px 0; }
  .switch {
    display: grid; grid-template-columns: 1fr 1fr; margin: 8px 16px 0; border: 1px solid var(--line); border-radius: 12px;
    background: var(--sunk); padding: 3px;
  }
  .switch button { border: 0; background: none; border-radius: 9px; min-height: 40px; font-weight: 600; cursor: pointer; color: var(--muted); }
  .switch button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
  main { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 24px; gap: 16px; }
  main[data-view="floor"] .panel { display: none; }
  main[data-view="table"] .floor { display: none; }
  .panel { position: static; max-height: none; min-height: calc(100vh - 230px); }
  .intro h1 { font-size: 32px; }
  .clock b { font-size: 22px; }
  .counter { margin-bottom: 12px; padding: 10px 12px; }
  .tables { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .t { padding: 10px 6px 12px; }
  .stage { height: 50vh; min-height: 300px; margin-bottom: 16px; }
  .stage-tip { left: 8px; bottom: 8px; }
  main.has-world[data-view="table"] .floor { display: block; }
  main.has-world[data-view="table"] .floor > :not(.stage) { display: none; }
  /* at a table the room stays pinned on top while the chat scrolls underneath */
  main.has-world[data-view="table"] .floor { position: sticky; top: 0; z-index: 3; align-self: start; background: var(--bg); padding-top: 4px; margin-top: -4px; }
  main.has-world[data-view="table"] .stage { height: 36vh; min-height: 240px; margin-bottom: 0; }
  /* people at the table become compact chips so the conversation keeps its room */
  .members { display: flex; flex-wrap: wrap; gap: 6px; }
  .members li { min-height: 32px; padding: 2px 4px 2px 3px; border: 1px solid var(--line); border-radius: 999px; gap: 6px; font-size: 13px; }
  .members .who { flex: none; max-width: 120px; }
  .members .av { width: 24px; height: 24px; font-size: 11px; }
  .members button { min-height: 24px; padding: 0 6px; }
  main.has-world[data-view="table"] .stage-tip { display: none; }
  main.has-world[data-view="table"] .panel { min-height: 0; }
  main.has-world[data-view="table"] .log { min-height: 200px; }
  .tables.chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tables.chips .t { padding: 10px 12px 12px; }
  .ph { padding: 16px 16px 14px; }
  .log, .say { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 360px) {
  .two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .roles { padding: 8px 16px 0; gap: 6px; }
  .role { min-width: 0; flex: 1; padding: 6px 10px; }
  .role span { display: none; }
  main[data-role="owner"] { grid-template-columns: minmax(0, 1fr); }
  main[data-role="owner"] .floor > :not(.stage) { display: none; }
  main[data-role="owner"] .stage { height: 34vh; min-height: 220px; margin-bottom: 0; }
  .barview:not([hidden]) { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .bar-stage { height: 62vh; min-height: 380px; }
  .bar-side { position: static; }
  .btn.hold { min-width: 160px; }
  .hud-steps li { font-size: 11px; padding: 3px 8px; }
  .cc-cards { grid-template-columns: minmax(0, 1fr); }
  .ow-hire { grid-template-columns: minmax(0, 1fr); }
  .brand-sub { display: none; }
}
