/* milrad · an instrument: paper and ink, one face (JetBrains Mono), one accent (volt).
   Tokens follow the AWV app language; light and dark follow the system until one is picked. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: block;
  src: url(/static/fonts/jetbrainsmono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: block;
  src: url(/static/fonts/jetbrainsmono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --ink: #0f1320;
  --ink-2: #2a2f3a;
  --mute: #5d6474;
  --dim: #8a90a0;
  --line: rgba(15, 19, 32, 0.1);
  --line-2: rgba(15, 19, 32, 0.16);
  --chrome: #ffffff;
  --chrome-line: #e3e5ea;
  --panel: #ffffff;
  --panel-2: #f5f6f8;
  --viewport: #f3f4f7;
  --hover: rgba(15, 19, 32, 0.045);
  --active: rgba(15, 19, 32, 0.08);
  /* volt: the one accent */
  --accent: #4d6c00;
  --accent-fill: #c6f432;
  --accent-hover: #b6e51f;
  --on-accent: #0f1320;
  --accent-line: rgba(77, 108, 0, 0.5);
  --accent-wash: rgba(198, 244, 50, 0.3);
  --green: #2fbf71;
  --orange: #e8650a;
  --red: #d92d20;
  --red-wash: rgba(217, 45, 32, 0.08);
  --red-fill: #d92d20;
  --shadow: 0 1px 2px rgba(15, 19, 32, 0.05), 0 12px 32px -14px rgba(15, 19, 32, 0.18);
  --shadow-lg: 0 1px 2px rgba(15, 19, 32, 0.06), 0 26px 60px -24px rgba(15, 19, 32, 0.28);
  --ring: 0 0 0 1px rgba(15, 19, 32, 0.08);
  /* the target as printed */
  --t-paper: #fbfaf5;
  --t-black: #17191e;
  --t-on-paper: #262a31;
  --t-on-black: #d3d6dc;
  --t-board: #cdb38c;
  --t-on-board: #6b5636;
  --m-prev: #ffffff;
  --m-last: #c6f432;
  --m-edge: #0f1320;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --snap: cubic-bezier(0.16, 1, 0.3, 1);
  --bar-h: 48px;
  --side-w: 340px;
  --tool: 32px;
  --ctl: 30px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #dcdee3;
    --ink-2: #b9bdc5;
    --mute: #9197a2;
    --dim: #6c717c;
    --line: rgba(220, 222, 227, 0.08);
    --line-2: rgba(220, 222, 227, 0.14);
    --chrome: #1f2227;
    --chrome-line: #2b2f36;
    --panel: #1c1f24;
    --panel-2: #23262c;
    --viewport: #1b1e23;
    --hover: rgba(220, 222, 227, 0.055);
    --active: rgba(220, 222, 227, 0.1);
    --accent: #d4ff4a;
    --accent-fill: #c6f432;
    --accent-hover: #d6ff5c;
    --on-accent: #10140a;
    --accent-line: rgba(212, 255, 74, 0.5);
    --accent-wash: rgba(212, 255, 74, 0.13);
    --green: #60bb83;
    --orange: #d98a50;
    --red: #f07167;
    --red-wash: rgba(240, 113, 103, 0.12);
    --red-fill: #c23b35;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.35), 0 26px 60px -24px rgba(0, 0, 0, 0.7);
    --ring: 0 0 0 1px rgba(220, 222, 227, 0.07);
    --t-paper: #dad8cf;
    --t-black: #111316;
    --t-on-paper: #2b2e34;
    --t-on-black: #9ea3ac;
  --t-board: #b19c7b;
  --t-on-board: #5a4a33;
    --t-board: #b19c7b;
    --t-on-board: #5a4a33;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #dcdee3;
  --ink-2: #b9bdc5;
  --mute: #9197a2;
  --dim: #6c717c;
  --line: rgba(220, 222, 227, 0.08);
  --line-2: rgba(220, 222, 227, 0.14);
  --chrome: #1f2227;
  --chrome-line: #2b2f36;
  --panel: #1c1f24;
  --panel-2: #23262c;
  --viewport: #1b1e23;
  --hover: rgba(220, 222, 227, 0.055);
  --active: rgba(220, 222, 227, 0.1);
  --accent: #d4ff4a;
  --accent-fill: #c6f432;
  --accent-hover: #d6ff5c;
  --on-accent: #10140a;
  --accent-line: rgba(212, 255, 74, 0.5);
  --accent-wash: rgba(212, 255, 74, 0.13);
  --green: #60bb83;
  --orange: #d98a50;
  --red: #f07167;
  --red-wash: rgba(240, 113, 103, 0.12);
  --red-fill: #c23b35;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.35), 0 26px 60px -24px rgba(0, 0, 0, 0.7);
  --ring: 0 0 0 1px rgba(220, 222, 227, 0.07);
  --t-paper: #dad8cf;
  --t-black: #111316;
  --t-on-paper: #2b2e34;
  --t-on-black: #9ea3ac;
}

