/* RaceSims tower console — look B, the hub's tokens (tower 0.5.0). The tower serves only tower/public, so it cannot read
   hub/public/style.css: the palette blocks, the type and space scales and the faces below are the hub's, copied verbatim
   (DESIGN.md is the record; tools/tower-tokens-unit.cjs holds them equal to the mock's look B). Barlow and Barlow Condensed are
   served from /console/fonts, so the console never depends on the internet for its own face.
   Colour is information: green means live or done, amber means look at this, red is the mark, the primary action and a race. */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("/console/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("/console/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("/console/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("/console/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("/console/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/console/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/console/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("/console/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }
/* ---- The tokens (the hub's, look B). :root is the dark palette (a console left open on a desk, often at night). Light is the
   same names with other values: :root[data-theme="light"] when chosen (theme in console.js, localStorage rs.theme), and the OS
   setting when nothing is chosen. The two light blocks are one list written twice (CSS has no other way); tower-tokens-unit.cjs
   fails if they drift apart. ---- */
:root {
  color-scheme: dark;
  --ground: #0a0b0e; --top: #0a0b0e; --rail: #0a0b0e; --panel: #12141a; --raised: #181b22; --hover: #181b22;
  --line: #22262e; --line-2: #2e333d; --input-bg: #0a0b0e; --scrim: #050608;
  --ink: #f4f5f7; --ink-2: #a9b0bc; --ink-3: #8b93a1;            /* #6e7685 is 4.0:1 on the panel: never text */
  --red: #e10600; --on-red: #ffffff; --bad: #ff6b61;
  --primary-hover-bg: #f4711f; --primary-hover-ink: #0a0b0e;      /* white on saffron is 2.9:1, so ink */
  --map-on-bg: #f4711f; --map-on-ink: #0a0b0e;
  --today-bg: #f4711f; --today-ink: #0a0b0e; --today-line: #f4711f; --range-line: #2e333d;
  --seg-on-bg: #2e333d;
  --tab-line: #e10600; --tab-line-h: 3px; --skew: -12deg;
  --ok: #4fd07a; --ok-ink: #4fd07a; --ok-bg: rgba(30,154,58,.2);
  --due-ink: #f5b400; --due-bg: rgba(245,180,0,.12);
  --ref-ink: #4ea3ff; --ref-bg: rgba(78,163,255,.13);
  --link: #4ea3ff; --focus: #f4711f; --sel-bg: #f4711f; --sel-ink: #0a0b0e;
  --r-panel: 0; --r-ctl: 0; --r-pill: 999px; --r-dot: 0;   /* pills are 999 (the plan); the mock's own demo pill is 0 */
  --shadow: none;
  --shadow-pop: 0 18px 44px rgba(0,0,0,.6);
  --f-display: "Barlow Condensed", "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  --f-text: "Barlow", "Segoe UI", system-ui, sans-serif;
  --f-fig: ui-monospace, "Cascadia Mono", Consolas, monospace;   /* figures: mono */
  --f-pod: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --f-code: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --w-title: 800; --w-num: 800; --w-nav: 700; --w-btn: 700; --w-brand: 800;
  --case-title: uppercase; --track-title: -.01em; --case-nav: uppercase; --track-nav: .04em;
  --case-th: uppercase; --track-th: .08em; --case-pill: uppercase; --track-pill: .05em;

  /* the scales: six type steps, the 4-px grid */
  --t-1: 12px; --t0: 14px; --t1: 16px; --t2: 20px; --t3: 28px; --t4: 40px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --top-h: 44px; --map-w: 96px; --rail-w: 56px; --bar-h: 56px;   /* the frame (the hub's): the top bar; the map — full, the rail at <= 1366 px, the bottom bar at <= 600 px */
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #f7f7f5; --top: #ffffff; --rail: #ffffff; --panel: #ffffff; --raised: #f1f1ee; --hover: #f3f3f1;
  --line: #e3e4e8; --line-2: #cfd2d8; --input-bg: #ffffff; --scrim: #9b9c9f;
  --ink: #0a0b0e; --ink-2: #4a515d; --ink-3: #5d6573;
  --red: #e10600; --on-red: #ffffff; --bad: #c0322a;
  --primary-hover-bg: #f4711f; --primary-hover-ink: #0a0b0e;
  --map-on-bg: #f4711f; --map-on-ink: #0a0b0e;
  --today-bg: #f4711f; --today-ink: #0a0b0e; --today-line: #f4711f; --range-line: #cfd2d8;
  --seg-on-bg: #e3e4e8;
  --tab-line: #e10600;
  --ok: #1e9a3a; --ok-ink: #146b28; --ok-bg: rgba(30,154,58,.13);
  --due-ink: #7a5100; --due-bg: rgba(245,180,0,.2);
  --ref-ink: #1b5fae; --ref-bg: rgba(78,163,255,.16);
  --link: #1b5fae; --focus: #0a0b0e; --sel-bg: #f4711f; --sel-ink: #0a0b0e;
  --shadow-pop: 0 18px 44px rgba(10,11,14,.22);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --ground: #f7f7f5; --top: #ffffff; --rail: #ffffff; --panel: #ffffff; --raised: #f1f1ee; --hover: #f3f3f1;
    --line: #e3e4e8; --line-2: #cfd2d8; --input-bg: #ffffff; --scrim: #9b9c9f;
    --ink: #0a0b0e; --ink-2: #4a515d; --ink-3: #5d6573;
    --red: #e10600; --on-red: #ffffff; --bad: #c0322a;
    --primary-hover-bg: #f4711f; --primary-hover-ink: #0a0b0e;
    --map-on-bg: #f4711f; --map-on-ink: #0a0b0e;
    --today-bg: #f4711f; --today-ink: #0a0b0e; --today-line: #f4711f; --range-line: #cfd2d8;
    --seg-on-bg: #e3e4e8;
    --tab-line: #e10600;
    --ok: #1e9a3a; --ok-ink: #146b28; --ok-bg: rgba(30,154,58,.13);
    --due-ink: #7a5100; --due-bg: rgba(245,180,0,.2);
    --ref-ink: #1b5fae; --ref-bg: rgba(78,163,255,.16);
    --link: #1b5fae; --focus: #0a0b0e; --sel-bg: #f4711f; --sel-ink: #0a0b0e;
    --shadow-pop: 0 18px 44px rgba(10,11,14,.22);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: var(--t0)/1.45 var(--f-text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=file]), select, textarea { background: var(--ground); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: var(--s2) var(--s3); color-scheme: inherit; }
input:not([type=checkbox]):not([type=file]), select { height: var(--s6); padding-block: 0; }   /* one control height: the buttons' 32 px */
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }   /* the browser's own grey is 4.3:1 */
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
a { color: var(--link); }
/* the keyboard ring (the hub's): inputs ring their border instead, in their own rule above */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the browser's own surfaces: the selection, the caret and the scrollbars are the palette's (the hub's B6) */
html { caret-color: var(--ink); scrollbar-color: var(--line-2) var(--ground); }
::selection { background: var(--sel-bg); color: var(--sel-ink); }
[hidden] { display: none !important; }
.mono { font-family: var(--f-fig); font-size: var(--t-1); }
.quiet { color: var(--ink-2); } .dim { color: var(--ink-3); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ================================================================================================================
   The frame (tower 0.5.0, the hub's look B — hub/public/style.css's frame block, copied): the 44-px top bar, the six-item
   map down the left, the page header. The map is the 96-px column of words above 1366 px, a 56-px rail of icons with their
   labels under them up to 1366 px, a bottom bar of the six at a phone's width. Signed out, the map is hidden and the page
   takes the whole width. Tokens only.
   ================================================================================================================ */
.frame-top { display: flex; align-items: center; gap: var(--s3); height: var(--top-h); padding: 0 var(--s4); background: var(--top); border-bottom: 1px solid var(--line); color: var(--ink); }
.frame-brand { display: flex; align-items: center; gap: var(--s2); min-width: 0; font: var(--w-brand) var(--t1)/1 var(--f-display); text-transform: var(--case-title); letter-spacing: var(--track-title); white-space: nowrap; }
.frame-brand .mark { flex: none; width: 5px; height: 16px; background: var(--red); transform: skewX(var(--skew)); }
.frame-brand .brand { font: inherit; }
.frame-brand .ver { font: 500 var(--t-1)/1 var(--f-text); color: var(--ink-2); text-transform: none; letter-spacing: 0; }
/* the RaceSims Studio logo is drawn white: it sits on a plate — the raised tone in the dark, an ink chip in light — so it reads in both */
.logo-plate { flex: none; display: inline-flex; padding: 0 var(--s1); background: var(--raised); }
.logo-plate .logo { display: block; width: 32px; height: 32px; object-fit: contain; }
:root[data-theme="light"] .logo-plate { background: var(--ink); }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .logo-plate { background: var(--ink); } }
.top-right { display: flex; align-items: center; gap: var(--s3); margin-left: auto; }
.frame-top .clock { flex: none; font: 600 var(--t1)/1 var(--f-fig); font-variant-numeric: tabular-nums; letter-spacing: 0; }
/* the switch: Dark · Light · Auto (the hub's, tower 0.5.0); the one thing stored is localStorage rs.theme */
.theme-switch { flex: none; display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-ctl); }
.theme-switch button { height: 28px; padding: 0 var(--s2); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font: var(--w-btn) var(--t0)/1 var(--f-display); text-transform: var(--case-nav); letter-spacing: var(--track-nav); }
.theme-switch button + button { border-left: 1px solid var(--line-2); }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--seg-on-bg); color: var(--ink); }
.theme-switch button:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
/* the shell: the map, then the body (each page's header and the page) */
.frame { display: grid; grid-template-columns: var(--map-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.frame:has(> .frame-map[hidden]) { grid-template-columns: minmax(0, 1fr); }
.frame-map { background: var(--rail); border-right: 1px solid var(--line); min-width: 0; }
.frame-map .map-items { position: sticky; top: 0; display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) var(--s2); }
.frame-map a { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s2); border-radius: var(--r-ctl); color: var(--ink-2); text-decoration: none; white-space: nowrap;
  font: var(--w-nav) var(--t1)/1 var(--f-display); text-transform: var(--case-nav); letter-spacing: var(--track-nav); }
