/* EdOps App Design Language v2 — reference component CSS.
 *
 * The executable version of DESIGN_LANGUAGE.md §6. Every value comes from a token in
 * ../dist/tokens.css; nothing here is a literal color or size except 0, 1px hairlines and
 * percentages. Density-dependent components read --eo-density-*, so the same markup is
 * correct in a summary page (data-density="comfortable") and a workspace grid
 * (data-density="compact"|"dense").
 *
 * Treat this as the reference, not a dependency: Django apps fold the pieces they use into
 * static/themes/edops/components/*.css; React apps port them into their component library.
 * The class names ARE the contract — keep them when porting.
 */

/* ---------- base ---------- */
.eo-app { font: var(--eo-type-body); color: var(--eo-text-primary); background: var(--eo-surface-page);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.eo-app *, .eo-app *::before, .eo-app *::after { box-sizing: border-box; }
.eo-app :focus-visible { outline: none; box-shadow: var(--eo-focus-ring); border-radius: var(--eo-radius-sm); }
.eo-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eo-icon { width: var(--eo-density-icon); height: var(--eo-density-icon); flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eo-caps { font: var(--eo-type-label-caps); letter-spacing: var(--eo-type-label-caps-tracking); text-transform: uppercase; color: var(--eo-text-secondary); }

/* ---------- buttons ---------- */
.eo-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--eo-space-2);
  height: var(--eo-density-control); padding: 0 var(--eo-space-5); border-radius: var(--eo-radius-control);
  font: var(--eo-type-body-strong); font-size: var(--eo-density-text-table); white-space: nowrap; cursor: pointer;
  border: 1px solid var(--eo-action-secondary-border); background: var(--eo-action-secondary-bg); color: var(--eo-action-secondary-fg);
  transition: background var(--eo-motion-fast), border-color var(--eo-motion-fast), color var(--eo-motion-fast); }
.eo-btn:hover { background: var(--eo-action-secondary-bg-hover); border-color: var(--eo-border-strong); }
.eo-btn-primary { background: var(--eo-action-primary-bg); border-color: var(--eo-action-primary-bg); color: var(--eo-action-primary-fg); }
.eo-btn-primary:hover { background: var(--eo-action-primary-bg-hover); border-color: var(--eo-action-primary-bg-hover); }
.eo-btn-quiet { border-color: transparent; background: transparent; color: var(--eo-action-quiet-fg); }
.eo-btn-quiet:hover { background: var(--eo-surface-hover); color: var(--eo-text-primary); border-color: transparent; }
.eo-btn-danger { color: var(--eo-action-danger-fg); }
.eo-btn-inverse { background: var(--eo-surface-inverse); border-color: var(--eo-surface-inverse); color: var(--eo-text-inverse); }
.eo-btn-sm { height: var(--eo-density-control-sm); padding: 0 var(--eo-space-3); font: var(--eo-type-chip); font-family: var(--eo-font-family-text); }
.eo-btn[disabled] { opacity: 1; background: var(--eo-surface-sunken); border-color: var(--eo-surface-sunken); color: var(--eo-text-disabled); cursor: default; }
.eo-icon-btn { display: inline-grid; place-items: center; width: var(--eo-density-control); height: var(--eo-density-control);
  border: 0; border-radius: var(--eo-radius-control); background: transparent; color: var(--eo-text-secondary); cursor: pointer; }
.eo-icon-btn:hover { background: var(--eo-surface-hover); color: var(--eo-text-primary); }

/* ---------- filter chips (one component; count is part of it) ---------- */
.eo-filters { display: flex; flex-wrap: wrap; gap: var(--eo-space-1); align-items: center; }
.eo-filter { display: inline-flex; align-items: center; gap: var(--eo-space-2); height: var(--eo-density-control-sm);
  padding: 0 var(--eo-space-4); border-radius: var(--eo-radius-control); border: 1px solid transparent; background: transparent;
  font: var(--eo-type-chip); color: var(--eo-action-quiet-fg); cursor: pointer; white-space: nowrap; }
.eo-filter:hover { background: var(--eo-surface-hover); color: var(--eo-text-primary); }
.eo-filter[aria-pressed="true"] { background: var(--eo-surface-selected); border-color: var(--eo-blue-100); color: var(--eo-action-quiet-fg-active); }
.eo-filter, .eo-segmented button, .eo-tag, .eo-badge { letter-spacing: 0; }
.eo-filter .eo-count { font-weight: var(--eo-font-weight-regular); color: var(--eo-text-tertiary); }
.eo-filter[aria-pressed="true"] .eo-count { color: inherit; }
.eo-filter .eo-swatch { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- segmented ---------- */
.eo-segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--eo-radius-pill); background: var(--eo-surface-sunken); }
.eo-segmented button { height: calc(var(--eo-density-control-sm) - 4px); padding: 0 var(--eo-space-4); border: 0; border-radius: var(--eo-radius-pill);
  background: transparent; font: var(--eo-type-chip); color: var(--eo-action-quiet-fg); cursor: pointer; }
.eo-segmented button[aria-pressed="true"] { background: var(--eo-surface-card); color: var(--eo-text-primary); box-shadow: 0 1px 2px var(--eo-black-a-14); }
/* An option with nothing to show (a department with no revenue): disabled, never hidden, so the set keeps its shape (D33). */
.eo-segmented button:disabled { color: var(--eo-text-disabled); cursor: default; }
.eo-segmented button:disabled:hover { background: transparent; }