/* -- base ------------------------------------------------------------------------- */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* watch only (the server's setting for this lane over the internet): no controls that change anything */
.viewer [data-write] { display: none !important; }
html, body { margin: 0; }
body {
  font: 500 12px/1.45 var(--mono);
  font-variant-ligatures: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: var(--chrome);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }

.label { font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--dim); line-height: 1; }

/* signs */
.sign { display: block; flex: none; }
.sign path { fill: none; stroke: currentColor; stroke-width: var(--w); stroke-linecap: round; stroke-linejoin: round; }
.sign [data-t="sub"] { opacity: 0.46; }
.sign [data-t="sub-dash"] { opacity: 0.46; stroke-dasharray: 2.1 2.1; }
.sign [data-t="dash"] { stroke-dasharray: 2.1 2.1; }
.sign [data-t="tone"] { fill: currentColor; stroke: none; opacity: 0.14; }
.sign [data-t="fill"] { fill: currentColor; stroke: none; }

/* tools: squares with a sign, a 2px ink bar under it when on */
.tool {
  position: relative; width: var(--tool); height: var(--tool); padding: 0; border: 0; border-radius: 7px;
  display: grid; place-items: center; background: transparent; color: var(--ink-2); flex: none;
  transition: background 0.15s, color 0.15s;
}
.tool:hover, .tool:focus-visible { background: var(--hover); color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--active); color: var(--ink); }
.tool[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 3px; height: 2px; border-radius: 1px; background: var(--ink);
}
.tool:disabled { opacity: 0.4; cursor: default; }

/* buttons */
.btn {
  height: var(--ctl); padding: 0 12px; border-radius: 7px; border: 1px solid var(--line-2); background: transparent;
  color: var(--ink-2); font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.btn:hover, .btn:focus-visible { background: var(--hover); color: var(--ink); }
.btn.primary {
  background: var(--accent-fill); border-color: transparent; color: var(--on-accent);
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.btn.primary:hover, .btn.primary:focus-visible { background: var(--accent-hover); color: var(--on-accent); }
.btn.primary:disabled { background: var(--panel-2); color: var(--dim); cursor: default; }
.btn.danger { color: var(--red); }
.btn.danger:hover, .btn.danger:focus-visible { background: var(--red-wash); color: var(--red); }
.btn.wide { width: 100%; }

/* the live dot: the one glow */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; display: inline-block; }
.live-dot.live { background: var(--green); box-shadow: 0 0 10px var(--green); animation: live 1.6s ease-in-out infinite; }
.live-dot.work { background: var(--orange); }
.live-dot.bad { background: var(--red); }
@keyframes live { 50% { opacity: 0.35; } }

/* -- frame: bar · stage + side · title block --------------------------------------- */

body.app { height: 100dvh; display: grid; grid-template-rows: var(--bar-h) minmax(0, 1fr); overflow: hidden; }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--chrome-line); background: var(--chrome); min-width: 0;
}
.bar-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bar-trail { display: flex; align-items: center; gap: 2px; }
.bar-rule { width: 1px; height: 18px; background: var(--chrome-line); flex: none; }
.wordmark { display: flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; letter-spacing: -0.02em; }
.wordmark b { color: var(--accent); font-weight: 700; }
.doc-head { display: grid; gap: 3px; min-width: 0; }
.kicker { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); line-height: 1; }
.doc-name { font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a lane's bar: the lane with its status light, then its setup; a small label over each value */
.bar-facts { display: flex; align-items: center; gap: 24px; min-width: 0; overflow: hidden; }
.fact-lane { flex: none; margin-right: 12px; }
.fact-lane .fv { gap: 7px; }
.fact-lane .live-dot { align-self: center; }
.fact { display: grid; gap: 5px; min-width: 0; }
.fact .label { font-size: 9.5px; }
.fv { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; line-height: 1; }
.fv b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.fv small { font-size: 11px; color: var(--mute); }
.fv small.bad { color: var(--red); }
.fv small:empty { display: none; }
/* narrower: the feed without its size, then the target alone (959 px and below), then on a phone the
   lane alone, its setup is in the settings */
@media (max-width: 1180px) { .fact-feed small { display: none; } }
@media (max-width: 599px) { .bar-facts { display: none; } }

.frame { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); min-height: 0; }