.frame-map a svg { display: none; flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; }
.frame-map a:hover { color: var(--ink); background: var(--hover); }
.frame-map a[aria-current="page"] { background: var(--map-on-bg); color: var(--map-on-ink); }
.frame-map a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the marked item is saffron: its ring is drawn inside the fill in the fill's own ink */
.frame-map a[aria-current="page"]:focus-visible { outline-color: var(--map-on-ink); outline-offset: calc(-1 * var(--s1)); }
.frame-body { min-width: 0; display: flex; flex-direction: column; }
.frame-body > main.page { flex: 1 1 auto; min-width: 0; padding: 0 var(--s5) var(--s5); }
/* the page header: each page's own .page-head, the title left (800, capitals), the actions pushed right */
.page-head { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin: 0; padding: var(--s4) 0 var(--s3); min-height: var(--s7); }
.page-head h1 { margin: 0; font: var(--w-title) var(--t3)/1.05 var(--f-display); text-transform: var(--case-title); letter-spacing: var(--track-title); }
.page-head h1 small { font: 500 var(--t1)/1.2 var(--f-text); color: var(--ink-2); margin-left: var(--s3); text-transform: none; letter-spacing: 0; }
.page-head h1 small .pill[data-pill] { margin: 0 var(--s1); }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
/* the rail: up to 1366 px every item stays, an icon with its label under it */
@media (max-width: 1366px) {
  .frame { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .frame-map .map-items { padding: var(--s2) 0; gap: var(--s1); }
  .frame-map a { flex-direction: column; justify-content: center; gap: var(--s1); padding: var(--s2) 0; font-size: var(--t-1); text-transform: none; letter-spacing: 0; }
  .frame-map a svg { display: block; }
  .frame-map a:focus-visible { outline-offset: -2px; }
}
/* a phone: the map is a bottom bar of the six; the top bar keeps the mark, "tower", the switch and the two buttons */
@media (max-width: 600px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .frame-map { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); border-right: 0; border-top: 1px solid var(--line); }
  .frame-map .map-items { position: static; flex-direction: row; height: var(--bar-h); padding: 0; gap: 0; }
  .frame-map a { flex: 1 1 0; min-width: 0; height: 100%; padding: var(--s1) 0; }
  body:has(.frame-map:not([hidden])) { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); }
  .frame-top { position: sticky; top: 0; z-index: 50; padding: 0 var(--s3); gap: var(--s2); }
  .top-right { gap: var(--s2); }
  .frame-top .clock, .frame-brand .ver, .logo-plate { display: none; }
  .theme-switch button { padding: 0 var(--s2); font-size: var(--t-1); }
  .top-right .btn.small { padding: 0 var(--s1); }
  .frame-body > main.page { padding: 0 var(--s4) var(--s4); overflow-x: auto; }   /* a wide table scrolls inside the page, never the page sideways */
  .page-head { padding: var(--s3) 0 var(--s2); }
  .page-head .page-actions { margin-left: 0; flex-basis: 100%; }
  .card { overflow-x: auto; }   /* a card's wide table scrolls inside the card; the cards keep the page's width */
}