/* ---------- fields ---------- */
.eo-search, .eo-select, .eo-input { display: inline-flex; align-items: center; gap: var(--eo-space-2); height: var(--eo-density-control);
  padding: 0 var(--eo-space-4); border: 1px solid var(--eo-border-default); border-radius: var(--eo-radius-control);
  background: var(--eo-surface-card); color: var(--eo-text-primary); font: var(--eo-type-small); font-family: var(--eo-font-family-data); font-size: var(--eo-density-text-table); }
.eo-search { color: var(--eo-text-secondary); min-width: 200px; background: var(--eo-surface-search); } /* light blue at rest (D30); secondary, since tertiary is 4.45:1 on it */
.eo-search:focus-within, .eo-input:focus { border-color: var(--eo-border-focus); }
.eo-search:focus-within { background: var(--eo-surface-overlay); }
.eo-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--eo-text-primary); } /* a real <input> inside the field: the field draws the box, the input none */
.eo-search input::placeholder { color: var(--eo-text-secondary); opacity: 1; }
.eo-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.eo-select::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; }

/* ---------- pills, codes, tags ---------- */
.eo-pill { display: inline-flex; align-items: center; gap: var(--eo-space-1); height: 20px; padding: 0 var(--eo-space-3);
  border-radius: var(--eo-radius-pill); font: var(--eo-type-chip); letter-spacing: var(--eo-type-chip-tracking); white-space: nowrap;
  background: var(--eo-status-neutral-bg); color: var(--eo-status-neutral-fg); }
.eo-pill-good { background: var(--eo-status-good-bg); color: var(--eo-status-good-fg); }
.eo-pill-attention { background: var(--eo-status-attention-bg); color: var(--eo-status-attention-fg); }
.eo-pill-ahead { background: var(--eo-status-ahead-bg); color: var(--eo-status-ahead-fg); }
.eo-pill-severe { background: var(--eo-status-severe-bg); color: var(--eo-status-severe-fg); }
.eo-pill-discussion { background: var(--eo-discussion-bg); color: var(--eo-discussion-fg); }
/* A category (what kind of thing: Expense, Revenue, Salary) is never colored, so color always means "look at this" (D13). */
.eo-pill-category { background: transparent; color: var(--eo-text-secondary); box-shadow: inset 0 0 0 1px var(--eo-border-strong); }
.eo-pill-edited { background: var(--eo-data-edited-bg); color: var(--eo-data-edited-fg); }
.eo-code { display: inline-grid; place-items: center; min-width: 30px; height: 16px; padding: 0 var(--eo-space-1);
  border-radius: var(--eo-radius-sm); font: var(--eo-type-code); letter-spacing: var(--eo-type-code-tracking); text-transform: uppercase;
  background: var(--eo-surface-sunken); color: var(--eo-text-secondary); }
.eo-code-detail { background: var(--eo-blue-50); color: var(--eo-blue-600); }
.eo-code-manual { background: var(--eo-neutral-200); color: var(--eo-text-primary); }
.eo-code-quiet { background: transparent; color: var(--eo-text-disabled); }
.eo-tag { display: inline-flex; align-items: center; gap: var(--eo-space-2); height: 24px; padding: 0 var(--eo-space-3);
  border-radius: var(--eo-radius-pill); background: var(--eo-surface-sunken); font: var(--eo-type-meta); color: var(--eo-text-primary); }
.eo-tag-scope { background: var(--eo-surface-selected); color: var(--eo-text-link); }
.eo-tag button { border: 0; background: none; padding: 0; color: inherit; opacity: .6; cursor: pointer; font: inherit; }
.eo-tag-add { background: transparent; border: 1px dashed var(--eo-border-strong); color: var(--eo-text-secondary); }
.eo-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--eo-radius-pill);
  background: var(--eo-mark-badge-bg); color: var(--eo-mark-badge-fg); font: var(--eo-type-code); }
.eo-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--eo-mark-star); }

/* ---------- switch, avatar ---------- */
.eo-switch { position: relative; width: 32px; height: 18px; border-radius: var(--eo-radius-pill); background: var(--eo-neutral-300); border: 0; cursor: pointer; flex: none; }
.eo-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--eo-white);
  box-shadow: 0 1px 2px var(--eo-black-a-14); transition: left var(--eo-motion-fast); }
.eo-switch[aria-checked="true"] { background: var(--eo-action-primary-bg); }
.eo-switch[aria-checked="true"]::after { left: 16px; }
.eo-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--eo-sky-500);
  color: var(--eo-white); font: var(--eo-type-chip); flex: none; }

/* ---------- menu / popover ---------- */
.eo-menu { min-width: 220px; padding: var(--eo-space-1); border: 1px solid var(--eo-border-default); border-radius: var(--eo-radius-md);
  background: var(--eo-surface-overlay); box-shadow: var(--eo-shadow-overlay); font: var(--eo-type-small); }
.eo-menu-title { padding: var(--eo-space-3) var(--eo-space-4) var(--eo-space-2); font: var(--eo-type-body-strong); font-size: var(--eo-font-size-13); border-bottom: 1px solid var(--eo-border-subtle); margin-bottom: var(--eo-space-1); }
.eo-menu-section { padding: var(--eo-space-3) var(--eo-space-4) var(--eo-space-1); }
.eo-menu-item { display: flex; align-items: center; gap: var(--eo-space-3); width: 100%; min-height: 28px; padding: 0 var(--eo-space-4);
  border: 0; border-radius: var(--eo-radius-control); background: transparent; color: var(--eo-text-primary); font: inherit; text-align: left; cursor: pointer; }