/* the stage: the target on the viewport's ground, edge to edge */
.stage { position: relative; background: var(--viewport); min-height: 0; overflow: hidden; user-select: none; }
#target { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: manipulation; }
.stage.editing #target { cursor: crosshair; }
.corner { position: absolute; width: 12px; height: 12px; border: 0 solid var(--line-2); pointer-events: none; }
.corner.tl { top: 8px; left: 8px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 8px; right: 8px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 8px; left: 8px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 8px; right: 8px; border-bottom-width: 1px; border-right-width: 1px; }

.hud-chip {
  position: absolute; top: 9px; right: 60px; height: 24px; padding: 0 10px; border-radius: 999px; border: 0;
  background: var(--chrome); color: var(--ink); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  box-shadow: var(--shadow), var(--ring); display: inline-flex; align-items: center; gap: 6px;
}

#sound-chip { top: 40px; color: var(--orange); }
#edit-chip { left: 50%; right: auto; top: 12px; transform: translateX(-50%); color: var(--accent); pointer-events: none; }
.tool.pending::before {
  content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange);
}

/* group size: a dashed circle round the series, its spread as a readout */
.group-halo { fill: none; stroke: rgba(15, 19, 32, 0.55); }
.group-ring { fill: none; stroke: var(--m-last); }
.group-mid { stroke: var(--m-last); }
#group-chip {
  top: auto; bottom: 12px; right: auto; left: 12px; height: auto; padding: 8px 12px; border-radius: 10px; display: block;
  text-transform: none; letter-spacing: 0; font-size: 11.5px; max-width: calc(100% - 24px); white-space: nowrap;
}
/* in full, and narrow for a phone (the labels short, POI; the point of impact in mm alone) */
#group-chip .g-full { display: grid; grid-template-columns: auto auto minmax(0, auto); column-gap: 12px; row-gap: 5px; align-items: baseline; }
#group-chip .g-short { display: none; grid-template-columns: auto minmax(0, auto); column-gap: 8px; row-gap: 4px; align-items: baseline; }
#group-chip .g-full > span, #group-chip .g-short > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#group-chip .cap { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
#group-chip b { font-weight: 600; color: var(--ink); }
#group-chip small { color: var(--dim); font-size: 10.5px; }
.group-line { fill: none; stroke: var(--m-last); }

/* docks float over the stage */
.dock {
  position: absolute; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--chrome);
  box-shadow: var(--shadow), var(--ring); z-index: 3;
}
.dock .tool { --tool: 30px; }
.dock-view { right: 12px; top: 50%; transform: translateY(-50%); flex-direction: column; }
/* the stage's foot (see lane.html): on a wide screen it leaves its parts where they float */
.stage-foot, .foot-chips { display: contents; }
.dock-rule { width: 18px; height: 1px; background: var(--chrome-line); margin: 4px auto; flex: none; }

/* the live feed: a HUD window, or the whole stage */
.feed {
  position: absolute; left: 12px; top: 12px; width: clamp(200px, 32%, 400px); height: auto; aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden; background: #000; box-shadow: var(--shadow-lg), var(--ring); cursor: zoom-in; z-index: 2;
}
.feed img { width: 100%; height: 100%; object-fit: contain; display: block; }
.feed[data-size="full"] { left: 12px; top: 12px; bottom: 12px; width: calc(100% - 72px); height: auto; aspect-ratio: auto; cursor: zoom-out; }
/* in the camera view: straightened or not, and closing it */
.feed-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.feed-btn {
  height: 26px; min-width: 26px; padding: 0 7px; border: 0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(18, 22, 32, 0.78); color: #eef0f3; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
}
.feed-btn:hover { background: rgba(18, 22, 32, 0.95); }
.feed-btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
/* the lane's status, bottom left in the picture; the picture is dark, so are the colours whatever the theme */
.feed-tag {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 7px; background: rgba(18, 22, 32, 0.82); color: #eef0f3;
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em; line-height: 1;
}
.feed-tag span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-tag.work { color: #e8a06a; }
.feed-tag.bad { color: #f07167; }
.feed[data-size="full"] .feed-tag { left: 12px; bottom: 12px; padding: 8px 12px; font-size: 15px; gap: 8px; }

/* hits on the target */
.hit .dot { fill: var(--m-prev); stroke: var(--m-edge); }
.hit text { fill: var(--m-edge); font-family: var(--mono); font-weight: 700; pointer-events: none; }
.hit.last .dot { fill: var(--m-last); }
.hit.uncertain .dot { stroke: var(--orange); stroke-dasharray: 1.6 1.1; }
.hit .pulse { fill: none; stroke: var(--m-last); opacity: 0; transform-box: fill-box; transform-origin: center; animation: pulse 1.1s var(--snap) 1; }
@keyframes pulse { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(3); } }
.stage.editing .hit { cursor: pointer; }

/* -- side: last shot · stats · series (scrolls by itself) ------------------------------ */

.side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--chrome-line); background: var(--chrome); }
.pane { border-bottom: 1px solid var(--chrome-line); padding: 0 14px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; }
.pane-head .val { font-size: 10.5px; color: var(--mute); }


