/* Klero — colors (light and dark), type, page basics, top bar, work area.
 * Brand: navy and brass. The stele logo (the kleroterion, Athens' juror-selection machine) is ICONS.logo
 * in js/core/util.js; the name is set in Source Serif capitals. */

/* Inter for everything, Source Serif 4 for the name (both SIL Open Font License, see each LICENSE in
 * web/vendor/), served from this server: no outside font service */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/vendor/inter/inter-latin-wght-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/vendor/source-serif-4/source-serif-4-latin-wght-normal.woff2) format("woff2");
}
/* the other fonts a device can choose in Settings (all SIL Open Font License; each folder has its LICENSE) */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url(/vendor/ibm-plex-sans/ibm-plex-sans-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/vendor/source-sans-3/source-sans-3-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/vendor/public-sans/public-sans-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/vendor/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-wght-normal.woff2) format("woff2"); }

/* ---------- colors: light appearance (the default). Dark appearance overrides these below. ----------
 * Names used all over the stylesheets: bg = page, surface = cards and panels, ink = text, line = borders,
 * accent = buttons and links, select = selection outline, danger / warn / ok = status colors. */
:root {
    /* page background (a color theme can change it with --p-bg) */
  --bg: var(--p-bg, #f3f4f6);
    /* cards, panels and dialogs; surface-2 and surface-3 are slightly darker steps for nested areas and hover */
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
    /* text: ink is main text, ink-2 secondary, ink-3 faint (hints, labels) */
  --ink: #111827;
  --ink-2: #444c5a;
  --ink-3: #6b7280;
    /* borders and dividers: line is light, line-2 a little stronger (inputs) */
  --line: #e2e5ea;
  --line-2: #cfd4dc;
  --brand: #0e1f3a;           /* navy: the top bar and the logo */
  --brass: #c9a45a;           /* brass on navy: the logo's chosen row, the main button in the bar */
  --gold: #a9822f;            /* brass dark enough to read on white */
    /* top bar and side rail: navy background, bar-ink its text, bar-ink-2 its quieter text */
  --bar: #0e1f3a;
  --bar-ink: #ffffff;
  --bar-ink-2: #a9b6cc;
  --accent: #1c3a6b;          /* buttons, links, focus: navy, a shade lighter than the bar */
    /* text on an accent button; accent-soft is a pale accent tint for hover and highlights */
  --accent-ink: #ffffff;
  --accent-soft: #e7ecf4;
    /* the courtroom floor behind the boxes, and the dots drawn on it */
  --floor: var(--p-floor, #fbfbfc);
  --floor-grid: var(--p-grid, rgba(17, 24, 39, .06));
    /* the dashed outlines of the jury box and gallery zones, and their labels */
  --zone: var(--p-zone, #c3c9d3);
  --zone-ink: var(--p-zone-ink, #6b7280);
  /* a juror box with no score (scored boxes take their green / red shade from shared/model.js) */
  --box: var(--p-box, #ffffff);
    /* text on a juror box */
  --box-ink: #111827;
    /* a juror box's border and shadow */
  --box-border: var(--p-box-border, #d3d8e0);
  --box-shadow: var(--p-box-shadow, 0 1px 2px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.05));
    /* thin line under the top bar */
  --bar-line: var(--p-bar-line, #08142a);
    /* outline around a selected juror box or a picked question */
  --select: #1c3a6b;
    /* red: strikes, errors, delete buttons; danger-soft is its pale background */
  --danger: #b42318;
  --danger-soft: #fdecea;
    /* green: favorable scores and success; warn / warn-soft is orange for cautions */
  --ok: #16803c;
  --warn: #b54708;
  --warn-soft: #fef4e6;
  --side-p: #2851b8;          /* the State / plaintiff */
    /* pale backgrounds for the two sides' strike cards */
  --side-p-soft: #e9effc;
  --side-d: #a14d0b;          /* the defense */
  --side-d-soft: #fcf0e3;
    /* small shadow for cards, and a large one for dialogs and floating panels */
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
    /* standard corner rounding in pixels */
  --radius: 10px;
    /* font stacks: serif is the name in the top bar; font is the body text; mono is for fixed-width text */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-features: "cv11", "ss01";   /* Inter's clearer 1, l and a; other fonts use none */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
/* ---------- colors: dark appearance ----------
 * Used when Settings is Automatic and the device is dark, or when dark is chosen (second block). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--pd-bg, #0f1216); --surface: var(--pd-surface, #171b21); --surface-2: var(--pd-surface-2, #1d222a); --surface-3: var(--pd-surface-3, #252b34);
    --ink: var(--pd-ink, #e8ebf0); --ink-2: var(--pd-ink-2, #b4bcc8); --ink-3: var(--pd-ink-3, #8b94a3);
    --line: var(--pd-line, #2a3039); --line-2: var(--pd-line-2, #3a424e); --bar: #0d1a30; --bar-ink: #ffffff; --bar-ink-2: #a9b6cc;
    --accent: #d4b06a; --accent-ink: #14110a; --accent-soft: #2e2717; --floor: var(--pd-floor, #13171c); --floor-grid: var(--pd-grid, rgba(255,255,255,.05));
    --zone: var(--pd-zone, #3c4552); --zone-ink: var(--pd-zone-ink, #8b94a3); --select: #d4b06a;
    --box: var(--pd-box, #ffffff); --box-border: var(--pd-box-border, #d3d8e0); --box-shadow: var(--pd-box-shadow, 0 1px 3px rgba(0,0,0,.45));
    --bar-line: var(--pd-bar-line, #08142a); --danger: #f07167; --danger-soft: #3a1d1c; --warn: #f0a050; --warn-soft: #3a2a17;
    --side-p: #7aa2ff; --side-p-soft: #1d2a45; --side-d: #f0a050; --side-d-soft: #3a2a17;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3); --shadow-lg: 0 12px 32px rgba(0,0,0,.5); color-scheme: dark;
  }
}
/* the same dark colors, forced on by choosing Dark in Settings */
:root[data-theme="dark"] {
  --bg: var(--pd-bg, #0f1216); --surface: var(--pd-surface, #171b21); --surface-2: var(--pd-surface-2, #1d222a); --surface-3: var(--pd-surface-3, #252b34);
  --ink: var(--pd-ink, #e8ebf0); --ink-2: var(--pd-ink-2, #b4bcc8); --ink-3: var(--pd-ink-3, #8b94a3);
  --line: var(--pd-line, #2a3039); --line-2: var(--pd-line-2, #3a424e); --bar: #0d1a30; --bar-ink: #ffffff; --bar-ink-2: #a9b6cc;
  --accent: #d4b06a; --accent-ink: #14110a; --accent-soft: #2e2717; --floor: var(--pd-floor, #13171c); --floor-grid: var(--pd-grid, rgba(255,255,255,.05));
  --zone: var(--pd-zone, #3c4552); --zone-ink: var(--pd-zone-ink, #8b94a3); --select: #d4b06a;
  --box: var(--pd-box, #ffffff); --box-border: var(--pd-box-border, #d3d8e0); --box-shadow: var(--pd-box-shadow, 0 1px 3px rgba(0,0,0,.45));
  --bar-line: var(--pd-bar-line, #08142a); --danger: #f07167; --danger-soft: #3a1d1c; --warn: #f0a050; --warn-soft: #3a2a17;
  --side-p: #7aa2ff; --side-p-soft: #1d2a45; --side-d: #f0a050; --side-d-soft: #3a2a17;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3); --shadow-lg: 0 12px 32px rgba(0,0,0,.5); color-scheme: dark;
}

/* ---------- color themes (Settings → Colors, per device) ----------
 * Each sets the page, the board floor and its dots, the dashed seating zones, and boxes with no score:
 * --p-* in light appearance, --pd-* (the same theme, dark) in dark appearance. Juror boxes stay light in
 * dark appearance, a little softer than white, so they match the green and red shades of scored boxes. */
:root[data-palette="stone"] {        /* Navy and stone (the default) */
  --p-bg: #ece6db; --p-floor: #e2dacb; --p-grid: rgba(14, 31, 58, .1); --p-zone: #a89a80; --p-zone-ink: #5e523c;
  --p-box: #ffffff; --p-box-border: #9c8f77; --p-box-shadow: 0 1px 2px rgba(42, 33, 22, .18), 0 3px 8px rgba(42, 33, 22, .1); --p-bar-line: #c9a45a; }
:root[data-palette="slate"] {        /* Navy and slate */
  --p-bg: #e4e8ee; --p-floor: #d3dae4; --p-grid: rgba(14, 31, 58, .12); --p-zone: #8e9aae; --p-zone-ink: #3f4b60;
  --p-box: #ffffff; --p-box-border: #8a97ab; --p-box-shadow: 0 1px 2px rgba(14, 31, 58, .18), 0 3px 8px rgba(14, 31, 58, .1); }
:root[data-palette="navy"] {         /* Navy board: boxes on a navy floor */
  --p-bg: #e8ebf0; --p-floor: #14284a; --p-grid: rgba(255, 255, 255, .07); --p-zone: rgba(201, 164, 90, .6); --p-zone-ink: #d8bc7e;
  --p-box: #ffffff; --p-box-border: #0e1f3a; --p-box-shadow: 0 2px 6px rgba(0, 0, 0, .35); --p-bar-line: #c9a45a; }
:root[data-palette="brass"] {        /* Parchment and brass */
  --p-bg: #f2ecdf; --p-floor: #e9dfc9; --p-grid: rgba(120, 90, 30, .12); --p-zone: #c9a45a; --p-zone-ink: #7a5d22;
  --p-box: #fffdf8; --p-box-border: #bfa878; --p-box-shadow: 0 1px 2px rgba(90, 66, 20, .16), 0 3px 8px rgba(90, 66, 20, .08); --p-bar-line: #c9a45a; }
:root[data-palette="contrast"] {     /* High contrast */
  --p-bg: #d5dbe4; --p-floor: #c2cad6; --p-grid: rgba(14, 31, 58, .14); --p-zone: #5c6878; --p-zone-ink: #2b3442;
  --p-box: #ffffff; --p-box-border: #1f2937; --p-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 4px 10px rgba(0, 0, 0, .12); }

/* the same themes in dark appearance */
:root[data-palette="stone"] {
  --pd-bg: #161412; --pd-surface: #1e1c19; --pd-surface-2: #252320; --pd-surface-3: #2e2b27; --pd-line: #3a3632; --pd-line-2: #4c4740;
  --pd-ink-2: #c2bcb2; --pd-ink-3: #999186; --pd-floor: #1c1a17; --pd-grid: rgba(236, 230, 219, .06); --pd-zone: #6d655a; --pd-zone-ink: #b0a797;
  --pd-box: #efebe4; --pd-box-border: #8a8174; --pd-bar-line: #c9a45a; }
:root[data-palette="slate"] {
  --pd-bg: #10151c; --pd-surface: #171e27; --pd-surface-2: #1d2530; --pd-surface-3: #252e3a; --pd-line: #2b3542; --pd-line-2: #3b4757;
  --pd-floor: #141b24; --pd-grid: rgba(169, 194, 245, .07); --pd-zone: #4f5d72; --pd-zone-ink: #9aa8bd;
  --pd-box: #e8ecf2; --pd-box-border: #7d8aa0; }
:root[data-palette="navy"] {
  --pd-bg: #0b1526; --pd-surface: #111d33; --pd-surface-2: #16243d; --pd-surface-3: #1c2c49; --pd-line: #22345a; --pd-line-2: #2f4570;
  --pd-ink-2: #b9c4d8; --pd-ink-3: #8e9cb6; --pd-floor: #0f1f3d; --pd-grid: rgba(255, 255, 255, .06); --pd-zone: rgba(201, 164, 90, .55); --pd-zone-ink: #d8bc7e;
  --pd-box: #f2f4f8; --pd-box-border: #0b1526; --pd-box-shadow: 0 2px 6px rgba(0, 0, 0, .5); --pd-bar-line: #c9a45a; }
:root[data-palette="brass"] {
  --pd-bg: #18140c; --pd-surface: #211c12; --pd-surface-2: #2a2317; --pd-surface-3: #332b1c; --pd-line: #3f3522; --pd-line-2: #54472d;
  --pd-ink-2: #cdbf9f; --pd-ink-3: #a39474; --pd-floor: #1f190f; --pd-grid: rgba(201, 164, 90, .1); --pd-zone: #9c7f45; --pd-zone-ink: #d6b979;
  --pd-box: #f6efdf; --pd-box-border: #a88e5c; --pd-bar-line: #c9a45a; }
:root[data-palette="contrast"] {
  --pd-bg: #05070a; --pd-surface: #0d1117; --pd-surface-2: #131820; --pd-surface-3: #1b222c; --pd-line: #4a5566; --pd-line-2: #6b7889;
  --pd-ink: #ffffff; --pd-ink-2: #dde2ea; --pd-ink-3: #bcc4d0; --pd-floor: #0a0d12; --pd-grid: rgba(255, 255, 255, .09); --pd-zone: #8b97a8; --pd-zone-ink: #dde2ea;
  --pd-box: #ffffff; --pd-box-border: #ffffff; --pd-box-shadow: none; }

/* ---------- fonts (Settings → Font, per device) ---------- */
:root[data-font="serif"] { --font: "Source Serif 4", Georgia, serif; --font-features: normal; }
:root[data-font="sourcesans"] { --font: "Source Sans 3", ui-sans-serif, system-ui, sans-serif; --font-features: normal; }
:root[data-font="plex"] { --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif; --font-features: normal; }
:root[data-font="public"] { --font: "Public Sans", ui-sans-serif, system-ui, sans-serif; --font-features: normal; }
:root[data-font="atkinson"] { --font: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif; --font-features: normal; }

/* ---------- page basics: reset, body text, small helpers ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  font-feature-settings: var(--font-features); letter-spacing: -.003em; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 550; line-height: 1.3; box-shadow: 0 1px 1px rgba(16,24,40,.04);
  transition: background-color .12s, border-color .12s; text-decoration: none; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); }
.btn:focus-visible, .tool:focus-visible, .me:focus-visible, .set-row:focus-visible, .tally:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 56px;
  background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; }
.bar, .rail {
  /* navy in both themes: everything in the bar and the rail (tools, strike counter, status) uses these light-on-navy colors */
  --ink: #f3f5f9; --ink-2: #c9d2e0; --ink-3: #9aa8bf; --surface: #16294a; --surface-2: #132442; --surface-3: #1e3459;
  --line: rgba(255, 255, 255, .14); --line-2: rgba(255, 255, 255, .26);
  --accent: var(--brass); --accent-ink: #0e1f3a; --accent-soft: rgba(201, 164, 90, .2);
  --side-p: #a9c2f5; --side-p-soft: rgba(169, 194, 245, .16); --side-d: #f4b885; --side-d-soft: rgba(244, 184, 133, .16);
  --ok: #6fd896; --warn: #f2a65a; --warn-soft: rgba(242, 166, 90, .18); --danger: #ff8a80; --danger-soft: rgba(255, 138, 128, .18); }
.bar-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.bar-right { display: flex; align-items: center; gap: 4px; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--bar-ink); text-decoration: none; font-weight: 650; font-size: 14px; flex: none;
  padding: 4px 6px 4px 0; border-radius: 8px; }
/* the name: Source Serif capitals, widely spaced */
.brand-name { font-family: var(--serif); font-size: 16px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--bar-ink); }
a.brand:hover .brand-name { color: var(--brass); }
.logo { display: inline-flex; width: 28px; height: 28px; }
.logo svg { width: 100%; height: 100%; }
.crumb-sep { color: var(--line-2); font-size: 18px; font-weight: 300; margin: 0 2px; }
.bar .title { background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--bar-ink);
  font-weight: 650; font-size: 15px; padding: 5px 8px; min-width: 80px; width: 26ch; max-width: 100%; text-overflow: ellipsis; }
.bar .title:hover { border-color: var(--line); }
.bar .title:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }

/* the side rail: big buttons down the left edge, icon over label, a count badge, and an "on" state while
 * their panel is open. Board closes the side panel. On phones the rail becomes a row along the bottom. */
.rail { flex: none; width: 88px; align-self: flex-start; position: sticky; top: calc(57px + env(safe-area-inset-top, 0px));
  height: calc(100vh - 57px - env(safe-area-inset-top, 0px)); height: calc(100dvh - 57px - env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bar); border-right: 1px solid var(--bar-line); overflow-y: auto; z-index: 20; }
.rail-gap { flex: 1; min-height: 6px; }
.tool { position: relative; flex: none; width: 74px; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 6px 2px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2);
  font-size: 11.5px; font-weight: 600; line-height: 1.15; text-align: center; }
.tool .ico { display: inline-flex; width: 22px; height: 22px; }
.tool .ico svg { width: 100%; height: 100%; }
.tool.on { background: var(--accent-soft); color: var(--accent); }
@media (hover: hover) { .tool:not(.on):not(.add-btn):hover { background: var(--surface-3); color: var(--ink); } }
.tool .count { position: absolute; top: 5px; right: 8px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--brass); color: #0e1f3a; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; }
.tool.add-btn { background: var(--brass); color: #0e1f3a; font-weight: 700; }
.tool.add-btn:active { filter: brightness(.95); }
.me { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brass); color: #0e1f3a; font-size: 12px; font-weight: 650;
  letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--bar-ink-2); white-space: nowrap; padding: 0 8px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.status.live .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,128,60,.14); }
.status.down { color: var(--danger); font-weight: 600; }
.status.down .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* the strike counter: each side's strikes left, and whose turn it is */
.tally { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); flex: none; font-size: 13px; }
.tally:hover { border-color: var(--line-2); }
.tally .side { display: inline-flex; align-items: baseline; gap: 5px; height: 30px; padding: 0 10px; border-radius: 7px; line-height: 30px; }
.tally .side-name { color: var(--ink-2); font-weight: 550; }
.tally .side b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tally .side-left { color: var(--ink-3); font-size: 12px; }
.tally .side.turn.side-p { background: var(--side-p-soft); box-shadow: inset 0 0 0 1px var(--side-p); }
.tally .side.turn.side-d { background: var(--side-d-soft); box-shadow: inset 0 0 0 1px var(--side-d); }
.tally .side.turn.side-p .side-name, .tally .side.turn.side-p b { color: var(--side-p); }
.tally .side.turn.side-d .side-name, .tally .side.turn.side-d b { color: var(--side-d); }
.tally-next { padding: 0 10px 0 6px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.tally-next b { color: var(--ink); font-weight: 650; }
.tally.done { background: rgba(22,128,60,.08); border-color: rgba(22,128,60,.35); }
.tally-done { padding: 0 12px; color: var(--ok); font-weight: 650; }

/* narrower screens: the connection shows as a dot; the name and title shrink */
@media (max-width: 1100px) {
  .status .txt, .tally-next { display: none; }
  .status { padding: 0 6px; }
  .bar .title { width: 18ch; }
}
/* iPad portrait and narrower */
@media (max-width: 860px) {
  .bar { gap: 6px; padding: 0 10px; }
  .brand-name:not(.home-brand), .crumb-sep { display: none; }
  .bar .title { width: 14ch; min-width: 60px; }
  .rail { width: 80px; }
  .tool { width: 68px; }
}
/* phones: the strike counter gets its own row; the rail becomes a row of buttons along the bottom */
@media (max-width: 600px) {
  .bar { flex-wrap: wrap; padding: 4px 10px 8px; }
  .bar-left { order: 1; }
  .bar-right { order: 2; }
  .tally { order: 3; width: 100%; justify-content: center; }
  .tally .side-left { display: none; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: auto; flex-direction: row; justify-content: space-around;
    gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--bar-line); z-index: 40; overflow: visible; }
  .rail-gap, .rail .me { display: none; }
  .tool { width: auto; flex: 1; min-width: 0; min-height: 54px; font-size: 10.5px; }
  .tool .count { right: 4px; }
  .stage-col { padding-bottom: 80px !important; }
}

/* ---------- work area ---------- */
.work { display: flex; align-items: flex-start; }
.stage-col { flex: 1; min-width: 0; padding: 14px 20px 24px; }
.offline-bar { display: none; margin: 0 0 10px; padding: 10px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger);
  border: 1px solid var(--danger); font-size: 14px; font-weight: 600; }
body.is-offline .offline-bar { display: block; }
.hint { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.hint b { color: var(--ink-2); font-weight: 600; }
.stage-wrap { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: var(--floor); box-shadow: var(--shadow); }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0;
  background-image: radial-gradient(var(--floor-grid) 1.2px, transparent 1.3px); background-size: 24px 24px; }
.zone { position: absolute; border: 1.5px dashed var(--zone); border-radius: 14px; pointer-events: none; background: rgba(127,137,153,.035); }
.zone span { position: absolute; left: 2px; top: -27px; font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--zone-ink); white-space: nowrap; }

/* a connection problem always says so in words, never by the dot's color alone */
.status.down .txt { display: inline !important; }