.eo-menu-item:hover { background: var(--eo-surface-hover); }
.eo-menu-item[aria-checked="true"] { background: var(--eo-surface-selected); color: var(--eo-action-quiet-fg-active); font-weight: var(--eo-font-weight-semibold); }
.eo-menu-item .eo-menu-aside { margin-left: auto; font: var(--eo-type-code); letter-spacing: var(--eo-type-code-tracking); color: var(--eo-text-tertiary); }
.eo-menu-item[aria-disabled="true"] { color: var(--eo-text-disabled); cursor: default; }
.eo-menu-item-danger { color: var(--eo-action-danger-fg); }
.eo-menu hr { border: 0; border-top: 1px solid var(--eo-border-subtle); margin: var(--eo-space-1) 0; }
.eo-menu-link { color: var(--eo-text-link); }

/* ---------- cards & KPI tiles ---------- */
.eo-card { background: var(--eo-surface-card); border: 1px solid var(--eo-border-default); border-radius: var(--eo-density-radius-card);
  box-shadow: var(--eo-shadow-raised); overflow: hidden; }
.eo-card-head { display: flex; align-items: center; gap: var(--eo-space-5); flex-wrap: wrap;
  padding: var(--eo-density-card-head-pad-y) var(--eo-density-card-pad); border-bottom: 1px solid var(--eo-border-default); }
.eo-card-title { font: var(--eo-type-title-card); margin: 0; }
.eo-card-title .eo-count { font-weight: var(--eo-font-weight-regular); color: var(--eo-text-tertiary); margin-left: var(--eo-space-1); }
.eo-card-hint { font: var(--eo-type-meta); color: var(--eo-text-secondary); margin: 2px 0 0; }
.eo-card-actions { margin-left: auto; display: flex; gap: var(--eo-space-3); align-items: center; }
.eo-card-body { padding: var(--eo-density-card-pad); }
/* Summary figures. There are no KPI tiles (D12): headline numbers live in a stat line under the page title,
   in a key-figures panel beside a chart, in the table's own filter control, and in a leading total row. */
.eo-stat { display: flex; flex-wrap: wrap; align-items: center; gap: var(--eo-space-2) var(--eo-space-6);
  padding: var(--eo-space-3) var(--eo-density-card-pad); background: var(--eo-surface-card);
  border: 1px solid var(--eo-border-default); border-radius: var(--eo-density-radius-card); }
.eo-stat-item { display: inline-flex; align-items: baseline; gap: var(--eo-space-2); white-space: nowrap; }
.eo-stat-label { font: var(--eo-type-meta); color: var(--eo-text-secondary); }
.eo-stat-value { font: var(--eo-type-figure); }
.eo-stat-sep { width: 1px; align-self: stretch; background: var(--eo-border-subtle); }
.eo-stat .eo-pace { flex: 0 0 120px; }
.eo-keyfigs { background: var(--eo-surface-card); border: 1px solid var(--eo-border-default); border-radius: var(--eo-density-radius-card); overflow: hidden; }
.eo-keyfigs-head { padding: var(--eo-space-3) var(--eo-space-5) var(--eo-space-1); font: var(--eo-type-meta); font-weight: var(--eo-font-weight-semibold); color: var(--eo-text-secondary); background: var(--eo-surface-muted); border-bottom: 1px solid var(--eo-border-subtle); }
.eo-keyfig { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--eo-space-5); align-items: center; padding: var(--eo-space-3) var(--eo-space-5); border-bottom: 1px solid var(--eo-border-subtle); }
.eo-keyfig:last-child { border-bottom: 0; }
.eo-keyfig-label { font: var(--eo-type-small); color: var(--eo-text-primary); }
.eo-keyfig-note { font: var(--eo-type-meta); color: var(--eo-text-secondary); grid-column: 1; }
.eo-keyfig-value { font: var(--eo-type-figure); text-align: right; grid-column: 2; grid-row: 1 / span 2; }
/* A population split drawn as a thin line under the filter control that carries its counts. */
.eo-split { display: flex; gap: 2px; height: 4px; }
.eo-split > i { display: block; border-radius: 2px; }

/* ---------- measure bars ---------- */
/* Pace: progress toward a budget against where you should be by now (the marker). */
.eo-pace { position: relative; height: 8px; min-width: 80px; border-radius: var(--eo-radius-sm); background: var(--eo-status-track); } /* fill width is min(% used, 100%); never rescale the track (§5.14) */
.eo-pace > i { position: absolute; inset: 0 auto 0 0; border-radius: var(--eo-radius-sm); background: var(--eo-status-neutral-fill); }
.eo-pace > b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--eo-status-marker); }
.eo-pace.is-good > i { background: var(--eo-status-good-fill); }
.eo-pace.is-attention > i { background: var(--eo-status-attention-fill); }
.eo-pace.is-ahead > i { background: var(--eo-status-ahead-fill); }
.eo-pace.is-severe > i { background: var(--eo-status-severe-fill); }
/* Variance to plan: a solid block, length ∝ |variance|, color = judgement. */
.eo-variance { display: inline-block; height: 8px; border-radius: 2px; min-width: 3px; background: var(--eo-status-good-fill); vertical-align: middle; }
.eo-variance.is-attention { background: var(--eo-status-attention-fill); }
.eo-variance.is-severe { background: var(--eo-status-severe-fill); }
/* Movement since prior forecast: a lollipop — deliberately unlike the solid variance block. */
.eo-movement { display: inline-flex; align-items: center; vertical-align: middle; }
.eo-movement > i { height: 2px; background: currentColor; }
.eo-movement::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.eo-movement { color: var(--eo-status-good-fill); }
.eo-movement.is-attention { color: var(--eo-status-attention-fill); }
.eo-movement.is-down { flex-direction: row-reverse; }
/* Composition: how a population splits across statuses. */
.eo-composition { display: flex; height: 8px; border-radius: var(--eo-radius-sm); overflow: hidden; gap: 2px; background: var(--eo-surface-card); }
.eo-composition > i { display: block; }