/* panels and the section heads (the hub's B5: an h2 is 800 capitals at 20 px; a note inside keeps its case) */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: var(--s4); margin-bottom: var(--s4); box-shadow: var(--shadow); }
.card h2 { margin: 0 0 var(--s3); font: var(--w-title) var(--t2)/1.15 var(--f-display); text-transform: var(--case-title); letter-spacing: var(--track-title); }
.card h3 { margin: var(--s4) 0 var(--s2); font: 700 var(--t0)/1.3 var(--f-display); text-transform: var(--case-th); letter-spacing: var(--track-th); }   /* a sub-head in a card (Commands: Waiting, Done) */
.card h2 + h3 { margin-top: 0; }
.card h2 small { font: 400 var(--t-1)/1.3 var(--f-text); color: var(--ink-2); margin-left: var(--s2); text-transform: none; letter-spacing: normal; }
.note { color: var(--ink-2); font-size: var(--t0); margin: 0 0 var(--s3); }
.msg { min-height: 1.4em; margin: var(--s2) 0; font-size: var(--t0); }
.msg.bad { color: var(--bad); } .msg.warn { color: var(--due-ink); }
.v-grid { display: grid; grid-template-columns: 3fr 2fr; gap: var(--s4); align-items: start; }
.v-grid > * { min-width: 0; }   /* a long line or a wide table in one card never widens the column past the page */
.v-side { display: flex; flex-direction: column; }   /* the narrow column: Overview's tiles and licence, Settings' versions and brand */
@media (max-width: 1100px) {
  .v-grid { grid-template-columns: 1fr; }
  /* Overview in one column (fix round 1): the tiles, the live pods, then the licence and the link — the side column opens up so
     its parts take their own places in the grid, and only the tiles move up */
  [data-panel="overview"] .v-side { display: contents; }
  [data-panel="overview"] .v-side > .stats { order: -1; }
}
.card > .acts { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s3); }
.card h2 + .facts { margin-top: 0; }

