/* kizforge dashboard.
   Control-room typography: system sans for prose, monospace for every number,
   one amber accent that only ever marks the chosen take, the live stage and
   whatever is playing. */

:root {
  --bg: #f7f7f5;
  --panel: #fff;
  --panel-2: #f1f1ee;
  --line: #dcdcd6;
  --line-soft: #e8e8e3;
  --ink: #1a1a18;
  --ink-2: #55564f;
  --ink-3: #86877e;
  --accent: #a85a00;
  --accent-soft: #f5e3cd;
  --bad: #a32b22;
  --bad-soft: #f6dedc;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --r: 3px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101110;
    --panel: #171817;
    --panel-2: #1e201e;
    --line: #2e302e;
    --line-soft: #232523;
    --ink: #e9e8e2;
    --ink-2: #a1a39a;
    --ink-3: #74766e;
    --accent: #e2a34d;
    --accent-soft: #3a2c15;
    --bad: #e08078;
    --bad-soft: #3a201d;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101110;
  --panel: #171817;
  --panel-2: #1e201e;
  --line: #2e302e;
  --line-soft: #232523;
  --ink: #e9e8e2;
  --ink-2: #a1a39a;
  --ink-3: #74766e;
  --accent: #e2a34d;
  --accent-soft: #3a2c15;
  --bad: #e08078;
  --bad-soft: #3a201d;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 72px;
  background: var(--bg);
  color: var(--ink);
  font: 400 13px/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }

.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- header ---------- */

.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.02em;
}
.wordmark::before {
  content: ""; display: inline-block; vertical-align: -1px;
  width: 3px; height: 11px; margin-right: 7px;
  background: var(--accent);
}

.top-gap { flex: 1; }

/* ---------- tabs ---------- */

/* Text, a hairline under the one you are on, amber only there. Two views of one
   page, so nothing here reads as navigation away from it. */
.tabs { display: flex; align-items: stretch; gap: 0; height: 100%; }

.tab {
  position: relative;
  display: flex; align-items: center; gap: 5px;
  padding: 0 11px;
  font: 400 12px/1 var(--sans);
  color: var(--ink-2);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }

.tabmark {
  display: inline-block;
  min-width: 15px; padding: 0 4px;
  font: 400 10px/15px var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--bg);
  background: var(--accent);
  border-radius: 8px;
}

body[data-view="run"] [data-view]:not([data-view="run"]),
body[data-view="compose"] [data-view]:not([data-view="compose"]),
body[data-view="dj"] [data-view]:not([data-view="dj"]),
body[data-view="records"] [data-view]:not([data-view="records"]) { display: none; }
body[data-view="compose"] #composePane { border-bottom: 0; }

/* ---------- run administration ---------- */

.runacts { display: flex; align-items: center; gap: 6px; }