/* ---------- summary table (comfortable tier) ---------- */
.eo-table { width: 100%; border-collapse: collapse; font: var(--eo-type-meta-data); font-size: var(--eo-density-text-table); line-height: var(--eo-density-text-table-lh); }
.eo-table th { height: var(--eo-density-row-header); padding: 0 var(--eo-density-cell-x); font: var(--eo-type-meta-data); font-size: var(--eo-density-text-meta);
  color: var(--eo-text-secondary); text-align: left; border-bottom: 1px solid var(--eo-border-default); white-space: nowrap; }
.eo-table td { height: var(--eo-density-row); padding: 0 var(--eo-density-cell-x); border-bottom: 1px solid var(--eo-border-subtle); }
.eo-table th:first-child, .eo-table td:first-child { padding-left: var(--eo-density-card-pad); }
.eo-table th:last-child, .eo-table td:last-child { padding-right: var(--eo-density-card-pad); }
.eo-table th.eo-num, .eo-table td.eo-num { text-align: right; }
/* Section rows (D18, revised by Josh 2026-11-06): slate band, slate rules above and below, and a 3px slate handle on the
   left edge. Slate, not the selection's blue.600, and section rows are never selectable, so the two handles can't be confused.
   Replaces the old .eo-group dark rule in summary tables, so both apps group rows the same way. */
.eo-table tr.eo-section td, .eo-grid tr.eo-section td { height: var(--eo-density-row-section); background: var(--eo-data-section-bg);
  font-weight: var(--eo-font-weight-bold); color: var(--eo-text-primary); border-top: 1px solid var(--eo-data-section-rule); border-bottom: 1px solid var(--eo-data-section-rule); }
.eo-grid tr.eo-section td.eo-c0 { box-shadow: inset 3px 0 0 var(--eo-data-section-bar); padding-left: calc(var(--eo-density-cell-x) + 3px); }
.eo-table tr.eo-section td:first-child { box-shadow: inset 3px 0 0 var(--eo-data-section-bar); padding-left: calc(var(--eo-density-card-pad) + 3px); }
.eo-table tr.eo-section td a { color: var(--eo-text-link); text-decoration: none; }
.eo-table td:first-child, .eo-grid td.eo-c0 { font-family: var(--eo-font-family-text); font-variant-numeric: normal; } /* the row label is text (§3.2) */
.eo-grid td.eo-c0 .eo-id { font-family: var(--eo-font-family-data); font-variant-numeric: tabular-nums; }
/* Totals (D19): two warm steps. A total is muted with a 1px rule; the grand total is sunken under a 2px ink "sum line". */
.eo-table tr.eo-total td, .eo-grid tr.eo-total td { font-weight: var(--eo-font-weight-semibold); background: var(--eo-data-total-bg); border-top: 1px solid var(--eo-border-strong); color: var(--eo-text-primary); }
.eo-table tr.eo-grand-total td, .eo-grid tr.eo-grand-total td { font-weight: var(--eo-font-weight-bold); background: var(--eo-surface-sunken); border-top: 2px solid var(--eo-text-primary); border-bottom: 1px solid var(--eo-border-strong); color: var(--eo-text-primary); }
.eo-table tr.eo-grand-total.is-lead td { border-top: 0; border-bottom: 2px solid var(--eo-text-primary); } /* a leading district total (§5.13): the sum line sits under it */
.eo-table .eo-row-link { font-weight: var(--eo-font-weight-semibold); color: var(--eo-text-link); text-decoration: none; white-space: nowrap; }
.eo-table td .eo-pace { min-width: 96px; }
.eo-table .eo-id { color: var(--eo-text-secondary); margin-right: var(--eo-space-2); }
.eo-table .eo-muted { color: var(--eo-text-tertiary); }
.eo-table tr.eo-section .eo-muted { color: var(--eo-text-secondary); } /* tertiary misses AA on the section band */

/* ---------- workspace grid (compact / dense tiers) ---------- */
.eo-grid { border-collapse: separate; border-spacing: 0; font: var(--eo-type-grid); font-size: var(--eo-density-text-table);
  line-height: var(--eo-density-text-table-lh); background: var(--eo-surface-card); }
.eo-grid th, .eo-grid td { height: var(--eo-density-row); padding: 0 var(--eo-density-cell-x); border-right: 1px solid var(--eo-border-subtle);
  border-bottom: 1px solid var(--eo-border-subtle); white-space: nowrap; text-align: right; }
