/* ============================================================================
   CleanOps — "Concrete & Signal"

   Three value planes carry the whole hierarchy, so almost nothing needs a
   shadow: an ink rail (the console), a cool concrete ground (the yard), and
   paper surfaces (the worksurface). Amber is the only accent and it always
   means the same thing — this needs you.

   One typeface, Archivo Variable. Its width axis does the work a second
   family usually does: extended for titles, normal for prose, condensed with
   tabular figures for anything that has to be scanned in a column.
   ========================================================================= */

/* --- Tokens -------------------------------------------------------------- */
:root {
  /* Surfaces, darkest to lightest */
  --ink:          #14181c;   /* asphalt: rail, primary text, primary button   */
  --ink-2:        #1d2329;   /* raised ink, inside the rail                    */
  --ink-3:        #2a323a;   /* ink hairline                                   */
  --concrete:     #eaedea;   /* the ground the app sits on                     */
  --concrete-2:   #e0e4e0;   /* recessed: table heads, tracks, wells           */
  --paper:        #ffffff;   /* elevated worksurface                           */

  /* Type on light */
  --text:         #14181c;
  --text-2:       #4a545d;
  --text-3:       #5a646d;
  /* Type on ink */
  --on-ink:       #f4f6f4;
  --on-ink-2:     #a3aeb4;
  --on-ink-3:     #838f97;

  /* Lines */
  --line:         #d4dad5;
  --line-soft:    #e3e7e3;
  --line-strong:  #bcc4bd;

  /* Signal — hi-vis amber. Attention, activity, the present moment. */
  --signal:       #e08a1f;
  --signal-hover: #c87710;
  --signal-deep:  #8a5205;   /* amber that passes contrast as text on light   */
  --signal-wash:  #fbf1e0;
  --signal-line:  #eed8b4;

  /* Semantic states */
  --go:           #1e6e4f;  --go-wash:   #e4f0ea;  --go-line:   #bedcce;
  --stop:         #b3261e;  --stop-wash: #f9e6e4;  --stop-line: #eec4c0;
  --hold:         #2f6b8f;  --hold-wash: #e5eef4;  --hold-line: #bed4e2;
  --idle:         #5e6872;  --idle-wash: #e8ebe8;  --idle-line: #d4dad5;
  /* In review is its own colour: orange, between "in flight" blue and
     "delivered" green, so a queue reads at a glance. */
  --review:       #a35400;  --review-wash: #fdeedd;  --review-line: #f3cfa6;

  /* Space — 4pt base */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px;

  /* Radius — small and consistent. Nothing is a pill except chips. */
  --r1: 3px; --r2: 6px; --r3: 10px;

  /* Depth — used almost nowhere on purpose */
  --lift:  0 1px 2px rgba(20, 24, 28, .06);
  --float: 0 12px 32px -8px rgba(20, 24, 28, .22), 0 2px 6px rgba(20, 24, 28, .08);

  /* Motion */
  --fast: 110ms cubic-bezier(.2, 0, .2, 1);
  --base: 180ms cubic-bezier(.2, 0, .2, 1);
  --rail-w: 236px;
}

/* Width-axis registers. Archivo carries all three. */
.u-display { font-stretch: 112%; font-weight: 700; letter-spacing: -.018em; }
.u-data    { font-stretch: 84%;  font-weight: 600; letter-spacing: .012em;
             font-variant-numeric: tabular-nums; }

/* --- Reset --------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--concrete);
  color: var(--text);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: var(--r1);
}

::selection { background: var(--signal-wash); color: var(--ink); }

/* ============================================================================
   SHELL
   ========================================================================= */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }

/* --- The rail: the console -------------------------------------------- */
.rail {
  background: var(--ink);
  color: var(--on-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.rail-brand {
  padding: var(--s5) var(--s5) var(--s4);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rail-glyph {
  width: 26px; height: 26px; flex: none;
  border-radius: var(--r1);
  background: var(--signal);
  color: var(--ink);
  display: grid; place-items: center;
}
.rail-glyph svg { width: 15px; height: 15px; }
.rail-name {
  font-stretch: 112%; font-weight: 700; font-size: 15px;
  letter-spacing: -.01em; line-height: 1.1;
}
.rail-sub {
  font-stretch: 84%; font-weight: 600; font-size: 10.5px;
  letter-spacing: .04em; color: var(--on-ink-3); margin-top: 1px;
}

.rail-nav { padding: var(--s2) var(--s3); flex: 1; overflow-y: auto; }
.rail-sect {
  font-stretch: 84%; font-weight: 600; font-size: 10.5px;
  letter-spacing: .06em; color: var(--on-ink-3);
  padding: var(--s4) var(--s3) var(--s2);
}
.rail-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px var(--s3);
  border-radius: var(--r2);
  color: var(--on-ink-2);
  font-size: 13.5px; font-weight: 500;
  position: relative;
  transition: color var(--fast), background var(--fast);
}
.rail-link svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.rail-link:hover { color: var(--on-ink); background: var(--ink-2); }
.rail-link.active { color: var(--ink); background: var(--on-ink); font-weight: 600; }
.rail-link.active svg { opacity: 1; }
/* The amber marker is the rail's only accent — it says "you are here". */
.rail-link.active::before {
  content: ""; position: absolute; left: -9px; top: 50%;
  width: 3px; height: 18px; margin-top: -9px;
  background: var(--signal); border-radius: 0 2px 2px 0;
}
.rail-count {
  margin-left: auto;
  font-stretch: 84%; font-weight: 700; font-size: 11px;
  font-variant-numeric: tabular-nums;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--signal); color: var(--ink);
}
.rail-link.active .rail-count { background: var(--ink); color: var(--signal); }
.rail-count.is-stop { background: var(--stop); color: #fff; }
.rail-link.active .rail-count.is-stop { background: var(--stop); color: #fff; }

.rail-foot { padding: var(--s3); border-top: 1px solid var(--ink-3); }
.rail-me {
  display: flex; align-items: center; gap: 10px;
  padding: var(--s2) var(--s2) var(--s3);
}
.rail-me .who-name {
  font-size: 13px; font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rail-me .who-role {
  font-stretch: 84%; font-weight: 600; font-size: 10.5px;
  letter-spacing: .04em; color: var(--on-ink-3);
}
.rail-out {
  width: 100%;
  background: transparent;
  border: 1px solid var(--ink-3);
  color: var(--on-ink-2);
  border-radius: var(--r2);
  padding: 7px var(--s3);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.rail-out svg { width: 14px; height: 14px; }
.rail-out:hover { background: var(--ink-2); color: var(--on-ink); border-color: #3a434c; }

/* --- Worksurface ------------------------------------------------------- */
.surface { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(234, 237, 234, .88);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  padding: var(--s4) var(--s6);
  display: flex; align-items: center; gap: var(--s4);
  min-height: 64px;
}
.topbar-title { min-width: 0; }
.topbar h1 {
  font-stretch: 112%; font-weight: 700; font-size: 21px;
  letter-spacing: -.02em; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }

/* Breadcrumb: the hierarchy, spelled out, never a middot soup. */
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 3px; }
.crumb a, .crumb span {
  font-stretch: 84%; font-weight: 600; font-size: 11.5px;
  letter-spacing: .03em; color: var(--text-3);
}
.crumb a { transition: color var(--fast); }
.crumb a:hover { color: var(--signal-deep); }
.crumb .sep { color: var(--line-strong); }
.crumb .here { color: var(--text-2); }

.content { padding: var(--s5) var(--s6) var(--s8); flex: 1; }
.stack > * + * { margin-top: var(--s5); }

/* Open-the-menu control, phone and tablet only */
.burger {
  display: none;
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); background: var(--paper);
  border-radius: var(--r2); cursor: pointer;
  place-items: center;
}
.burger svg { width: 17px; height: 17px; }
.rail-scrim { display: none; }

/* ============================================================================
   SITUATION BAND — the dashboard's one bold element
   ========================================================================= */
.situation {
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--r3);
  padding: var(--s5) var(--s6);
  overflow: hidden;
}
.sit-head {
  display: flex; align-items: flex-start; gap: var(--s5);
  flex-wrap: wrap;
}
.sit-phase {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .07em; color: var(--signal);
}
.sit-name {
  font-stretch: 112%; font-weight: 700; font-size: 26px;
  letter-spacing: -.022em; line-height: 1.1; margin-top: 3px;
}
.sit-note { color: var(--on-ink-2); font-size: 13px; margin-top: 6px; max-width: 62ch; }
.sit-ratio { margin-left: auto; text-align: right; flex: none; }
.sit-ratio .n {
  font-stretch: 112%; font-weight: 700; font-size: 34px;
  letter-spacing: -.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sit-ratio .l {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .04em; color: var(--on-ink-3); margin-top: 4px;
}

.sit-track {
  margin-top: var(--s5);
  height: 6px; border-radius: 3px;
  background: var(--ink-3);
  overflow: hidden;
}
.sit-track > span {
  display: block; height: 100%;
  background: var(--signal);
  border-radius: 3px;
  width: 0;
  transition: width 620ms cubic-bezier(.16, .84, .32, 1);
}
.sit-dates {
  display: flex; justify-content: space-between;
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .03em; color: var(--on-ink-3);
  margin-top: 7px;
}
.sit-dates .late { color: var(--signal); }

/* Counters: each one is a filter, not decoration. */
.sit-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin-top: var(--s5);
  background: var(--ink-3);
  border: 1px solid var(--ink-3);
  border-radius: var(--r2);
  overflow: hidden;
}
.sit-count {
  background: var(--ink);
  padding: var(--s3) var(--s4);
  text-align: left;
  border: 0; cursor: pointer;
  display: block; width: 100%;
  transition: background var(--fast);
}
.sit-count:hover { background: var(--ink-2); }
.sit-count .n {
  font-stretch: 112%; font-weight: 700; font-size: 22px;
  line-height: 1.05; color: var(--on-ink);
  font-variant-numeric: tabular-nums;
}
.sit-count .l {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .035em; color: var(--on-ink-2); margin-top: 3px;
}
/* Each counter carries its own flag colour, so the state of the phase reads
   before a single word does. Values are lifted for legibility on ink. */
.sit-count.is-hot .n    { color: var(--signal); }
.sit-count.is-stop .n   { color: #f08a80; }
.sit-count.is-review .n { color: #f0ab5e; }
.sit-count.is-live .n   { color: #7fc0e8; }
.sit-count.is-go .n     { color: #62c79a; }
.sit-count::after {
  content: ""; display: block; height: 2px; margin-top: var(--s3);
  border-radius: 1px; background: var(--ink-3);
  transition: background var(--fast);
}
.sit-count.is-hot::after    { background: var(--signal); }
.sit-count.is-stop::after   { background: #f08a80; }
.sit-count.is-review::after { background: #f0ab5e; }
.sit-count.is-live::after   { background: #7fc0e8; }
.sit-count.is-go::after     { background: #62c79a; }
.sit-count[disabled] { cursor: default; }
.sit-count[disabled]:hover { background: var(--ink); }

/* ============================================================================
   PANELS
   ========================================================================= */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line-soft);
  min-height: 52px;
}
.panel-head h2 {
  font-size: 14px; font-weight: 650; letter-spacing: -.005em;
}
.panel-head .tail { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.panel-body { padding: var(--s5); }
.panel-body.flush { padding: 0; }
.panel-foot {
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--line-soft);
  background: #fbfcfb;
}

.count-tag {
  font-stretch: 84%; font-weight: 700; font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px; border-radius: 9px;
  background: var(--concrete-2); color: var(--text-2);
}
.count-tag.is-hot { background: var(--signal-wash); color: var(--signal-deep); }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); align-items: start; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); align-items: start; }
.cols-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s5); align-items: start; }

/* ============================================================================
   STATUS LANGUAGE
   ========================================================================= */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .025em;
  padding: 2px 8px 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--idle-line);
  background: var(--idle-wash);
  color: var(--text-2);
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip.s-in_progress { background: var(--hold-wash);   border-color: var(--hold-line);   color: var(--hold); }
.chip.s-submitted   { background: var(--review-wash); border-color: var(--review-line); color: var(--review); }
.chip.s-done,
.chip.s-completed   { background: var(--go-wash);     border-color: var(--go-line);     color: var(--go); }
.chip.s-blocked,
.chip.s-overdue,
.chip.s-at_risk     { background: var(--stop-wash);   border-color: var(--stop-line);   color: var(--stop); }
.chip.s-cancelled   { background: transparent; border-color: var(--line); color: var(--text-3); }
.chip.s-cancelled .dot { background: var(--text-3); }
.chip.s-not_broken_down { background: transparent; border-style: dashed; border-color: var(--line-strong); color: var(--text-3); }

/* Priority: a weight mark, not another coloured pill competing with status. */
.prio {
  display: inline-flex; align-items: center; gap: 4px;
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .025em; color: var(--text-2);
}
.prio i { display: block; width: 3px; height: 9px; border-radius: 1px; background: var(--line-strong); }
.prio.p-low i:nth-child(1) { background: var(--text-3); }
.prio.p-medium i:nth-child(-n+2) { background: var(--signal); }
.prio.p-high i { background: var(--stop); }

/* Avatars carry role as a quiet tint, not a rainbow. */
.avatar {
  width: 28px; height: 28px; flex: none;
  border-radius: var(--r2);
  display: grid; place-items: center;
  font-stretch: 84%; font-weight: 700; font-size: 11px;
  letter-spacing: .02em;
  background: var(--concrete-2); color: var(--text-2);
  border: 1px solid var(--line);
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; border-radius: var(--r1); }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; border-radius: var(--r2); }
.avatar.r-ops   { background: var(--ink);        color: var(--signal);   border-color: var(--ink); }
.avatar.r-coord { background: var(--signal-wash);color: var(--signal-deep); border-color: var(--signal-line); }
.avatar.r-lead  { background: var(--hold-wash);  color: var(--hold);     border-color: var(--hold-line); }
.rail .avatar { border-color: var(--ink-3); background: var(--ink-2); color: var(--on-ink); }
.rail .avatar.r-ops { background: var(--signal); color: var(--ink); border-color: var(--signal); }

/* Ticks: one mark per real task. No task, no tick — so an empty package
   reads as "not broken down" instead of a dishonest 0%. */
.ticks { display: flex; gap: 2px; align-items: center; }
.ticks i {
  display: block; height: 8px; flex: 1 1 auto; min-width: 3px; max-width: 14px;
  border-radius: 1px; background: var(--concrete-2);
}
.ticks i.t-in_progress { background: var(--hold); }
.ticks i.t-submitted   { background: var(--review); }
.ticks i.t-done        { background: var(--go); }
.ticks i.t-blocked     { background: var(--stop); }
.ticks i.t-overdue     { background: var(--stop); }
.ticks i.t-cancelled   { background: var(--line); }
.ticks.is-empty {
  height: 8px; border: 1px dashed var(--line-strong); border-radius: 2px; background: none;
}
.ticks.is-dense { background: var(--concrete-2); border-radius: 2px; overflow: hidden; gap: 0; }
.ticks.is-dense i { min-width: 0; max-width: none; border-radius: 0; }

/* Plain proportional meter, used where a per-task tick makes no sense */
.meter { height: 5px; border-radius: 3px; background: var(--concrete-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.meter.is-signal > span { background: var(--signal); }

/* ============================================================================
   TASK ROWS — a table, kept semantic, but read like a dispatch board
   ========================================================================= */
.rows { width: 100%; }
.rows thead th {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .045em; color: var(--text-3);
  text-align: left; padding: var(--s2) var(--s4);
  background: #f7f9f7;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.rows thead th.num { text-align: right; }
.rows tbody td {
  padding: 10px var(--s4);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.rows tbody tr:last-child td { border-bottom: 0; }
.rows tbody tr.row { cursor: pointer; transition: background var(--fast); }
.rows tbody tr.row:hover { background: #f8faf8; }
.rows tbody tr.row:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }

/* Left edge carries status without spending a column on it */
.rows td.edge {
  width: 3px; padding: 0;
  background: var(--line);
  border-bottom: 1px solid var(--line-soft);
}
.rows tr.e-in_progress td.edge { background: var(--hold); }
.rows tr.e-submitted   td.edge { background: var(--review); }
.rows tr.e-done        td.edge { background: var(--go); }
.rows tr.e-blocked     td.edge,
.rows tr.e-overdue     td.edge { background: var(--stop); }
.rows tr.e-cancelled   td.edge { background: var(--line-soft); }

.cell-task { min-width: 0; }
.cell-task .t {
  font-weight: 600; font-size: 13.5px; letter-spacing: -.005em;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 42ch;
}
.cell-task .t.is-struck { text-decoration: line-through; color: var(--text-3); }
.cell-task .w {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .025em; color: var(--text-3); margin-top: 1px;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 42ch;
}
.cell-owner { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.cell-owner span { font-size: 12.5px; color: var(--text-2); }
.cell-num { text-align: right; font-variant-numeric: tabular-nums; font-stretch: 84%; font-weight: 600; }

/* Deadlines read in human time, and only shout when they should. */
.due { font-size: 12.5px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.is-soon { color: var(--signal-deep); font-weight: 600; }
.due.is-late { color: var(--stop); font-weight: 600; }
.due.is-none { color: var(--text-3); }

/* ============================================================================
   LEDGER — work packages
   ========================================================================= */
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 92px;
  gap: var(--s4);
  align-items: center;
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background var(--fast);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row:hover { background: #f8faf8; }
.ledger-name {
  font-weight: 600; font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ledger-meta {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .025em; color: var(--text-3); margin-top: 2px;
}
.ledger-ratio {
  text-align: right;
  font-stretch: 84%; font-weight: 600; font-size: 12px;
  font-variant-numeric: tabular-nums; color: var(--text-2);
  white-space: nowrap;
}
.ledger-state { display: flex; justify-content: flex-end; }

/* ============================================================================
   ACTIVITY STREAM
   ========================================================================= */
.stream { position: relative; }
.stream-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: var(--s3);
  padding: var(--s3) 0;
  position: relative;
}
/* the connecting spine */
.stream-item:not(:last-child)::before {
  content: ""; position: absolute;
  left: 13px; top: 34px; bottom: -6px;
  width: 1px; background: var(--line-soft);
}
.stream-mark {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--concrete-2); color: var(--text-2);
  border: 1px solid var(--line);
  position: relative; z-index: 1;
}
.stream-mark svg { width: 13px; height: 13px; }
.stream-mark.k-go    { background: var(--go-wash);     border-color: var(--go-line);     color: var(--go); }
.stream-mark.k-stop  { background: var(--stop-wash);   border-color: var(--stop-line);   color: var(--stop); }
.stream-mark.k-hold  { background: var(--hold-wash);   border-color: var(--hold-line);   color: var(--hold); }
.stream-mark.k-sig   { background: var(--signal-wash); border-color: var(--signal-line); color: var(--signal-deep); }
.stream-text { min-width: 0; padding-top: 3px; }
.stream-text .line { font-size: 13px; color: var(--text); }
.stream-text .line b { font-weight: 650; }
.stream-text .line .quiet { color: var(--text-2); }
.stream-text .sub {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .025em; color: var(--text-3); margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   TASK DETAIL
   ========================================================================= */
.detail-head { margin-bottom: var(--s4); }
.detail-title {
  font-stretch: 112%; font-weight: 700; font-size: 25px;
  letter-spacing: -.022em; line-height: 1.18;
  max-width: 30ch;
}
.detail-flags { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }

.facts { }
.fact {
  display: grid; grid-template-columns: 92px minmax(0, 1fr);
  gap: var(--s3); align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.fact:last-child { border-bottom: 0; }
.fact dt {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .04em; color: var(--text-3);
}
.fact dd { margin: 0; font-size: 13px; min-width: 0; }

.prose { font-size: 14px; line-height: 1.65; color: var(--text); max-width: 68ch; }
.prose.is-muted { color: var(--text-3); font-style: italic; }

/* The primary action block: one obvious next move for this role and state. */
.act-block { padding: var(--s4) var(--s5); background: #fbfcfb; }
.act-lead {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .04em; color: var(--text-3); margin-bottom: var(--s3);
}
.act-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.act-row .btn { flex: none; }

/* Alert strip — a live blocker, a requested change */
.alert {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--stop-line);
  background: var(--stop-wash);
  border-radius: var(--r2);
  font-size: 13px; color: #7c1a14;
}
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--stop); }
.alert .h { font-weight: 650; display: block; }
.alert.is-signal { border-color: var(--signal-line); background: var(--signal-wash); color: #6d4104; }
.alert.is-signal svg { color: var(--signal-deep); }

/* Submissions */
.sub-item { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-soft); }
.sub-item:last-child { border-bottom: 0; }
.sub-top { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.sub-who { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.sub-when {
  margin-left: auto;
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .025em; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.sub-body {
  margin-top: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--concrete);
  border-radius: var(--r2);
  font-size: 13px; word-break: break-word;
}
.sub-body a { color: var(--hold); text-decoration: underline; text-underline-offset: 2px; }
.sub-note {
  margin-top: var(--s3); padding-left: var(--s4);
  border-left: 2px solid var(--line);
  font-size: 13px; color: var(--text-2);
}
.sub-note .h {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .04em; color: var(--text-3); display: block; margin-bottom: 2px;
}
.file-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 13px; color: var(--hold);
  border: 1px solid var(--hold-line); background: var(--hold-wash);
  padding: 5px 10px; border-radius: var(--r2); cursor: pointer;
  transition: background var(--fast);
}
.file-link:hover { background: #d9e7f0; }
.file-link svg { width: 14px; height: 14px; }

/* ============================================================================
   TEAM
   ========================================================================= */
.crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: var(--s3); align-items: start; }
.crew-card {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--paper);
  padding: var(--s4);
}
.crew-card.is-you { border-color: var(--signal-line); background: var(--signal-wash); }
.crew-top { display: flex; align-items: center; gap: 10px; }
.crew-name { font-weight: 650; font-size: 13.5px; line-height: 1.2; }
.crew-role {
  font-stretch: 84%; font-weight: 600; font-size: 10.5px;
  letter-spacing: .04em; color: var(--text-3);
}
.crew-load { margin-top: var(--s4); }
.crew-nums {
  display: flex; gap: var(--s4); margin-top: var(--s3);
  font-stretch: 84%; font-weight: 600; font-size: 11.5px;
  letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.crew-nums b { font-weight: 700; font-size: 13px; display: block; color: var(--text); }
.crew-nums .u { color: var(--text-3); }
.crew-nums .is-stop b { color: var(--stop); }
.crew-nums .is-hold b { color: var(--review); }
.crew-nums .is-go b { color: var(--go); }
.crew-idle {
  margin-top: var(--s4);
  font-size: 12.5px; color: var(--text-3);
}

/* ============================================================================
   CONTROLS
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r2);
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--on-ink);
  font-size: 13px; font-weight: 600; letter-spacing: -.003em;
  cursor: pointer; white-space: nowrap;
  position: relative;
  transition: background var(--fast), border-color var(--fast), transform var(--fast), color var(--fast);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: #232b32; border-color: #232b32; }
.btn:active { transform: translateY(1px); }

.btn.ghost { background: var(--paper); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: #f5f7f5; border-color: var(--line-strong); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.quiet:hover { background: var(--concrete-2); color: var(--text); }
.btn.go { background: var(--go); border-color: var(--go); color: #fff; }
.btn.go:hover { background: #185a40; border-color: #185a40; }
.btn.warn { background: var(--paper); color: var(--signal-deep); border-color: var(--signal-line); }
.btn.warn:hover { background: var(--signal-wash); }
.btn.bad { background: var(--paper); color: var(--stop); border-color: var(--stop-line); }
.btn.bad:hover { background: var(--stop-wash); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: var(--r1); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Busy: the label stays put, a ring spins in its place. Nothing resizes. */
.btn[data-busy] { color: transparent !important; pointer-events: none; }
.btn[data-busy]::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: var(--on-ink);
  animation: spin .6s linear infinite;
}
.btn.ghost[data-busy]::after, .btn.warn[data-busy]::after,
.btn.bad[data-busy]::after, .btn.quiet[data-busy]::after { color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--paper);
  border-radius: var(--r2); cursor: pointer; color: var(--text-2);
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: #f5f7f5; color: var(--text); border-color: var(--line-strong); }

/* The command trigger reads as a search field, because that is what it is. */
.cmd-trigger {
  display: flex; align-items: center; gap: var(--s2);
  height: 32px; padding: 0 var(--s2) 0 10px;
  border: 1px solid var(--line); background: var(--paper);
  border-radius: var(--r2); cursor: pointer;
  color: var(--text-3); font-size: 13px;
  transition: border-color var(--fast), color var(--fast);
  min-width: 190px;
}
.cmd-trigger:hover { border-color: var(--line-strong); color: var(--text-2); }
.cmd-trigger svg { width: 15px; height: 15px; }
.cmd-trigger .k {
  margin-left: auto;
  font-stretch: 84%; font-weight: 600; font-size: 10.5px;
  border: 1px solid var(--line); border-radius: var(--r1);
  padding: 1px 5px; color: var(--text-3); background: #f7f9f7;
}

/* Fields */
.field { margin-bottom: var(--s4); }
.field > label, .form-label {
  display: block;
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .04em; color: var(--text-2);
  margin-bottom: 5px;
}
input[type="text"], input[type="search"], input[type="number"], input[type="date"],
input[type="file"], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--paper);
  font-size: 13.5px;
  transition: border-color var(--fast), box-shadow var(--fast);
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(224, 138, 31, .16);
}
textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
select { appearance: none; background-image: none; padding-right: 11px; }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.toolbar {
  display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap;
  margin-bottom: var(--s4);
}
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 340px; }
.toolbar .search svg {
  position: absolute; left: 10px; top: 50%; margin-top: -8px;
  width: 15px; height: 15px; color: var(--text-3); pointer-events: none;
}
.toolbar .search input { padding-left: 32px; }
.toolbar select { width: auto; min-width: 150px; }

/* Segmented filter */
.seg {
  display: inline-flex; padding: 2px;
  background: var(--concrete-2); border-radius: var(--r2);
}
.seg button {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 11px; border-radius: var(--r1);
  font-stretch: 84%; font-weight: 600; font-size: 11.5px;
  letter-spacing: .025em; color: var(--text-2); white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--text); box-shadow: var(--lift); }

/* ============================================================================
   EMPTY + ERROR
   ========================================================================= */
.empty {
  padding: var(--s7) var(--s5);
  text-align: center;
}
.empty .glyph {
  width: 40px; height: 40px; margin: 0 auto var(--s4);
  display: grid; place-items: center;
  border-radius: var(--r2);
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
}
.empty .glyph svg { width: 18px; height: 18px; }
.empty .h { font-weight: 650; font-size: 14px; }
.empty .p { color: var(--text-3); font-size: 13px; margin-top: 5px; max-width: 46ch; margin-inline: auto; }
.empty .btn { margin-top: var(--s4); }
.empty.tight { padding: var(--s5); }

.error {
  border: 1px solid var(--stop-line);
  background: var(--stop-wash);
  color: #7c1a14;
  padding: var(--s3) var(--s4);
  border-radius: var(--r2);
  font-size: 13px;
}
.error .h { font-weight: 650; display: block; margin-bottom: 2px; }

/* ============================================================================
   LOADING — skeletons that match the shape of the thing they replace
   ========================================================================= */
.sk {
  background: linear-gradient(90deg, var(--concrete-2) 25%, #eef1ee 37%, var(--concrete-2) 63%);
  background-size: 400% 100%;
  animation: shim 1.4s ease-in-out infinite;
  border-radius: var(--r1);
  height: 10px;
}
@keyframes shim { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-band { height: 168px; border-radius: var(--r3); }
.sk-row { display: flex; gap: var(--s4); align-items: center; padding: 13px var(--s5); border-bottom: 1px solid var(--line-soft); }
.sk-row:last-child { border-bottom: 0; }
.sk-row .sk:nth-child(1) { flex: 3; }
.sk-row .sk:nth-child(2) { flex: 1; }
.sk-row .sk:nth-child(3) { flex: 1; }

/* Revalidation: a hairline crawl at the very top. Never blocks reading. */
.refreshing {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 90; background: transparent; overflow: hidden;
}
.refreshing span {
  display: block; height: 100%; width: 34%;
  background: var(--signal);
  animation: crawl 1.1s ease-in-out infinite;
}
@keyframes crawl {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ============================================================================
   MODAL
   ========================================================================= */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 24, 28, .42);
  display: grid; place-items: center;
  padding: var(--s4);
  animation: fade var(--base) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Content arriving over a skeleton settles rather than snaps. */
.is-arriving { animation: arrive 200ms cubic-bezier(.2, 0, .2, 1) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Capped table footer */
.rows-more {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--line-soft);
  background: #fbfcfb;
}
.rows-more-n {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .035em; color: var(--text-3);
}
.modal {
  background: var(--paper);
  border-radius: var(--r3);
  box-shadow: var(--float);
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  animation: pop var(--base) cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: var(--s3);
}
.modal-head h2 { font-size: 15px; font-weight: 650; }
.modal-head .icon-btn { margin-left: auto; border-color: transparent; background: transparent; }
.modal-body { padding: var(--s5); }
.modal-foot {
  padding: var(--s3) var(--s5) var(--s5);
  display: flex; gap: var(--s2); justify-content: flex-end;
}

/* ============================================================================
   COMMAND PALETTE
   ========================================================================= */
.cmd-back {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(20, 24, 28, .38);
  display: flex; justify-content: center;
  padding: 12vh var(--s4) var(--s4);
  animation: fade var(--fast) both;
}
.cmd {
  background: var(--paper);
  border-radius: var(--r3);
  box-shadow: var(--float);
  width: min(560px, 100%);
  max-height: 62vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pop var(--base) cubic-bezier(.2, .9, .3, 1) both;
}
.cmd-input { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-soft); }
.cmd-input svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.cmd-input input { border: 0; padding: 0; font-size: 15px; background: none; }
.cmd-input input:focus { box-shadow: none; }
.cmd-list { overflow-y: auto; padding: var(--s2) 0 var(--s3); }
.cmd-group {
  font-stretch: 84%; font-weight: 600; font-size: 10.5px;
  letter-spacing: .05em; color: var(--text-3);
  padding: var(--s3) var(--s5) 5px;
}
.cmd-item {
  display: flex; align-items: center; gap: var(--s3);
  padding: 8px var(--s5); cursor: pointer;
  border: 0; background: none; width: 100%; text-align: left;
}
.cmd-item svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.cmd-item .l { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item .r {
  margin-left: auto; flex: none;
  font-stretch: 84%; font-weight: 600; font-size: 11px; color: var(--text-3);
}
.cmd-item.on { background: var(--signal-wash); }
.cmd-item.on svg { color: var(--signal-deep); }

/* ============================================================================
   TOAST
   ========================================================================= */
.toasts {
  position: fixed; bottom: var(--s5); right: var(--s5); z-index: 120;
  display: flex; flex-direction: column; gap: var(--s2);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--on-ink);
  padding: 10px var(--s4);
  border-radius: var(--r2);
  box-shadow: var(--float);
  font-size: 13px; font-weight: 500;
  animation: toast-in 240ms cubic-bezier(.2, .9, .3, 1) both;
  max-width: 380px;
}
.toast svg { width: 16px; height: 16px; flex: none; color: var(--signal); }
.toast.is-go svg { color: #5fd39c; }
.toast.is-stop svg { color: #f08a80; }
.toast.leaving { animation: toast-out 180ms ease-in both; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ============================================================================
   SIGN IN
   ========================================================================= */
.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--concrete);
}
.gate-art {
  background: var(--ink);
  color: var(--on-ink);
  padding: var(--s8) var(--s7);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
/* A street grid, drawn in CSS: the product's subject, not an illustration. */
.gate-art::before {
  content: ""; position: absolute; inset: -20%;
  background-image:
    linear-gradient(var(--ink-3) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-3) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: rotate(-12deg);
  opacity: .5;
  mask-image: radial-gradient(120% 90% at 30% 40%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 30% 40%, #000 20%, transparent 72%);
}
.gate-art > * { position: relative; }
.gate-brand { display: flex; align-items: center; gap: 10px; }
.gate-mark {
  width: 30px; height: 30px; border-radius: var(--r2);
  background: var(--signal); color: var(--ink);
  display: grid; place-items: center;
}
.gate-mark svg { width: 17px; height: 17px; }
.gate-brand .n { font-stretch: 112%; font-weight: 700; font-size: 17px; letter-spacing: -.012em; }
.gate-kicker {
  font-stretch: 84%; font-weight: 600; font-size: 10.5px;
  letter-spacing: .09em; color: var(--signal); margin-top: 1px;
}
/* The headline types itself once; the caret stops blinking when it lands. */
.gate-line .type::after {
  content: ""; display: inline-block;
  width: .06em; height: .86em; margin-left: .06em;
  background: var(--signal); vertical-align: -.06em;
  opacity: 0;
}
.gate-line .type.is-typing::after { opacity: 1; animation: caret 900ms steps(1) infinite; }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.gate-line { min-height: 1.04em; }
.gate-line {
  font-stretch: 112%; font-weight: 700;
  font-size: clamp(30px, 4.2vw, 46px);
  letter-spacing: -.03em; line-height: 1.04;
  max-width: 15ch;
}
.gate-sub { color: var(--on-ink-2); font-size: 14.5px; margin-top: var(--s4); max-width: 38ch; line-height: 1.6; }
.gate-legend { display: flex; gap: var(--s5); flex-wrap: wrap; }
.gate-legend div {
  font-stretch: 84%; font-weight: 600; font-size: 11px;
  letter-spacing: .04em; color: var(--on-ink-3);
}
.gate-legend b { display: block; font-stretch: 112%; font-weight: 700; font-size: 19px; color: var(--on-ink); letter-spacing: -.01em; }

.gate-form { display: grid; place-items: center; padding: var(--s7) var(--s6); }
.gate-box { width: min(380px, 100%); }
.gate-box h1 {
  font-stretch: 112%; font-weight: 700; font-size: 24px;
  letter-spacing: -.022em;
}
.gate-box .lead { color: var(--text-2); font-size: 14px; margin-top: 7px; line-height: 1.6; }
.gate-box form { margin-top: var(--s6); }
.gate-box input {
  font-size: 17px; padding: 11px 13px;
  font-stretch: 84%; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase;
}
.gate-box input::placeholder { letter-spacing: .04em; text-transform: none; font-weight: 500; color: var(--text-3); }
.gate-box .btn { margin-top: var(--s3); }
.gate-note { font-size: 12.5px; color: var(--text-3); margin-top: var(--s5); line-height: 1.6; }
.gate-err { margin-top: var(--s3); }

/* ============================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1180px) {
  :root { --rail-w: 208px; }
  .content { padding: var(--s5) var(--s5) var(--s7); }
  .topbar { padding: var(--s4) var(--s5); }
  .cols-side { grid-template-columns: minmax(0, 1fr) 288px; }
}

@media (max-width: 1000px) {
  .cols-2, .cols-3, .cols-side { grid-template-columns: 1fr; }
  .situation { padding: var(--s5); }
  .sit-ratio { margin-left: 0; text-align: left; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 272px; height: 100%;
    transform: translateX(-100%);
    transition: transform var(--base);
    box-shadow: var(--float);
  }
  .rail.open { transform: none; }
  .rail-scrim {
    display: block; position: fixed; inset: 0; z-index: 39;
    background: rgba(20, 24, 28, .4);
    opacity: 0; pointer-events: none;
    transition: opacity var(--base);
  }
  .rail-scrim.open { opacity: 1; pointer-events: auto; }
  .burger { display: grid; }
  .gate { grid-template-columns: 1fr; }
  .gate-art { padding: var(--s6) var(--s5); gap: var(--s6); min-height: 300px; }
  .gate-form { padding: var(--s6) var(--s5) var(--s7); place-items: start center; }
  .cmd-trigger { min-width: 0; width: 32px; padding: 0; justify-content: center; }
  .cmd-trigger .t, .cmd-trigger .k { display: none; }
}

@media (max-width: 620px) {
  .content { padding: var(--s4) var(--s4) var(--s7); }
  .topbar { padding: var(--s3) var(--s4); min-height: 56px; }
  .topbar h1 { font-size: 18px; }
  .situation { padding: var(--s4); border-radius: var(--r2); }
  .sit-name { font-size: 21px; }
  .sit-counts { grid-template-columns: 1fr 1fr; }
  .panel { border-radius: var(--r2); }
  .panel-head, .panel-body { padding-left: var(--s4); padding-right: var(--s4); }
  .ledger-row { grid-template-columns: minmax(0, 1fr) 78px; padding: var(--s3) var(--s4); }
  .ledger-row .ledger-track { display: none; }
  /* The final crumb repeats the page title below it — on a phone that costs a
     whole line, so keep only the trail that leads back up. */
  .crumb { flex-wrap: nowrap; overflow: hidden; }
  .crumb .here { display: none; }
  .crumb .sep:has(+ .here) { display: none; }
  .detail-title { font-size: 21px; }
  .crew { grid-template-columns: 1fr; }
  .toasts { left: var(--s4); right: var(--s4); bottom: var(--s4); }
  .toast { max-width: none; }
  /* A seven-column board cannot survive a phone, and sideways scrolling hides
     the two things that matter. Each row restacks: the task owns a line, the
     dispatch facts wrap under it, the status edge stays a vertical bar. */
  .scroll-x { overflow-x: visible; }
  .rows { min-width: 0; }
  .rows thead { display: none; }
  .rows, .rows tbody, .rows tr, .rows td { display: block; }
  .rows tbody tr.row {
    position: relative;
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px var(--s3);
    padding: var(--s3) var(--s4) var(--s3) calc(var(--s4) + 2px);
    border-bottom: 1px solid var(--line-soft);
  }
  .rows tbody tr:last-child { border-bottom: 0; }
  .rows tbody td { padding: 0; border-bottom: 0; }
  .rows td.edge {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; height: auto; border-bottom: 0;
  }
  .rows td.cell-task { flex: 1 0 100%; }
  /* Six filters do not fit 360px; one shallow swipe beats a two-line strip. */
  .seg { display: flex; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: 0 0 auto; }
  .cell-task .t, .cell-task .w { max-width: none; }
}

/* ============================================================================
   REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .sit-track > span { transition: none; }
  .sk { animation: none; background: var(--concrete-2); }
  .refreshing span { animation: none; width: 100%; opacity: .5; }
}

/* Print: the worksurface only. */
@media print {
  .rail, .topbar-tools, .burger, .act-block, .toasts { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; }
  .panel { border-color: #ccc; }
}