/* ================================================================================================================
   The venue page, one job per view (tower 0.5.0 Task 5): the tab strip (the hub's .frame-tabs), the stat tiles (UI.tile), the
   More menu (menu() in console.js — the hub has none, so it is small and on the hub's tokens). Tokens only.
   ================================================================================================================ */
/* the tab strip: condensed 700 capitals in --ink-2, 24-px gaps over a hairline; the current tab --ink over the red slanted 3-px
   line. Real links (#venue=CODE&tab=…); on a phone it scrolls sideways inside itself, never the page. */
.v-tabs { display: flex; gap: var(--s5); margin: 0 0 var(--s4); padding: 0 var(--s1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.v-tabs::-webkit-scrollbar { display: none; }
.v-tabs a { position: relative; flex: none; padding: var(--s3) var(--s1); color: var(--ink-2); text-decoration: none; white-space: nowrap;
  font: var(--w-nav) var(--t1)/1 var(--f-display); text-transform: var(--case-nav); letter-spacing: var(--track-nav); }
.v-tabs a:hover { color: var(--ink); }
.v-tabs a[aria-current] { color: var(--ink); }
.v-tabs a[aria-current]::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: 0; height: var(--tab-line-h); background: var(--tab-line); transform: skewX(var(--skew)); }
.v-tabs a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* the stat tile (the hub's UI.tile): a flat panel, the figure in the 800 face, the label in small capitals under it, a note; a
   warning tile's figure is amber. Here the note may wrap (it holds a chip) and an action line and a fold may follow. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.stat { min-width: 0; padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.stat .v { font: var(--w-num) var(--t4)/1 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .v.text { font-size: var(--t2); line-height: 1.15; white-space: normal; }
.stat .l { margin-top: var(--s1); font: 600 var(--t-1)/1.3 var(--f-text); text-transform: var(--case-th); letter-spacing: var(--track-th); color: var(--ink-2); }
.stat .s { margin-top: var(--s1); font: 400 var(--t-1)/1.6 var(--f-text); color: var(--ink-2); }
.stat .s b { color: var(--ink); font-weight: 600; }
.stat.warn .v { color: var(--due-ink); }
.stat .acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin-top: var(--s2); font-size: var(--t-1); }
.stat details { margin-top: var(--s2); font-size: var(--t-1); color: var(--ink-2); }
.stat summary { width: max-content; cursor: pointer; color: var(--ink-2); }
.stat summary:hover { color: var(--ink); }
.ver-pods { margin-top: var(--s1); line-height: 1.5; }
.ver-pods .behind { color: var(--due-ink); font-weight: 600; } .ver-pods .offp { color: var(--ink-3); }
/* the menu: under its button from 601 px, square on --panel with the pop shadow; items 32 px; the group heads in small capitals;
   the danger pair after a hairline, outlined and inked in --bad, never filled. On a phone: a bottom sheet over the scrim. */
.menu-wrap { position: relative; display: inline-flex; }
.menu-wrap > .btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; }
.menu-wrap > .btn[aria-expanded="true"] { border-color: var(--ink); }   /* More, while its menu is open */
.menu { position: absolute; top: calc(100% + var(--s1)); right: 0; z-index: 60; min-width: 240px; padding: var(--s2) 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); }
.menu-group { display: flex; flex-direction: column; }
.menu-group + .menu-group { margin-top: var(--s2); }
.menu-head { padding: var(--s1) var(--s3); font: 600 var(--t-1)/1.3 var(--f-text); text-transform: var(--case-th); letter-spacing: var(--track-th); color: var(--ink-2); }
.menu-item { display: flex; align-items: center; width: 100%; height: var(--s6); padding: 0 var(--s3); border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink); text-align: left; white-space: nowrap; cursor: pointer; font: 500 var(--t0)/1 var(--f-text); }
.menu-item:hover, .menu-item:focus { background: var(--hover); }
.menu-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.menu-sep { margin: var(--s2) 0; border-top: 1px solid var(--line); }
.menu-group.danger { gap: var(--s2); padding: 0 var(--s3); }
.menu-item.danger { border: 1px solid var(--bad); background: none; color: var(--bad); }
.menu-item.danger:hover, .menu-item.danger:focus { background: var(--hover); }
.menu-scrim, .menu-foot, .menu-close { display: none; }   /* the sheet's own: drawn at <= 600 px only */
@media (max-width: 600px) {
  .menu-sep.menu-foot { display: block; }
  .menu-item.menu-close { display: flex; justify-content: center; }
  .v-tabs { gap: var(--s4); }
  .menu-scrim { display: block; position: fixed; inset: 0; z-index: 110; background: color-mix(in srgb, var(--scrim) 60%, transparent); }
  .menu { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 115; min-width: 0; max-height: calc(100dvh - var(--top-h)); overflow-y: auto;
    padding: var(--s3) 0 calc(var(--s3) + env(safe-area-inset-bottom, 0px)); border: 0; border-top: 1px solid var(--line-2); }
  .menu-item { height: calc(var(--s6) + var(--s3)); font-size: var(--t1); }   /* 44 px: a thumb's target */
}