/* column-group bands and their period rule */
.eo-grid thead tr.eo-bands th { height: var(--eo-density-row-band); text-align: center; background: var(--eo-surface-muted);
  font: var(--eo-type-label-caps); letter-spacing: var(--eo-type-label-caps-tracking); text-transform: uppercase; color: var(--eo-text-secondary); }
.eo-grid thead tr.eo-heads th { height: var(--eo-density-row-header); background: var(--eo-surface-muted); color: var(--eo-text-secondary);
  font-weight: var(--eo-font-weight-semibold); font-size: var(--eo-density-text-meta); border-bottom: 1px solid var(--eo-border-strong); vertical-align: bottom; padding-bottom: var(--eo-space-2); }
.eo-grid thead tr.eo-heads th[data-period] { box-shadow: inset 0 2px 0 var(--eo-data-actual-rule); }
.eo-grid thead tr.eo-heads th[data-period="forecast"] { box-shadow: inset 0 2px 0 var(--eo-data-forecast-rule); color: var(--eo-data-forecast-fg); }
.eo-grid thead tr.eo-heads th[data-period="plan"] { box-shadow: inset 0 2px 0 var(--eo-data-plan-rule); color: var(--eo-data-plan-fg); }
.eo-grid thead tr.eo-heads th[data-period="current"] { box-shadow: inset 0 2px 0 var(--eo-data-current-rule); color: var(--eo-text-primary); }
.eo-grid thead tr.eo-bands th[data-period="forecast"] { background: var(--eo-data-forecast-bg); color: var(--eo-data-forecast-fg); }
.eo-grid thead tr.eo-bands th[data-period="plan"] { background: var(--eo-data-plan-band); color: var(--eo-data-plan-fg); }
/* period roles on body cells */
.eo-grid td[data-period="actual"] { color: var(--eo-data-actual-fg); background: var(--eo-data-actual-bg); }
.eo-grid td[data-period="forecast"] { color: var(--eo-data-forecast-fg); background: var(--eo-data-forecast-bg); }
.eo-grid td[data-period="plan"] { color: var(--eo-data-plan-fg); background: var(--eo-data-plan-bg); }
/* border hierarchy: 2px strong = structural, 1px strong = boundary inside a block, 1px subtle = cell grid */
.eo-grid .eo-structural { border-left: 2px solid var(--eo-border-strong); }
.eo-grid .eo-boundary { border-left: 1px solid var(--eo-border-strong); }
/* frozen first column */
.eo-grid .eo-c0 { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--eo-surface-card); border-right: 2px solid var(--eo-border-strong); min-width: 220px; }
.eo-grid thead .eo-c0 { background: var(--eo-surface-muted); z-index: 2; color: var(--eo-text-primary); }
.eo-grid.is-scrolled .eo-c0 { box-shadow: var(--eo-shadow-sticky-edge); }
.eo-grid .eo-c0 .eo-id { color: var(--eo-text-secondary); margin-right: var(--eo-space-2); }
/* row hierarchy */
.eo-grid tr.eo-section .eo-c0 { background: var(--eo-data-section-bg); }
.eo-grid tr.eo-group .eo-c0 { color: var(--eo-data-group-fg); font-weight: var(--eo-font-weight-semibold); padding-left: calc(var(--eo-density-cell-x) + var(--eo-space-3)); }
.eo-grid tr.eo-group td { border-bottom-color: var(--eo-border-subtle); }
.eo-grid tr.eo-account .eo-c0 { padding-left: calc(var(--eo-density-cell-x) + var(--eo-space-6)); }
.eo-grid tr.eo-total .eo-c0 { padding-left: calc(var(--eo-density-cell-x) + var(--eo-space-3)); }
/* states */
/* Hover (D17): a surface per period, so forecast cells stay blue under the pointer. Surface only. */
.eo-grid tr.eo-account:hover td, .eo-table tbody tr:hover td { background: var(--eo-data-row-hover); }
.eo-grid tr.eo-account:hover td[data-period="actual"] { background: var(--eo-data-actual-hover); }
.eo-grid tr.eo-account:hover td[data-period="forecast"] { background: var(--eo-data-forecast-hover); }
/* Selected (D17, Make's SelectedRow in brand blue): one band across the grid, so it still reads when the handle is scrolled off.
   Selection wins over hover; an edited cell keeps its ring. */
.eo-grid tr[aria-selected="true"] td, .eo-grid tr[aria-selected="true"]:hover td { background: var(--eo-surface-selected);
  border-top: 1px solid var(--eo-blue-500); border-bottom: 1px solid var(--eo-blue-500); }
.eo-grid tr[aria-selected="true"] .eo-c0 { box-shadow: inset 3px 0 0 var(--eo-blue-600); color: var(--eo-blue-600); }
.eo-grid td.is-edited { background: var(--eo-data-edited-bg); color: var(--eo-text-primary);
  box-shadow: inset 0 0 0 2px var(--eo-data-edited-mark); }
.eo-grid td input { width: 100%; height: calc(var(--eo-density-row) - 4px); border: 1px solid transparent; border-radius: var(--eo-radius-xs);
  background: transparent; font: inherit; color: inherit; text-align: right; padding: 0 var(--eo-space-1); }
.eo-grid td input:hover { border-color: var(--eo-border-default); }
.eo-grid td input:focus { outline: none; border-color: var(--eo-border-focus); background: var(--eo-surface-card); box-shadow: 0 0 0 2px var(--eo-blue-100); }
.eo-grid .eo-left { text-align: left; }
.eo-grid .eo-note { color: var(--eo-mark-note-empty); }
.eo-grid .eo-note.has-notes { color: var(--eo-mark-note); }

