/*
  Spike: kitchen display system (Screenery template)
  A kitchen ticket rail at full contrast: black ground, white type, Oswald for words you read from three metres, Nova Mono for clocks and counts.
  Colour is reserved for timing (green on time, amber late, red very late), always paired with a word and a shape. Allergies are white, inverted, hatched.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Primitives: icons, buttons, chips, segments, kbd
   4. App shell: top bar, banners, 86 strip
   5. Toolbar and legend
   6. Rail and tickets
   7. All day panel
   8. Report
   9. Dialogs: drawer, modal, forms
  10. Toasts, skeletons, states
  11. Motion
  12. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0a0a0a;
  --ticket: #0f0f0f;
  --raise: #161616;
  --raise-2: #202020;
  --line: #2a2a2a;
  --line-2: #3d3d3d;
  --steel: #5a5a5a;

  --text: #fff;
  --text-2: #d2d2d2;
  --text-3: #a3a3a3;   /* lowest text tone: 7.6:1 on --ticket */

  /* Timing only. Black ink sits on each of them at 9:1 or better. */
  --ok: #3be27a;
  --late: #ffc21a;
  --vlate: #ff5a45;
  --ink: #000;

  --font-d: "Oswald", "Arial Narrow", sans-serif;
  --font-m: "Nova Mono", ui-monospace, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 3px;
  --top-h: 64px;
  --tap: 48px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: var(--steel) var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-d); font-size: 16px; line-height: 1.35; caret-color: var(--text); accent-color: var(--text); }
::selection { background: var(--text); color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 2px solid var(--bg); }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; box-shadow: 0 0 0 5px var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; text-wrap: balance; line-height: 1.1; }
p { margin: 0; }
a { color: var(--text); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; }
.skip { position: absolute; left: var(--s3); top: -60px; z-index: 50; background: var(--text); color: var(--ink); padding: var(--s2) var(--s3); text-decoration: none; }
.skip:focus { top: var(--s3); }
kbd { font-family: var(--font-m); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 2px; color: var(--text-2); line-height: 1.4; }
.tbl, table { font-variant-numeric: tabular-nums; }

/* ---------- 3. Primitives ---------- */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-xs { width: 14px; height: 14px; }
.ic-xl { width: 40px; height: 40px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border: 2px solid var(--line-2); background: var(--raise); color: var(--text); border-radius: var(--r); font-family: var(--font-d); font-size: 15px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--text-3); background: var(--raise-2); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: 13px; }
.btn-ghost { background: transparent; }
.btn-icon { width: 44px; padding: 0; }
.btn-primary, .btn-invert { background: var(--text); color: var(--ink); border-color: var(--text); }
.btn-primary:hover, .btn-invert:hover { background: var(--text-2); border-color: var(--text-2); }
.btn.is-busy span::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.count { font-family: var(--font-m); font-size: 13px; min-width: 22px; padding: 0 4px; border: 1px solid var(--line-2); }

.seg { min-height: 44px; padding: 0 var(--s4); border: 2px solid var(--line-2); background: transparent; color: var(--text-2); font-family: var(--font-d); font-size: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; border-radius: var(--r); }
.seg[aria-pressed="true"] { background: var(--text); color: var(--ink); border-color: var(--text); }
.seg:hover:not([aria-pressed="true"]) { border-color: var(--text-3); color: var(--text); }

.chip { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); border: 2px dashed var(--line-2); background: transparent; color: var(--text-3); border-radius: var(--r); font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.chip[aria-pressed="true"] { border-style: solid; border-color: var(--text-2); color: var(--text); }
.chip-n { font-family: var(--font-m); font-size: 13px; padding: 0 5px; border: 1px solid currentColor; }
.chip[aria-pressed="false"] .chip-n { text-decoration: line-through; }

