/* Desktop Feeds, matching mockup/desktop-overhaul (#feeds): a quiet summary
   line, one card of provider rows, and the classification footer. */
:root {
  --sans: 'IBM Plex Sans', ui-sans-serif, -apple-system, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ink: #141816; --ink-2: #2D3330; --muted: #59615C; --faint: #858C87; --ghost: #B4BAB5;
  --line: #E7E9E6; --line-strong: #D6DAD5; --ground: #F5F6F3; --hover: #F8F9F7; --paper: #FFFFFF;
  --green: #1E5C42; --sel: #F0F5F1;
  --amber: #9A6208; --amber-soft: #FBF1DE; --red: #B23A2E; --red-soft: #FBEDEA;
  --gutter: 32px;
  --pop-shadow: 0 2px 6px rgb(20 24 22 / 8%), 0 16px 40px rgb(20 24 22 / 14%);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); }
body { color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button { color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; transform: translateY(-180%); border-radius: 7px; background: var(--ink); padding: 8px 12px; color: white; }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.feeds { display: flex; flex-direction: column; min-width: 0; min-height: calc(100vh - var(--app-header-height)); padding: 36px var(--gutter) 48px; background: var(--ground); }
.feeds > * { flex: none; }

/* ───────────── Summary line ───────────── */
.fleet-line { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font: 500 12px/1.6 var(--mono); white-space: nowrap; }
.fleet-line b { color: var(--ink); font-weight: 600; }
.fleet-stats { margin: 0; font: inherit; }
.fl-sep { margin: 0 12px; color: var(--ghost); }
.fleet-today { position: relative; }
.fleet-today button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; }
.fleet-today button svg { width: 13px; height: 13px; }
.fleet-today .added { color: #5F7869; }
.fleet-today .gone { color: #946F6D; }
.stale-note { margin-left: 12px; color: var(--amber); }
.clock { margin-left: auto; color: var(--muted); font: inherit; white-space: nowrap; }

/* Today's breakdown by job type. */
.pop { position: absolute; z-index: 40; min-width: 220px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); box-shadow: var(--pop-shadow); }
.ticker-pop { left: 0; top: calc(100% + 6px); min-width: 280px; padding: 10px 12px; font-family: var(--sans); font-weight: 400; white-space: normal; }
.ticker-pop table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.ticker-pop td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.ticker-pop td + td { padding-left: 16px; text-align: right; }
.ticker-pop .pos { color: var(--green); font-weight: 600; }
.ticker-pop .neg { color: var(--red); }
.ticker-pop p { margin: 8px 0 0; color: var(--faint); font-size: 12px; }

/* ───────────── Providers ───────────── */
.prov-card { margin-bottom: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
/* Columns sized to their widest value: aligned like a table, gaps close to the compact text. */
table.prov { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 13.5px; }
table.prov th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 11px; font-weight: 500; text-align: right; white-space: nowrap; }
table.prov th:first-child { text-align: left; }
table.prov td { width: 1%; height: 41px; padding: 0 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.prov tr.p-row td { height: 37px; }
table.prov td:first-child { width: 170px; min-width: 170px; text-align: left; }
table.prov tr:last-child td { border-bottom: 0; }
table.prov tr.p-row { cursor: pointer; }
table.prov tr.p-row:hover td { background: var(--hover); }
table.prov tr.p-row.open td { background: var(--sel); border-bottom-color: transparent; }
table.prov .p-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
table.prov .p-name svg { width: 14px; height: 14px; color: var(--faint); transition: transform .15s; }
table.prov tr.open .p-name svg { transform: rotate(90deg); }
table.prov td.student-count { color: var(--ink); font-weight: 600; }
table.prov td.scale { color: var(--faint); font-size: 12.5px; font-weight: 400; }
table.prov td.pct { padding-right: 20px; color: var(--ink-2); font-weight: 500; text-align: right; }
table.prov .warn, table.prov td.pct.warn { color: var(--amber); font-weight: 600; }
table.prov .bad, table.prov td.pct.bad { color: var(--red); font-weight: 600; }
/* Problem counts, each with its wall colour as a square. */
table.prov td.issue-cell { padding: 0 18px 0 0; color: var(--muted); font-size: 13px; text-align: left; }
.issue { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.issue i { width: 5px; height: 5px; flex: none; }
table.prov td.fill { width: auto; padding: 0; }
table.prov td.scale { padding-left: 0; padding-right: 0; color: var(--faint); font-size: 12.5px; text-align: right; }
table.prov td.scale + td.scale { padding: 0 12px 0 16px; }

/* Expanded provider: the wall alone. */
table.prov .p-detail td { width: auto; height: auto; padding: 6px 16px 18px; background: var(--sel); text-align: left; white-space: normal; }
.sq-wrap { position: relative; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.sq-wrap canvas { display: block; image-rendering: pixelated; cursor: crosshair; }
.sq-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 180px; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12.5px; box-shadow: var(--pop-shadow); }
.sq-tip b { display: block; margin-bottom: 2px; }
.sq-tip span { display: block; color: #C9D2CC; }

/* ───────────── Footer ───────────── */
.fleet-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); color: var(--faint); font: 500 12px/1.6 var(--mono); }
.fleet-foot p { margin: 0; }
.fleet-foot b { color: var(--muted); font-weight: 600; }
.fleet-foot a { color: var(--muted); text-decoration-color: var(--ghost); text-underline-offset: 3px; }

/* ───────────── Loading, empty and error ───────────── */
.state { min-height: 320px; display: grid; place-items: center; align-content: center; margin-bottom: 28px; padding: 35px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: center; }
.state-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: var(--ground); color: var(--muted); }
.state-icon.error { background: var(--red-soft); color: var(--red); }
.state h2 { margin: 13px 0 4px; font-size: 18px; }
.state p { max-width: 420px; margin: 0; color: var(--muted); }
.state button { margin-top: 16px; padding: 8px 13px; border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: white; font-weight: 600; }
.loading-state { border: 0; background: transparent; }
.loading-state p { margin-top: 10px; }
.spinner { width: 23px; height: 23px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* ───────────── Narrow desktop (1024–1199) ───────────── */
@media (max-width: 1199px) {
  :root { --gutter: 24px; }
  table.prov td:first-child { width: 140px; min-width: 140px; }
}
@media (prefers-reduced-motion: reduce) { table.prov .p-name svg { transition: none; } .spinner { animation-duration: 2s; } }
