/* Layout: three-column operator shell — navy nav rail | neutral work area | bid timeline rail.
   Columns collapse into slide-over drawers as the screen narrows. */
:root {
  --bg: #E6E8EB;
  --panel: #F3F4F6;
  --panel-2: #EAECEF;
  --raised: #F9FAFB;
  --ink: #1A2030;
  --ink-2: #434B5D;
  --muted: #697184;
  --line: #D3D7DE;
  --line-2: #BCC2CC;
  --rail: #161B27;
  --rail-2: #212837;
  --rail-ink: #D7DBE4;
  --rail-muted: #8D94A7;
  --gold: #E8B710;
  --gold-ink: #6B5100;
  --gold-soft: #F3E4AE;
  --focus: #2A78D6;
  --s1: #2a78d6;
  --s2: #eb6834;
  --ctx: #98A0AE;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --st-monitoring: #86b6ef;
  --st-jar_test: #5598e7;
  --st-industrial_trial: #2a78d6;
  --st-preparing: #1c5cab;
  --st-submitted: #104281;
  --st-awarded: #0ca30c;
  --st-lost: #d03b3b;
  --map-bg: #D9DDE3;
  --map-land: #F3F4F6;
  --map-edge: #B6BDC8;
  --shadow: 0 10px 30px rgba(22, 27, 39, .16);
  --scrim: rgba(22, 27, 39, .32);

  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 6px;
  --ai: #0E6B6B;
  --ai-soft: #DCEEEB;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141B; --panel: #191D26; --panel-2: #212632; --raised: #1D222C;
    --ink: #E5E8EE; --ink-2: #B6BCC9; --muted: #8890A1; --line: #2B313E; --line-2: #3A4252;
    --rail: #0B0E14; --rail-2: #161B25; --rail-ink: #D7DBE4; --rail-muted: #8088A0;
    --gold: #F0C232; --gold-ink: #F0C232; --gold-soft: #3A3118; --focus: #6DA7EC;
    --s1: #3987e5; --s2: #d95926; --ctx: #5E6676;
    --st-monitoring: #184f95; --st-jar_test: #256abf; --st-industrial_trial: #3987e5; --st-preparing: #6da7ec; --st-submitted: #9ec5f4;
    --map-bg: #0E1117; --map-land: #1D222C; --map-edge: #3A4252;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .5);
    --ai: #5CC4B8; --ai-soft: #133331;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11141B; --panel: #191D26; --panel-2: #212632; --raised: #1D222C;
  --ink: #E5E8EE; --ink-2: #B6BCC9; --muted: #8890A1; --line: #2B313E; --line-2: #3A4252;
  --rail: #0B0E14; --rail-2: #161B25; --rail-ink: #D7DBE4; --rail-muted: #8088A0;
  --gold: #F0C232; --gold-ink: #F0C232; --gold-soft: #3A3118; --focus: #6DA7EC;
  --s1: #3987e5; --s2: #d95926; --ctx: #5E6676;
  --st-monitoring: #184f95; --st-jar_test: #256abf; --st-industrial_trial: #3987e5; --st-preparing: #6da7ec; --st-submitted: #9ec5f4;
  --map-bg: #0E1117; --map-land: #1D222C; --map-edge: #3A4252;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .5);
  --ai: #5CC4B8; --ai-soft: #133331;
  color-scheme: dark;
}