/* ---------- toolbar (D15) ---------- */
/* One toolbar for both apps: standalone above a workspace, or .is-attached as the head of the card it filters.
   Never wraps. Under 1120px the title block hides; then the scroll region scrolls sideways, with a fade and an arrow
   button on any side that has more. A few lines of script toggle .can-start/.can-end from scrollLeft and make the
   arrows scroll by about 70% of the visible width (see §5.17). */
.eo-toolbar { display: flex; align-items: center; gap: var(--eo-space-3); flex-wrap: nowrap; min-width: 0;
  min-height: calc(var(--eo-density-control) + 2 * var(--eo-space-2)); padding: var(--eo-space-1) var(--eo-space-3) var(--eo-space-1) var(--eo-space-5);
  background: var(--eo-surface-card); border: 1px solid var(--eo-border-default); border-radius: var(--eo-density-radius-card); }
.eo-toolbar.is-attached { border-radius: var(--eo-density-radius-card) var(--eo-density-radius-card) 0 0; border-bottom-color: var(--eo-border-subtle); }
.eo-toolbar-id { display: grid; flex: none; padding-right: var(--eo-space-5); border-right: 1px solid var(--eo-border-subtle); }
.eo-toolbar-title { font: var(--eo-type-title-card); margin: 0; white-space: nowrap; }
.eo-toolbar-sub { font: var(--eo-type-meta); font-size: var(--eo-density-text-meta); color: var(--eo-text-secondary); margin: 0; white-space: nowrap; }
.eo-toolbar-scroll { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.eo-toolbar-track { display: flex; align-items: center; gap: var(--eo-space-3); min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.eo-toolbar-track::-webkit-scrollbar { display: none; }
.eo-toolbar-track > * { flex: none; }
.eo-toolbar-scroll::before, .eo-toolbar-scroll::after { content: ""; position: absolute; top: 0; bottom: 0; width: 48px; pointer-events: none; opacity: 0; transition: opacity var(--eo-motion-fast); z-index: 1; }
.eo-toolbar-scroll::before { left: 0; background: linear-gradient(to right, var(--eo-surface-card) 45%, transparent); }
.eo-toolbar-scroll::after { right: 0; background: linear-gradient(to left, var(--eo-surface-card) 45%, transparent); }
.eo-toolbar-scroll.can-start::before, .eo-toolbar-scroll.can-end::after { opacity: 1; }
.eo-toolbar-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: none; place-items: center; width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--eo-border-default); border-radius: 50%; background: var(--eo-surface-overlay); color: var(--eo-text-primary); box-shadow: var(--eo-shadow-overlay); cursor: pointer; }
.eo-toolbar-arrow[data-dir="start"] { left: 2px; } .eo-toolbar-arrow[data-dir="end"] { right: 2px; }
.eo-toolbar-scroll.can-start .eo-toolbar-arrow[data-dir="start"], .eo-toolbar-scroll.can-end .eo-toolbar-arrow[data-dir="end"] { display: grid; }
.eo-toolbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--eo-space-3); flex: none; } /* pending-work chips, then actions; the primary action last */
@media (max-width: 1120px) { .eo-toolbar-id { display: none; } }
@media (prefers-reduced-motion: reduce) { .eo-toolbar-track { scroll-behavior: auto; } }

/* ---------- page header (summary tier) ---------- */
.eo-back { display: inline-flex; align-items: center; gap: var(--eo-space-2); font: var(--eo-type-body-strong); font-size: var(--eo-font-size-13); color: var(--eo-text-link); text-decoration: none; }
.eo-h1 { font: var(--eo-type-title-page); letter-spacing: var(--eo-type-title-page-tracking); margin: var(--eo-space-3) 0 var(--eo-space-2); }
.eo-lede { font: var(--eo-type-body); color: var(--eo-text-secondary); margin: 0; }
.eo-lede b { color: var(--eo-text-primary); }

/* ---------- charts (D26–D29): blue is this year, budget is neutral; bars per period, lines for running totals ---------- */
.eo-chart-legend { display: flex; flex-wrap: wrap; gap: var(--eo-space-1) 14px; font: var(--eo-type-meta); color: var(--eo-text-secondary); }
.eo-chart-legend > * { display: inline-flex; align-items: center; gap: var(--eo-space-2); white-space: nowrap; }
button.eo-chart-legend-item { border: 0; background: none; padding: var(--eo-space-1) 0; font: inherit; color: inherit; cursor: pointer; }
button.eo-chart-legend-item[aria-pressed="false"] { color: var(--eo-text-disabled); }
button.eo-chart-legend-item[aria-pressed="false"] .eo-key { opacity: .35; }
/* Swatch drawn as its mark. */
.eo-key { display: inline-block; flex: none; }
.eo-key-line, .eo-key-dot, .eo-key-dash { width: 16px; height: 0; border-top: 2px solid var(--eo-key, var(--eo-chart-actual)); }
.eo-key-dot { border-top-style: dotted; }
.eo-key-dash { border-top-style: dashed; }
.eo-key-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--eo-key, var(--eo-chart-actual)); }
.eo-key-hatch { width: 10px; height: 10px; border-radius: 2px;
  background: repeating-linear-gradient(135deg, var(--eo-chart-forecast) 0 2px, var(--eo-chart-forecast-hatch) 2px 5px); }