/* ---------- 4. App shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s5); min-height: var(--top-h); padding: 0 var(--s5); background: var(--bg); border-bottom: 2px solid var(--line); }
.brand { flex: none; display: flex; align-items: center; gap: var(--s3); }
.brand-mark { flex: none; width: 30px; height: 30px; fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.brand-mark rect { fill: var(--text); stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.brand-venue { font-family: var(--font-m); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.views { display: flex; gap: var(--s1); }
.view-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); background: transparent; border: 2px solid transparent; color: var(--text-3); text-transform: uppercase; font-size: 16px; font-weight: 500; letter-spacing: .05em; border-radius: var(--r); }
.view-btn[aria-pressed="true"] { color: var(--text); border-color: var(--text); }
.view-btn:hover { color: var(--text); }
.view-btn kbd { font-size: 10px; }
.clock { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.clock-day { font-family: var(--font-m); font-size: 12px; color: var(--text-3); text-transform: uppercase; }
.clock-time { font-family: var(--font-m); font-size: 32px; font-variant-numeric: tabular-nums; }
.clock-s { font-size: 18px; color: var(--text-3); }
.top-actions { display: flex; align-items: center; gap: var(--s2); }
.link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-m); font-size: 12px; color: var(--text-3); text-transform: uppercase; margin-right: var(--s2); white-space: nowrap; }
.link.is-off { color: var(--text); background: var(--text); color: var(--ink); padding: 4px 6px; }

.banner { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s5); background: var(--text); color: var(--ink); }
.banner p { flex: 1; font-size: 16px; }
.banner .btn-invert { background: var(--ink); color: var(--text); border-color: var(--ink); }

.strip86 { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s5); border-bottom: 2px solid var(--line); background: var(--panel); overflow-x: auto; }
.strip86-label { flex: none; font-family: var(--font-m); font-size: 18px; background: var(--text); color: var(--ink); padding: 2px 8px; }
.strip86-list { display: flex; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.s86 { display: inline-flex; align-items: baseline; gap: var(--s2); min-height: 40px; padding: 0 var(--s3); background: transparent; border: 2px solid var(--text); border-radius: var(--r); white-space: nowrap; }
.s86 b { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.s86 span { font-family: var(--font-m); font-size: 13px; color: var(--text-2); }

.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.pane-rail { padding: var(--s4) var(--s5) var(--s7); min-width: 0; }
.pane-allday { position: sticky; top: var(--top-h); max-height: calc(100dvh - var(--top-h)); overflow-y: auto; border-left: 2px solid var(--line); background: var(--panel); padding: var(--s4) var(--s4) var(--s6); }
.pane-report { grid-column: 1 / -1; padding: var(--s5) var(--s5) var(--s7); }
.app[data-view="report"] .pane-rail, .app[data-view="report"] .pane-allday { display: none; }
.view-allday { display: none; }

/* ---------- 5. Toolbar and legend ---------- */
.toolbar { display: grid; gap: var(--s3); padding-bottom: var(--s4); border-bottom: 4px solid var(--steel); }
.rail-title { display: flex; align-items: baseline; gap: var(--s3); font-size: 28px; }
.rail-sum { font-family: var(--font-m); font-size: 15px; font-weight: 400; color: var(--text-2); text-transform: none; letter-spacing: 0; }
.stations { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tool-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; }
.channels { display: flex; flex-wrap: wrap; gap: var(--s2); }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); border: 2px solid var(--line-2); border-radius: var(--r); color: var(--text-3); }
.search:focus-within { border-color: var(--text); color: var(--text); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; outline: none; }
.search input::placeholder { color: var(--text-3); }
.sort { display: flex; align-items: center; gap: var(--s2); font-family: var(--font-m); font-size: 12px; color: var(--text-3); text-transform: uppercase; }
.sort select, .field select { min-height: 44px; padding: 0 var(--s6) 0 var(--s3); background: var(--raise) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; border: 2px solid var(--line-2); border-radius: var(--r); appearance: none; font-family: var(--font-d); font-size: 15px; text-transform: uppercase; color: var(--text); }
.focus-dish { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border: 2px solid var(--text); font-size: 17px; text-transform: uppercase; justify-self: start; }