html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 var(--f-body);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--focus); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
.mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.num { text-align: right; white-space: nowrap; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
#app { height: 100%; }
.shell { height: 100%; display: grid; grid-template-columns: 228px minmax(0, 1fr) 312px; grid-template-rows: minmax(0, 1fr); }
.nav { border-right: 1px solid var(--rail-2); background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; min-height: 0; padding-top: env(safe-area-inset-top, 0px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.wordmark { font-family: var(--f-display); font-weight: 800; font-stretch: 125%; font-variation-settings: "wdth" 125; letter-spacing: .06em; font-size: 16px; line-height: 1; color: #fff; }
.wordmark small { display: block; font-family: var(--f-body); font-weight: 500; font-variation-settings: normal; font-stretch: normal; letter-spacing: .1em; font-size: 9.5px; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.nav-links { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--rail-muted); padding: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r); color: var(--rail-ink); text-decoration: none; font-weight: 500; position: relative; }
.nav-link:hover { background: var(--rail-2); }
.nav-link[aria-current="page"] { background: var(--rail-2); color: #fff; }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav-link .count { margin-left: auto; font-size: 11.5px; color: var(--rail-muted); }
.nav-foot { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rail-2); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #1A2030; display: grid; place-items: center; font-weight: 700; font-size: 11.5px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.nav-foot .who { min-width: 0; flex: 1; }
.nav-foot .who b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-foot .who span { display: block; font-size: 11.5px; color: var(--rail-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: var(--r); cursor: pointer; display: grid; place-items: center; color: inherit; }
.icon-btn:hover { background: var(--panel-2); }
.nav .icon-btn:hover { background: var(--rail-2); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.topbar h1 { font-family: var(--f-display); font-variation-settings: "wdth" 108; font-weight: 700; font-size: 21px; letter-spacing: -.005em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .titles { min-width: 0; flex: 1; }
.demo-pill { font-size: 11.5px; font-weight: 600; color: var(--gold-ink); background: var(--gold-soft); border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.save-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--good) 14%, var(--panel)); color: var(--ink-2); white-space: nowrap; }
.save-pill.busy { background: var(--gold-soft); color: var(--gold-ink); }
.menu-btn, .tl-btn { display: none; }
.tl-btn { align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--r); padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.tl-btn .badge { background: var(--ink); color: var(--panel); border-radius: 99px; font-size: 11px; padding: 0 6px; }
.view { flex: 1; overflow: auto; padding: 22px 28px 40px; min-height: 0; }
.view-inner { display: flex; flex-direction: column; gap: 18px; max-width: 1500px; }

.timeline { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding-top: env(safe-area-inset-top, 0px); }
.tl-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 8px; }
.tl-head h2 { font-family: var(--f-display); font-variation-settings: "wdth" 115; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tl-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.tl-head .tl-close { display: none; margin-left: auto; }
.tl-body { overflow-y: auto; padding: 8px 10px 24px; flex: 1; }
.tl-group { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 8px 6px; display: flex; justify-content: space-between; }
.tl-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 9px 8px; border-radius: var(--r); cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.tl-item:hover { background: var(--panel-2); }
.tl-date { text-align: center; border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 0 4px; background: var(--raised); align-self: start; }
.tl-date b { display: block; font-family: var(--f-display); font-size: 17px; font-weight: 700; line-height: 1.1; }
.tl-date span { display: block; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tl-date.urgent { border-color: var(--crit); }
.tl-date.soon { border-color: var(--warn); }
.tl-ref { font-family: var(--f-mono); font-size: 12px; font-weight: 500; }
.tl-muni { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-left { font-weight: 600; color: var(--ink-2); }
.tl-left.urgent { color: var(--crit); }
.tl-empty { padding: 20px 10px; color: var(--muted); font-size: 13px; }

.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }

@media (max-width: 1240px) {
  .shell { grid-template-columns: 212px minmax(0, 1fr); }
  .timeline { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 92vw); z-index: 50; transform: translateX(105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .shell.tl-open .timeline { transform: none; }
  .tl-btn { display: inline-flex; }
  .tl-head .tl-close { display: grid; }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; left: 0; top: 0; bottom: 0; width: min(270px, 86vw); z-index: 50; transform: translateX(-105%); transition: transform .22s ease; }
  .shell.nav-open .nav { transform: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .view { padding: 16px 16px 40px; }
  .demo-pill { display: none; }
}
@media (max-width: 520px) { .tl-btn .lbl { display: none; } .topbar .sub { display: none; } .kpi .value { font-size: 23px; } }
@media (prefers-reduced-motion: reduce) { .timeline, .nav, .drawer { transition: none !important; } }

/* ---------- Building blocks ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head .hint { color: var(--muted); font-size: 12.5px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 14px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); border-radius: var(--r); padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.gold { background: var(--gold); color: #1A2030; border-color: var(--gold); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.danger { color: var(--crit); }
.btn.danger.solid { background: var(--crit); color: #fff; border-color: var(--crit); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg.i { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field > span em { font-style: normal; color: var(--crit); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); background: var(--raised); border-radius: var(--r); padding: 7px 10px; min-height: 34px; }
textarea.input { min-height: 76px; resize: vertical; }
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.input:disabled { background: var(--panel-2); color: var(--ink-2); border-style: dashed; cursor: not-allowed; opacity: 1; }
.input.flag { outline: 2px solid var(--gold); outline-offset: -1px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .input { width: auto; min-width: 0; }
.filters .search { flex: 1 1 220px; max-width: 360px; position: relative; }
.filters .search .input { width: 100%; padding-left: 32px; }
.filters .search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.filters .count { margin-left: auto; color: var(--muted); font-size: 12.5px; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; position: sticky; top: 0; }
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover { color: var(--ink); }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tr.clickable { cursor: pointer; }
.t tr.clickable:hover td { background: var(--panel-2); }
.t tr.selected td { background: var(--gold-soft); }
.t td.actions { white-space: nowrap; text-align: right; }
.t .strong { font-weight: 600; }
.t tfoot td { font-weight: 700; border-top: 1px solid var(--line-2); border-bottom: 0; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); }
.cell-sub.clip { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.mono { white-space: nowrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.chip.new { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }
.chip.shared { font-weight: 500; font-size: 11px; padding: 1px 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 500; }
.fit { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; }
.fit .bars { display: inline-flex; gap: 2px; align-items: flex-end; }
.fit .bars i { width: 4px; border-radius: 1px; background: var(--line-2); display: block; }
.fit .bars i:nth-child(1) { height: 6px; } .fit .bars i:nth-child(2) { height: 9px; } .fit .bars i:nth-child(3) { height: 12px; }
.fit .bars i.on { background: var(--ink); }
.due { white-space: nowrap; }
.due small { display: block; font-size: 11.5px; color: var(--muted); }
.due small.urgent { color: var(--crit); font-weight: 600; }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- KPIs & charts ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 13px 16px 14px; min-width: 0; }
.kpi .label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.kpi .value { font-family: var(--f-display); font-variation-settings: "wdth" 100; font-weight: 650; font-size: 27px; line-height: 1.15; margin-top: 4px; letter-spacing: -.01em; }
.kpi .ctx { font-size: 12px; color: var(--muted); margin-top: 2px; }

.stage-bars { display: flex; flex-direction: column; gap: 10px; }
.stage-row { display: grid; grid-template-columns: 128px minmax(0, 1fr) 92px; gap: 12px; align-items: center; font-size: 13px; }
.stage-row .name { display: flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.stage-row .track { height: 14px; position: relative; }
.stage-row .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; min-width: 2px; }
.stage-row .val { text-align: right; font-weight: 600; white-space: nowrap; }
.stage-row .val small { font-weight: 400; color: var(--muted); margin-left: 4px; }

.bench { display: flex; flex-direction: column; }
.bench-row { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr) 64px; gap: 14px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.bench-row:last-of-type { border-bottom: 0; }
.bench-row .nm { min-width: 0; }
.bench-row .nm b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bench-row .nm span { font-size: 11.5px; color: var(--muted); }
.bench-strip { position: relative; height: 22px; }
.bench-strip .grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.bench-strip .rng { position: absolute; top: 9px; height: 4px; border-radius: 2px; background: var(--line-2); }
.bench-strip .med { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--s1); border: 2px solid var(--panel); }
.bench-strip .ours { position: absolute; top: 2px; width: 2px; height: 18px; margin-left: -1px; background: var(--s2); border-radius: 1px; }
.bench-axis { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr) 64px; gap: 14px; padding-top: 6px; }
.bench-axis .ticks { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.bench-axis .ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw-line { width: 18px; height: 4px; border-radius: 2px; background: var(--line-2); }
.legend .sw-tick { width: 2px; height: 14px; background: var(--s2); border-radius: 1px; }

/* ---------- Maps ---------- */
.map { height: 440px; border-radius: 0 0 8px 8px; background: var(--map-bg); }
.map.short { height: 360px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.leaflet-container { background: var(--map-bg) !important; font: 13px/1.4 var(--f-body) !important; }
.leaflet-tooltip.tip-map, .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel) !important; color: var(--ink) !important; border: 1px solid var(--line-2) !important; box-shadow: var(--shadow) !important; }
.leaflet-tooltip.tip-map::before { display: none; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 13px; }
.leaflet-popup-content b { font-size: 13.5px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted) !important; }
.leaflet-control-zoom a { background: var(--panel) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--panel) 80%, transparent) !important; color: var(--muted) !important; font-size: 10.5px !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.pop-meta { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }

/* ---------- Split panes (digests, plants) ---------- */
.split { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.split-list { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 150px); position: sticky; top: 0; }
.split-list .list { overflow-y: auto; flex: 1; }
.li { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 16px; cursor: pointer; }
.li:hover { background: var(--panel-2); }
.li[aria-selected="true"] { background: var(--gold-soft); }
.li .t1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.li .t1 b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .t2 { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.back-btn { display: none; }
@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-list { position: static; max-height: none; }
  .split.has-sel .split-list { display: none; }
  .split:not(.has-sel) .split-detail { display: none; }
  .back-btn { display: inline-flex; }
}

.detail-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .titles { flex: 1; min-width: min(100%, 260px); }
.detail-head h2 { font-family: var(--f-display); font-variation-settings: "wdth" 104; font-size: 22px; font-weight: 700; line-height: 1.2; }
.detail-head .ref { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.detail-head .meta { color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 14px 18px; }
.fact span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.fact b { display: block; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.reqs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.req { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); font-weight: 500; }
.req .mk { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; }
.req.yes .mk { background: var(--ink); color: var(--panel); }
.req.no { color: var(--muted); }
.req.no .mk { border: 1.5px solid var(--line-2); color: var(--muted); }
.docs { display: flex; flex-direction: column; gap: 6px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.doc .pdf { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--crit); border-radius: 3px; padding: 3px 4px; flex: none; }
.doc .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.person { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--raised); min-width: 0; }
.person b { display: block; }
.person .role { font-size: 12px; color: var(--muted); }
.person .line { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; min-width: 0; }
.person .line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.compare { font-size: 12px; font-weight: 600; }

/* ---------- Pipeline board ---------- */
.board-wrap { overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.board { display: grid; grid-template-columns: repeat(7, minmax(196px, 1fr)); gap: 12px; min-width: 1450px; }
.col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 420px; scroll-snap-align: start; }
.col.drop { outline: 2px dashed var(--focus); outline-offset: -2px; }
.col-head { padding: 11px 12px 9px; border-bottom: 1px solid var(--line); }
.col-head .ttl { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.col-head .ttl .n { margin-left: auto; font-weight: 600; color: var(--muted); font-size: 12px; }
.col-head .sum { font-size: 12px; color: var(--muted); margin-top: 2px; }
.col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.opp > span { display: block; }
.opp { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; cursor: grab; text-align: left; width: 100%; display: block; }
.opp:hover { border-color: var(--line-2); box-shadow: 0 2px 8px rgba(22, 27, 39, .08); }
.opp.dragging { opacity: .5; }
.opp .r1 { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.opp .muni { font-weight: 600; margin-top: 4px; font-size: 13.5px; }
.opp .prod { font-size: 12px; color: var(--muted); }
.opp .r3 { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; gap: 6px; }
.opp .val { font-weight: 700; font-size: 13px; }

/* ---------- Drawer (forms, opportunity panel) ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); z-index: 60; box-shadow: var(--shadow); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .22s ease; border-left: 1px solid var(--line); }
.drawer.open { transform: none; }
.drawer.wide { width: min(880px, 100vw); }
.drawer.mid { width: min(720px, 100vw); }
/* chemicals on a pipeline card */
.ctags { display: flex !important; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ctag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.ctag.won { background: color-mix(in srgb, var(--good) 14%, var(--panel)); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); color: var(--ink); }
.ctag.lost { color: var(--muted); }
.ctag.notbid { color: var(--muted); text-decoration: line-through; background: none; border-style: dashed; }
tr.notbid td { color: var(--muted); }
tr.notbid td .strong { font-weight: 500; }
table.t.compact td, table.t.compact th { padding: 7px 9px; }
.num-in { width: 92px; min-height: 30px; padding: 4px 8px; text-align: right; }
/* award / lost results, one block per chemical */
.aw-lines { display: flex; flex-direction: column; gap: 8px; }
.aw-row { border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.aw-row.won { border-left: 3px solid var(--good); }
.aw-row.lost { border-left: 3px solid var(--line-2); }
.aw-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aw-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 10px; align-items: start; }
@media (max-width: 620px) { .aw-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .aw-fields > .field:last-child { grid-column: 1 / -1; } }
/* equipment rows on the plant form */
.line-row.eq { grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr) minmax(0, 1.1fr) minmax(0, 1.6fr) 32px; }
.line-row.eq.locked { grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr) minmax(0, 1.1fr) minmax(0, 1.6fr) auto; background: var(--panel-2); }
.line-row.eq.locked .field b { font-weight: 600; padding-top: 2px; }
.clip-cell { display: block; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-head { padding: 16px 20px; padding-top: calc(16px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.drawer-head .titles { flex: 1; min-width: 0; }
.drawer-head h2 { font-family: var(--f-display); font-variation-settings: "wdth" 104; font-size: 18px; font-weight: 700; }
.drawer-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 12px 20px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lines { display: flex; flex-direction: column; gap: 8px; }
.line-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.6fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .85fr) 32px; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.line-row.pc { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.2fr) 32px; }
.line-row .x { margin-top: 22px; }
.hint { display: block; font-size: 11.5px; line-height: 1.45; color: var(--muted); margin-top: 4px; }
.hint.ok { color: var(--ink-2); }
.hint b { font-weight: 600; color: var(--ink-2); }
.sug { border: 1px solid var(--line-2); background: var(--gold-soft); color: var(--gold-ink); border-radius: 99px; padding: 1px 8px; margin: 2px 4px 2px 0; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.sug:hover { border-color: var(--gold-ink); }
@media (max-width: 720px) { .line-row, .line-row.pc, .line-row.eq, .line-row.eq.locked { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .line-row .x { grid-column: 2; justify-self: end; margin-top: 0; } }
.notice { padding: 10px 12px; border-radius: var(--r); background: var(--gold-soft); color: var(--gold-ink); font-size: 13px; font-weight: 500; }
.notice.plain { background: var(--panel-2); color: var(--ink-2); }
.notice.error { background: color-mix(in srgb, var(--crit) 12%, var(--panel)); color: var(--crit); }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.stage-opt { border: 1px solid var(--line-2); background: var(--raised); border-radius: var(--r); padding: 7px 8px; cursor: pointer; font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stage-opt[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--panel); }
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
.note .body { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 11px; }
.note .by { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.confirm-row td { background: var(--gold-soft) !important; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.tab .n { font-weight: 500; color: var(--muted); margin-left: 4px; font-size: 12px; }

/* ---------- Toasts & tooltip ---------- */
.toasts { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--panel); border-radius: 8px; padding: 10px 14px; font-weight: 500; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.toast a, .toast button { color: var(--gold); background: none; border: 0; font-weight: 700; cursor: pointer; padding: 0; margin-left: auto; text-decoration: underline; }
.tip { position: fixed; z-index: 95; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 10px; font-size: 12.5px; box-shadow: var(--shadow); max-width: 280px; }

/* ---------- Login ---------- */
.login { height: 100%; overflow-y: auto; display: flex; padding: 24px 16px; background: var(--bg); }
.login-card { margin: auto; width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.login-top { background: var(--rail); padding: 26px 28px 22px; color: var(--rail-ink); }
.login-top .brand { padding: 0; }
.login-top .wordmark { font-size: 22px; }
.login-top .wordmark small { font-size: 10.5px; }
.login-top p { margin: 14px 0 0; color: var(--rail-muted); font-size: 13px; }
.login-body { padding: 22px 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-accts { display: flex; flex-direction: column; gap: 8px; }
.demo-acct { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line-2); background: var(--raised); border-radius: 8px; padding: 10px 12px; cursor: pointer; width: 100%; }
.demo-acct:hover { border-color: var(--ink-2); }
.demo-acct b { display: block; font-size: 13.5px; }
.demo-acct span { display: block; font-size: 12px; color: var(--muted); }
.login-foot { font-size: 12px; color: var(--muted); text-align: center; padding: 0 28px 22px; }
.linkish { background: none; border: 0; padding: 0; color: var(--focus); cursor: pointer; font-weight: 600; font-size: 12.5px; }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 18px; align-items: start; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: var(--raised); padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }

/* documents */
.doc .nm2 { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc .nm2 b, .doc .nm2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .nm2 b { font-weight: 600; font-size: 13px; }
.doc .nm2 span { font-size: 11.5px; color: var(--muted); }
.upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.upload-row .input { width: auto; flex: 1 1 180px; }
.doc-count { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.doc-count svg.i { width: 14px; height: 14px; }
.opp .r1 .mono { white-space: nowrap; }
.opp .r1 > span:last-child { text-align: right; }

/* ---------- AI bid reader ---------- */
.ai-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 18px; border: 1.5px dashed var(--line-2); border-radius: 8px; background: var(--raised); cursor: pointer; }
.drop svg.i { width: 26px; height: 26px; color: var(--ai); }
.drop b { font-size: 15px; }
.drop:hover, .drop.over, .from-pdf.over { border-color: var(--ai); background: var(--ai-soft); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.job { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.job-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.job-t .muted { font-size: 12.5px; }
.job + small { display: block; margin-top: 6px; }
.spin { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ai); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.from-pdf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--raised); }
.from-pdf > span:first-child { flex: 1 1 260px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.from-pdf > span:first-child svg.i, .ai-note svg.i, .ai-mark svg.i, .line-desc svg.i { color: var(--ai); }
.ai-note { background: var(--ai-soft); color: var(--ink); line-height: 1.55; }
.ai-note svg.i { width: 16px; height: 16px; vertical-align: -3px; }
.ai-mark { display: inline-flex; vertical-align: -3px; margin-left: 6px; }
.ai-mark svg.i { width: 15px; height: 15px; }
.input.ai, select.input.ai, textarea.input.ai { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 45%, var(--line-2)); }
.check.ai-check { background: var(--ai-soft); border-radius: 4px; padding: 2px 6px; margin: -2px -6px; }
.line-desc { grid-column: 1 / -1; display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); }
.line-desc svg.i { width: 15px; height: 15px; margin-top: 1px; }
.new-muni { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid color-mix(in srgb, var(--ai) 35%, var(--line)); border-radius: var(--r); background: var(--raised); }
.new-muni:empty { display: none; }
#new-muni:empty { display: none; }
.brief { display: flex; flex-direction: column; gap: 14px; }
.brief-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.brief-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 4px; font-size: 12.5px; }
.gng { flex: none; font-family: var(--f-display); font-weight: 800; letter-spacing: .08em; font-size: 12px; line-height: 1; padding: 6px 10px; border-radius: 4px; color: #fff; background: #B45309; }
.gng.go { background: #166534; }
.gng.no_go { background: #991B1B; }
.gng.sm { font-size: 10.5px; padding: 3px 7px; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.bsec { border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); overflow: hidden; min-width: 0; }
.bsec > h4 { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; color: #fff; background: #0D2340; }
.bsec.teal > h4 { background: #0E6B6B; }
.bsec.amber > h4 { background: #B45309; }
.bsec.red > h4 { background: #991B1B; }
.bsec.green > h4 { background: #166534; }
.bsec .in { padding: 8px 12px 10px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); font-weight: 500; flex: none; max-width: 45%; }
.kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kv b i { color: var(--muted); font-weight: 400; }
.kv b.hi { background: var(--gold-soft); color: var(--gold-ink); padding: 0 6px; border-radius: 3px; }
.blist { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.blist .flag-dq { color: var(--crit); }
.blist .flag-w { color: var(--ink-2); }
.blist .flag-w b { color: #B45309; }
.blist li.for::marker { content: "✓  "; color: var(--good); }
.blist li.watch::marker { content: "!  "; color: #B45309; font-weight: 800; }
.tag-req { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--crit); margin-left: 4px; }
.gng-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px 18px; font-size: 13px; }
.gng-cols > div > b { display: block; margin-bottom: 4px; }
.bsec-table { border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
iframe.onepager { width: 100%; flex: 1; min-height: 70vh; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.focus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 7px 14px; }
.focus-grid .check { font-size: 13px; }
.focus-cat { grid-column: 1 / -1; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.focus-cat:first-child { margin-top: 0; }
.check:has(input:disabled) { cursor: default; color: var(--ink-2); }