.eo-key-outline { width: 10px; height: 10px; border: 1px dashed var(--eo-chart-prior-outline); }
.eo-key-tick { width: 12px; height: 3px; border-radius: 1px; background: var(--eo-chart-ledger); }
.eo-chart-end { font: var(--eo-type-meta-data); font-weight: var(--eo-font-weight-semibold); color: var(--eo-text-primary); }
.eo-chart-gap-tag { display: inline-flex; align-items: center; gap: var(--eo-space-1); height: 20px; padding: 0 var(--eo-space-3); border-radius: var(--eo-radius-pill);
  background: var(--eo-surface-overlay); border: 1px solid var(--eo-status-attention-fill); color: var(--eo-status-attention-fg);
  font: var(--eo-type-chip); white-space: nowrap; }
.eo-chart-gap-tag.is-good { border-color: var(--eo-status-good-fill); color: var(--eo-status-good-fg); }
.eo-chart-tooltip { position: absolute; z-index: 8; min-width: 160px; padding: var(--eo-space-2) var(--eo-space-3); pointer-events: none;
  background: var(--eo-surface-overlay); border: 1px solid var(--eo-border-default); border-radius: var(--eo-radius-sm); box-shadow: var(--eo-shadow-overlay);
  font: var(--eo-type-meta); color: var(--eo-text-secondary); }
.eo-chart-tooltip-title { font-weight: var(--eo-font-weight-semibold); color: var(--eo-text-primary); margin-bottom: var(--eo-space-1); }
.eo-chart-tooltip-row { display: flex; align-items: center; gap: var(--eo-space-2); padding: 1px 0; }
.eo-chart-tooltip-row b { margin-left: auto; font: var(--eo-type-meta-data); font-weight: var(--eo-font-weight-semibold); color: var(--eo-text-primary); }
.eo-chart-tooltip-diff { border-top: 1px solid var(--eo-border-subtle); margin-top: var(--eo-space-1); padding-top: var(--eo-space-1); }

/* ---------- overlays (D21–D25): four kinds, no others ---------- */
/* Drawer: a tray under the grid. It's a flex sibling of the grid card, so the grid gets shorter; nothing is covered. */
.eo-drawer { flex: 0 0 auto; height: 400px; min-height: 160px; margin: 0 var(--eo-space-5); display: flex; flex-direction: column; min-width: 0;
  background: var(--eo-surface-page); border: 1px solid var(--eo-border-strong); border-bottom: 0; border-radius: var(--eo-radius-md) var(--eo-radius-md) 0 0;
  box-shadow: var(--eo-shadow-drawer); padding: 0 var(--eo-space-5) var(--eo-space-5); animation: eo-rise var(--eo-motion-base); }
.eo-drawer-grip { flex: none; height: 12px; display: grid; place-items: center; cursor: row-resize; }
.eo-drawer-grip::before { content: ""; width: 52px; height: 3px; border-radius: 2px; background: var(--eo-border-strong); }
.eo-drawer-grip:focus-visible { outline: none; box-shadow: var(--eo-focus-ring); border-radius: var(--eo-radius-xs); }
.eo-drawer-head { flex: none; display: flex; align-items: center; gap: var(--eo-space-3); min-height: var(--eo-density-control); padding: 0 var(--eo-space-1) var(--eo-space-2);
  border-bottom: 1px solid var(--eo-border-default); white-space: nowrap; }
.eo-drawer-title { font: var(--eo-type-title-card); margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.eo-drawer-body { flex: 1; min-height: 0; display: flex; gap: var(--eo-space-5); padding-top: var(--eo-space-3); }
.eo-drawer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--eo-space-3); overflow: auto; }
.eo-drawer-main > *, .eo-drawer-rail { background: var(--eo-surface-card); border: 1px solid var(--eo-border-default); border-radius: var(--eo-radius-sm); }
.eo-drawer-rail { flex: 0 0 240px; overflow: auto; }
@media (max-width: 1100px) { .eo-drawer-body { flex-direction: column; overflow: auto; } .eo-drawer-rail { flex-basis: auto; } }

/* Side panel: a right tray that narrows the grid (a flex sibling), covering it only on narrow screens. */
.eo-side-panel { flex: 0 0 320px; display: flex; flex-direction: column; min-height: 0; background: var(--eo-surface-page);
  border-left: 1px solid var(--eo-border-strong); box-shadow: var(--eo-shadow-side); animation: eo-slide var(--eo-motion-base); }
.eo-side-panel-tabs { flex: none; display: flex; align-items: center; gap: var(--eo-space-1); min-height: 45px; padding: 0 var(--eo-space-2);
  background: var(--eo-surface-card); border-bottom: 1px solid var(--eo-border-default); }
.eo-side-panel-subject { flex: none; padding: var(--eo-space-3) var(--eo-space-4); font: var(--eo-type-small); font-weight: var(--eo-font-weight-semibold);
  background: var(--eo-surface-muted); border-bottom: 1px solid var(--eo-border-default); }
.eo-side-panel-body { flex: 1; min-height: 0; overflow: auto; padding: var(--eo-space-3); display: grid; gap: var(--eo-space-3); align-content: start; }
.eo-side-panel-composer { flex: none; padding: var(--eo-space-3); border-top: 1px solid var(--eo-border-default); }
@media (max-width: 1100px) { .eo-side-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 100%); z-index: 6; } }