/* ================================================================================================================
   Buttons (the hub's three kinds, look B). primary: red, one per view, the B slant — the red is a ::before skewed by
   --skew, so the box leans and the label stands upright in --on-red (hover: saffron with ink); default: --raised, a --line-2
   border, --ink; quiet: no ground, --ink-2. Danger is a default outlined in --bad, never filled. 32 px; .btn.small 28 px
   (the one small size: table rows, the venue's actions, the top bar). Tokens only.
   ================================================================================================================ */
.btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: var(--s6); padding: 0 var(--s3); vertical-align: middle;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--raised); color: var(--ink); box-shadow: none; text-decoration: none; white-space: nowrap; cursor: pointer;
  font: var(--w-btn) var(--t1)/1 var(--f-display); text-transform: var(--case-nav); letter-spacing: var(--track-nav); }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: transparent; border-color: transparent; color: var(--on-red); padding: 0 var(--s4); }
.btn.primary::before { content: ""; position: absolute; inset: -1px; z-index: -1; background: var(--red); border-radius: var(--r-ctl); transform: skewX(var(--skew)); }
.btn.primary:hover { color: var(--primary-hover-ink); border-color: transparent; }
.btn.primary:hover::before { background: var(--primary-hover-bg); }
.btn.quiet { background: none; border-color: transparent; color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); border-color: var(--line-2); }
.btn.danger { background: none; border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--hover); border-color: var(--bad); }
.btn.small { height: calc(var(--s6) - var(--s1)); padding: 0 var(--s2); font-size: var(--t0); }
.btn.primary.small { padding: 0 var(--s3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary:disabled:hover { color: var(--on-red); }
.btn.primary:disabled:hover::before { background: var(--red); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ================================================================================================================
   table.grid (the hub's): a sticky head in small capitals over an inset hairline, cells 8 × 12, a row hover, figures right
   in the mono face, the actions cell last with .btn.small only. An empty table is one full-width row holding the empty state.
   ================================================================================================================ */
table.grid { width: 100%; border-collapse: collapse; font-size: var(--t0); background: var(--panel); }
table.grid th { position: sticky; top: 0; z-index: 1; padding: var(--s2) var(--s3); background: var(--panel); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); text-align: left; vertical-align: bottom; white-space: nowrap;
  font: 600 var(--t-1)/1.3 var(--f-text); text-transform: var(--case-th); letter-spacing: var(--track-th); color: var(--ink-2); }
table.grid td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tbody tr:hover > td { background: var(--hover); }
table.grid tr.click { cursor: pointer; }
table.grid .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid td.num { font: 600 var(--t0)/1.3 var(--f-fig); font-variant-numeric: tabular-nums; }
table.grid td.acts { text-align: right; white-space: nowrap; }
table.grid td .btn.small + .btn.small { margin-left: var(--s1); }
table.grid tbody tr.empty-row > td { padding: 0; }
table.grid tbody tr.empty-row:hover > td { background: transparent; }
table.grid td > .empty { padding: var(--s5) var(--s4); }
tr.dim0 td { opacity: .72; }   /* a filtered-out row: de-emphasised, 3:1 or better with margin in both modes (Ruling 10; .65 is 2.8:1 in light) */
table.grid tbody tr.hit > td { background: var(--due-bg); }
/* a wide table scrolls inside its own box (the Content matrix), its head staying in view */
.table-wrap { max-height: 70vh; overflow: auto; }

/* ================================================================================================================
   The pills (the hub's UI.pill, as pill() in console.js): one status word, filled by the colour rule — live · look · off for
   a venue, live · free · off · booked · done · look for a pod, and no other word. 22 px, 999 round, 12 px capitals.
   ================================================================================================================ */
.pill[data-pill] { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--s2); border: 0; border-radius: var(--r-pill); box-shadow: none; vertical-align: middle; white-space: nowrap;
  font: 600 var(--t-1)/1 var(--f-text); text-transform: var(--case-pill); letter-spacing: var(--track-pill); }
.pill[data-pill="live"], .pill[data-pill="done"], .pill[data-pill="paid"] { background: var(--ok-bg); color: var(--ok-ink); }
.pill[data-pill="look"], .pill[data-pill="booked"], .pill[data-pill="owed"] { background: var(--due-bg); color: var(--due-ink); }
.pill[data-pill="refunded"] { background: var(--ref-bg); color: var(--ref-ink); }
.pill[data-pill="off"], .pill[data-pill="free"], .pill[data-pill="void"] { background: var(--raised); color: var(--ink-3); border: 1px solid var(--line-2); }   /* the line keeps the shape on a hovered row (--hover is --raised in the dark) */
td > .pill[data-pill] { margin-right: var(--s1); }
/* the chips: versions and results (current, behind, revoked, done, lost, failed …) — not status pills; round, on the tokens */
.chip { display: inline-flex; align-items: center; gap: var(--s1); height: 22px; padding: 0 var(--s2); border-radius: var(--r-pill); background: var(--raised); border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; font: 600 var(--t-1)/1 var(--f-text); }
.chip.ok { border-color: var(--ok); color: var(--ok-ink); } .chip.warn { border-color: var(--due-ink); color: var(--due-ink); } .chip.bad { border-color: var(--bad); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips .chip b { color: var(--ink); }
.lic-ok { color: var(--ok-ink); } .lic-due { color: var(--due-ink); } .lic-overdue { color: var(--bad); }

/* the empty state (the hub's UI.empty): two lines and no icon — what this is, then what to do — with the action as a button */
.empty { padding: var(--s6) var(--s5); text-align: center; color: var(--ink-2); font-size: var(--t0); }
.empty b { display: block; color: var(--ink); font: 600 var(--t2)/1.2 var(--f-display); margin-bottom: var(--s2); }
.empty p { margin: 0 auto var(--s4); max-width: 44ch; }
.empty p:last-child { margin-bottom: 0; }
:is(.dlg, .tiles, .card .card) .empty { padding: var(--s4) var(--s3); }
:is(.dlg, .tiles, .card .card) .empty b { font-size: var(--t1); margin-bottom: var(--s1); }

/* pod tiles from the last heartbeat: the pod, its pill, what it is doing, its agent */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: var(--s2); }
.tile { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s1) var(--s2); padding: var(--s3); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-ctl); min-height: 72px; }
.tile b { font: 700 var(--t1)/1 var(--f-display); letter-spacing: var(--track-nav); }
.tile .st { grid-column: 1 / -1; display: block; font-size: var(--t0); color: var(--ink); }
.tile .st.quiet { color: var(--ink-2); }
.tile small { grid-column: 1 / -1; display: block; color: var(--ink-2); font-size: var(--t-1); }
.tile.behind small { color: var(--due-ink); }