.last { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 16px; padding: 2px 0 14px; min-height: 70px; }
.figure { font-size: 54px; font-weight: 600; letter-spacing: -0.04em; line-height: 0.9; color: var(--ink); border-radius: 8px; padding: 2px 6px; margin: -2px -6px; }
.figure.flash { animation: flash 1.1s var(--ease); }
.figure small { font-size: 0.36em; font-weight: 500; letter-spacing: 0; color: var(--dim); margin-left: 3px; }
@keyframes flash { from { background: var(--accent-wash); } to { background: transparent; } }
.readout { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-content: end; }
.readout dt { font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--dim); align-self: center; }
.readout dd { margin: 0; color: var(--ink); text-align: right; white-space: nowrap; }
.readout dd small { color: var(--dim); font-size: 10.5px; }
.flags { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.flag { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--panel-2); color: var(--ink-2); }
.flag.warn { color: var(--orange); }
.empty { color: var(--dim); align-self: center; }

/* the total grows over a day, the shot count and the average stay short */
.stats { display: grid; grid-template-columns: 0.8fr 1fr 1.3fr 0.9fr; padding: 12px 0; gap: 8px; }
.stats div { display: grid; gap: 7px; min-width: 0; overflow: hidden; }
.stats b { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.stats b, .stats .label { justify-self: start; white-space: nowrap; }
/* wider than its column: it travels to its end, rests, and comes back */
.stats .run { animation: run var(--run-t, 3s) ease-in-out infinite alternate; }
@keyframes run { 0%, 20% { transform: translateX(0); } 80%, 100% { transform: translateX(var(--run)); } }
.stats b small { font-size: 11px; color: var(--dim); font-weight: 500; letter-spacing: 0; }

.pane-series { flex: 1; min-height: 0; display: flex; flex-direction: column; border-bottom: 0; padding: 0; }
.pane-series .pane-head { padding: 0 10px 0 14px; height: 46px; flex: none; border-bottom: 1px solid var(--chrome-line); }
.head-actions { display: flex; align-items: center; gap: 6px; }
/* the view tabs and the two actions share one row, in both languages: a little less air inside each */
.pane-series .pane-head .seg button { min-width: 0; padding: 0 7px; }
.pane-series .head-actions .btn { padding: 0 8px; }
/* the quiet counterpart to the one volt action: a hairline, no fill; red only under the pointer */
.btn.quiet {
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.btn.quiet:hover, .btn.quiet:focus-visible { background: var(--red-wash); border-color: transparent; color: var(--red); }
.btn.quiet:disabled { background: transparent; color: var(--dim); border-color: var(--line); cursor: default; }
.series-scroll { flex: 1; min-height: 0; overflow: auto; padding: 6px 8px 12px; overscroll-behavior: contain; }
.series-row {
  display: grid; gap: 6px; width: 100%; padding: 8px 6px; border: 0; border-radius: 8px; background: transparent; text-align: left;
  color: inherit; transition: background 0.15s;
}
.series-row:hover, .series-row:focus-visible { background: var(--hover); }
.series-row.selected { background: var(--active); }
.series-head { display: flex; justify-content: space-between; align-items: baseline; }
.series-head .name { font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--dim); }
.series-row.current .series-head .name { color: var(--ink); }
.series-head .sum { color: var(--ink); font-weight: 600; }
.series-head .sum small { color: var(--dim); font-weight: 500; margin-left: 6px; }
.cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.cell { position: relative; height: 32px; border-radius: 6px; background: var(--panel-2); display: grid; place-items: center; color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.cell i { position: absolute; left: 5px; top: 3px; font-style: normal; font-size: 8.5px; color: var(--dim); font-weight: 500; }
.cell.ten { color: var(--ink); font-weight: 800; }
.cell.latest { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cell.uncertain { box-shadow: inset 0 0 0 1px var(--orange); }
.cell.empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.series-empty { color: var(--dim); padding: 10px 6px; }

/* -- title block ------------------------------------------------------------------------ */


/* -- window (settings) -------------------------------------------------------------------- */

dialog.window {
  width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 12px;
  background: var(--panel); color: var(--ink-2); box-shadow: var(--shadow-lg), var(--ring); overflow: auto;
}
dialog.window[open] { animation: arrive 0.3s var(--snap); }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
dialog.window::backdrop { background: rgba(15, 19, 32, 0.28); }
.win-head { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--chrome-line); }
.win-tile { width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; color: var(--ink); flex: none; }
.win-title { flex: 1; display: grid; gap: 4px; }
.win-call { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); line-height: 1; }
.win-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.15; letter-spacing: -0.01em; }
.win-body { padding: 12px 14px 14px; display: grid; gap: 12px; }
.win-sect { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--chrome-line); }
.win-sect .btn { flex: 1; }
.win-foot { padding: 12px 14px 14px; border-top: 1px solid var(--chrome-line); }
.win-foot .btn { height: 32px; }