.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; padding: var(--s3) 0 var(--s4); font-family: var(--font-m); font-size: 12px; color: var(--text-2); text-transform: uppercase; }
.legend-note { text-transform: none; color: var(--text-3); }
.cue { display: inline-flex; align-items: center; gap: 6px; }
.cue svg { width: 14px; height: 14px; }
.cue-ok svg { fill: var(--ok); } .cue-late svg { fill: var(--late); } .cue-vlate svg { fill: var(--vlate); }

/* ---------- 6. Rail and tickets ---------- */
.rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: var(--s5) var(--s3); align-items: start; padding-top: var(--s3); outline: none; }
.ticket { position: relative; display: flex; flex-direction: column; background: var(--ticket); border: 2px solid var(--line-2); border-radius: 0 0 var(--r) var(--r); outline: none; }
/* The clip that holds the ticket on the rail */
.ticket::before { content: ""; position: absolute; top: -14px; left: 50%; width: 44px; height: 12px; translate: -50% 0; background: var(--steel); border-radius: 2px 2px 0 0; }
.ticket.is-sel { border-color: var(--text); box-shadow: 0 0 0 2px var(--text); }
.ticket:focus-visible { border-color: var(--text); box-shadow: 0 0 0 3px var(--text), 0 0 0 6px var(--bg); }
.ticket.is-faded { opacity: .38; }

.t-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "no time" "where cue" "meta meta"; gap: 2px var(--s3); width: 100%; padding: var(--s2) var(--s3) var(--s2); border: 0; text-align: left; color: var(--ink); background: var(--ok); }
.st-late .t-head { background: var(--late); }
.st-vlate .t-head { background: var(--vlate); }
.st-hold .t-head { background: var(--raise-2); color: var(--text); }
.t-no { grid-area: no; font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.t-time { grid-area: time; font-family: var(--font-m); font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; text-align: right; }
.t-where { grid-area: where; display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; min-width: 0; }
.t-where .ic { width: 18px; height: 18px; }
.t-cue { grid-area: cue; display: inline-flex; align-items: center; gap: 5px; justify-self: end; font-family: var(--font-m); font-size: 13px; text-transform: uppercase; white-space: nowrap; }
.t-cue svg { width: 13px; height: 13px; fill: currentColor; }
.t-meta { grid-area: meta; font-family: var(--font-m); font-size: 12px; opacity: .85; }
.st-vlate .t-head { background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(0, 0, 0, .1) 14px 20px); }

