/* RfX Software Factory board. No framework, no web font, no third-party origin (the CSP allows none). */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --line: #dfe3e8;
  --text: #17202b;
  --muted: #5b6673;
  --faint: #8a94a0;
  --accent: #1f6f5c;
  --accent-text: #ffffff;
  --focus: #2b6cb0;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);

  /* Status: always a word too, never a colour alone. */
  --ok: #1d7a46;
  --ok-bg: #e3f4ea;
  --running: #1f5fae;
  --running-bg: #e3edfa;
  --held: #93580a;
  --held-bg: #fbefd9;
  --failed: #b42318;
  --failed-bg: #fde8e6;
  --idle: #5b6673;
  --idle-bg: #eceff2;

  /* Series: eight categorical hues, distinct in both themes. */
  --c1: #2f6fb3;
  --c2: #d07a1f;
  --c3: #2e8b57;
  --c4: #b8406b;
  --c5: #6b57b8;
  --c6: #1f8f99;
  --c7: #9a7b12;
  --c8: #7a8591;

  --radius: 10px;
  --gutter: 16px;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #171d24;
    --surface-2: #1e252e;
    --line: #2b343f;
    --text: #e7ebef;
    --muted: #a3adb8;
    --faint: #75808c;
    --accent: #4fb79a;
    --accent-text: #0b1512;
    --focus: #7fb2ec;
    --shadow: none;

    --ok: #6fd39a;
    --ok-bg: #173225;
    --running: #85b6f0;
    --running-bg: #182a40;
    --held: #f0b45a;
    --held-bg: #3a2a10;
    --failed: #f38b80;
    --failed-bg: #3d1a17;
    --idle: #a3adb8;
    --idle-bg: #232b34;

    --c1: #6aa5e6;
    --c2: #ee9d4a;
    --c3: #5fc28a;
    --c4: #e2769e;
    --c5: #a08ff0;
    --c6: #4fc3cc;
    --c7: #d8b84a;
    --c8: #9aa5b1;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.num { font-variant-numeric: tabular-nums; }

/* --- Header and tabs ------------------------------------------------------------------------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand h1 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.mark { width: 28px; height: 28px; flex: none; fill: var(--accent); }
.mark.big { width: 44px; height: 44px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
#who-name { overflow: hidden; text-overflow: ellipsis; max-width: 28vw; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px var(--gutter) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs button {
  border: 0;
  background: none;
  padding: 10px 14px 11px;
  font-weight: 550;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

main { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 16px var(--gutter) 32px; }
.foot { padding: 14px var(--gutter) 22px; color: var(--faint); font-size: 12px; text-align: center; }

/* --- Sign-in gate ---------------------------------------------------------------------------- */
.gate { display: grid; place-items: center; min-height: 60vh; }
.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.gate-card h2 { font-size: 20px; margin: 12px 0 8px; }
.gate-card p { color: var(--muted); margin: 0 0 18px; }
.gate-note { font-size: 13px; color: var(--muted); }
.gate-note.error { color: var(--failed); }
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
}