/* forms */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); }
.form label { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-1); color: var(--ink-2); }
.form label:has(textarea), .form .acts { grid-column: 1 / -1; }
.form input, .form select, .form textarea { font-size: var(--t0); }
.form.inline { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.form .acts { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s1); }
.inline-label { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t0); color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s4); margin: var(--s3) 0 0; font-size: var(--t0); }
.facts dt { color: var(--ink-2); font-size: var(--t-1); text-transform: var(--case-th); letter-spacing: var(--track-th); align-self: baseline; }
.facts dd { margin: 0; }
/* on a phone a fact sits under its name: the long names leave the values no room beside them (after the rules above, which it overrides) */
@media (max-width: 600px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 0; } .facts dd { margin-bottom: var(--s2); } }
.login { max-width: 380px; margin: 10vh auto 0; display: grid; gap: var(--s3); }
.login h1 { margin: 0; font: var(--w-title) var(--t3)/1.05 var(--f-display); text-transform: var(--case-title); letter-spacing: var(--track-title); }
.login label { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-1); color: var(--ink-2); }
.login input { font-size: var(--t1); }
.login .acts { display: flex; justify-content: flex-end; }

/* the dialog and the toasts (the hub's ui.js shapes): a 440-px card (640 wide) on the 60% scrim, the pop shadow */
.dlg-back { position: fixed; inset: 0; z-index: 120; background: color-mix(in srgb, var(--scrim) 60%, transparent); display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.dlg { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: var(--s5); width: min(440px, 100%); max-height: calc(100vh - 2 * var(--s4)); overflow-y: auto; box-shadow: var(--shadow-pop); }
.dlg { max-height: calc(100dvh - 2 * var(--s4)); }   /* the screen as it is on a phone, its browser bars shown; the 100vh above is the fallback (Ruling 9) */
.dlg.wide { width: min(640px, 100%); }
.dlg h2 { margin: 0 0 var(--s3); font: var(--w-title) var(--t2)/1.15 var(--f-display); text-transform: var(--case-title); letter-spacing: var(--track-title); }
.dlg-body p { margin: 0 0 var(--s3); color: var(--ink); font-size: var(--t0); line-height: 1.45; }
.dlg-body .quiet { color: var(--ink-2); }
.dlg-body .msg.warn { color: var(--due-ink); }
.dlg-fields { display: grid; gap: var(--s3); margin: var(--s3) 0 var(--s4); }
.dlg-fields label { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-1); color: var(--ink-2); }
.dlg-fields textarea { width: 100%; resize: vertical; }
.dlg pre { font: var(--t-1)/1.45 var(--f-code); background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: var(--s3); max-height: 60vh; overflow: auto; white-space: pre-wrap; margin: 0 0 var(--s3); }
.dlg-acts { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s4); }
.key { font: 600 var(--t1)/1.4 var(--f-fig); word-break: break-all; background: var(--ground); border: 1px solid var(--due-ink); border-radius: var(--r-ctl); padding: var(--s3); user-select: all; }
.toasts { position: fixed; left: var(--s5); bottom: var(--s5); z-index: 130; display: flex; flex-direction: column; gap: var(--s2); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s4); background: var(--raised); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); border-radius: var(--r-ctl); padding: var(--s3) var(--s4); font-size: var(--t0); color: var(--ink); box-shadow: var(--shadow); }
.toast.bad { border-left-color: var(--bad); } .toast.warn { border-left-color: var(--due-ink); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .18s ease-out; }
  .toast.out { opacity: 0; transform: translateY(6px); transition: opacity .22s, transform .22s; }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .toasts { left: var(--s4); right: var(--s4); bottom: calc(var(--bar-h) + var(--s4)); } }