.t-body { padding: var(--s3); display: grid; gap: var(--s3); }
.allergy { padding: var(--s2) var(--s3); background: linear-gradient(#fff, #fff) padding-box, repeating-linear-gradient(45deg, #000 0 5px, #fff 5px 10px) border-box; border: 6px solid transparent; color: var(--ink); }
.alg-what { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; }
.alg-what .ic { stroke-width: 2.4; }
.alg-note { margin-top: 3px; font-family: var(--font-m); font-size: 13px; line-height: 1.35; }

.course { display: grid; gap: var(--s1); }
.course-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding-bottom: var(--s1); border-bottom: 1px solid var(--line-2); font-family: var(--font-m); font-size: 12px; text-transform: uppercase; color: var(--text-2); }
.course-head.is-hold { border-bottom-style: dashed; color: var(--text); }
.course-hold .items { opacity: .82; }
.course-away { font-family: var(--font-m); font-size: 12px; color: var(--text-3); text-transform: uppercase; padding: var(--s1) 0; border-bottom: 1px dashed var(--line); }
.items { list-style: none; margin: 0; padding: 0; display: grid; }
.item { display: grid; grid-template-columns: 34px 1fr auto; gap: var(--s2); align-items: start; width: 100%; min-height: 44px; padding: 6px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.items li:last-child .item { border-bottom: 0; }
.item:hover .iname { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.qty { font-family: var(--font-m); font-size: 20px; line-height: 1.2; text-align: center; border: 1px solid var(--line-2); }
.iname { display: grid; gap: 2px; font-size: 19px; font-weight: 500; text-transform: uppercase; letter-spacing: .015em; line-height: 1.15; padding-top: 2px; }
.mod { display: inline-flex; align-items: center; gap: 4px; justify-self: start; font-family: var(--font-m); font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text-2); }
.is-alg .mod { background: var(--text); color: var(--ink); padding: 1px 5px; }
.itags { display: flex; gap: 4px; align-items: center; padding-top: 4px; }
.stn { font-family: var(--font-m); font-size: 11px; color: var(--text-3); text-transform: uppercase; border: 1px solid var(--line-2); padding: 0 4px; }
.tag86 { font-family: var(--font-m); font-size: 12px; background: var(--text); color: var(--ink); padding: 0 4px; }
.ic-done { width: 18px; height: 18px; }
.item.is-done .iname, .item.is-done .qty { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 2px; }
.item.is-done .mod { color: var(--text-3); }
.item.is-dim { opacity: .45; }
.t-note { display: flex; gap: 6px; align-items: flex-start; font-family: var(--font-m); font-size: 13px; color: var(--text); border: 1px dashed var(--text-3); padding: 6px 8px; }
.t-note .ic { width: 16px; height: 16px; }

.t-foot { display: flex; gap: var(--s2); padding: 0 var(--s3) var(--s3); margin-top: auto; }
.btn-bump { flex: 1; min-height: 52px; background: var(--text); color: var(--ink); border-color: var(--text); font-size: 20px; font-weight: 600; letter-spacing: .08em; }
.btn-bump:hover { background: var(--text-2); }
.btn-fire-big { background: transparent; color: var(--text); border-style: dashed; }
.btn-fire-big:hover { background: var(--raise-2); }
.btn-fire { min-height: 32px; padding: 0 var(--s2); font-size: 12px; border-width: 1px; }
.btn-more { width: 52px; min-height: 52px; }

/* No-JS still copy */
.t-course { font-family: var(--font-m); font-size: 12px; text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--line-2); }
.t-item { font-size: 18px; text-transform: uppercase; }
.t-item b { font-family: var(--font-m); font-weight: 400; margin-right: 6px; }
.t-item i { display: block; font-style: normal; font-family: var(--font-m); font-size: 13px; text-transform: none; color: var(--text-2); }
.noscript { margin-top: var(--s4); font-family: var(--font-m); color: var(--text-2); }

/* ---------- 7. All day ---------- */
.ad-head { padding-bottom: var(--s3); border-bottom: 4px solid var(--steel); margin-bottom: var(--s3); }
.ad-head h2 { font-size: 24px; }
.ad-sub { font-family: var(--font-m); font-size: 12px; color: var(--text-3); margin-top: 4px; }
.ad-list { display: grid; gap: var(--s4); }
.ad-group h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--text-2); letter-spacing: .08em; padding-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.ad-tot { font-family: var(--font-m); font-size: 15px; font-weight: 400; }
.ad-group ul { list-style: none; margin: 0; padding: 0; }
.ad-row { display: flex; align-items: center; gap: var(--s2); border-bottom: 1px solid var(--line); }
.ad-dish { flex: 1; display: grid; grid-template-columns: 46px 1fr; gap: var(--s2); align-items: center; min-height: 52px; padding: var(--s1) 0; background: transparent; border: 0; text-align: left; min-width: 0; }
.ad-n { font-family: var(--font-m); font-size: 30px; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.ad-name { display: grid; font-size: 17px; font-weight: 500; text-transform: uppercase; line-height: 1.15; }
.ad-split { font-family: var(--font-m); font-size: 12px; font-weight: 400; text-transform: none; color: var(--text-3); }
.ad-row.is-on .ad-dish { box-shadow: inset 0 0 0 2px var(--text); padding-right: var(--s2); }
.ad-row.is-86 .ad-name { text-decoration: line-through; text-decoration-thickness: 2px; }
.ad-86 { min-width: 44px; min-height: 40px; font-family: var(--font-m); font-size: 14px; }
.ad-empty { font-family: var(--font-m); font-size: 14px; color: var(--text-2); padding: var(--s4) 0; }

/* ---------- 8. Report ---------- */
.rep-head { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; align-items: end; padding-bottom: var(--s4); border-bottom: 4px solid var(--steel); }
.rep-head h1 { font-size: 34px; }
.rep-sub { font-family: var(--font-m); font-size: 14px; color: var(--text-2); margin-top: 6px; max-width: 80ch; }
.ranges { display: flex; flex-wrap: wrap; gap: var(--s2); }
.rep-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: var(--s5); padding-top: var(--s5); }
.rep-tables { grid-column: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.rep-tables h2 { font-size: 18px; margin-bottom: var(--s3); }

/* The z-read: a till slip, printed white on black */
.zread { grid-row: span 2; align-self: start; background: var(--ticket); border: 2px solid var(--line-2); padding: var(--s4); font-family: var(--font-m); }
.z-top { font-size: 13px; color: var(--text-2); text-transform: uppercase; text-align: center; padding-bottom: var(--s3); border-bottom: 2px dashed var(--line-2); }
.zread dl { margin: 0; }
.z-row { display: grid; gap: 2px; padding: var(--s3) 0; border-bottom: 1px dashed var(--line-2); }
.z-row dt { font-size: 12px; color: var(--text-3); text-transform: uppercase; }
.z-row dd { margin: 0; display: grid; }
.z-row b { font-weight: 400; font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.z-row:first-child b, .z-row:last-child b { font-size: 17px; }
.z-row small { font-size: 12px; color: var(--text-3); }
.z-print { margin-top: var(--s4); width: 100%; }

.rep-charts { display: grid; gap: var(--s5); min-width: 0; align-content: start; }
.chart-fig { margin: 0; }
.chart-fig figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s2); }
.chart-title { font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.readout { font-family: var(--font-m); font-size: 13px; color: var(--text-2); min-height: 1.3em; }
.chart { position: relative; min-height: 180px; border: 1px solid var(--line); background: var(--panel); outline-offset: 3px; }
.chart svg { display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--text-3); font-family: var(--font-m); font-size: 11px; }
.chart .tick-target { fill: var(--text-2); }
.chart .bar { fill: var(--text-2); }
.chart .bar.is-on { fill: var(--text); }
.chart .line { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linejoin: round; }
.chart .dot { fill: var(--bg); stroke: var(--text); stroke-width: 2; }
.chart .dot.is-on { fill: var(--text); }
.chart .target { stroke: var(--text-3); stroke-dasharray: 6 5; stroke-width: 1.5; }
.chart .guide { stroke: var(--text-3); stroke-width: 1; }
.chart-table summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; font-family: var(--font-m); font-size: 13px; text-transform: uppercase; color: var(--text-2); text-decoration: underline; text-underline-offset: 4px; }