.field { display: grid; gap: 6px; }
.field select, .field input[type="number"], .field input[type="text"], .field input[type="password"] {
  height: var(--ctl); border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  padding: 0 10px; font-size: 12.5px; width: 100%;
}
.field select:focus, .field input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-wash); }
.line { display: flex; align-items: center; justify-content: space-between; min-height: 30px; gap: 10px; }
.readline { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 22px; }
.readline span:last-child { color: var(--ink); text-align: right; }
.note { margin: 0; font-size: 11.5px; color: var(--mute); line-height: 1.5; }

/* segmented well: what is chosen lifts off it */
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { height: 24px; min-width: 44px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); font-size: 11px; }
.seg button[aria-pressed="true"] { background: var(--chrome); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 19, 32, 0.12), var(--ring); }

/* slider fast ↔ precise, its standard position marked on the path */
.slider { position: relative; --thumb: 18px; padding: 4px 0 18px; }
.slider input { -webkit-appearance: none; appearance: none; width: 100%; height: var(--thumb); margin: 0; background: transparent; position: relative; z-index: 1; }
.slider input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.slider input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.slider input::-webkit-slider-thumb {
  -webkit-appearance: none; width: var(--thumb); height: var(--thumb); border-radius: 50%; background: var(--ink);
  border: 3px solid var(--panel); box-shadow: var(--ring); margin-top: calc(2px - var(--thumb) / 2);
}
.slider input::-moz-range-thumb { width: var(--thumb); height: var(--thumb); border-radius: 50%; background: var(--ink); border: 3px solid var(--panel); }
.slider-mark { position: absolute; top: calc(4px + var(--thumb) / 2 + 5px); transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; pointer-events: none; }
.slider-mark::before { content: ""; width: 1.5px; height: 7px; border-radius: 1px; background: var(--accent); }
.slider-mark span { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.slider-ends { display: flex; justify-content: space-between; margin-top: -14px; }

/* -- statistics: the side's lower half, everything since the last Clear ------------------- */

.analysis { padding: 0 14px 16px; }
.st-sect { padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.st-sect:last-of-type { border-bottom: 0; }
.st-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.st-at { font-size: 10px; color: var(--dim); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 3px 0; align-items: baseline; }
.kv .k { color: var(--mute); font-size: 11px; }
.kv .v { color: var(--ink); font-weight: 600; text-align: right; white-space: nowrap; }
.kv .v small { color: var(--dim); font-weight: 500; font-size: 10.5px; margin-left: 6px; }
.kv .sub { grid-column: 1 / -1; justify-self: end; font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.st-note { font-size: 10.5px; color: var(--dim); margin: 10px 0 0; }

/* rings: one thin bar per ring, the ten in volt; 4px round at the data end, square at the base */
.rbars { display: grid; gap: 3px; }
.rbar { display: grid; grid-template-columns: 18px minmax(0, 1fr) 30px 36px; align-items: center; gap: 8px; font-size: 11px; }
.rbar .rk { color: var(--mute); text-align: right; }
.rbar .rt { height: 10px; }
.rbar .rt i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--ink-2); opacity: 0.5; }
.rbar.ten .rt i { background: var(--accent-fill); opacity: 1; }
.rbar .rn { text-align: right; color: var(--ink); font-weight: 600; }
.rbar .rp { text-align: right; color: var(--dim); }

/* series results: a 2px line, dots with a surface ring, a hairline average; the best series in volt */
.trend { display: block; width: 100%; height: auto; overflow: visible; }
.trend .base, .trend .avg { stroke: var(--line-2); stroke-width: 1; }
.trend .line { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: 0.6; }
.trend .dot { fill: var(--ink-2); stroke: var(--chrome); stroke-width: 2; }
.trend .best .dot { fill: var(--accent-fill); stroke: var(--m-edge); stroke-width: 1.2; }
.trend .hit-area { fill: transparent; }
.trend .pt:hover .dot { r: 5.5; }
.trend .ax, .trend .val { font-family: var(--mono); font-size: 9.5px; fill: var(--dim); }
.trend .val { fill: var(--ink); font-weight: 600; }

/* -- overview -------------------------------------------------------------------------- */

body.overview { min-height: 100dvh; background: var(--viewport); }
.overview .bar { position: sticky; top: 0; height: var(--bar-h); z-index: 1; }
.lanes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); padding: 20px; max-width: 1200px; margin: 0 auto; }
.lead, .net { max-width: 1200px; margin: 0 auto; padding: 20px 20px 0; color: var(--mute); }
.net { display: flex; align-items: center; gap: 8px; min-width: 0; }
.net .v { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the trial (milrad/edition.py): its days under the bar, its link to the full version */
.trial-line { max-width: 1200px; margin: 0 auto; padding: 20px 20px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--ink); }
.trial-line .v { font-weight: 600; }
.trial-line.ended .v { color: var(--red); }
.trial-chip {
  height: 26px; padding: 0 10px; margin-right: 6px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--accent-wash); color: var(--accent); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.trial-chip.ended { background: var(--red-wash); color: var(--red); }