/* brand 0.31: the venue's logo in the row and on its page, and the push/remove actions */
.v-logo-cell { display: inline-flex; align-items: center; gap: var(--s2); }
.v-logo-sm { height: 22px; width: auto; max-width: 96px; object-fit: contain; display: block; }
.v-brand { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.v-brand .v-logo-box { display: flex; align-items: center; justify-content: center; min-width: 160px; height: 72px; padding: var(--s2) var(--s3); background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-ctl); }
.v-brand .v-logo-box img { max-height: 56px; max-width: 220px; width: auto; height: auto; object-fit: contain; display: block; }
.v-brand .v-brand-words { font-size: var(--t0); color: var(--ink-2); display: grid; gap: var(--s1); }
.v-brand .v-brand-words b { color: var(--ink); }
.v-brand .acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-left: auto; }
.check-row { display: flex !important; flex-direction: row !important; align-items: center; gap: var(--s2) !important; grid-column: 1 / -1; color: var(--ink) !important; font-size: var(--t0) !important; }


/* ================================================================================================================
   0.6.0 Task 13: the venue's Bookings tab — the status line, the seven views' strip (the tab strip's look, one step under the venue's), an
   order's page, Failed placements in --bad until it is empty. Tokens only, on the 4-px grid, the six type steps.
   ================================================================================================================ */