.tbl-frame { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-family: var(--font-m); font-size: 14px; }
th, td { padding: 9px var(--s2); border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child { text-align: left; font-family: var(--font-d); font-size: 15px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; }
thead th { font-family: var(--font-m) !important; font-size: 11px !important; color: var(--text-3); text-transform: uppercase; font-weight: 400; border-bottom: 2px solid var(--line-2); }
tfoot th, tfoot td { border-top: 2px solid var(--line-2); border-bottom: 0; color: var(--text); }
#slow-table td:nth-child(2) { text-align: left; white-space: normal; }
.mix-bar { display: flex; height: 36px; margin-bottom: var(--s3); border: 2px solid var(--line-2); }
.mix-bar span { display: flex; align-items: center; padding-left: 8px; overflow: hidden; white-space: nowrap; font-family: var(--font-m); font-size: 12px; text-transform: uppercase; }
.mix-dine { background: var(--text); color: var(--ink); }
.mix-take { background: #9c9c9c; color: var(--ink); }
.mix-deliv { background: #3a3a3a; color: var(--text); }

/* ---------- 9. Dialogs ---------- */
dialog { padding: 0; border: 0; color: var(--text); background: var(--panel); }
dialog::backdrop { background: rgba(0, 0, 0, .72); }
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(540px, 100%); max-width: 100%; border-left: 2px solid var(--text); overflow-y: auto; }
.drawer-in { padding: var(--s5); display: grid; gap: var(--s4); }
.modal { width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 2px solid var(--text); overflow-y: auto; }
.modal-in { padding: var(--s5); display: grid; gap: var(--s4); }
.dr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.dr-head h2 { font-size: 26px; }
.dr-sub { font-family: var(--font-m); font-size: 13px; color: var(--text-2); line-height: 1.5; }
.dt-head { margin: calc(var(--s5) * -1) calc(var(--s5) * -1) 0; padding: var(--s4) var(--s5); background: var(--ok); color: var(--ink); }
.dt-head.st-late { background: var(--late); } .dt-head.st-vlate { background: var(--vlate); } .dt-head.st-hold { background: var(--raise-2); color: var(--text); }
.dt-head .btn-icon { background: transparent; border-color: currentColor; color: inherit; }
.dt-cue { display: flex; align-items: center; gap: 6px; font-family: var(--font-m); font-size: 15px; text-transform: uppercase; margin-top: 4px; }
.dt-cue svg { width: 14px; height: 14px; fill: currentColor; }
.dt-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin: 0; }
.dt-facts dt { font-family: var(--font-m); font-size: 11px; color: var(--text-3); text-transform: uppercase; }
.dt-facts dd { margin: 0; font-size: 18px; text-transform: uppercase; }
.dt-courses { display: grid; gap: var(--s4); }
.dt-courses h3, .dt-log h3, .dt-notes h3 { display: flex; justify-content: space-between; font-size: 16px; padding-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.dt-courses h3 span { font-family: var(--font-m); font-size: 12px; font-weight: 400; color: var(--text-2); }
.dt-courses ul, .dt-log ol { list-style: none; margin: 0; padding: 0; }
.dt-courses li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s2); padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 18px; text-transform: uppercase; }
.dt-courses li b { font-family: var(--font-m); font-weight: 400; min-width: 22px; }
.dt-courses li i { flex-basis: 100%; padding-left: 30px; font-style: normal; font-family: var(--font-m); font-size: 13px; text-transform: none; color: var(--text-2); }
.dt-courses li.is-done { color: var(--text-3); text-decoration: line-through; }
.dt-log li { display: flex; gap: var(--s3); padding: 6px 0; font-family: var(--font-m); font-size: 13px; color: var(--text-2); border-bottom: 1px dashed var(--line); }
.dt-log time { color: var(--text); }
.dt-notes { display: grid; gap: var(--s2); }
.dt-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; padding-top: var(--s2); }
.dt-actions .btn-primary { min-width: 140px; min-height: 52px; font-size: 18px; }