/* what the trial leaves out: there, switched off */
.off, .btn:not(.primary):not(.quiet):disabled { opacity: 0.45; }
.off, .off *, button:disabled { cursor: not-allowed; }
.add-card.off:hover { background: transparent; color: var(--mute); box-shadow: none; border-color: var(--line-2); }
.add-card.off:hover .add-sign { background: var(--panel-2); color: var(--ink-2); }
.trial-over {
  position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px;
  background: color-mix(in srgb, var(--viewport) 82%, transparent); text-align: center;
}
.trial-over b { font-size: 18px; color: var(--ink); }
@media (max-width: 599px) { .trial-chip { font-size: 9.5px; padding: 0 8px; letter-spacing: 0.06em; } }
/* something to do here (sign in to Tailscale, allow Funnel): the sentence wraps, its link stays whole */
.net.act { flex-wrap: wrap; row-gap: 6px; }
.net.act .v { white-space: normal; }
.net .link { white-space: nowrap; }
/* one column exactly as wide as the card: a longer text never widens it, and with it the QR code */
.lane-card {
  display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 12px; padding: 14px; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow), var(--ring);
  transition: box-shadow 0.15s; align-content: start;
}
.lane-card:hover { box-shadow: var(--shadow-lg), var(--ring); }
/* the internet may change this lane: a volt hairline, so it is never forgotten */
.lane-card.open { box-shadow: var(--shadow), 0 0 0 1.5px var(--accent-line); }
.lane-open { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; color: inherit; text-decoration: none; border-radius: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; min-width: 0; }
/* every line of a card is one line, whatever the status says: the cards keep their height and the
   QR codes stay put while the statuses change */