.b-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-height: var(--s6); margin: 0 0 var(--s3); font-size: var(--t0); color: var(--ink); }
.b-views { margin-bottom: var(--s4); }
.b-views a.bad { color: var(--bad); }
.b-views a .chip { margin-left: var(--s1); vertical-align: middle; }
.b-order-head, .b-sub-head { padding-top: 0; min-height: 0; }
.b-order-head h2, .b-sub-head h2 { margin: 0; font: var(--w-title) var(--t2)/1.15 var(--f-display); text-transform: var(--case-title); letter-spacing: var(--track-title); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.b-order-head h2 .mono { font: var(--w-title) var(--t2)/1.15 var(--f-fig); }
.person { display: inline-flex; flex-direction: column; gap: 0; }
.person b { font-weight: 600; color: var(--ink); }
.person small { font-size: var(--t-1); color: var(--ink-2); }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.b-seq { margin: var(--s2) 0 0; font-size: var(--t-1); }
.bad-text { color: var(--bad); }
.b-refund-why { font-size: var(--t-1); max-width: 44ch; }
.b-failed-sum { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ok); font-size: var(--t0); color: var(--ink); }
.b-failed-sum.bad { border-left-color: var(--bad); }
.b-failed-sum.bad b { color: var(--bad); }
table.grid tr.failed > td:first-child, table.grid tr.failed > td:first-child a { color: var(--bad); font-weight: 600; }

/* ---- 0.4.1: who is up to date ---- */
/* the fleet strip above the Venues table: four of the hub's stat tiles (the figure in the 800 face, the label in small
   capitals under it, a note); a tile filters the rows (aria-pressed). Flat and square; a warning tile's figure is amber. */
.fleet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
@media (max-width: 1000px) { .fleet { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fleet-tile { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; text-align: left; padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: none; cursor: pointer; color: var(--ink); font: inherit; }
.fleet-tile:hover { border-color: var(--ink-2); }
.fleet-tile[aria-pressed="true"] { border-color: var(--ink); background: var(--raised); }
.fleet-tile .fig { display: flex; align-items: baseline; gap: var(--s2); }
.fleet-tile .n { font: var(--w-num) var(--t4)/1 var(--f-display); font-variant-numeric: tabular-nums; }
.fleet-tile .n.warn { color: var(--due-ink); } .fleet-tile .n.grey { color: var(--ink-2); } .fleet-tile .n.ok { color: var(--ok-ink); }
.fleet-tile .of { color: var(--ink-2); font-size: var(--t0); }
.fleet-tile .k { margin-top: var(--s1); font: 600 var(--t-1)/1.3 var(--f-text); text-transform: var(--case-th); letter-spacing: var(--track-th); color: var(--ink-2); }
.fleet-tile .d { display: block; margin-top: var(--s1); color: var(--ink-2); font-size: var(--t-1); line-height: 1.35; }
.fleet-tile .d b { color: var(--ink); font-weight: 600; }
/* the hub / agents cells of the venues table (the venue page has the stat tiles above) */
.ver-cell { display: inline-block; } .ver-cell .v { font-weight: 600; white-space: nowrap; } .ver-cell .chip { vertical-align: middle; } .ver-cell .why { color: var(--ink-3); font-size: var(--t-1); display: block; max-width: 300px; line-height: 1.3; margin-top: var(--s1); }
.ver-cell .btn { margin-left: var(--s2); vertical-align: middle; }
.ver-cell .btn[disabled] { opacity: .5; cursor: not-allowed; }
