/* Starting point from the Melrose Sevens prototype's palette. */
:root {
  --ink: #1b1f24;
  --muted: #5b6470;
  --surface: #ffffff;
  --ground: #f6f4f9;
  --accent: #8a21d1;
  --rule: #e3dfe9;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.page { max-width: 30rem; margin: 0 auto; padding: 2rem 1rem; display: grid; gap: 1rem; }
h1 { margin: 0; font-size: 1.75rem; line-height: 1.2; }
.kicker { margin: 0; color: var(--accent); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.25rem; }
.label { margin: 0; color: var(--muted); font-size: 0.85rem; }
.balance { margin: 0.25rem 0 0; font-size: 2.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.fans { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.fans button { width: 100%; text-align: left; padding: 0.75rem 1rem; font: inherit; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; }
.fans button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.offers { display: grid; gap: 0.75rem; }
.offer h2 { margin: 0.25rem 0 0.75rem; font-size: 1.1rem; }
.offer button, .quiz-options button { font: inherit; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.offer button:focus-visible, .quiz-options button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The guest's answer page (ADR-0020 §6): one full-width button per option. */
.quiz-now { display: grid; gap: 0.6rem; }
.quiz-now h2, .quiz-now p { margin: 0; overflow-wrap: anywhere; }
.quiz-options { display: grid; gap: 0.5rem; }
.quiz-options form { margin: 0; }
.quiz-options button { width: 100%; padding: 0.9rem 1rem; text-align: left; }
.quiz-picks { margin: 0; padding-left: 1.2rem; }
.quiz-result { font-weight: 600; font-size: 1.2rem; }
/* A plain button for now. Apple's and Google's guidelines require their own
   "Add to Apple Wallet" and "Add to Google Wallet" badge artwork before this
   ships (ADR-0004, ADR-0027). */
.wallet button { font: inherit; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px; border: 0; background: #000; color: #fff; cursor: pointer; }
.wallet button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sign-in { display: grid; gap: 0.5rem; }
.sign-in input { font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
.sign-in input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sign-in .check { display: flex; gap: 0.5rem; align-items: center; }
.sign-in button, .sign-out button { font: inherit; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; justify-self: start; }
.sign-out button { background: none; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
.ok { margin: 0; color: #1f6b44; }
.warn { margin: 0; color: #9a4a10; }
.notice { margin: 0; padding: 0.75rem 1rem; border-radius: 10px; background: #e6f4ec; color: #1f6b44; }
/* htmx adds this class while a request is in flight. */
.htmx-request button { opacity: 0.6; }
/* The admin portal (ADR-0010): desktop-first, the same palette. */
.admin { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; display: grid; gap: 1rem; }
.admin h2 { margin: 0.5rem 0 0; font-size: 1.15rem; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.admin-head p { margin: 0; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--rule); }
.admin-nav a { padding: 0.5rem 0.9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.admin-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.75rem; }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 0.9rem 1rem; }
.tile .label { display: flex; justify-content: space-between; gap: 0.5rem; }
.figure { margin: 0.25rem 0 0; font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile.sample { border-style: dashed; background: transparent; }
.tile.sample .figure { color: var(--muted); }
.badge { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.4rem; border-radius: 6px; background: #fdf1d8; color: #7a4b00; }
.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.data th, .data td { padding: 0.55rem 0.9rem; text-align: left; border-bottom: 1px solid var(--rule); }
.data th { font-size: 0.8rem; font-weight: 600; color: var(--muted); background: var(--ground); }
.data tr:last-child td { border-bottom: 0; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data .gain { color: #1f6b44; }
.data .spend { color: #9a4a10; }
.search { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.search input { font: inherit; padding: 0.5rem 0.75rem; border: 1px solid var(--rule); border-radius: 10px; min-width: 18rem; }
.search button { font: inherit; font-weight: 600; padding: 0.5rem 1rem; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.pager { display: flex; gap: 1.5rem; }
.small-figure { font-size: 1.1rem; overflow-wrap: anywhere; }
/* A second, quieter action on an offer: a code to redeem at the partner (ADR-0012). */
.offer .claim button { margin-top: 0.5rem; background: none; color: var(--accent); border: 1px solid var(--accent); }
.code { margin: 0.25rem 0; font: 600 1.05rem/1.4 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; user-select: all; }
/* The quiz's question editor (ADR-0020 §6): used on a phone too, so one
   column, full-width fields, nothing wider than the screen. */
.quiz-groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.quiz-groups li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.status { font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: 6px; background: var(--ground); color: var(--muted); white-space: nowrap; }
.quiz-question { display: grid; gap: 0.5rem; padding: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; max-width: 40rem; }
.quiz-question h2 { display: flex; align-items: center; gap: 0.5rem; }
.history { list-style: none; margin: 0; padding: 0; }
.quiz-form { display: grid; gap: 0.4rem; max-width: 40rem; min-width: 0; }
.quiz-form input, .quiz-form textarea, .quiz-form select { font: inherit; width: 100%; box-sizing: border-box; padding: 0.55rem 0.7rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
.quiz-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 0.4rem; min-width: 0; }
.quiz-form legend { padding: 0; margin-bottom: 0.2rem; }
.quiz-form .option-label { font-size: 0.85rem; color: var(--muted); }
.quiz-form .pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.5rem; }
.quiz-form .pair > div { display: grid; gap: 0.4rem; grid-template-rows: 1fr auto; align-items: end; }
.quiz-form button, .quiz-publish button, .quiz-order button, .quiz-moves button, .quiz-delete button { font: inherit; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; justify-self: start; }
.quiz-delete button { background: none; color: #9a4a10; border: 1px solid currentColor; }
.quiz-delete summary { cursor: pointer; color: #9a4a10; width: fit-content; }
.quiz-stored { border-left: 3px solid var(--rule); padding-left: 0.7rem; }
.quiz-stored p, .quiz-stored ol { margin: 0.2rem 0; }
.quiz-delete summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-delete[open] { display: grid; gap: 0.4rem; }
.quiz-delete p { margin: 0; }
.quiz-form :focus-visible, .quiz-delete button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A grid column is never narrower than its content by default, and a
   select is as wide as its longest option: let it shrink to the screen. */
.quiz-editor { grid-template-columns: minmax(0, 1fr); }
.quiz-editor .history li { overflow-wrap: anywhere; }
.quiz-run-question { border-top: 1px solid var(--rule); padding: 0.6rem 0; display: grid; gap: 0.3rem; min-width: 0; }
.quiz-run-question.current { border-left: 3px solid var(--accent); padding-left: 0.7rem; }
.quiz-run-question h3, .quiz-run-question p { margin: 0; overflow-wrap: anywhere; }
.quiz-moves { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quiz-moves form { margin: 0; }
.quiz-moves button:disabled { background: var(--rule); color: var(--muted); cursor: default; }
.quiz-order { display: grid; gap: 0.5rem; min-width: 0; }
.quiz-order fieldset { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; min-width: 0; }
.quiz-order legend { float: left; width: 100%; padding: 0; overflow-wrap: anywhere; }
.quiz-order input { font: inherit; width: 4rem; padding: 0.4rem 0.5rem; border: 1px solid var(--rule); border-radius: 8px; }
.quiz-order input[readonly] { background: var(--ground); color: var(--muted); }

/* Seat map (ADR-0019, CENG-45). Colours are variables so the app's dark
   theme, when it comes, can swap them; the rest of the app is light-only, so
   the seats are too for now. Each seat's text meets WCAG AA (4.5:1) on its
   colour: white on best 6.5, regular 5.2, cheap 5.3 and other 6.0; taken ink
   on taken 5.6; ink on yours 8.2. */
:root {
  --seat-best: #8a21d1;
  --seat-regular: #2f6cc4;
  --seat-cheap: #1f7a52;
  /* A tier with no colour of its own. */
  --seat-other: #5b6470;
  --seat-taken: #c9c4d1;
  --seat-taken-ink: #3f4650;
  --seat-ink: #ffffff;
  --seat-yours: #f2a900;
}
.seat-map .stage { margin: 0 0 0.5rem; text-align: center; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 2px solid var(--rule); }
.seat-grid { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
.seat-grid caption { caption-side: bottom; padding-top: 0.5rem; text-align: left; }
.seat-grid th { width: 1.25rem; vertical-align: middle; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.seat-grid td { padding: 0; }
.seat-grid td.aisle { width: 0.35rem; }
.seat { width: 100%; min-width: 0; aspect-ratio: 1; padding: 0; border: 0; border-radius: 4px; background: var(--seat-other); color: var(--seat-ink); font: inherit; font-size: 0.65rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.seat.tier-best, .swatch.tier-best { background: var(--seat-best); }
.seat.tier-regular, .swatch.tier-regular { background: var(--seat-regular); }
.seat.tier-cheap, .swatch.tier-cheap { background: var(--seat-cheap); }
.seat.taken, .seat.held, .seat.held-back, .swatch.taken { background: var(--seat-taken); color: var(--seat-taken-ink); cursor: not-allowed; }
.seat.yours, .swatch.yours { background: var(--seat-yours); color: #1b1f24; outline: 2px solid var(--ink); outline-offset: 1px; }
.seat:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.seat-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.75rem 0 0; padding: 0; list-style: none; font-size: 0.8rem; color: var(--muted); }
.swatch { display: inline-block; width: 0.75rem; height: 0.75rem; margin-right: 0.35rem; border-radius: 3px; vertical-align: -0.1rem; background: var(--seat-other); }
.seat.held-yours { background: var(--seat-yours); color: #1b1f24; outline: 2px dashed var(--ink); outline-offset: 1px; }
.seat-notice { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border-radius: 8px; background: var(--ground); font-size: 0.9rem; }
.seat-notice:empty { display: none; }
.seat-map .your-seat { margin: 0 0 0.75rem; }
.hold-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 0.75rem; }
.hold-panel p { flex-basis: 100%; margin: 0; }
/* The seat help desk (ADR-0019 A15): a host may give a held-back seat, so
   it stays grey but can be pressed, marked by a dashed edge. */
.seat-desk .seat.held-back:not(:disabled), .swatch.held-back { background: var(--seat-taken); color: var(--seat-taken-ink); outline: 2px dashed var(--seat-taken-ink); outline-offset: -2px; cursor: pointer; }
.desk-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.desk-list li { overflow-wrap: anywhere; }
.desk-find { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; margin: 0 0 1rem; }
.desk-find label { flex-basis: 100%; }
.desk-find input { flex: 1 1 12rem; min-width: 0; font: inherit; padding: 0.5rem; }
.desk-find button { font: inherit; font-weight: 600; padding: 0.5rem 1rem; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.hold-panel button { font: inherit; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.hold-panel button.let-go { background: none; color: var(--accent); border: 1px solid var(--accent); }

/* The launch night's big screen (ADR-0010 amendment, CENG-57). It fills
   the projector, so it carries its own light and dark palette, chosen by
   the page (?theme=, A7) and never by the laptop's prefers-color-scheme.
   Sizes follow the viewport, for reading from the back of the room. */
.screen.screen-light {
  --screen-bg: #f6f4f9;
  --screen-tile: #ffffff;
  --screen-ink: #1b1f24;
  --screen-muted: #5b6470;
  --screen-track: #e3dfe9;
  --screen-bar: #8a21d1;
  color-scheme: light;
}
.screen.screen-dark {
  --screen-bg: #14111a;
  --screen-tile: #1f1a28;
  --screen-ink: #f4f1f8;
  --screen-muted: #b3abc0;
  --screen-track: #352d42;
  --screen-bar: #c084fc;
  color-scheme: dark;
}
main.screen { min-height: 100vh; margin: 0; padding: 2.5vh 2.5vw; background: var(--screen-bg); color: var(--screen-ink); display: grid; gap: 2vh; align-content: start; }
.screen h1 { font-size: clamp(1.5rem, min(3vw, 5vh), 4rem); }
.screen-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2vh 1.5vw; }
/* As large as a tile's heading, so a frozen screen is visible from the room (A5). */
.screen-updated { grid-column: 1 / -1; margin: 0; text-align: right; color: var(--screen-muted); font-size: clamp(1rem, min(1.8vw, 2.8vh), 2.4rem); font-weight: 600; font-variant-numeric: tabular-nums; }
.tile { min-width: 0; padding: 2vh 1.5vw; border-radius: 1vw; background: var(--screen-tile); }
.tile h2 { margin: 0 0 1vh; font-size: clamp(1rem, min(1.8vw, 2.8vh), 2.4rem); font-weight: 600; color: var(--screen-muted); }
.tile .unit { font-size: 0.7em; font-weight: 400; }
.tile .figure { margin: 0; font-size: clamp(3rem, min(8vw, 12vh), 10rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .caption { margin: 0.5vh 0 0; font-size: clamp(0.9rem, min(1.6vw, 2.5vh), 2.2rem); color: var(--screen-muted); }
.bars { display: grid; gap: 0.7vh; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; align-items: center; gap: 1vw; font-size: clamp(0.9rem, min(1.5vw, 2.4vh), 2.2rem); }
.bar-label { overflow-wrap: anywhere; }
.bar-figure { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-track { width: 100%; height: 1.2em; background: var(--screen-track); border-radius: 0.3em; }
.columns { width: 100%; height: 28vh; background: var(--screen-track); border-radius: 0.6vw; }
.screen .bar { fill: var(--screen-bar); }
.room-question { grid-column: 1 / -1; margin: 1vh 0 0; text-align: center; font-size: clamp(1.5rem, min(3vw, 5vh), 4.5rem); font-weight: 700; overflow-wrap: anywhere; }

/* The quiz's big screen (ADR-0020 §6): read across a room. */
.quiz-screen { max-width: 64rem; margin: 0 auto; padding: 2rem 1rem; }
.quiz-board { display: grid; gap: 1rem; }
.quiz-board-waiting { font-size: 2.5rem; text-align: center; margin: 4rem 0; }
.quiz-board-status { font-size: 1.4rem; color: var(--muted); margin: 0; }
.quiz-board-prompt { font-size: 3rem; margin: 0; overflow-wrap: anywhere; }
.quiz-board-options { font-size: 2rem; margin: 0; padding-left: 2.5rem; }
.quiz-board-options .correct { font-weight: 700; color: var(--accent); }
.quiz-board-rows { font-size: 2rem; border-collapse: collapse; justify-self: start; }
.quiz-board-rows td { padding: 0.2rem 2rem 0.2rem 0; }
/* The code is what a guest looks for: as large as the rest, and bold.
   "monospace, monospace" stops browsers shrinking a lone monospace font. */
.quiz-board-rows .code { font-family: ui-monospace, Menlo, monospace, monospace; font-size: 1em; font-weight: 700; letter-spacing: 0.08em; }
/* The scan page (ADR-0016 §1): the last result, large enough to read at
   arm's length at a door, then one field. */
.scan-result { margin: 0 0 1rem; padding: 1rem 1.25rem; border-radius: 10px; font-size: 1.4rem; font-weight: 600; }
.scan-ok { background: #e6f4ec; color: #1f6b44; }
.scan-refused { background: #fbeee4; color: #9a4a10; }
.scan-form { display: grid; gap: 0.5rem; max-width: 32rem; }
/* What the next card earns, beside the field (CENG-41): large enough to
   notice before scanning. */
.scan-for { margin: 0; font-size: 1.1rem; }
.scan-form input[type="text"] { font: inherit; font-size: 1.2rem; padding: 0.75rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
.scan-form input:focus-visible, .scan-form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scan-form button { font: inherit; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; justify-self: start; }

/* The card on the web (ADR-0004 amendment 2026-10-28): the QR code at the
   page's width, up to a size a scanner reads easily. It is black on white
   whatever the page's colours, as a scanner needs. */
.fan-card-qr { max-width: 18rem; margin: 0 auto; }
.fan-card-qr svg { display: block; width: 100%; height: auto; }

/* A stall's basket on the scan page (ADR-0023 §3): each Add, Remove and
   Clear is its own small form, laid out on one line. */
.basket ul { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.basket li { margin: 0.25rem 0; }
.basket form { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.basket-total { font-size: 1.1rem; }