.card-status { display: inline-flex; align-items: center; gap: 6px; max-width: 60%; min-width: 0; font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.card-status span, .lane-card .kicker, .card-info > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-card .qr { background: #fff; border-radius: 8px; padding: 10px; }
.lane-card .qr img { display: block; width: 100%; aspect-ratio: 1; }
.lane-card .kicker { line-height: 1.4; display: block; }
.lane-card .url { color: var(--dim); font-size: 10.5px; word-break: break-all; }
/* the iPhone app: the camera's picture where the QR code would be; a lane on another network faded */
.lane-card.pic .qr { background: var(--viewport); padding: 0; overflow: hidden; }
.lane-card.pic .qr img { aspect-ratio: 16 / 9; object-fit: cover; }
.lane-card.away .qr img { opacity: 0.35; filter: grayscale(1); }
.card-info, .card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; color: var(--mute); }
/* the series, and under it the camera: two lines, always */
.card-info { display: grid; gap: 5px; }
.card-info .cam { color: var(--dim); }
.card-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.card-foot .watch { display: grid; gap: 5px; white-space: nowrap; }
/* deleting a lane: a quiet bin beside its two lines */
.card-info { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
.card-info .del { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--dim); }
.card-info .del:hover, .card-info .del:focus-visible { background: var(--red-wash); color: var(--red); }

/* the + card: where the next lane goes */
.add-card {
  min-height: 220px; place-content: center; justify-items: center; gap: 10px; background: transparent; box-shadow: none;
  border: 1.5px dashed var(--line-2); color: var(--mute); font-size: 12px; letter-spacing: 0.04em;
}
.add-card:hover, .add-card:focus-visible { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); border-color: transparent; }
.add-sign { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--ink-2); }
.add-card:hover .add-sign { background: var(--accent-fill); color: var(--on-accent); }
.lanes-empty { max-width: 1200px; margin: 0 auto; padding: 0 20px; color: var(--mute); }
.lanes-foot { max-width: 1200px; margin: 0 auto; padding: 0 20px 28px; display: flex; justify-content: flex-end; }

/* the targets to print: a small picture of each page, what it is, its two papers */
dialog.sheets-win { width: min(440px, calc(100vw - 24px)); }
.sheet-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding-top: 12px; border-top: 1px solid var(--chrome-line); }
.sheet-thumb svg { display: block; width: 70px; height: 99px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.sheet-text { display: grid; gap: 6px; }
.sheet-text b { color: var(--ink); font-weight: 600; font-size: 13px; }
.sheet-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sheet-links .btn { text-decoration: none; }
.sheet-row { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); }
.sheet-row span:last-child { color: var(--dim); }