.ghost.danger { color: var(--ink-3); }
.ghost.danger:hover { color: var(--bad); border-color: var(--bad); }
.ghost.danger.is-armed { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.ghost:disabled { opacity: 0.5; cursor: default; }

.runmsg {
  flex: 1 1 100%;
  margin-top: 4px;
  font: 400 12px/1.5 var(--mono);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.runmsg.is-error { color: var(--bad); }

.picker, .ghost {
  font: 400 12px/1 var(--sans);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 5px 7px;
  cursor: pointer;
}
.picker { font-family: var(--mono); max-width: 42vw; }
.ghost:hover { border-color: var(--ink-3); }
.ghost.is-on { color: var(--accent); border-color: var(--accent); }
a.ghost { text-decoration: none; padding: 5px 8px; }

.conn {
  flex: 0 0 auto;
  white-space: nowrap;
  font: 400 11px/1 var(--mono);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.conn::before {
  content: ""; display: inline-block; vertical-align: 0;
  width: 6px; height: 6px; margin-right: 6px; border-radius: 50%;
  background: var(--ink-3);
}
.conn-live::before { background: var(--accent); }
.conn-down::before, .conn-retry::before { background: var(--bad); }

/* ---------- run bar ---------- */

.runbar {
  padding: 16px 14px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.runbar-id { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.runbar-id h1 { font-size: 19px; letter-spacing: -0.01em; }

.concept {
  flex: 1 1 340px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
  max-width: 78ch;
}

/* ---------- the "now" line ---------- */

/* One sentence, always the first thing under the title: what the pipeline is doing this
   second, and how long it has been doing it. A dot carries the state so the eye can
   read it without the words, and only a live run gets the amber. */
.nowband {
  display: flex; align-items: baseline; gap: 10px 14px; flex-wrap: wrap;
  margin-top: 12px;
}
.now {
  font: 400 15px/1.45 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.now::before {
  content: ""; display: inline-block; vertical-align: 1px;
  width: 7px; height: 7px; margin-right: 9px; border-radius: 50%;
  background: var(--ink-3);
}
.nowband[data-tone="live"] .now::before { background: var(--accent); }
.nowband[data-tone="bad"] .now { color: var(--bad); }
.nowband[data-tone="bad"] .now::before { background: var(--bad); }
.nowband[data-tone="done"] .now::before { background: var(--ink-2); }
.now-age { font: 400 12px/1.5 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.now-queue {
  flex: 1 1 100%;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font: 400 12px/1.6 var(--mono);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.now-queue.is-hot { color: var(--accent); }
.now-queue .ghost { font-size: 11px; padding: 3px 7px; }

.readout {
  display: flex; flex-wrap: wrap; gap: 0 26px;
  margin: 12px 0 10px;
}
.readout > div { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.readout dt {
  font: 400 10px/1 var(--sans);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.readout dd {
  margin: 0;
  font: 400 15px/1.15 var(--mono);
  font-variant-numeric: tabular-nums;
}
.readout dd small { font-size: 11px; color: var(--ink-3); }
.readout .hot dd { color: var(--accent); }
.readout .bad dd { color: var(--bad); }

.progress { height: 2px; background: var(--line-soft); }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }

.stagestrip {
  display: flex; flex-wrap: wrap; gap: 0;
  margin: 0; padding: 0; list-style: none;
}
.stagestrip li {
  flex: 1 1 0; min-width: 92px;
  padding: 7px 10px 8px 0;
  border-top: 2px solid var(--line);
  color: var(--ink-3);
}
.stagestrip .s-name {
  display: block;
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.04em;
}
.stagestrip .s-msg {
  display: block;
  font-size: 11px; line-height: 1.35;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.stagestrip .is-done { border-top-color: var(--ink-3); color: var(--ink-2); }
.stagestrip .is-done .s-name { color: var(--ink); }
.stagestrip .is-active { border-top-color: var(--accent); }
.stagestrip .is-active .s-name { color: var(--accent); }
.stagestrip .is-error { border-top-color: var(--bad); }
.stagestrip .is-error .s-name { color: var(--bad); }

/* ---------- panes ---------- */

main { padding: 0 14px; }

.pane { border-bottom: 1px solid var(--line); padding: 14px 0 18px; }
.pane:last-child { border-bottom: 0; }

.pane-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 10px;
}
.pane-head h2 {
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2);
}
.note { flex: 1; font: 400 11px/1.3 var(--mono); color: var(--ink-3); min-width: 0; }
.empty { color: var(--ink-3); font-size: 12px; }

/* ---------- arrangement timeline ---------- */

.tl-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; }
.tl { display: flex; align-items: stretch; min-width: min-content; }

.seg {
  display: flex; flex-direction: column; gap: 5px;
  text-align: left;
  flex: 1 1 auto;
  min-width: 132px;
  padding: 9px 10px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line);
  border-radius: var(--r);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.seg + .seg { margin-left: 0; }
.seg:hover { background: var(--panel-2); }
.seg.is-sel { border-color: var(--ink-3); background: var(--panel-2); }
/* Four states on the top edge, readable before a word is: a pale hairline for one that
   has not started, amber for the one being worked on, solid ink for a clean pass, and
   a dashed ink edge for one kept below its bar -- which is a compromise, not a failure,
   so it never takes the red. */
.seg.st-done { border-top-color: var(--ink-2); }
.seg.st-live { border-top-color: var(--accent); }
.seg.st-fail { border-top-color: var(--bad); }
.seg.is-kept { border-top-style: dashed; border-top-color: var(--ink-3); }
.seg.is-playing { box-shadow: inset 3px 0 0 var(--accent); }

/* The lit segment fills to the percentage the machine reports. It is a wash behind the
   text, not a bar beside it, so the segment itself is the gauge. */
/* No clipping here: the wash is inset inside the segment, so it never needs it, and a
   segment that clipped would cut a long title. */
.seg { position: relative; }
.seg > * { position: relative; }
.seg-wash {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--fill, 0%);
  background: var(--accent-soft);
  transition: width .35s ease;
  pointer-events: none;
}
.seg.is-working { border-color: var(--accent); border-top-color: var(--accent); }
.seg.is-working .seg-state, .seg.is-working .live-txt { color: var(--accent); }

.seg-top {
  display: flex; align-items: baseline; gap: 6px;
  font: 400 11px/1 var(--mono); color: var(--ink-3);
}
.seg-idx { color: var(--ink); }
.seg-title {
  font: 500 13px/1.25 var(--sans);
  overflow-wrap: anywhere;
}
.seg-nums {
  display: flex; gap: 8px; flex-wrap: wrap;
  font: 400 11px/1.3 var(--mono); color: var(--ink-2);
}
.seg-state { font: 400 10px/1 var(--mono); letter-spacing: 0.06em; color: var(--ink-3); }
.seg.st-live .seg-state { color: var(--accent); }
.seg.st-fail .seg-state { color: var(--bad); }

/* A bridge is a few seconds against a track's ninety, so it is never sized by its
   length: it keeps a narrow fixed column, wide enough to stay clickable, and widens
   only while it is the thing being built. */
.link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  flex: 0 0 auto; width: 74px;
  padding: 4px 3px;
  background: none; border: 0; border-top: 2px solid transparent; border-radius: var(--r);
  color: var(--ink-3);
  font: 400 10px/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.link:hover { color: var(--ink); background: var(--panel-2); }
.link.is-sel { color: var(--ink); background: var(--panel-2); }
.link .rail { display: block; width: 100%; height: 1px; background: var(--line); }
.link.has-audio .rail { background: var(--ink-3); }
.link.is-playing .rail, .link.is-playing { color: var(--accent); }
.link.is-playing .rail { background: var(--accent); }
.link b { font-weight: 400; color: inherit; }
.link .bl-name { color: var(--ink-2); letter-spacing: 0.04em; }
.link .bl-score { font-size: 11px; }
.link .bl-floor, .link .bl-round { color: var(--ink-3); white-space: nowrap; }

.link.st-done { border-top-color: var(--ink-2); }
.link.st-done .bl-name, .link.st-done .bl-score { color: var(--ink); }
.link.st-fail { border-top-color: var(--bad); }
.link.st-fail .bl-floor { color: var(--bad); }
.link.is-kept { border-top-style: dashed; border-top-color: var(--ink-3); }
.link.is-working {
  width: 132px;
  border-top-color: var(--accent);
  background: var(--accent-soft);
}
.link.is-working .bl-name, .link.is-working .bl-score, .link.is-working .bl-round { color: var(--accent); }
.link.is-working .rail { background: var(--accent); }

.ruler {
  display: flex; margin-top: 4px;
  font: 400 10px/1.4 var(--mono); color: var(--ink-3);
}

/* ---------- detail ---------- */

.tag {
  font: 400 10px/1.5 var(--mono);
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
.tag-hot { color: var(--accent); border-color: var(--accent); }
.tag-bad { color: var(--bad); border-color: var(--bad); }

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 20px 34px;
  align-items: start;
}

.grp { margin-bottom: 18px; }
.grp:last-child { margin-bottom: 0; }
.grp > h4 {
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 7px;
}

.kv { display: flex; flex-wrap: wrap; gap: 3px 22px; }
.kv > div { display: flex; flex-direction: column; gap: 1px; min-width: 62px; }
.kv dt, .kv .k {
  font: 400 10px/1.2 var(--sans);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.kv dd, .kv .v { margin: 0; font: 400 13px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.kv .v em { font-style: normal; color: var(--ink-3); }
.kv .warn .v { color: var(--bad); }

.text {
  font: 400 12.5px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 9px 11px;
  margin: 0;
}
.text.prose { font-family: var(--sans); font-size: 13px; }

details.fold > summary {
  cursor: pointer;
  font: 400 11px/1.4 var(--mono);
  color: var(--ink-3);
  list-style: none;
  padding: 4px 0;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "+ "; }
details.fold[open] > summary::before { content: "- "; }
details.fold > summary:hover { color: var(--ink); }


.chain { display: flex; flex-direction: column; gap: 0; }
.chain > div {
  padding: 7px 0 9px 13px;
  border-left: 1px solid var(--line);
  position: relative;
}
.chain > div::before {
  content: ""; position: absolute; left: -3px; top: 12px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--line);
}
.chain > div:last-child { border-left-color: transparent; }
.chain .c-k {
  display: block;
  font: 400 10px/1.4 var(--sans);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.chain .c-v { font-size: 12.5px; line-height: 1.55; color: var(--ink); }

.tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- takes matrix ---------- */

.matrix-scroll { overflow-x: auto; }
/* The columns size to their own numbers rather than to the block, so a wide display
   keeps the take label next to its scores and leaves the slack on the right. The
   min-width is the floor a narrow window scrolls against instead of crushing them. */
.matrix { border-collapse: collapse; width: auto; max-width: 100%; min-width: 460px; }
/* Ten axes and two group means. */
.matrix.wide { min-width: 940px; }
.matrix td.cell { min-width: 52px; }
.matrix th, .matrix td {
  padding: 5px 6px;
  text-align: right;
  font: 400 12px/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.matrix thead th {
  font: 400 10px/1.2 var(--sans);
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  vertical-align: bottom;
}
.matrix th:first-child, .matrix td:first-child, .matrix .l { text-align: left; }
.matrix td.cell { padding-bottom: 4px; }
.matrix .bar { display: block; height: 2px; margin-top: 3px; background: var(--ink-3); }
.matrix tr.is-chosen td { background: var(--accent-soft); }
.matrix tr.is-chosen .bar { background: var(--accent); }
.matrix .mean { font-size: 13px; }
.matrix tr.is-chosen .mean { color: var(--accent); }
.matrix tr.is-cut .mean { color: var(--bad); }

/* The two score groups, and the axis that lost its floor. */
.matrix tr.mhead th {
  font: 600 10px/1.3 var(--sans);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); text-align: left;
  border-bottom: 0; padding-bottom: 2px; white-space: normal;
}
.matrix .gsep { border-left: 1px solid var(--line); }
.matrix .gm { color: var(--ink-2); }
.matrix td.gmean {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.matrix tr.is-chosen td.gmean { color: var(--accent); }
.matrix td.is-floor { color: var(--bad); background: var(--bad-soft); }
.matrix td.is-floor .bar { background: var(--bad); }
.matrix tr.is-chosen td.is-floor { color: var(--bad); }
.matrix td.is-spread { box-shadow: inset 0 -2px 0 var(--bad); }

.oldfmt {
  font: 400 11.5px/1.55 var(--sans);
  color: var(--ink-3);
  margin: 0 0 7px;
}

/* The clause that decided the take, straight from the run's own accept rule. */
.rule {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px;
  margin: 4px 0 0;
  font: 400 11.5px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
.rule .r-ok { color: var(--ink-2); }
.rule .r-bad { color: var(--bad); }
.rule .r-sep { color: var(--line); }

/* What the critic heard against what the plan asked for. */
.genre {
  border-left: 2px solid var(--line);
  padding: 2px 0 2px 10px;
  margin-top: 6px;
}
.genre.is-drift { border-left-color: var(--bad); }
.genre .g-row {
  display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.genre .g-k {
  flex: 0 0 78px;
  font: 400 10px/1.6 var(--sans);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.genre .g-v {
  font: 400 13px/1.4 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.genre .g-off { color: var(--bad); }
.genre .g-none { color: var(--ink-3); font-size: 11.5px; }
.genre .g-say { margin: 5px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.genre .g-say.is-bad { color: var(--bad); }
.genre .g-passes { margin: 3px 0 0; font: 400 11px/1.5 var(--mono); color: var(--ink-3); }

.takeswide { margin-top: 20px; }

/* ---------- one bridge, while it is being built and after ---------- */

.blive {
  display: flex; flex-direction: column; gap: 3px;
  border-left: 2px solid var(--accent);
  padding: 3px 0 3px 10px;
  margin: 0 0 12px;
}
.blive .bl-live {
  font: 400 13.5px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.blive .bl-msg { font: 400 11.5px/1.55 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }

/* A pool that misses the floor is repainted again. That is the recipe, not a fault, so
   it is set in the same ink as everything else and never in red. */
.bretry {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border-left: 1px solid var(--line);
  padding: 6px 0 8px 11px;
  margin: 14px 0 10px;
}
.bretry .br-k {
  font: 400 10px/1.5 var(--sans);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.bretry .br-v { font: 400 12px/1.6 var(--sans); color: var(--ink-2); overflow-wrap: anywhere; }

.bridgerow.is-kept { border-left-style: dashed; }
.bridgerow.st-live { border-left-color: var(--accent); }

/* A candidate that cleared the floor and one that did not, told apart in the table
   without reading the number: the ones that cleared keep the ink, the ones that did
   not fall back to the muted column the rest of the pool sits in. */
.matrix tr.is-pass .mean { color: var(--ink); }
.matrix tr.is-under td, .matrix tr.is-under .mean { color: var(--ink-3); }
.matrix tr.is-under .bar { background: var(--line); }
.matrix tr.is-chosen.is-under td { color: var(--ink-2); }
.matrix tr.is-chosen.is-under .mean { color: var(--accent); }


/* ---------- the take generating right now ---------- */

.live { margin: 5px 0 1px; }
.live-bar { display: flex; gap: 2px; height: 2px; }
.live-seg { flex: 1 1 0; min-width: 0; background: var(--line-soft); }
.live-fill { display: block; height: 100%; width: 0; background: var(--ink-3); transition: width .35s ease; }
.live-seg.is-active .live-fill { background: var(--accent); }
.live-key {
  display: flex; gap: 2px; margin-top: 4px;
  font: 400 10px/1.2 var(--mono); letter-spacing: 0.04em; color: var(--ink-3);
}
.live-key span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.live-key span.is-active { color: var(--accent); }
.live-txt { margin-top: 4px; font: 400 11px/1.5 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.seg .live-txt { color: var(--ink-3); }
tr.liverow td { padding: 2px 6px 9px 0; border-bottom: 1px solid var(--line-soft); white-space: normal; }

.playbtn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 2px 7px 2px 5px;
  font: 400 11px/1.4 var(--mono);
  cursor: pointer;
}
.playbtn:hover { border-color: var(--ink-3); }
.playbtn svg { width: 8px; height: 9px; fill: currentColor; }
.playbtn.is-playing { color: var(--accent); border-color: var(--accent); }
.playbtn[disabled] { opacity: .45; cursor: default; }

.verdict { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); margin-top: 3px; }
.problems { margin: 5px 0 0; padding-left: 15px; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.problems li { margin-bottom: 2px; }
.fix { font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); margin-top: 4px; }

.takefoot { border-bottom: 1px solid var(--line); padding: 6px 0 10px; }
.takefoot:last-child { border-bottom: 0; }
.takefoot .tf-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font: 400 11px/1.4 var(--mono); color: var(--ink-3); }
.takefoot .tf-g { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- segments table (finished mix) ---------- */

.cue { width: 100%; border-collapse: collapse; }
.cue td, .cue th {
  padding: 4px 8px 4px 0; text-align: left;
  font: 400 12px/1.4 var(--mono); font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line-soft);
}
.cue th { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); font-family: var(--sans); }
.cue .t { color: var(--ink-3); width: 1%; white-space: nowrap; }
.cue tr.is-bridge td { color: var(--ink-3); }
.cue button.link-time {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--accent); text-decoration: none;
}
.cue button.link-time:hover { text-decoration: underline; }

/* ---------- bible ---------- */

.arc { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.arc > div { flex: 1 1 150px; padding: 8px 10px; background: var(--panel); }
.arc .a-h { display: flex; justify-content: space-between; gap: 8px; font: 400 11px/1.4 var(--mono); color: var(--ink-3); }
.arc .a-g { font: 500 12.5px/1.4 var(--sans); }
.arc .a-n { font-size: 12px; line-height: 1.5; color: var(--ink-2); margin-top: 3px; }

.motifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 22px; }
.motif .m-n { font: 500 12.5px/1.4 var(--sans); }
.motif .m-k { font: 400 10px/1.4 var(--mono); color: var(--ink-3); letter-spacing: 0.05em; }
.motif .m-d { font-size: 12px; line-height: 1.5; color: var(--ink-2); }

/* ---------- log ---------- */

.log {
  max-height: 42vh; overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 6px 0;
}
.line {
  display: grid;
  grid-template-columns: 7ch 7ch 11ch minmax(0, 1fr);
  gap: 2px 10px; align-items: baseline;
  padding: 1px 10px;
  font: 400 11.5px/1.5 var(--mono);
}
.line:hover { background: var(--panel-2); }
.line-t { color: var(--ink-3); }
.line-s { color: var(--ink-2); }
.line-e { color: var(--ink-3); overflow-wrap: anywhere; }
.line-m { color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.line-error .line-s, .line-error .line-m { color: var(--bad); }
.follow { font: 400 11px/1 var(--mono); color: var(--ink-3); display: flex; align-items: center; gap: 5px; }

/* ---------- transport ---------- */

.transport {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.tplay {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  border: 0; border-radius: 50%;
  cursor: pointer;
}
.tplay svg { width: 10px; height: 11px; fill: currentColor; }

.tmeta { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tlabel { font: 500 12px/1.3 var(--sans); overflow-wrap: anywhere; }
.tsub { font: 400 10.5px/1.3 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.ttime { flex: 0 0 auto; font: 400 11px/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.tseek {
  flex: 1 1 120px; min-width: 60px;
  appearance: none; -webkit-appearance: none;
  height: 16px; background: none; cursor: pointer;
}
.tseek::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
.tseek::-moz-range-track { height: 2px; background: var(--line); }
.tseek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 10px; height: 10px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--accent);
}
.tseek::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--accent); }

/* The target is a large desktop display. This is the one fallback so a small
   window stays usable, not a layout to design around. */
@media (max-width: 700px) {
  .wordmark { display: none; }
  .picker { flex: 1 1 auto; min-width: 0; max-width: none; }
  .transport { flex-wrap: wrap; gap: 6px 10px; }
  .tmeta { flex: 1 1 auto; }
  .tseek { order: 9; flex: 1 1 100%; }
  body { padding-bottom: 108px; }
}

/* A 4K panel is usually driven at 100 percent, so scale the whole page up
   rather than shipping type tuned for a laptop. */
@media (min-width: 2200px) {
  body { zoom: 1.35; }
}
@media (min-width: 3000px) {
  body { zoom: 1.75; }
}

@media (prefers-reduced-motion: reduce) {
  .progress i, .live-fill { transition: none; }
}

/* ---------- dossiers: one per track, the plan first ---------- */

.dossier, .bridgerow {
  padding: 16px 0 20px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 56px;
}
.dossier:first-child, .bridgerow:first-child { border-top: 0; }
.dossier.is-target, .bridgerow.is-target {
  box-shadow: -10px 0 0 -8px var(--accent);
}
.dossier.st-planned .dhead h3 { color: var(--ink-2); }
.dossier.is-mix { border-top: 0; }
.dossier.is-mix .dhead h3 { font-size: 20px; }

.bridgerow {
  margin-left: 18px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.bridgerow .dhead h3 { font-size: 14px; font-weight: 500; }
.bridgerow .d-idx { color: var(--ink-3); }

.dhead {
  display: flex; align-items: baseline; gap: 8px 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.dhead .d-idx { font: 400 12px/1 var(--mono); color: var(--ink-3); }
.dhead h3 { font-size: 17px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dhead .playbtn { margin-left: auto; }

/* ---------- prompt rewrites ---------- */

.text.diff { border-left-color: var(--ink-3); }
.text.diff.was { color: var(--ink-2); }
.d-l { color: var(--ink-3); }
.d-cut { text-decoration: line-through; color: var(--ink-3); }
.d-add { background: var(--accent-soft); color: var(--ink); }

.tf-k { color: var(--ink-3); }
.tf-hot { color: var(--accent); }
.tf-bad { color: var(--bad); }

.concept-full { font-size: 13.5px; line-height: 1.65; color: var(--ink); }
.concept.is-error { color: var(--bad); font-family: var(--mono); }

/* ---------- compose: one text box and a button, knobs folded away ---------- */

.compose { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.cbrief {
  width: 100%; max-width: 88ch;
  min-height: 3.6em;
  resize: none;                 /* it grows to its own content instead */
  overflow: hidden;
  font: 400 13.5px/1.6 var(--sans);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 10px 12px;
}
.cbrief:focus { border-color: var(--ink-3); border-left-color: var(--ink-3); }
.cbrief::placeholder { color: var(--ink-3); }

.cgo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.solid {
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink); border-radius: var(--r);
  padding: 6px 14px;
  font: 500 12px/1.2 var(--sans);
  cursor: pointer;
}
.solid:hover { background: var(--ink-2); border-color: var(--ink-2); }
.solid[disabled] { opacity: .45; cursor: default; }

.cmsg { font: 400 11px/1.4 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.cmsg.over { color: var(--bad); }
.note.is-hot { color: var(--accent); }

/* ---------- the knobs ---------- */

.knobfold { width: 100%; max-width: 1180px; }
.cknob-lead { font-size: 12px; line-height: 1.5; color: var(--ink-3); margin: 2px 0 12px; }

.knobgrp { margin-bottom: 16px; }
.knobgrp > h4 {
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
}

.knobrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px 28px; align-items: start; }
.knob { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 420px; }
.knob-2 { grid-column: span 2; max-width: 100%; }
.knob-k {
  font: 400 10px/1.2 var(--sans);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.knob-h, .knob-d { font: 400 11px/1.45 var(--sans); color: var(--ink-3); margin: 0; overflow-wrap: anywhere; }
.knob-d { font-family: var(--mono); font-size: 10.5px; }

.kin {
  font: 400 12.5px/1.3 var(--mono);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 5px 7px;
  min-width: 0;
}
.kin:focus { border-color: var(--ink-3); }
.kin::placeholder { color: var(--ink-3); }
.kin-wide { width: 100%; }
.kin-num { width: 9ch; }
.kin-area { resize: vertical; }
.kin-row { display: flex; align-items: baseline; gap: 7px; }
.kin-u { font: 400 11px/1.3 var(--mono); color: var(--ink-3); }
select.kin { font-family: var(--sans); cursor: pointer; max-width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 5px 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 3px 8px 3px 6px;
  font: 400 12px/1.4 var(--sans);
  color: var(--ink-2);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink-3); }
.chip:has(input:checked) { color: var(--ink); border-color: var(--ink-3); background: var(--panel-2); }
.chip input { margin: 0; accent-color: var(--ink-2); }

/* ---------- one composed request ---------- */

.creqs { display: flex; flex-direction: column; }
.creqs:not(:empty) { margin-top: 18px; }
#cEmpty { margin-top: 14px; }

.creq {
  border-top: 1px solid var(--line);
  padding: 12px 0 14px 13px;
  border-left: 2px solid transparent;
  margin-left: -13px;
}
.creq:first-child { border-top: 0; }
.creq.st-asking, .creq.st-running, .creq.st-new, .creq.st-claimed { border-left-color: var(--accent); }
.creq.st-failed { border-left-color: var(--bad); }

.creq-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.creq-id { font: 400 12px/1.4 var(--mono); color: var(--ink-3); }
.creq-st {
  font: 400 10px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2);
}
.creq.st-asking .creq-st, .creq.st-running .creq-st,
.creq.st-new .creq-st, .creq.st-claimed .creq-st { color: var(--accent); }
.creq.st-failed .creq-st { color: var(--bad); }
.creq-when { font: 400 11px/1.4 var(--mono); color: var(--ink-3); }

.creq-brief {
  margin: 6px 0 0; max-width: 88ch;
  font: 400 13.5px/1.6 var(--sans);
  overflow-wrap: anywhere;
}
.creq .tags { margin-top: 7px; }
.creq-note { margin-top: 6px; font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); }
.creq-err { margin-top: 6px; font: 400 12px/1.5 var(--mono); color: var(--bad); overflow-wrap: anywhere; }

/* ---------- the question round ---------- */

.qform { margin-top: 12px; max-width: 96ch; }
.qform > h4 {
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.q { padding: 0 0 14px; }
.q-t { font: 500 13.5px/1.55 var(--sans); overflow-wrap: anywhere; }
.q-w { margin-top: 3px; font: 400 12px/1.55 var(--sans); color: var(--ink-3); overflow-wrap: anywhere; }
.q-opts { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 7px; }
.q-free { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.q-free > span { font: 400 10px/1.2 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- dj: real records, hand-overs between them ---------- */

/* One run per row, the way the picker lists them, but with room for the title and
   the progress. The selected one carries the same amber edge a targeted dossier does. */
.djruns { display: flex; flex-direction: column; }
.djrun {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 4px 14px; align-items: baseline;
  width: 100%;
  padding: 7px 0 7px 13px; margin-left: -13px;
  background: none; border: 0; border-top: 1px solid var(--line-soft);
  border-left: 2px solid transparent;
  text-align: left; color: inherit; font: inherit;
  cursor: pointer;
}
.djrun:first-child { border-top: 0; }
.djrun:hover { background: var(--panel-2); }
.djrun.is-sel { border-left-color: var(--accent); background: var(--panel-2); }
.djrun .r-id { font: 400 12px/1.4 var(--mono); color: var(--ink-2); }
.djrun .r-title { font: 500 13px/1.4 var(--sans); overflow-wrap: anywhere; }
.djrun .r-st { font: 400 10px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.djrun.st-running .r-st { color: var(--accent); }
.djrun.st-error .r-st { color: var(--bad); }
.djrun .r-pct, .djrun .r-when { font: 400 11px/1.4 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.djhead { margin-bottom: 14px; }
.djhead .kv { margin-top: 8px; }
.djhead .progress { margin-top: 10px; }
.djprog { margin-top: 5px; font: 400 12px/1.5 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.djprog.is-bad { color: var(--bad); }

.djeditbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 12px; }

/* The override on its way: new, claimed, running, done. */
.djladder { display: flex; flex-direction: column; gap: 4px; }
.djladder:not(:empty) { margin-bottom: 12px; }
.ladder {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px;
  font: 400 11.5px/1.6 var(--mono); color: var(--ink-3);
}
.ladder .l-id { color: var(--ink-2); }
.ladder .l-arrow { color: var(--line); }
.ladder .step { padding: 0 1px; border-bottom: 1px solid transparent; }
.ladder .step.is-past { color: var(--ink-2); }
.ladder .step.is-on { color: var(--accent); border-bottom-color: var(--accent); }
.ladder .step.is-bad { color: var(--bad); border-bottom-color: var(--bad); }
.ladder .l-note { color: var(--ink-2); }
.ladder .l-err { flex: 1 1 100%; color: var(--bad); white-space: pre-wrap; overflow-wrap: anywhere; }

/* The time axis: one column, a rail down the left, a dot per record, and the seam
   between two records set in from the rail. A phone gets the same column, narrower. */
.djaxis { display: flex; flex-direction: column; margin-left: 4px; border-left: 1px solid var(--line); }
.leg { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 0 12px 14px; }
.leg::before {
  content: ""; position: absolute; left: -4px; top: 18px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--ink-3);
}
.leg.st-rendering::before { background: var(--accent); border-color: var(--accent); }
.leg.st-done::before { background: var(--ink); border-color: var(--ink); }
.leg-t {
  flex: 0 0 5.5ch;
  background: none; border: 0; padding: 0;
  font: 400 13px/1.4 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--accent); text-align: left; cursor: pointer;
}
.leg-t:hover { text-decoration: underline; }
.leg-t:disabled { color: var(--ink-3); cursor: default; text-decoration: none; }
.leg-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.leg-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.leg-h .d-idx { font: 400 12px/1 var(--mono); color: var(--ink-3); }
.leg-name { font: 500 14px/1.3 var(--sans); overflow-wrap: anywhere; }
.leg-edit { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.leg-edit select.kin { width: 100%; max-width: 88ch; font-family: var(--mono); font-size: 12px; }
.leg-edit input.kin { max-width: 88ch; }

.seam {
  margin-left: calc(14px + 5.5ch + 12px);
  padding: 8px 0 10px 12px;
  border-left: 2px solid var(--line-soft);
}
.seam.st-rendering { border-left-color: var(--accent); }
.seam.st-done { border-left-color: var(--ink-3); }
.seam.st-failed { border-left-color: var(--bad); }
.seam-h {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px;
  font: 400 11.5px/1.6 var(--mono); color: var(--ink-2);
}
.seam-k { color: var(--ink-3); letter-spacing: 0.04em; }
.seam-v { color: var(--ink); }
.seam-why { margin-top: 4px; max-width: 88ch; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.seam .kv { margin-top: 6px; }
.seam details.fold { margin-top: 4px; }
.seam-pic { overflow-x: auto; margin-top: 4px; }
.seam-pic img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line-soft); border-radius: var(--r); }
.seam-edit { margin-top: 8px; }
.seam-edit .cgo { margin-top: 8px; }
.nudge { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.nudge .kin { font-size: 11.5px; }
.nudge .ghost { padding: 4px 8px; font-family: var(--mono); }

@media (max-width: 700px) {
  .djrun { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px 10px; }
  .djrun .r-when { display: none; }
  .leg { gap: 8px; }
  .seam { margin-left: 14px; }
}

/* the Live band of the DJ tab (docs/stream.md) */
.djlive { border: 1px solid var(--line, #ddd); border-radius: 8px; padding: .6em .9em; margin-bottom: 1em; }
.djlive .liveaudio { width: 100%; margin: .4em 0; }
.djlive .liverow { display: flex; gap: .6em; align-items: baseline; padding: .15em 0; }
.djlive .liverow.is-now { font-weight: 600; }
.djlive .livesteer { display: flex; gap: .5em; flex-wrap: wrap; align-items: center; margin-top: .5em; }
.djlive .livesteer .kin { flex: 1 1 18em; }
.djlive .tag-dim { opacity: .55; }

/* the Records tab (docs/stream.md) */
.recfilters { display: flex; gap: .5em; flex-wrap: wrap; align-items: center; margin: .4em 0; }
.recfilters .kin { max-width: 16em; }
.reclegend { font-size: .85em; opacity: .8; }
.reclegend .lg { display: inline-block; width: 1.4em; height: .7em; vertical-align: middle; }
.lg-sec { background: #e85; } .lg-voice { background: rgba(40,80,200,.8); } .lg-beat { background: #222; } .lg-pause { background: #d33; }
.recrow { border-bottom: 1px solid var(--line, #e4e4e4); padding: .35em 0; }
.rechead { display: flex; gap: .5em; align-items: baseline; flex-wrap: wrap; }
.reclink { background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-align: left; }
.recacts { margin-left: auto; display: flex; gap: .4em; }
.recstrip { display: block; max-width: 100%; height: 26px; margin-top: .25em; border-radius: 3px; }
.recdetail { margin: .4em 0 .2em; }
.reclabel { font-size: .85em; opacity: .8; margin-top: .4em; }
.recacc { display: flex; gap: 2px; margin-top: .2em; }
.recacc i { display: inline-block; width: 14px; height: 18px; background: #333; border-radius: 2px; }
.recacc i.recbeat { outline: 1px solid #e85; }
.djlive .livequeue { margin-top: .5em; }
.djlive .livequeue .liverow button { padding: 0 .4em; }
.djlive .livehist { margin-top: .5em; font-size: .9em; opacity: .85; }

.seam-lanes .lanes { display: block; max-width: 100%; font: 11px system-ui, sans-serif; }

.seam-lanes { margin: .4em 0; }
.seam-lanes .lanes { cursor: crosshair; border-radius: 4px; background: #fafafa; }
.seam-lanes .lanes-read { font-size: .85em; opacity: .85; margin: .2em 0 0; }

.djlive .livesteering { margin-top: .5em; }
.djlive .steerlog .liverow { font-size: .9em; }

.djlive .steerlog .liverow { white-space: pre-line; align-items: flex-start; }

.tlwrap { margin: .3em 0 .6em; }
.tlbar { display: flex; gap: .4em; align-items: center; margin-bottom: .2em; }
.tlbar .ghost.is-on { font-weight: 600; }
.tlcanvas { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line, #e2e2e2); cursor: grab; user-select: none; }
.tlcanvas:active { cursor: grabbing; }

.tlink { background: none; border: 0; padding: 0 .1em; font: inherit; color: #1a5fb4; cursor: pointer; text-decoration: underline dotted; }
.tlink:hover { color: #0b3d80; text-decoration: underline; }
pre.tblock { white-space: pre-wrap; font: 12px/1.5 ui-monospace, monospace; }