/* --- Common blocks --------------------------------------------------------------------------- */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.bar .grow { flex: 1; }
.asof { color: var(--muted); font-size: 12px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.panel h3 { font-size: 14px; font-weight: 650; margin-bottom: 4px; }
.panel + .panel { margin-top: 14px; }
.grid > .panel { margin-top: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.note { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.note .amber { color: var(--held); font-weight: 600; }
.missing { color: var(--muted); }
.missing small { color: var(--faint); margin-left: 4px; }
.problem {
  border: 1px solid var(--held);
  background: var(--held-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
/* The board's own data is broken or old (health.js): red, above every view, a word and a colour. */
.health { margin-bottom: 12px; }
.banner {
  border: 1px solid var(--failed);
  background: var(--failed-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 550;
}
.banner + .banner { margin-top: 6px; }
.banner .status { margin-right: 4px; }
select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  max-width: 100%;
}

/* Status: a word plus a colour. */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650;
  padding: 2px 9px 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.t-ok { color: var(--ok); background: var(--ok-bg); }
.t-running { color: var(--running); background: var(--running-bg); }
.t-held { color: var(--held); background: var(--held-bg); }
.t-failed { color: var(--failed); background: var(--failed-bg); }
.t-idle, .t-unknown { color: var(--idle); background: var(--idle-bg); }

/* Initiative chips and series colours. */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  white-space: nowrap;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--chip, var(--c8)); }
.k1 { --chip: var(--c1); } .k2 { --chip: var(--c2); } .k3 { --chip: var(--c3); } .k4 { --chip: var(--c4); }
.k5 { --chip: var(--c5); } .k6 { --chip: var(--c6); } .k7 { --chip: var(--c7); } .k8 { --chip: var(--c8); }
svg .k1 { fill: var(--c1); } svg .k2 { fill: var(--c2); } svg .k3 { fill: var(--c3); } svg .k4 { fill: var(--c4); }
svg .k5 { fill: var(--c5); } svg .k6 { fill: var(--c6); } svg .k7 { fill: var(--c7); } svg .k8 { fill: var(--c8); }

/* --- Flow board ------------------------------------------------------------------------------ */
.needs {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  font-size: 14px;
}
.needs strong { font-weight: 650; }
.needs .count { font-weight: 700; }
.needs.calm { color: var(--muted); }
.needs.call { border-color: var(--held); background: var(--held-bg); }

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.col {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 140px;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 8px;
}
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 0 2px 2px; }
.col-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 650; }
.col-head .n { font-size: 20px; font-weight: 700; }
.col-hint { font-size: 12px; color: var(--muted); margin: -4px 2px 2px; }
.col.wide { border: 1px dashed var(--line); background: transparent; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
}
.card .t { font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.card a.num { font-weight: 650; text-decoration: none; color: var(--accent); }
.card a.num:hover { text-decoration: underline; }
.who-badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.who-badge.person { border-color: var(--held); color: var(--held); }
.empty { color: var(--faint); font-size: 12px; padding: 4px 2px; }
.more { font-size: 12px; color: var(--muted); padding: 2px; }
.pipe .verdict { display: flex; flex-direction: column; gap: 6px; }
.pipe .detail { font-size: 13px; overflow-wrap: anywhere; }
.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.stages li { display: flex; justify-content: space-between; gap: 8px; }

/* Narrow screens: the columns become a list, stage by stage. */
@media (max-width: 760px) {
  .board { grid-auto-flow: row; grid-auto-columns: auto; overflow-x: visible; }
  .col { min-height: 0; }
  .top { flex-wrap: wrap; }
  #who-name { max-width: 50vw; }
}

/* --- Tables ---------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
td.r, th.r { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }

/* --- Figures --------------------------------------------------------------------------------- */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 2px; }
.kpi .when { color: var(--faint); font-size: 11px; margin-top: 2px; }
.stagebar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); margin: 8px 0 6px; }
.stagebar span { display: block; height: 100%; background: var(--chip, var(--c8)); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 8px 0 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; }