/* Sheet and dialog: modal, on surface.overlay over the scrim. The page behind stops scrolling. */
.eo-scrim { position: fixed; inset: 0; background: var(--eo-surface-scrim); z-index: 1050; }
.eo-sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(900px, calc(100vw - 48px)); z-index: 1051; display: flex; flex-direction: column;
  background: var(--eo-surface-overlay); box-shadow: var(--eo-shadow-overlay); animation: eo-slide var(--eo-motion-base); }
.eo-sheet-head { flex: none; display: flex; align-items: flex-start; gap: var(--eo-space-5); padding: var(--eo-space-7) var(--eo-space-7) var(--eo-space-5); }
.eo-sheet-kicker { font: var(--eo-type-meta); color: var(--eo-text-secondary); }
.eo-sheet-title { font: var(--eo-type-title-card); margin: var(--eo-space-1) 0 0; }
.eo-sheet-facts { font: var(--eo-type-meta-data); color: var(--eo-text-secondary); margin-top: 2px; }
.eo-sheet-body { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--eo-border-default); }
.eo-dialog { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(480px, calc(100vw - 32px)); max-height: 76vh; z-index: 1051;
  display: flex; flex-direction: column; background: var(--eo-surface-overlay); border-radius: var(--eo-radius-md); box-shadow: var(--eo-shadow-overlay);
  animation: eo-fade var(--eo-motion-base); }
.eo-dialog.is-wide { width: min(880px, calc(100vw - 32px)); }
.eo-dialog-head { display: flex; align-items: center; gap: var(--eo-space-3); padding: var(--eo-space-6) var(--eo-space-6) var(--eo-space-3); }
.eo-dialog-title { font: var(--eo-type-title-section); letter-spacing: var(--eo-type-title-section-tracking); margin: 0; flex: 1; }
.eo-dialog-body { flex: 1; min-height: 0; overflow: auto; padding: 0 var(--eo-space-6) var(--eo-space-5); font: var(--eo-type-small); color: var(--eo-text-secondary); }
.eo-dialog-foot { display: flex; justify-content: flex-end; gap: var(--eo-space-3); padding: var(--eo-space-5) var(--eo-space-6); border-top: 1px solid var(--eo-border-subtle); }
@keyframes eo-rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes eo-slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes eo-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .eo-drawer, .eo-side-panel, .eo-sheet { animation-name: eo-fade; } }

/* ---------- side panel comment ---------- */
.eo-comment { display: grid; grid-template-columns: auto 1fr; gap: var(--eo-space-2) var(--eo-space-4); padding: var(--eo-space-5);
  border: 1px solid var(--eo-border-default); border-radius: var(--eo-radius-md); background: var(--eo-surface-card); font: var(--eo-type-small); }
.eo-comment .eo-avatar { grid-row: span 2; width: 24px; height: 24px; }
.eo-comment-who { font-weight: var(--eo-font-weight-semibold); }
.eo-comment-who small { font-weight: var(--eo-font-weight-regular); color: var(--eo-text-tertiary); margin-left: var(--eo-space-2); font-size: var(--eo-font-size-11); }

/* ---------- states (D20) ---------- */
/* Empty: inside the card, under its headers. One sentence (why) + at most one action (what to do). */
.eo-empty { min-height: 120px; display: grid; place-content: center; justify-items: center; gap: var(--eo-space-4); padding: var(--eo-space-7);
  text-align: center; font: var(--eo-type-small); color: var(--eo-text-secondary); }
.eo-empty b { color: var(--eo-text-primary); font-weight: var(--eo-font-weight-semibold); }
/* Loading: skeleton rows in the real table, shown only after 300ms (the app adds .is-loading after a 300ms timer). */
.eo-skeleton { display: block; height: 10px; border-radius: var(--eo-radius-xs); background: var(--eo-surface-sunken); animation: eo-pulse 1.4s ease-in-out infinite; }
.eo-num .eo-skeleton { margin-left: auto; }
@keyframes eo-pulse { 50% { opacity: .55; } }
/* Refreshing data already on screen: keep it, and say so in the toolbar. Never blank the grid to reload it. */
.eo-busy { display: inline-flex; align-items: center; gap: var(--eo-space-2); font: var(--eo-type-meta); color: var(--eo-text-secondary); }
.eo-busy::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--eo-text-link); animation: eo-pulse 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .eo-skeleton, .eo-busy::before { animation: none; } }
/* Error: in the card that failed, with Try again. Plain words; no codes. A page-top banner only when the whole page failed. */
.eo-error { min-height: 120px; display: grid; place-content: center; justify-items: center; gap: var(--eo-space-3); padding: var(--eo-space-7);
  text-align: center; font: var(--eo-type-small); color: var(--eo-text-secondary); }
.eo-error-title { display: inline-flex; align-items: center; gap: var(--eo-space-2); color: var(--eo-text-primary); font-weight: var(--eo-font-weight-semibold); }
.eo-error-title::before { content: "!"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--eo-status-severe-bg); color: var(--eo-status-severe-fg); font: var(--eo-type-code); }
/* Freshness: a quiet fact in the toolbar's context line; attention when stale or the last sync failed. */
.eo-fresh.is-stale { color: var(--eo-status-attention-fg); }
.eo-fresh.is-stale::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: var(--eo-space-1); background: var(--eo-status-attention-fill); }