.recall-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.recall-list li { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; padding: var(--s3); border: 2px solid var(--line-2); }
.recall-list li.is-last { border-color: var(--text); }
.recall-list li > div { display: grid; gap: 2px; min-width: 0; }
.recall-list b { font-size: 20px; }
.recall-list span { font-size: 15px; text-transform: uppercase; }
.recall-list small { font-family: var(--font-m); font-size: 12px; color: var(--text-3); }
.recall-list .empty { font-family: var(--font-m); color: var(--text-2); }

.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field legend, .left-row label, .note-row label { font-size: 15px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; padding: 0; }
.opt { font-family: var(--font-m); font-size: 12px; color: var(--text-3); text-transform: none; letter-spacing: 0; font-weight: 400; }
.field input[type="text"], .field input[type="number"], .field textarea { width: 100%; min-height: 48px; padding: var(--s2) var(--s3); background: var(--raise); border: 2px solid var(--line-2); border-radius: var(--r); font-family: var(--font-m); font-size: 17px; }
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--text); outline: none; }
.field [aria-invalid="true"] { border-color: var(--text); border-style: dashed; }
.field select { width: 100%; }
.left-row, .note-row { display: grid; gap: 6px; margin-top: var(--s3); }
.left-row input { max-width: 120px; }
.radios { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: 6px; }
.radios-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.radio { position: relative; }
.radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--s2); border: 2px solid var(--line-2); border-radius: var(--r); font-size: 15px; text-transform: uppercase; text-align: center; color: var(--text-2); }
.radio input:checked + span { background: var(--text); color: var(--ink); border-color: var(--text); }
.radio input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 2px; }
.err { font-family: var(--font-m); font-size: 13px; color: var(--text); }
.err:not(:empty)::before { content: "×  "; }
.err:empty { display: none; }
.hint { font-family: var(--font-m); font-size: 12px; color: var(--text-3); }
.form-msg:empty { display: none; }
.form-msg.is-error { padding: var(--s3); border: 2px dashed var(--text); font-family: var(--font-m); font-size: 14px; line-height: 1.45; }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); }
.modal-foot .btn-primary { min-width: 140px; min-height: 52px; font-size: 18px; }
.keys { margin: 0; display: grid; gap: 0; }
.keys div { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.keys dt { display: flex; gap: 4px; align-items: center; font-family: var(--font-m); font-size: 12px; color: var(--text-3); }
.keys dd { margin: 0; font-size: 16px; text-transform: uppercase; text-align: right; }
.keys kbd { font-size: 13px; color: var(--text); }

/* ---------- 10. Toasts, skeletons, states ---------- */
.toasts { position: fixed; left: 50%; bottom: var(--s5); translate: -50% 0; z-index: 40; display: grid; gap: var(--s2); width: min(520px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--raise); border: 2px solid var(--text); font-size: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }

.skel { pointer-events: none; padding: 0 0 var(--s3); gap: var(--s3); }
.sk { background: linear-gradient(90deg, var(--raise) 0 40%, var(--raise-2) 50%, var(--raise) 60% 100%) 0 0 / 300% 100%; border-radius: 2px; }
.sk-head { height: 82px; border-radius: 0; }
.sk-line { height: 22px; margin: 0 var(--s3); }
.pane-allday .sk-line { margin: var(--s2) 0; height: 40px; }
.sk-btn { height: 52px; margin: var(--s2) var(--s3) 0; }

.rail-state { grid-column: 1 / -1; display: grid; justify-items: start; gap: var(--s3); max-width: 60ch; padding: var(--s7) 0; }
.rail-state h2 { font-size: 40px; }
.rail-state p { font-family: var(--font-m); font-size: 16px; color: var(--text-2); line-height: 1.5; }
.rail-state.is-error { padding: var(--s5); border: 2px dashed var(--text); max-width: 680px; }
.rail-empty-art { width: 220px; height: 90px; fill: none; stroke: var(--steel); stroke-width: 4; stroke-linecap: round; }

/* ---------- 11. Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { to { background-position: -150% 0; } }
  /* Signature: a bumped ticket is pulled up off the rail */
  .ticket.is-leaving { animation: pull .26s var(--ease) forwards; pointer-events: none; }
  @keyframes pull { to { translate: 0 -40px; opacity: 0; clip-path: inset(0 0 100% 0); } }
  .ticket.is-new { animation: land .5s var(--ease); }
  @keyframes land { from { translate: 0 -24px; opacity: 0; } }
  .st-vlate .t-head { animation: crawl 1.6s linear infinite; }
  @keyframes crawl { to { background-position: 40px 0; } }
  .toast { animation: rise .3s var(--ease); }
  @keyframes rise { from { translate: 0 12px; opacity: 0; } }
  .drawer[open] { animation: slide .3s var(--ease); }
  @keyframes slide { from { translate: 40px 0; opacity: 0; } }
  .btn, .seg, .chip { transition: background .15s, border-color .15s, color .15s; }
}