.chart { width: 100%; max-width: 860px; height: auto; display: block; margin-top: 8px; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10px; }
.chart .nodata { fill: var(--line); }
.chart .spark { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend .chip { background: none; padding: 0; font-weight: 500; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .tabs button, .link { transition: color 120ms ease, border-color 120ms ease; }
}

/* --- For you (rfx#580, Kristjan 17.11) ------------------------------------------------------ */
.fy-box { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 12px 14px; margin-bottom: 14px; }
.fy-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 10px; }
.fy-head h2 { margin: 0; font-size: 15px; }
.fy-toggle { margin-left: auto; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.fy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.card.fy { display: flex; flex-direction: column; gap: 6px; }
.fy-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card.fy.plan .fy-kind, .card.fy.question .fy-kind { color: var(--accent); }
.fy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
.btn { display: inline-flex; align-items: center; border-radius: 6px; padding: 6px 10px; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 600; text-decoration: none; }
.copy { font-size: 13px; }

.over-cap { color: var(--failed); font-weight: 600; }

/* --- Cost tab (Kristjan 19.11): three figures, a quiet weight, a meter; "Cost covered by" ------- */
.kpis.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.kpi.cost { display: flex; flex-direction: column; gap: 4px; }
.kpi.cost .value { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin-top: 0; }
.kpi.cost .sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.kpi.cost .sub > div + div { margin-top: 2px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 2px 0; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter.m-near span { background: var(--held); }
.meter.m-over span { background: var(--failed); }
.kpi.cost .value .over-cap, .kpi.cost .value .near-cap { font-size: 13px; font-weight: 600; }
.near-cap { color: var(--held); font-weight: 600; }
.pace-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pace .value { font-size: 24px; font-weight: 600; }
svg .seat { fill: url(#seat-hatch); stroke: var(--c5); stroke-width: 1; }
.chart .hatch-line { stroke: var(--c5); stroke-width: 2; }
svg .ce-pending { fill: url(#ce-pending-hatch); stroke: var(--c1); stroke-width: 1; stroke-dasharray: 2 2; }
.chart .pending-line { stroke: var(--c1); stroke-width: 2; opacity: 0.55; }
.chip.ce-pending { --chip: var(--c1); }
.legend .chip.ce-pending::before { background: repeating-linear-gradient(-45deg, var(--c1) 0 2px, transparent 2px 4px); outline: 1px dashed var(--c1); opacity: 0.8; }
.chip.seat { --chip: var(--c5); }
.legend .chip.seat::before { background: repeating-linear-gradient(45deg, var(--c5) 0 2px, transparent 2px 4px); outline: 1px solid var(--c5); }
.chart .ahead { fill: var(--surface-2); }
.chart .credit-end { stroke: var(--failed); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .marker { fill: var(--failed); font-size: 10.5px; font-weight: 600; }
.chart.covered { max-width: 980px; }

/* Flow: the state of each card (Kristjan 19.11). A coloured edge and a word, never colour alone. */
.flow-sum { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-size: 13px; }
.flow-sum button {
  font: inherit; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.flow-sum button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.flow-sum button.s-moving::before { background: var(--ok); }
.flow-sum button.s-person::before { background: var(--held); }
.flow-sum button.s-stuck::before { background: var(--failed); }
.flow-sum button.s-intake::before { background: var(--line); }
.flow-sum button[aria-pressed="true"] { border-color: var(--text); font-weight: 650; }
.flow-sum button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.flow-sum .clear { color: var(--muted); }
.flow-sum .clear::before { display: none; }

.card.s-moving { border-left: 4px solid var(--ok); }
.card.s-waiting { border-left: 4px solid var(--idle); }
.card.s-person { border-left: 4px solid var(--held); }
.card.s-stuck { border-left: 4px solid var(--failed); background: var(--failed-bg); }
.card .state-word { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.card.s-moving .state-word { color: var(--ok); }
.card.s-waiting .state-word { color: var(--idle); }
.card.s-person .state-word { color: var(--held); }
.card.s-stuck .state-word { color: var(--failed); }
.card .waits { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.card .waits b { font-weight: 600; }
.card .age { font-size: 11px; padding: 1px 6px; border-radius: 4px; color: var(--held); background: var(--held-bg); }
.card .working { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.card .working.long { color: var(--held); }
.card .working.lost { color: var(--failed); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; animation: live-pulse 1.6s ease-in-out infinite; }
.working.long .live-dot { background: var(--held); }
.working.lost .live-dot { background: var(--failed); animation: none; }
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); opacity: .65; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* "Model spend by token type" (Kristjan 19.11): the share table and the reads-per-write per role. */
table.compact { margin-top: 10px; max-width: 560px; }
table.compact th, table.compact td { padding: 4px 8px; }
table.compact tr.total td { border-top: 1px solid var(--line); font-weight: 600; color: var(--text); }

/* --- Plan (Kristjan 20.11): four figures, the Gantt, the critical path ------------------------- */
.kpis.four, .kpis.five { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gantt { overflow-x: auto; margin-top: 10px; --gl: 320px; }
.g-inner { position: relative; }
.g-row { display: grid; grid-template-columns: var(--gl) 1fr; align-items: center; min-height: 30px; border-top: 1px solid var(--line); }
.g-row.g-head { border-top: 0; min-height: 22px; }
.g-row.g-group { min-height: 26px; }
.g-row.g-group .g-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 8px; }
.g-label {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  padding: 4px 10px 4px 2px; font-size: 13px; text-align: left;
  background: none; border: 0; cursor: default;
}
button.g-label { cursor: pointer; }
button.g-label:hover .g-name { text-decoration: underline; text-underline-offset: 2px; }
.g-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.g-count { margin-left: auto; color: var(--muted); font-size: 12px; flex: none; }
.g-still { width: 9px; height: 9px; flex: none; }
.g-row.moving { background: color-mix(in srgb, var(--ok) 8%, transparent); }
.g-row.moving .g-name { font-weight: 600; }
.g-track { position: relative; height: 30px; }
.g-axis { height: 22px; }
.g-tick { position: absolute; top: 3px; font-size: 10.5px; color: var(--faint); padding-left: 3px; border-left: 1px solid var(--line); line-height: 16px; white-space: nowrap; }
.g-tick.month { color: var(--text); font-weight: 650; }
.g-band { position: absolute; top: 8px; height: 14px; border-radius: 4px; min-width: 3px; }
.g-band.b-done { background: var(--accent); }
.g-band.b-plan { background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.g-band.b-plan.est { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 45%, var(--surface)) 0 4px, var(--surface) 4px 7px); outline: 1px dashed var(--accent); outline-offset: -1px; }
.g-band.b-wait { background: var(--held); }
.g-band.b-risk { background: var(--failed); opacity: .75; }
.g-band.b-range { background: repeating-linear-gradient(45deg, var(--faint) 0 2px, transparent 2px 6px); opacity: .7; }
.g-band.open-ended { -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent); mask-image: linear-gradient(90deg, #000 55%, transparent); }
.g-note { position: absolute; top: 7px; padding: 0 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; line-height: 16px; }
.g-note.left { text-align: right; }
.g-note.cut { overflow: hidden; text-overflow: ellipsis; }
.g-over { position: absolute; top: 0; bottom: 0; left: var(--gl); right: 0; pointer-events: none; }
.g-line { position: absolute; top: 22px; bottom: 0; width: 0; border-left: 2px solid var(--running); }
.g-line.l-deadline { border-left: 2px dashed var(--text); }
.g-line.l-credit { border-left: 2px dashed var(--failed); }
.g-line-label { position: absolute; top: 3px; font-size: 10.5px; font-weight: 650; white-space: nowrap; padding: 0 4px; line-height: 16px; background: var(--surface); }
.g-line-label.l-today { color: var(--running); }
.g-line-label.l-deadline { color: var(--text); }
.g-line-label.l-credit { color: var(--failed); }
.g-detail { grid-column: 1 / -1; padding: 6px 4px 12px 18px; border-top: 1px dashed var(--line); background: var(--surface-2); }
.g-detail .note { margin-top: 0; }
.g-moving { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ok); }
table.g-issues { max-width: none; margin-top: 6px; }
table.g-issues td.g-where { white-space: nowrap; color: var(--muted); }
.g-legend .g-key { display: inline-flex; align-items: center; gap: 6px; }
.g-legend .g-key::before { content: ""; width: 18px; height: 10px; border-radius: 3px; }
.g-legend .g-key.b-done::before { background: var(--accent); }
.g-legend .g-key.b-plan::before { background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.g-legend .g-key.b-plan.est::before { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 45%, var(--surface)) 0 3px, var(--surface) 3px 5px); outline: 1px dashed var(--accent); }
.g-legend .g-key.b-wait::before { background: var(--held); }
.g-legend .g-key.b-risk::before { background: var(--failed); opacity: .75; }
.g-legend .g-key.b-range::before { background: repeating-linear-gradient(45deg, var(--faint) 0 2px, transparent 2px 5px); }
.g-legend .g-key.k-moving::before { display: none; }
.g-legend .g-key.l-today::before { width: 0; height: 12px; border-left: 2px solid var(--running); border-radius: 0; }
.g-legend .g-key.l-deadline::before { width: 0; height: 12px; border-left: 2px dashed var(--text); border-radius: 0; }
.g-legend .g-key.l-credit::before { width: 0; height: 12px; border-left: 2px dashed var(--failed); border-radius: 0; }
@media (max-width: 760px) {
  .gantt { --gl: 170px; }
  .g-label { font-size: 12px; }
}

/* --- Agents tab (Kristjan 20.11): live control; today's budget, slots by role ------------------- */
.panel.budget .bar { margin-bottom: 8px; }
.panel.budget .order { font-size: 12.5px; font-weight: 600; color: var(--text); }
.budget-row { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.budget-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.budget-cell .label { color: var(--muted); font-size: 12px; }
.budget-cell .value { font-size: 18px; font-weight: 600; }
.budget-cell .value .over-cap, .budget-cell .value .near-cap { font-size: 12px; }
.budget-cell .sub { color: var(--muted); font-size: 12px; }
.slot-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.slot { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.slot .num { color: var(--text); font-weight: 600; }
.slot.busy { border-color: var(--running); }
.slot.busy .num { color: var(--running); }
.slot.full { border-color: var(--held); background: var(--held-bg); }
.slot.full .num { color: var(--held); }

/* --- Log (rfx#1372): release notes, the merge train collapsed ------------------------------ */
.log-prod { margin: 4px 0 10px; }
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.release-head h3 { margin: 0; }
.release-when { color: var(--muted); font-size: 12px; }
.release-link { margin-left: auto; font-size: 12px; }
.release.small h3 { font-size: 13px; }
.release .group { margin-top: 10px; }
.release h4, .release summary { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.release summary { cursor: pointer; }
ul.features { margin: 0; padding-left: 18px; }
ul.features li { margin: 2px 0; overflow-wrap: anywhere; }
ul.features a.num { color: var(--accent); }
ul.features .pr { color: var(--faint); font-size: 12px; }
.log-line { color: var(--muted); font-size: 12px; margin: 8px 2px; }
details.train > summary { cursor: pointer; font-weight: 600; }
table.log td:first-child { white-space: nowrap; }
table.log td .note { margin-top: 2px; overflow-wrap: anywhere; }