/* the new lane's window: a little wider, two fields a row where they are short */
dialog.add-win { width: min(460px, calc(100vw - 24px)); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.feed-row { display: flex; gap: 8px; }
.feed-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px !important; }
.find-row { display: flex; }
.note.warn { color: var(--red); }
.still { position: relative; border-radius: 8px; overflow: hidden; background: var(--viewport); aspect-ratio: 16 / 9; display: grid; place-items: center; }
.still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.still img[hidden] { display: none; }
.still-msg { position: relative; font-size: 11px; color: var(--mute); padding: 0 16px; text-align: center; }
.still img:not([hidden]) + .still-msg {
  position: absolute; right: 8px; bottom: 8px; padding: 3px 7px; border-radius: 6px; background: rgba(15, 19, 32, 0.66); color: #fff;
}
.still.bad .still-msg { color: var(--red); }
.cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.cams:empty { display: none; }
.cam-tile {
  display: grid; gap: 3px; padding: 6px; border: 0; border-radius: 8px; background: var(--panel-2); text-align: left;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2);
}
.cam-pic {
  aspect-ratio: 16 / 9; border-radius: 5px; overflow: hidden; margin-bottom: 3px; background: var(--viewport);
  display: grid; place-items: center; color: var(--dim);
}
.cam-pic img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-touch-callout: none; }
/* answered on the cameras' port, but no picture (no login, or another): its address only */
.cam-tile.blind { background: transparent; box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.cam-tile.blind .cam-pic { background: var(--panel-2); }
.cam-tile.blind .cam-ip { color: var(--ink-2); }
.cam-tile.blind .cam-use { white-space: normal; }
.find { gap: 10px; padding-top: 14px; border-top: 1px solid var(--chrome-line); }
.find > .label { color: var(--ink-2); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cam-ip { font-family: var(--mono); font-size: 11px; color: var(--ink); }
.cam-use { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-tile.used { opacity: 0.62; }
/* a phone takes a hover style for a first tap of its own: only where there is a pointer to hover with */
@media (hover: hover) { .cam-tile:hover { box-shadow: inset 0 0 0 1px var(--line-2); } }
.cam-tile[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--accent-line); opacity: 1; }

@media print {
  .overview .bar .bar-trail, .lead, .net, .card-status, .card-info, .card-foot, .add-card, .lanes-foot, .lanes-empty { display: none !important; }
  body.overview { background: #fff; }
  .lanes { grid-template-columns: repeat(2, 1fr); }
  .lane-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* -- phone first: the stage on top, the side below it, the series scrolling on their own ------- */

@media (max-width: 959px) {
  :root { --side-w: 100%; }
  /* a phone scrolls the page, not the series list: the target, the last shot, then every series in
     full; the bar and the series' own bar stay on top */
  body.app { height: auto; min-height: 100dvh; overflow: visible; grid-template-rows: var(--bar-h) auto; }
  .frame { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .pane-series, .series-scroll { flex: none; overflow: visible; }
  .pane-series .pane-head { position: sticky; top: var(--bar-h); z-index: 5; background: var(--chrome); }
  .fact-feed, .fact-det { display: none; }
  .stage { height: min(calc(100vw + 40px), 58dvh); }
  /* a small screen's bar: the sign and the lane with its target */
  .lane-bar { position: sticky; top: 0; z-index: 6; gap: 10px; padding-left: 12px; }
  .lane-bar .wordmark span + span, .lane-bar .bar-rule { display: none; }
  .hud-chip { right: auto; left: 12px; top: auto; bottom: 10px; }
  #sound-chip { left: auto; right: 12px; top: 42px; bottom: auto; }
  /* the bottom edge: the chips at the left, the dock at the right, side by side */
  .stage-foot {
    display: flex; position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 3; gap: 8px;
    align-items: flex-end; pointer-events: none;
  }
  .foot-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; flex: 1 1 0; }
  .stage-foot .hud-chip, .stage-foot .dock { position: static; transform: none; pointer-events: auto; }
  .stage-foot .dock { flex: none; }
  #group-chip { max-width: 100%; font-size: 11px; padding: 7px 10px; }
  #group-chip .g-full { column-gap: 9px; }
  #group-chip .cap { font-size: 9px; }
  .dock-view { flex-direction: row; }
  .dock-rule { width: 1px; height: 18px; margin: auto 4px; }
  /* a phone's stage is small: the camera view is smaller */
  .feed { left: 12px; top: 12px; width: 54%; }
  .feed[data-size="full"] { left: 8px; top: 8px; width: calc(100% - 16px); bottom: 54px; height: auto; }
  /* the camera view enlarged covers the stage down to the dock: the group chip steps aside. The small
     window at the top leaves it be, but on a phone held sideways (a stage of 200 px or so) it fills
     the height, and the chip steps aside for it too */
  .stage:has(.feed[data-size="full"]:not([hidden])) #group-chip { display: none; }
  @media (max-height: 500px) { .stage:has(.feed:not([hidden])) #group-chip { display: none; } }
  .side { border-left: 0; border-top: 1px solid var(--chrome-line); }
  .last { gap: 12px; min-height: 0; }
  .figure { font-size: 42px; }
  .stats { padding: 10px 0; }
  /* statistics on a phone: the last shot and the tiles step aside, the statistics repeat them */
  .side.stats-view > .pane:not(.pane-series) { display: none; }
  /* the narrowest phones (320 px): the series bar's buttons closer together, so they fit */
  @media (max-width: 359px) {
    .pane-series .pane-head { padding: 0 8px 0 10px; gap: 6px; }
    .pane-series .pane-head .seg button { padding: 0 5px; }
    .pane-series .head-actions .btn { padding: 0 6px; }
    .stage-foot { left: 8px; right: 8px; gap: 6px; }
    #group-chip { font-size: 10px; padding: 6px 8px; }
    #group-chip .cap { font-size: 8.5px; letter-spacing: 0.06em; }
    #group-chip small { font-size: 9.5px; }
  }
  /* the overview's bar on a phone: no divider and no printing */
  .overview .bar-lead .bar-rule, #print { display: none; }
}

/* a phone upright: beside the dock only the narrow form fits */
@media (max-width: 599px) {
  #group-chip .g-full { display: none; }
  #group-chip .g-short { display: grid; }
  #group-chip .g-short .cap { letter-spacing: 0.08em; }
  /* a pair breaks between its two halves, never inside one */
  #group-chip .g-short > span:not(.cap) { white-space: normal; line-height: 1.45; }
  #group-chip .pair { display: inline-block; white-space: nowrap; }
}

@media (pointer: coarse) {
  :root { --tool: 40px; --ctl: 38px; }
  .dock .tool { --tool: 36px; }
  .seg button { height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