@media print {
  .top, .bottom, .toolbar, .pane-rail, .pane-allday, .ranges, .z-print, .banner, .strip86 { display: none !important; }
  body, .zread { background: #fff; color: #000; }
}

/* ---------- 12. Narrow screens ---------- */
.bottom { display: none; }

@media (min-width: 1200px) {
  .app[data-view="allday"] .pane-rail { display: block; }
}
@media (max-width: 1199px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .view-allday { display: inline-flex; }
  .pane-allday { display: none; position: static; max-height: none; border-left: 0; background: transparent; padding: var(--s4) var(--s5) var(--s7); }
  .app[data-view="allday"] .pane-rail { display: none; }
  .app[data-view="allday"] .pane-allday { display: block; }
  .ad-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s5); align-items: start; }
  .rep-grid { grid-template-columns: 1fr; }
  .zread dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); column-gap: var(--s5); }
  .zread { grid-row: auto; }
  .rep-tables { grid-column: 1; grid-template-columns: 1fr 1fr; }
  .rep-tables section:last-child { grid-column: 1 / -1; }
  .brand-venue { display: none; }
  .top { gap: var(--s3); }
  .link span { display: none; }
}
@media (max-width: 1100px) and (min-width: 760px) {
  .brand-text { display: none; }
}
@media (max-width: 900px) {
  .top-actions .btn:not(.btn-icon) span:not(.count) { display: none; }
  .top-actions .btn:not(.btn-icon) { width: 48px; padding: 0; position: relative; }
  .top-actions .count { position: absolute; top: -6px; right: -6px; background: var(--bg); }
  .view-btn kbd { display: none; }
}
@media (max-width: 759px) {
  :root { --top-h: 56px; }
  .top { padding: 0 var(--s4); }
  .views, .top-actions .btn:not(.btn-icon), #open-keys { display: none; }
  .link { margin: 0; }
  .clock-time { font-size: 26px; }
  .clock-s { font-size: 15px; }
  .banner { flex-wrap: wrap; padding: var(--s3) var(--s4); }
  .strip86 { padding: var(--s2) var(--s4); }
  .pane-rail, .pane-allday, .pane-report { padding-left: var(--s4); padding-right: var(--s4); padding-bottom: 120px; }
  .rail-title { font-size: 24px; flex-wrap: wrap; }
  .stations { display: grid; grid-template-columns: repeat(3, 1fr); }
  .seg { padding: 0 var(--s2); }
  .channels { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .chip { justify-content: center; padding: 0 6px; font-size: 13px; gap: 5px; }
  .chip .ic { display: none; }
  .tool-row { flex-wrap: nowrap; gap: var(--s2); }
  .search { flex: 1 1 auto; min-width: 0; }
  .search kbd { display: none; }
  .sort > span { display: none; }
  .sort select { width: 132px; font-size: 13px; padding-right: 28px; }
  .channels { order: -1; }
  .tool-row { flex-wrap: wrap; }
  .legend { gap: var(--s2) var(--s3); }
  .legend-note { display: none; }
  .rail { grid-template-columns: 1fr; gap: var(--s5); }
  .ad-list { grid-template-columns: 1fr; }
  .rep-head h1 { font-size: 28px; }
  .ranges { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .zread dl { grid-template-columns: 1fr 1fr; column-gap: var(--s4); }
  .z-row b { font-size: 20px; }
  .rep-tables { grid-template-columns: 1fr; }
  .dt-facts { grid-template-columns: 1fr 1fr; }
  .drawer-in, .modal-in { padding: var(--s4); }
  .dt-head { margin: calc(var(--s4) * -1) calc(var(--s4) * -1) 0; padding: var(--s4); }
  .radios-4 { grid-template-columns: 1fr 1fr; }
  .toasts { bottom: 84px; }
  .bottom { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bg); border-top: 2px solid var(--line-2); padding-bottom: env(safe-area-inset-bottom); }
  .bot-btn { display: grid; justify-items: center; gap: 2px; min-height: 64px; padding: 8px 0; background: transparent; border: 0; color: var(--text-3); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
  .bot-btn[aria-pressed="true"] { color: var(--text); box-shadow: inset 0 3px 0 var(--text); }
}
.field input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.field input[type="number"]::-webkit-inner-spin-button, .field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
