/* ============================================================================
   Budget Workstation (explorer/workstation.html). Loads AFTER tool.css: the
   topbar, grain and tokens are the Explorer's; this file is the tri-pane.
   Every colour is a token (or a token mixed with transparency) so the Light
   theme in appearance.js flips it — a hard-coded surface renders as an
   unreadable block under it (web/CLAUDE.md, "Every colour in that component
   is a token").
   Voices: Instrument Serif for headlines and display numerals, Inter caps for
   furniture, JetBrains Mono for every figure and code.
   ========================================================================== */
.ws-page .app { height: 100vh; }
.ws { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 0; position: relative; }
body.ws-has-dossier .ws { grid-template-columns: 280px minmax(0, 1fr) 470px; }

/* ---- rail ---------------------------------------------------------------- */
.ws-rail { border-right: 1px solid var(--line); overflow-y: auto; padding: 1.1rem 1rem 3rem; background: var(--bg-panel); }
.ws-blk { margin-bottom: 1.25rem; }
.ws-blk--foot { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.ws-lbl { display: block; font: 700 .6875rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .55rem; }
.ws-input { width: 100%; box-sizing: border-box; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: .55rem .7rem; font: 400 .85rem var(--sans); }
.ws-input:focus { outline: none; border-color: var(--accent); }
select.ws-input { font-size: .8rem; }
.ws-hint { font: 400 .6875rem/1.5 var(--mono); color: var(--ink-faint); margin-top: .45rem; }
.ws-hint a, .ws-link { color: var(--accent-ink,var(--accent)); text-decoration: none; }
.ws-link { font: 500 .72rem var(--mono); display: inline-block; margin-top: .4rem; }
.ws-tokens { margin-top: .5rem; font: 400 .6875rem/1.7 var(--mono); color: var(--ink-dim); }
.ws-tokens summary { cursor: pointer; color: var(--ink-faint); }
.ws-tokens code { color: var(--accent-soft); background: var(--bg-soft); padding: 0 .25rem; border-radius: 3px; }
.ws-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ws-chip { font: 500 .6875rem var(--mono); color: var(--ink-dim); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .28rem .65rem; cursor: pointer; }
.ws-chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.ws-chip.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.ws-facet { display: flex; flex-direction: column; gap: .1rem; }
.ws-frow { display: flex; align-items: center; gap: .5rem; padding: .22rem .2rem; border-radius: 5px; cursor: pointer; font: 400 .8rem var(--sans); color: var(--ink-dim); }
.ws-frow:hover { background: var(--row); color: var(--ink); }
.ws-frow.on { color: var(--ink); }
.ws-frow input { accent-color: var(--accent); margin: 0; }
.ws-fname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-fcount { font: 400 .6875rem var(--mono); color: var(--ink-faint); }

/* ---- buttons, pills, generic ------------------------------------------- */
.ws-btn { font: 500 .72rem var(--mono); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .38rem .8rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.ws-btn:hover { border-color: var(--ink-faint); }
.ws-btn--acc { color: var(--accent-ink,var(--accent)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ws-dim { color: var(--ink-faint); }
.ws-small { font-size: .74rem; }
.ws-acc { color: var(--accent-ink,var(--accent)); }
.up { color: var(--good); }
.dn { color: var(--warn); }
.ws-pill { font: 600 .6875rem var(--mono); color: var(--accent-ink,var(--accent)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 999px; padding: .15rem .5rem; }
.ws-note { font: 400 .74rem/1.6 var(--sans); color: var(--ink-faint); max-width: 70rem; margin: 1rem 0; }
/* civilian: Treasury's fee-funded offices, named under the grid with no figure */
.ws-fee { max-width: 70rem; margin: 1rem 0; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 6px; }
.ws-fee p { margin: .3rem 0 .4rem; font-size: .8rem; line-height: 1.5; }
.ws-fee ul { margin: 0; padding-left: 1.1rem; font-size: .84rem; line-height: 1.7; }
.ws-feetag { font: 600 .6875rem/1 var(--sans); text-transform: uppercase; letter-spacing: .04em; padding: .15rem .35rem; border-radius: 3px; border: 1px solid var(--line); color: var(--ink-dim); }
.ws-callout { border-left: 2px solid var(--warn); background: color-mix(in srgb, var(--warn) 7%, transparent); padding: .6rem .8rem; font: 400 .78rem/1.55 var(--sans); color: var(--ink-dim); margin: .6rem 0; border-radius: 0 6px 6px 0; }
.ws-callout b { color: var(--ink); }
mark.kw { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--ink); border-radius: 2px; padding: 0 1px; }
/* light mode: a 28% amber wash vanishes on the cream, amber-tinted rows — use a
   solid fill with a darker underline so the keyword reads at a glance */
body.light mark.kw { background: #f6c76f; color: #14110a; box-shadow: inset 0 -2px 0 #b06a08; font-weight: 600; }

/* ---- main ---------------------------------------------------------------- */
.ws-main { overflow-y: auto; padding: 1.3rem clamp(1rem, 2.2vw, 2rem) 5rem; min-width: 0; }
.ws-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 1.1rem; }
/* the defense row carries six tiles when the bundle has a summary block (the mandatory tile);
   at five columns the sixth wrapped onto a row of its own */
.ws-kpis--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ws-kpi { padding: .9rem 1.1rem; border-right: 1px solid var(--line); min-width: 0; }
.ws-kpi:last-child { border-right: 0; }
.ws-kpi__n { font: 400 2rem/1.05 var(--serif); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-kpi__n small { font: 400 .8rem var(--mono); color: var(--ink-dim); margin-left: .25rem; }
.ws-kpi__n.acc { color: var(--accent-ink,var(--accent)); }
.ws-kpi__n.up { color: var(--good); }
.ws-kpi__n.dn { color: var(--warn); }
.ws-kpi__l { font: 400 .7rem/1.4 var(--sans); color: var(--ink-dim); margin-top: .35rem; }
.ws-tabs, .ws-dtabs { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ws-tab { font: 600 .6875rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .42rem .85rem; cursor: pointer; }
.ws-tab:hover { color: var(--ink); }
.ws-tab.on { color: var(--accent-ink,var(--accent)); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ws-tabs__sp { flex: 1; }
.ws-scope { font: 400 .7rem var(--mono); color: var(--ink-faint); }

.ws-gridbar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .6rem; }
.ws-gridbar .ws-lbl { margin: 0; color: var(--accent-ink,var(--accent)); }
.ws-gridbar .ws-dim { font: 400 .6875rem var(--mono); }
.ws-gridwrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: calc(100vh - 290px); }
.ws-grid { width: 100%; border-collapse: collapse; font: 400 .78rem var(--sans); }
.ws-grid thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-soft); font: 700 .6875rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ws-grid thead th.sortable { cursor: pointer; }
.ws-grid thead th.sortable:hover { color: var(--ink); }
.ws-grid th sup { color: var(--accent-ink,var(--accent)); }
.ws-grid td { padding: .6rem .6rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ws-grid .num, .ws-ctab .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-row { cursor: pointer; }
.ws-row:hover td { background: var(--row); }
.ws-row.sel td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ws-row.sel td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.ws-cb { width: 1.6rem; }
.ws-cb input { accent-color: var(--accent); }
.ws-code { font: 500 .78rem var(--mono); color: var(--ink); white-space: nowrap; }
.ws-sub { font: 400 .6875rem/1.45 var(--mono); color: var(--ink-faint); }
.ws-sub.ws-ended { color: var(--warn); text-transform: uppercase; letter-spacing: .08em; }
.ws-title { min-width: 280px; max-width: 460px; }
.ws-t { font: 500 .84rem/1.35 var(--sans); color: var(--ink); }
.ws-kids { font: 500 .6875rem var(--mono); color: var(--accent-ink,var(--accent)); background: none; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 4px; padding: 0 .35rem; cursor: pointer; }
.ws-flags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
.ws-flag { font: 600 .6875rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); border: 1px solid var(--line); border-radius: 4px; padding: .1rem .35rem; }
.ws-flag--cliff, .ws-flag--ends { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.ws-flag--hockey { color: var(--accent-ink,var(--accent)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ws-flag--ramp { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.ws-flag--msar { color: var(--accent-soft); }
.ws-flag--hit { color: var(--accent-ink,var(--accent)); border-color: var(--accent); }
.ws-flag--so { color: var(--ink-dim); border-style: dashed; }
.ws-svc { font: 700 .6875rem var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: .15rem .4rem; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-dim); white-space: nowrap; }
.ws-svc--army { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.ws-svc--navy { color: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.ws-svc--af { color: var(--accent-ink,var(--accent)); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.ws-svc--sf { color: var(--ink); border-color: var(--ink-faint); }
.ws-vend { max-width: 220px; font-size: .74rem; color: var(--ink-dim); }
.ws-mk { display: inline-block; font: 500 .6875rem var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: .05rem .3rem; margin: 0 .2rem .2rem 0; white-space: nowrap; }
.ws-mk.up { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.ws-mk.dn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.ws-match { margin-top: .45rem; border-left: 2px solid var(--accent); padding: .3rem .55rem; background: color-mix(in srgb, var(--accent) 5%, transparent); border-radius: 0 5px 5px 0; }
.ws-match__where { display: block; font: 600 .6875rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink,var(--accent)); }
.ws-match__text { display: block; font: 400 .74rem/1.5 var(--sans); color: var(--ink-dim); margin-top: .2rem; }
.ws-drawer td { background: var(--bg-panel); }
.ws-kidtab { width: 100%; border-collapse: collapse; font: 400 .74rem var(--sans); }
.ws-kidtab th { font: 700 .6875rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); text-align: left; padding: .3rem .4rem; }
.ws-kidtab td { padding: .3rem .4rem; border-top: 1px solid var(--line-soft); }
.ws-kidtab .num { text-align: right; font-family: var(--mono); }
.ws-kidtab tr.hit td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ws-empty { text-align: center; padding: 2.5rem; color: var(--ink-faint); }
.ws-more { text-align: center; margin: .9rem 0; }
.ws-spark { display: block; }
.ws-spark .sp-a, .ws-fbar .sp-a { fill: var(--ink-faint); background: var(--ink-faint); }
.ws-spark .sp-e, .ws-fbar .sp-e { fill: var(--ink-dim); background: var(--ink-dim); }
.ws-spark .sp-r, .ws-fbar .sp-r { fill: var(--accent); background: var(--accent); }
.ws-spark .sp-o, .ws-fbar .sp-o { fill: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 45%, transparent); }
.ws-spark .sp-n { fill: var(--line); }

/* ---- analytic views ---------------------------------------------------- */
.ws-head { margin: .4rem 0 1rem; max-width: 62rem; }
.ws-head h2 { font: 400 1.9rem/1.15 var(--serif); margin: .3rem 0 .5rem; color: var(--ink); }
.ws-head h3 { font: 400 1.35rem var(--serif); margin: 1.4rem 0 .3rem; }
.ws-head p { font: 400 .85rem/1.6 var(--sans); color: var(--ink-dim); margin: 0; }
.ws-head b { color: var(--ink); font-weight: 600; }
.ws-kicker { font: 700 .6875rem var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--accent-ink,var(--accent)); }
.ws-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ws-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-col { border: 1px solid var(--line); border-radius: 10px; padding: 1rem; background: var(--bg-panel); min-width: 0; }
.ws-colhead { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ws-colhead h3 { font: 400 1.25rem var(--serif); margin: 0; }
.ws-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.ws-card { border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; margin-top: .6rem; cursor: pointer; background: var(--bg); }
.ws-card:hover { border-color: var(--ink-faint); }
.ws-card--cliff, .ws-card--ends { border-left: 2px solid var(--warn); }
.ws-card--hockey { border-left: 2px solid var(--accent); }
.ws-card--ramp { border-left: 2px solid var(--good); }
.ws-card__top { display: flex; justify-content: space-between; align-items: center; }
.ws-card__t { font: 500 .84rem/1.35 var(--sans); margin: .3rem 0; }
.ws-card__row { display: flex; align-items: flex-end; gap: .7rem; }
.ws-card__m { font: 400 .7rem/1.4 var(--mono); color: var(--ink-dim); }
.ws-card__msar { font: 400 .6875rem/1.5 var(--mono); color: var(--ink-faint); margin-top: .4rem; }
.ws-card__msar a { color: var(--accent-soft); }
.ws-bills { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ws-dl { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 0 0 1rem; }
.ws-dl__t { font-size: .84rem; color: var(--ink-dim); }
.ws-bill { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .75rem; min-width: 180px; }
.ws-bill__n a, .ws-bill__n { font: 500 .78rem var(--mono); color: var(--accent-ink,var(--accent)); text-decoration: none; }
.ws-bill__s { font: 400 .78rem var(--sans); color: var(--ink); margin: .2rem 0; }
.ws-bar { padding: .45rem 0; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.ws-bar:hover span { color: var(--accent-ink,var(--accent)); }
.ws-bar__top { display: flex; justify-content: space-between; gap: .6rem; font: 400 .8rem var(--sans); }
.ws-bar__top b { font: 500 .78rem var(--mono); color: var(--accent-ink,var(--accent)); white-space: nowrap; }
.ws-bar__track { height: 3px; background: var(--line); border-radius: 2px; margin: .3rem 0; }
.ws-bar__track i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.ws-ctab { width: 100%; border-collapse: collapse; font: 400 .76rem var(--sans); margin: .4rem 0; }
.ws-ctab th { font: 700 .6875rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.ws-ctab td { padding: .4rem .4rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ws-ctab a, .ws-cmp a, .ws-msar a, .ws-markrow a, .ws-cite a { color: var(--accent-ink,var(--accent)); text-decoration: none; }
.ws-cmp { border-collapse: collapse; font: 400 .8rem var(--sans); min-width: 100%; }
.ws-cmp th, .ws-cmp td { padding: .5rem .7rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; min-width: 200px; }
.ws-cmp tbody th { font: 700 .6875rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); min-width: 150px; }
.ws-cmp thead th { position: relative; background: var(--bg-soft); }
.ws-x { position: absolute; top: .4rem; right: .4rem; background: none; border: 0; color: var(--ink-faint); cursor: pointer; }

/* ---- dossier ----------------------------------------------------------- */
.ws-dossier { display: none; border-left: 1px solid var(--line); overflow-y: auto; padding: 1rem 1.2rem 4rem; background: var(--bg-panel); min-width: 0; }
body.ws-has-dossier .ws-dossier { display: block; }
.ws-dos__bar { display: flex; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.ws-crumb { font: 400 .6875rem var(--mono); color: var(--ink-faint); }
.ws-dos__t { font: 400 1.7rem/1.15 var(--serif); margin: .3rem 0 .5rem; }
.ws-dos__acts { display: flex; gap: .4rem; flex-wrap: wrap; margin: .8rem 0; }
.ws-kpis--dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-kpis--dos .ws-kpi { border-bottom: 1px solid var(--line); }
.ws-kpis--dos .ws-kpi:nth-child(2n) { border-right: 0; }
.ws-kpis--dos .ws-kpi__n { font-size: 1.5rem; }
.ws-ask { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ws-ask .ws-lbl { margin: 0 .3rem 0 0; color: var(--accent-ink,var(--accent)); }
.ws-sec { margin: 1rem 0 1.3rem; }
.ws-sec__h { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--line); padding-bottom: .35rem; margin-bottom: .4rem; }
.ws-sec__h h4 { font: 700 .6875rem var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); margin: 0; }
.ws-kv { display: grid; gap: .3rem; margin: .6rem 0; }
.ws-kv div { display: flex; justify-content: space-between; gap: 1rem; font: 400 .8rem var(--sans); color: var(--ink-dim); border-bottom: 1px solid var(--line-soft); padding: .3rem 0; }
.ws-kv b { font: 500 .8rem var(--mono); color: var(--ink); }
.ws-fbars { display: flex; align-items: flex-end; gap: .4rem; height: 160px; padding-top: .5rem; }
.ws-fbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.ws-fbar i { display: block; width: 70%; border-radius: 2px 2px 0 0; }
/* the reconciliation (mandatory) segment, stacked on the regular bar (2026-11-20) */
.ws-fbar .sp-m, .ws-sw.sp-m { background: var(--ov-rec, #8e6fe0); }
.ws-fbar--stk i + i { border-radius: 0; }
.ws-flegend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: .5rem 0 0; font-size: .72rem; color: var(--ink-dim); }
.ws-sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; }
.ws-sw.sp-r { background: var(--accent); }
.ws-fbar__v { font: 400 .6875rem var(--mono); color: var(--ink-dim); margin-bottom: .2rem; white-space: nowrap; }
.ws-fbar__y { font: 500 .6875rem var(--mono); color: var(--ink); margin-top: .25rem; }
.ws-markrow { display: flex; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--line-soft); font: 400 .8rem var(--sans); }
.ws-markrow b { font: 500 .8rem var(--mono); white-space: nowrap; }
.ws-om { font: 400 .76rem/1.5 var(--sans); color: var(--ink-dim); padding: .35rem 0; border-bottom: 1px solid var(--line-soft); }
.ws-om span { font: 500 .72rem var(--mono); }
.ws-msar { padding: .35rem 0; }
.ws-narr { margin: .8rem 0; }
.ws-narr p { font: 400 .8rem/1.6 var(--sans); color: var(--ink-dim); margin: .2rem 0 .7rem; }
.ws-acts { font: 400 .78rem/1.6 var(--sans); color: var(--ink-dim); padding-left: 1.1rem; }
.ws-cite { font: 400 .7rem/1.5 var(--mono); color: var(--ink-faint); border-top: 1px solid var(--line); padding-top: .7rem; margin-top: 1rem; }

/* six tiles too narrow for one row: two rows of three (below 861px the 2-column rule takes over) */
@media (min-width: 861px) and (max-width: 1280px) {
  .ws-kpis--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ws-kpis--6 .ws-kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .ws-kpis--6 .ws-kpi:nth-child(3n) { border-right: 0; }
}
/* With the dossier open the grid pane is ~690 px at 1440: six KPI tiles in one row cut their
   figures to "$93…" (Kevin's UX review, 2026-12-02), so they take two rows of three, as below 1280. */
@media (min-width: 1281px) {
  body.ws-has-dossier .ws-kpis--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.ws-has-dossier .ws-kpis--6 .ws-kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  body.ws-has-dossier .ws-kpis--6 .ws-kpi:nth-child(3n) { border-right: 0; }
}
/* ---- narrow screens: the dossier overlays rather than squeezing the grid -- */
@media (max-width: 1280px) {
  body.ws-has-dossier .ws { grid-template-columns: 260px minmax(0, 1fr); }
  .ws-dossier { position: absolute; right: 0; top: 0; bottom: 0; width: min(470px, 100%); z-index: 5; box-shadow: -12px 0 30px color-mix(in srgb, var(--bg) 70%, transparent); }
  .ws-cols { grid-template-columns: 1fr; }
}
/* ---- COMPACT: a narrow OR a short window (a phone, or a desktop browser zoomed past ~200%) ----
   The desktop page is held to one screen and each pane scrolls on its own. In a small window
   that left two tiny scroll boxes under a header that had wrapped to three lines (Kevin,
   2026-12-02, at 250% zoom: the rail stopped at "SEARCH", the grid got 153 px). Here the page
   scrolls as one document, the rail starts folded behind a "Filters" button
   (workstation.js COMPACT_Q, its own remembered key) and the dossier takes the whole window.
   ⚠ COMPACT_Q in workstation.js is this query, word for word: keep them equal. */
@media (max-width: 860px), (max-height: 600px) {
  body.ws-page { overflow: auto; }
  .ws-page .app { height: auto; min-height: 100vh; }
  .ws, body.ws-has-dossier .ws { grid-template-columns: minmax(0, 1fr); }
  .ws-rail { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; overflow: visible; }
  .ws-main { overflow: visible; }
  .ws-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-kpi { padding: .6rem .8rem; }
  .ws-kpi__n { font-size: 1.5rem; }
  .ws-cols--2 { grid-template-columns: 1fr; }
  .ws-gridwrap { max-height: none; }
  .ws-dossier { position: fixed; inset: 0; width: auto; z-index: 50; border-left: 0; }
}
.ws-lock { grid-column: 1 / -1; max-width: 40rem; margin: 4rem auto; text-align: center; }
.ws-lock h2 { font: 400 2rem var(--serif); }
.ws-lock p { color: var(--ink-dim); }
.ws-flag--shared { opacity: .7; border-style: dashed; }
.ws-input--sm { padding: .4rem .6rem; font-size: .76rem; margin-bottom: .4rem; }
.ws-facet--pae { max-height: 320px; overflow-y: auto; }
.ws-fgroup { font: 700 .6875rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink,var(--accent)); margin: .5rem 0 .15rem; }
.ws-frow--sub { padding-left: 1.2rem; font-size: .76rem; }
.ws-frow--zero .ws-fname { color: var(--ink-faint); }
.ws-caret { background: none; border: 0; color: var(--ink-faint); cursor: pointer; padding: 0 .2rem; font-size: .7rem; }
.ws-paeline { font: 400 .76rem/1.5 var(--sans); color: var(--ink-dim); margin: .3rem 0 .6rem; }
.ws-paeline b { color: var(--ink); font-weight: 600; }
.ws-conf { font: 600 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.ws-conf--h { color: var(--good); } .ws-conf--m { color: var(--accent-ink,var(--accent)); } .ws-conf--l { color: var(--warn); }
.ws-chipn { font-style: normal; color: var(--ink-faint); margin-left: .2rem; }
.ws-chip.on .ws-chipn { color: var(--bg); }
.ws-numrow { display: flex; gap: .5rem; margin-top: .5rem; }
.ws-numlab { display: flex; align-items: center; gap: .25rem; font: 400 .7rem var(--mono); color: var(--ink-dim); border: 1px solid var(--line); border-radius: 8px; padding: .25rem .5rem; flex: 1; }
.ws-numlab--off { opacity: .5; }
.ws-numin { width: 3.6rem; background: transparent; border: 0; color: var(--ink); font: 500 .8rem var(--mono); text-align: right; }
.ws-numin:focus { outline: none; }
/* the match strip under a row, across the numbers */
.ws-grid tr.ws-row:has(+ .ws-matchrow) td { border-bottom: 0; }
.ws-matchrow td { padding-top: 0; }
.ws-matchrow .ws-match { margin-top: 0; }
.ws-matchrow .ws-match__text { font-size: .8rem; }
.ws-paecol { min-width: 210px; max-width: 260px; }
/* the Columns menu */
.ws-colwrap { position: relative; }
.ws-colmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 250px; max-height: 420px; overflow-y: auto; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; box-shadow: 0 12px 30px color-mix(in srgb, var(--bg) 70%, transparent); }
.ws-colmenu__head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.ws-colmenu__head .ws-lbl { margin: 0; flex: 1; }
.ws-linkbtn { background: none; border: 0; color: var(--accent-ink,var(--accent)); font: 500 .6875rem var(--mono); cursor: pointer; padding: 0; }
.ws-colopt { display: flex; align-items: center; gap: .5rem; font: 400 .8rem var(--sans); color: var(--ink-dim); padding: .22rem 0; cursor: pointer; }
.ws-colopt:hover { color: var(--ink); }
.ws-colopt input { accent-color: var(--accent); margin: 0; }

/* ==== the rail, one pattern (2026-10-07) — overrides the first cut above ==== */
.ws-rail { padding: 0 0 3rem; }
.ws-rail .ws-blk { padding: 1rem 1.1rem 0; margin: 0; }
.ws-rail > .ws-dim { padding: 1rem 1.1rem 0; margin: 0; }
.ws-active { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem 1.1rem; background: var(--bg-panel); border-bottom: 1px solid var(--line); font: 500 .6875rem var(--mono); color: var(--accent-ink,var(--accent)); }
.ws-active--none { color: var(--ink-faint); }
.ws-linkbtn:disabled { color: var(--ink-faint); cursor: default; opacity: .6; }
.ws-rail .ws-lbl { margin-bottom: .45rem; }
.ws-rail .ws-hint { margin-top: .35rem; }
.ws-tokens { margin-top: .35rem; }
/* sections */
.ws-sec { border-top: 1px solid var(--line-soft); margin-top: 1rem; }
.ws-sec + .ws-sec { margin-top: 0; }
.ws-sec > summary { list-style: none; display: flex; align-items: center; gap: .5rem; padding: .8rem 1.1rem; cursor: pointer; user-select: none; }
.ws-sec > summary::-webkit-details-marker { display: none; }
.ws-sec > summary:hover .ws-sec__t { color: var(--ink); }
.ws-sec__t { font: 700 .6875rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }
.ws-sec__m { flex: 1; min-width: 0; text-align: right; font: 400 .6875rem var(--mono); color: var(--accent-ink,var(--accent)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-sec__m:empty::after, .ws-sec__m #ws-paenote { color: var(--ink-faint); }
.ws-sec__chev { width: 6px; height: 6px; border-right: 1.5px solid var(--ink-faint); border-bottom: 1.5px solid var(--ink-faint); transform: rotate(-45deg); transition: transform .15s var(--ease); flex: none; margin-left: .15rem; }
.ws-sec[open] > summary .ws-sec__chev { transform: rotate(45deg); }
.ws-sec__b { padding: 0 1.1rem .9rem; }
/* rows: marker · name · count · slot — the same grid everywhere, so counts align */
.ws-frow { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 16px; align-items: center; column-gap: .55rem; padding: .26rem .35rem; margin: 0 -.35rem; border-radius: 6px; font: 400 .8rem/1.3 var(--sans); color: var(--ink-dim); cursor: pointer; }
.ws-frow:hover { background: var(--row); color: var(--ink); }
.ws-frow.on { color: var(--ink); }
.ws-frow.on .ws-fname { font-weight: 500; }
.ws-frow--zero .ws-fname, .ws-frow--zero .ws-fcount { color: var(--ink-faint); }
.ws-frow--sub { padding-left: 1.4rem; font-size: .76rem; }
.ws-frow input { margin: 0; width: 13px; height: 13px; accent-color: var(--accent); }
.ws-fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-fcount { font: 400 .6875rem var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-faint); text-align: right; }
.ws-frow.on .ws-fcount { color: var(--accent-ink,var(--accent)); }
.ws-fslot { display: flex; justify-content: center; }
.ws-caret { padding: 0; width: 16px; line-height: 1; }
.ws-fgroup { margin: .7rem 0 .2rem; color: var(--ink-faint); }
.ws-fgroup:first-child { margin-top: .3rem; }
.ws-facet--pae { max-height: none; overflow: visible; }
.ws-input--sm { margin: 0 0 .3rem; }
/* change thresholds: one tidy row */
.ws-numrow { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-top: .55rem; }
.ws-numlab { display: flex; align-items: center; gap: .3rem; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 7px; font: 400 .6875rem var(--mono); color: var(--ink-faint); white-space: nowrap; }
.ws-numlab:focus-within { border-color: var(--accent); }
.ws-numin { flex: 1; min-width: 0; width: auto; text-align: right; }
/* PAE folded by service */
.ws-svcgrp { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; column-gap: .55rem; width: calc(100% + .7rem); margin: 0 -.35rem; padding: .38rem .35rem; background: none; border: 0; border-radius: 6px; cursor: pointer; text-align: left; font: 600 .76rem var(--sans); color: var(--ink-dim); }
.ws-svcgrp:hover { background: var(--row); color: var(--ink); }
.ws-svcgrp .ws-sec__chev { justify-self: center; }
.ws-svcgrp.open .ws-sec__chev { transform: rotate(45deg); }
.ws-svcbody { display: none; padding: .1rem 0 .4rem .6rem; border-left: 1px solid var(--line-soft); margin-left: .2rem; }
.ws-svcbody.open, .ws-pae--searching .ws-svcbody { display: block; }
.ws-pae--searching .ws-svcgrp { display: none; }
/* threshold boxes: fixed-width inputs so both fit a 280px rail */
.ws-numlab { padding: .3rem .45rem; gap: .25rem; }
.ws-numin { flex: 0 0 2.4rem; width: 2.4rem; }
.ws-numlab span:first-child { flex: 1; }
.ws-sec__m .ws-dim, .ws-sec__m #ws-paenote { color: var(--ink-faint); }
.ws-caret { display: flex; align-items: center; justify-content: center; height: 16px; background: none; border: 0; cursor: pointer; }
.ws-caret .ws-sec__chev { width: 5px; height: 5px; margin: 0; transform: rotate(-45deg); }
.ws-caret.open .ws-sec__chev { transform: rotate(45deg); }
/* PAE names WRAP (2026-10-31, Kevin: "fix the UI so we can actually read this"). The rail is
   ~280px and a portfolio's name is the thing a reader scans for; one-line ellipsis made
   "Agile Sustainment & …" and "Layered Protection & I…" of the two Army PAEs a reader most needs
   to tell apart. The count and the ▸ stay on the first line (align-items: start). Every other
   facet keeps the one-line rule: its names are short. */
.ws-facet--pae .ws-frow { align-items: start; }
.ws-facet--pae .ws-frow input, .ws-facet--pae .ws-fslot, .ws-facet--pae .ws-fcount { margin-top: .12rem; }
.ws-facet--pae .ws-fname { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
/* a roster entry that is not a working PAE (pfTag): its kind / status, under the name */
.ws-facet--pae .ws-ftag { display: block; font-size:.6875rem; font-weight: 400; color: var(--ink-faint); margin-top: .1rem; }

/* ==== the market builder (2026-10-07) — a window over the page, not the rail ==== */
.ws-lblrow { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.ws-lblrow .ws-lbl { margin-bottom: .45rem; }
.ws-newmk { background: none; border: 0; padding: 0; cursor: pointer; font: 600 .6875rem var(--mono); color: var(--accent-ink,var(--accent)); }
.ws-newmk:hover { text-decoration: underline; }
.ws-mknote { font: 400 .6875rem/1.5 var(--mono); color: var(--good); margin-top: .45rem; }
.ws-mkwords { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }
.ws-mkw { font: 500 .6875rem var(--mono); color: var(--ink-dim); border: 1px solid var(--line); border-radius: 999px; padding: .12rem .45rem; }
.ws-mkw--all { color: var(--accent-soft); }
.ws-mkw--none { color: var(--warn); border-style: dashed; }
.ws-mkacts { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin-top: .45rem; }
.ws-mkacts .ws-link { margin-top: 0; }

/* The header's menus (the Defense Budget tray, the account menu) open DOWN over the
   panes. .topbar has a backdrop-filter, which makes it a stacking context at level 0,
   so the rail's sticky filter bar (z-index 3) drew over an open tray (Kevin,
   screenshot, 2026-10-07). Lift the whole header above the panes; the market
   builder (z-index 60, fixed) still covers everything. */
.ws-page .topbar { position: relative; z-index: 40; }


/* ---- Overview view (2026-10-08): the colours pass the dataviz validator against
   --bg-panel in each theme (dark #0d0f12, light #fbf8f1) ---- */
.ws-page { --ov-actual: #8a877e; --ov-enacted: #3d8be0; --ov-request: #c9821c; --ov-plan: #2f9e6f; --ov-rec: #8e6fe0; }
body.light .ws-page, body.light.ws-page { --ov-actual: #8a877e; --ov-enacted: #2f74c4; --ov-request: #b06a08; --ov-plan: #1f8a62; --ov-rec: #7351c9; }
.ws-ov-panel { border: 1px solid var(--line-soft, var(--line)); border-radius: 10px; background: var(--bg-panel); padding: 1rem 1.1rem; margin-bottom: 1rem; min-width: 0; }
.ws-ov-ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .8rem; margin-bottom: .7rem; }
.ws-ov-ph h3 { margin: 0; font: 400 1.25rem var(--serif); color: var(--ink); }
.ws-ov-ph .ws-dim { font: 400 .6875rem var(--mono); }
.ws-ov-legend { margin-left: auto; display: flex; gap: .8rem; font: 400 .6875rem var(--mono); color: var(--ink-dim); }
.ws-ov-key { display: inline-flex; align-items: center; gap: .35rem; }
.ws-ov-key i { width: .7rem; height: .7rem; border-radius: 3px; display: inline-block; }
.ws-ov-stats { display: flex; flex-wrap: wrap; gap: 1.6rem; margin: .2rem 0 .6rem; }
.ws-ov-stats div { display: flex; flex-direction: column; }
.ws-ov-stats b { font: 400 1.6rem var(--serif); color: var(--ink); }
.ws-ov-stats span { font: 400 .6875rem var(--mono); color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
.ws-ov-chart { width: 100%; height: auto; display: block; }
.ws-ov-grid { stroke: var(--line); stroke-width: 1; }
.ws-ov-base { stroke: var(--ink-faint); stroke-width: 1; }
.ws-ov-v { fill: var(--ink); font: 500 0.75rem var(--mono); text-anchor: middle; }
.ws-ov-x { fill: var(--ink-dim); font: 400 0.6875rem var(--mono); text-anchor: middle; }
.ws-ov-col:hover rect { filter: brightness(1.15); }
.ws-ov-k--actual { fill: var(--ov-actual); background: var(--ov-actual); }
.ws-ov-k--enacted { fill: var(--ov-enacted); background: var(--ov-enacted); }
.ws-ov-k--request { fill: var(--ov-request); background: var(--ov-request); }
.ws-ov-k--plan { fill: var(--ov-plan); background: var(--ov-plan); }
/* reconciliation (mandatory) money, stacked on the regular bar (2026-11-20) */
.ws-ov-k--rec { fill: var(--ov-rec, #8e6fe0); background: var(--ov-rec, #8e6fe0); }
.ws-ov-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ws-ov-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ws-ov-row3 .ws-ov-panel, .ws-ov-row2 .ws-ov-panel { margin-bottom: 0; }
.ws-ov-row3 { margin-bottom: 1rem; }
.ws-ov-bar { padding: .32rem .35rem; border-radius: 6px; }
.ws-ov-bar[data-svcpick], .ws-ov-bar[data-fampick], .ws-ov-bar[data-goto] { cursor: pointer; }
.ws-ov-bar:hover { background: var(--row); }
.ws-ov-bar__top { display: flex; justify-content: space-between; gap: .6rem; font: 400 .8rem var(--sans); color: var(--ink); }
.ws-ov-bar__top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ws-ov-bar__top b { font: 500 .78rem var(--mono); white-space: nowrap; }
.ws-ov-track { position: relative; height: 6px; margin: .3rem 0 .2rem; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 3px; }
.ws-ov-track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ov-request); border-radius: 3px; }
.ws-ov-track u { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: var(--ink); text-decoration: none; }
.ws-ov-mv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ws-ov-mvh { font: 600 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .1em; margin: 0 .35rem .3rem; }
.ws-ov-mvh.up, .ws-ov-bar b.up { color: var(--good); }
.ws-ov-mvh.dn, .ws-ov-bar b.dn { color: var(--warn); }
.ws-ov-track i.ws-ov-i--up { background: var(--good); }
.ws-ov-track i.ws-ov-i--dn { background: var(--warn); }
.ws-ov-bar[role=button]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 1100px) { .ws-ov-row3, .ws-ov-row2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ws-ov-mv { grid-template-columns: 1fr; } .ws-ov-legend { margin-left: 0; flex-wrap: wrap; } }
.ws-ov-mark { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 4; }
.ws-ov-keymark { width: 1rem !important; height: 0 !important; border-top: 2px dashed var(--ink); border-radius: 0 !important; background: none !important; }
.ws-ov-note { font: 400 .74rem/1.5 var(--sans); color: var(--ink-dim); margin: .5rem 0 0; max-width: 62rem; }
/* Capture: recompete windows over the linked contracts' end dates */
.ws-rcw { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; margin: .2rem 0 .4rem; }
.ws-rcw__b { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; text-align: left; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; color: var(--ink); cursor: pointer; font: inherit; }
.ws-rcw__b span { font: 400 .6875rem var(--mono); color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; }
.ws-rcw__b b { font: 400 1.35rem var(--serif); }
.ws-rcw__b i { font: 400 .7rem var(--sans); font-style: normal; color: var(--ink-dim); }
.ws-rcw__b.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ws-rcw__b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .ws-rcw { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* civilian mode (?civ=1) — the preview note at the top of the rail, and the long
   bureau / account lists that carry a find box */
.ws-facet--find { max-height: 320px; overflow-y: auto; margin-top: .35rem; }

/* Defense | Civilian, at the top of the rail on both modes */
.ws-mode { display: flex; gap: 2px; margin: 0 0 .7rem; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.ws-mode a { flex: 1; text-align: center; font: 600 .6875rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); text-decoration: none; padding: .35rem .5rem; border-radius: 999px; }
.ws-mode a:hover { color: var(--ink); }
.ws-mode a.on { color: var(--bg); background: var(--accent); }

/* ---- civilian: the Agency and Account pickers (2026-10-11). The rail shows a button
   and the picks as chips; the Agency sheet is the shared HitchTree, the Account window
   is this page's own (an account is not an organisation, so it is not a tree). */
.ws-pickbtn { width: 100%; text-align: left; font: 500 .8rem var(--sans); color: var(--accent-ink,var(--accent)); background: var(--bg-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 6px; padding: .45rem .6rem; cursor: pointer; }
.ws-pickbtn:hover { border-color: var(--accent); }
.ws-picks { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.ws-pick { display: inline-flex; align-items: center; gap: .2rem; max-width: 100%; font: 400 .74rem/1.3 var(--sans); color: var(--ink); background: var(--bg-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 12px; padding: .15rem .2rem .15rem .55rem; }
.ws-pick__x { border: 0; background: transparent; color: var(--ink-dim); cursor: pointer; font-size: .9rem; line-height: 1; padding: 0 .25rem; border-radius: 50%; }
.ws-pick__x:hover { color: var(--ink); background: var(--row); }
.ws-acm { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ws-acm__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.ws-acm__panel { position: relative; display: flex; flex-direction: column; width: min(860px, 100%); max-height: min(86vh, 900px); background: var(--bg-panel, var(--bg)); color: var(--ink); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.ws-acm__hd { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem .4rem; }
.ws-acm__hd h2 { margin: 0; font: 600 1.05rem var(--sans); }
.ws-acm__x { border: 0; background: transparent; color: var(--ink-dim); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.ws-acm__tools { padding: .2rem 1.1rem .6rem; border-bottom: 1px solid var(--line); }
.ws-acm__opts { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .5rem; font: 400 .78rem var(--sans); color: var(--ink-dim); }
.ws-acm__opts label { display: inline-flex; align-items: center; gap: .35rem; }
.ws-acm__opts input { accent-color: var(--accent); margin: 0; }
.ws-acm__opts select { width: auto; }
.ws-acm__sort { margin-left: auto; }
.ws-acm__list { overflow: auto; padding: .3rem .6rem .6rem; flex: 1; min-height: 160px; }
/* an agency: one header line, its accounts indented under it */
.ws-acm__ag { margin-top: .2rem; }
.ws-acm__aghd { display: grid; grid-template-columns: auto 1fr auto auto; gap: .5rem; align-items: center; width: 100%; padding: .45rem .5rem; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: 600 .84rem var(--sans); }
.ws-acm__aghd:hover { background: var(--row); }
.ws-acm__ag.open > .ws-acm__aghd { position: sticky; top: 0; z-index: 1; background: var(--bg-panel, var(--bg)); }
.ws-acm__ag.open > .ws-acm__aghd .ws-sec__chev { transform: rotate(45deg); }
.ws-acm__agt { min-width: 0; }
.ws-acm__agn { font: 400 .74rem var(--mono); color: var(--ink-faint); white-space: nowrap; }
/* a row: tick · name + owner · money. Three columns, one height, the money
   right-aligned so a column of rows reads as a table */
.ws-acm__row { display: grid; grid-template-columns: auto 1fr auto; gap: .1rem .7rem; align-items: start; padding: .4rem .5rem; border-radius: 6px; cursor: pointer; }
.ws-acm__row:hover { background: var(--row); }
.ws-acm__row.on { background: var(--accent-soft); }
.ws-acm__row input { accent-color: var(--accent); margin: .25rem 0 0; }
.ws-acm__row--sub { margin-left: 1.3rem; }
.ws-acm__row--out { opacity: .6; }
.ws-acm__main { display: flex; flex-direction: column; min-width: 0; }
.ws-acm__t { font: 500 .88rem/1.3 var(--sans); color: var(--ink); }
.ws-acm__code { font: 400 .7rem var(--mono); color: var(--ink-faint); margin-left: .3rem; }
.ws-acm__who { font: 400 .76rem/1.3 var(--sans); color: var(--ink-dim); }
.ws-acm__who em { font-style: italic; }
.ws-acm__line { font: 400 .74rem var(--sans); color: var(--ink-dim); }
.ws-acm__num { font: 500 .82rem/1.3 var(--mono); text-align: right; white-space: nowrap; }
.ws-acm__num em { display: block; font-style: normal; font-size: .7rem; color: var(--ink-faint); }
.ws-acm__num em.up { color: var(--good); }
.ws-acm__num em.down { color: var(--warn); }
.ws-acm__cg { color: var(--accent-ink,var(--accent)); font-weight: 500; }
.ws-acm__sect { margin: .9rem .5rem .2rem; font: 600 .7rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.ws-acm__empty { padding: .8rem .5rem; font: 400 .82rem var(--sans); color: var(--ink-dim); }
.ws-acm__ft { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); }
.ws-acm__sum { flex: 1; font: 400 .78rem var(--sans); color: var(--ink-dim); }
@media (max-width: 600px) {
  .ws-acm { padding: 0; }
  .ws-acm__panel { max-height: 100vh; height: 100%; border-radius: 0; }
  .ws-acm__agn { display: none; }
}

/* ==== the PAE rail's remainder row and its unit line (2026-11-12) ==== */
.ws-paeunit { margin: .4rem 0 .5rem; }
.ws-frow--rest .ws-fname { font-style: italic; }

/* ==== the rail folds to a strip (2026-11-12) ===============================
   #ws-railbtn sits at the end of the sticky filter bar; folded, the rail is a
   44px column holding only that button and the filter count, and the grid takes
   the width. Defined after the breakpoints above, so each breakpoint that
   changes the columns is restated here. */
.ws-railbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-dim); cursor: pointer; padding: .3rem .45rem; font: 500 .6875rem var(--mono); }
.ws-railbtn:hover, .ws-railbtn:focus-visible { color: var(--ink); border-color: var(--ink-faint); }
.ws-railbtn__i { width: 6px; height: 6px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-left: 2px; }
.ws-railbtn__n { display: none; }
body.ws-rail-off .ws { grid-template-columns: 44px minmax(0, 1fr); }
body.ws-rail-off.ws-has-dossier .ws { grid-template-columns: 44px minmax(0, 1fr) 470px; }
body.ws-rail-off .ws-rail { overflow: hidden; }
body.ws-rail-off .ws-rail > :not(.ws-active) { display: none; }
body.ws-rail-off .ws-active { flex-direction: column; justify-content: flex-start; padding: .6rem 0; border-bottom: 0; background: transparent; }
body.ws-rail-off .ws-active > :not(.ws-railbtn) { display: none; }
body.ws-rail-off .ws-railbtn { flex-direction: column; margin: 0; padding: .45rem .35rem; }
body.ws-rail-off .ws-railbtn__i { transform: rotate(-135deg); margin: 0 2px 0 0; }
body.ws-rail-off .ws-railbtn__n:not(:empty) { display: block; color: var(--accent-ink,var(--accent)); }
@media (max-width: 1280px) {
  body.ws-rail-off.ws-has-dossier .ws { grid-template-columns: 44px minmax(0, 1fr); }
}
/* the button's word "Filters", shown only in a compact window, where the folded rail is one row */
.ws-railbtn__t { display: none; }
@media (max-width: 860px), (max-height: 600px) {
  body.ws-rail-off .ws, body.ws-rail-off.ws-has-dossier .ws { grid-template-columns: minmax(0, 1fr); }
  body.ws-rail-off .ws-rail { border-bottom: 1px solid var(--line); padding-bottom: 0; }
  body.ws-rail-off .ws-active { flex-direction: row; justify-content: flex-start; padding: .55rem 1rem; }
  body.ws-rail-off .ws-railbtn { flex-direction: row; margin: 0; padding: .45rem .8rem; font-size: .72rem; color: var(--ink); }
  body.ws-rail-off .ws-railbtn__i { order: 2; }
  .ws-railbtn__t { display: inline; }
  body.ws-rail-off .ws-railbtn__n:not(:empty)::before { content: "· "; }
}
