
/* [DESIGN-BUILD-1-DASHBOARD] Ported from `substrat/gtm/brand/design-
   system/tokens.css` (the canonical token source; that file's own header
   names this crate's `APP_CSS` as one of its two reconciliation targets,
   "so the poster can adopt this file with zero renames"). Values are
   transcribed verbatim (lowercase hex, matching this file's own prior
   convention -- case has no effect on the colour, and a prior gate test,
   `app_css_carries_the_real_brand_tokens`, asserts on the lowercase
   literal).
   [DESIGN-SHELL-1, root-cause fix] `--font-sans`/`--font-mono` name the
   same faces the artboards were designed against, and this block used to
   stop there -- no `@font-face` anywhere in this file or its CSP, so
   every actual render fell through to the `system-ui`/platform-mono tail
   of each stack, which [DESIGN-SHELL-GAP] named as "most of the visual
   difference from the canvas." Fixed below with same-origin `@font-face`
   rules pointing at `/assets/fonts/*.woff2` (served by `font_asset_
   handler`, embedded into the binary via `include_bytes!`) -- no CDN,
   `font-src 'self'` in `APPROVAL_PAGE_CSP` is the only source these can
   load from. SIL Open Font License 1.1 for both families, recorded
   verbatim beside the source files (`assets/fonts/OFL-Inter.txt`,
   `assets/fonts/OFL-JetBrainsMono.txt`). */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
:root {
  /* ---- Carbon family (base) ---- */
  --carbon: #000000;
  --graphite: #0f0f12;
  --charcoal: #1a1a1f;
  --smoke: #2d2d34;
  --fog: #6e6e78;
  --mist: #c8c8d0;
  --paper: #ffffff;
  --cream: #f8f4ec;

  /* ---- Magenta family (signature; sparing) ---- */
  --m50: #fbeaf0;
  --m200: #ed93b1;
  --m400: #d4537e;
  --m600: #993556;
  --m800: #72243e;
  --m900: #4b1528;
  --magenta: var(--m400); /* legacy alias -- every existing rule below keeps working */

  /* ---- Functional (product UI only) ---- */
  --info: #378add;
  --success: #1d9e75;
  --danger: #a32d2d;
  --warning: #ba7517;

  /* ---- Type ---- */
  --font-sans: 'Inter', 'GT America', 'Söhne', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Berkeley Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ---- Shape ---- */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  /* ---- Spacing (4px base) ---- */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-14: 56px; --s-20: 80px;

  /* ---- Focus ---- */
  --focus-ring: 1.5px solid var(--m400);

  /* ---- Semantic: product (dark, only mode this surface renders) ---- */
  --background: var(--graphite);
  --foreground: var(--mist);
  --card: var(--charcoal);
  --card-foreground: var(--mist);
  --border: var(--smoke);
  --muted-foreground: var(--fog);
  --primary: var(--m400);
  --primary-foreground: var(--paper);
  --radius: var(--radius-lg);
}

* { box-sizing: border-box; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  margin: 0;
  padding: 2rem;
  line-height: 1.5;
  /* [DESIGN-SHELL-1 review, visual checklist item a] Was 960px -- at
     1440px viewport width that left roughly 900px of actual content
     (960px minus this rule's own 2rem/side padding), narrow enough that
     the batch id, staged timestamp and "Approve all remaining" button
     wrapped onto 3-4 lines instead of the one line the artboards show.
     1320px matches the artboards' own widest section (`Main.dc.html`'s
     `.sect{width:1240px}` plus its own padding) with room to spare inside
     a 1440px viewport. */
  max-width: 1320px;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
a { color: var(--primary); }

h1 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
/* [DESIGN-SHELL-1] Matches the artboards' own `h2` treatment (Main/
   AdminUsers/Connections.dc.html: `font-size:20px;font-weight:500`,
   `--paper`) -- each view's own page title (Batches/Connected companies/
   Who can approve what), distinct from `h2.section-label` below, which
   stays reserved for a smaller in-page eyebrow/subsection label. */
.page-title {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--paper);
  margin: 0 0 1rem;
}
h2.section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin: 2rem 0 0.75rem;
}
h2.month-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin: 2rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.375rem;
}

/* [APPROVAL-UI-POLISH item 1] "Signed in as <email>" + Sign out, once
   `renderAuthStatus` has confirmed a live session -- the sign-in link
   this replaces is styled by the plain `a` rule above. */
#auth_status { font-size: 0.8125rem; color: var(--muted-foreground); margin-bottom: 0.5rem; }
#auth_status span { color: var(--foreground); }
#auth_status button { margin-left: 0.5rem; }

/* [APPROVAL-UI-POLISH item 2] "Connected companies" -- a vertical list,
   one row per currently-connected org, each with its provider's own
   brand mark (inlined SVG, see `PROVIDER_ICON_SVG`). */
.connected-companies-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.connected-company-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}
.connected-company-row .provider-icon { display: flex; align-items: center; height: 1.125rem; }
.connected-company-row .provider-icon svg { height: 100%; width: auto; display: block; }
.connected-company-org { font-weight: 600; }
.connected-company-firm, .connected-company-meta { color: var(--muted-foreground); }
.connected-company-meta { margin-left: auto; font-size: 0.75rem; white-space: nowrap; }
/* [eng-review finding, folded] A `reauth_required` row's Reconnect link
   and Remove button sit inline in ONE cell (unlike the other `<span>`
   cells above, which get their spacing from the row's own `gap`) -- a
   plain literal space between them read as too tight on this row's
   compact 0.8125rem type. */
.connected-company-action .disconnect-btn { margin-left: 0.5rem; }
.cap-note, .rp-sync-note { color: var(--muted-foreground); font-size: 0.75rem; margin: 0.25rem 0; }

.batch-summary {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}
.batch-summary .count { font-weight: 700; color: var(--foreground); }
.batch-summary .label { color: var(--muted-foreground); }

/* [JC-12 live-battery ask] Each `.batch-summary` pill is a clickable
   status filter -- "a clear option to see draft ones, approved and
   posted ones and rejected ones" (Brad, live-battery walkthrough). */
.status-filter {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
}
.status-filter:hover { border-color: var(--muted-foreground); }
.status-filter.active {
  background: var(--charcoal);
  border-color: var(--info);
}
.status-filter.active .label { color: var(--foreground); }

/* [BATCHFLOW-REVIEW-GAPS item 7, "one vocabulary"] The raw nine-status
   breakdown, moved behind a native disclosure rather than a second
   `.batch-summary` bar sitting in plain sight beside the four bucket
   pills above it.
   [W-VISIBLE screenshot proof, live bug caught -- SAME CLASS as the
   `.reject-form[hidden]` bug this file already hit once this session, and
   the 2026-09-11 void-modal bug before it] This doc comment used to claim
   `<details>` needed no override "the way `.reject-form[hidden]` once
   did" -- that claim was WRONG, caught by evaluating the live page rather
   than trusting the reasoning: `.batch-summary`'s own `display: flex`
   (an AUTHOR rule) wins the cascade over the UA's internal "hide a closed
   `<details>`'s non-summary content" behaviour, exactly the same
   author-beats-UA mechanism `[hidden]` loses to. The raw nine-status pills
   rendered on screen with `details.open === false`, proven via a headless
   `getComputedStyle` check, not just eyeballing a screenshot. Fixed the
   same way `.reject-form[hidden]`/`.modal-overlay[hidden]` already are:
   an explicit override, keyed off the closed state itself rather than
   trusting that the display property was never touched. */
.status-detail { margin-bottom: 1rem; }
.status-detail summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}
.status-detail summary:hover { color: var(--foreground); }
.status-detail .batch-summary { margin-bottom: 0; }
.status-detail:not([open]) .batch-summary {
  display: none;
}

/* [DESIGN-SHELL-1 review, visual checklist item d] `#main_nav` had NO
   rule at all before this -- three `<a>` links rendered by the plain `a`
   rule above (`color: var(--primary)`, the browser's own default
   underline), reading as body-text links under the page title rather
   than a nav bar. `showView` already toggles `.active` on the matching
   link (`data-nav` == the current view) -- only the styling was missing.
   Underlined-tab-with-a-bottom-border-indicator is `Main.dc.html`'s own
   treatment of ITS tab bar; reused here for the page-level nav since
   no artboard drew this bar directly (page-shell chrome, not a
   BatchFlow/Main-scoped component). */
#main_nav {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}
#main_nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
}
#main_nav a:hover { color: var(--foreground); }
#main_nav a.active {
  color: var(--foreground);
  border-bottom-color: var(--primary);
}

/* [JC-12 live-battery ask] The cross-batch Journal Entries dashboard --
   3-way Draft/Completed/Rejected filter + a plain Name/Status table. */
.dashboard-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.dashboard-tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted-foreground);
}
.dashboard-tab:hover { border-color: var(--muted-foreground); }
.dashboard-tab.active {
  background: var(--charcoal);
  border-color: var(--info);
  color: var(--foreground);
}
.entry-dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.entry-dashboard-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.entry-dashboard-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.entry-dashboard-table tr.dashboard-row { cursor: pointer; }
.entry-dashboard-table tr.dashboard-row:hover { background: var(--charcoal); }
.entry-dashboard-table tr:last-child td { border-bottom: none; }
/* [DESIGN-BUILD-1-DASHBOARD, Main] Entries/Totals -- right-aligned,
   tabular-nums, same convention `table.lines td.amount` already uses. */
.entry-dashboard-table td.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.entry-dashboard-table td .badge { margin-right: 0.25rem; }
.entry-dashboard-table td .badge:last-child { margin-right: 0; }

/* [DESIGN-SHELL-1 review, visual checklist item e] Was a solid,
   uppercase, white-on-color block (`Statuses.dc.html`'s own "shipped
   defect" callout is about a DIFFERENT bug -- the missing `Superseded`
   colour -- but the shape gap is real too: the artboard's own `.bdg` is a
   subtle inline pill, a tinted background with the SAME colour as its own
   text, a small leading dot, never a solid fill). Values below are the
   artboard's own literal `rgba(...)`  -- the exact 20%-alpha tint of each
   token colour -- not independently chosen. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 1.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge-staged { background: rgba(55, 138, 221, 0.2); color: var(--info); }
.badge-approved { background: rgba(186, 117, 23, 0.2); color: var(--warning); }
.badge-posting { background: rgba(55, 138, 221, 0.2); color: var(--info); }
.badge-posted { background: rgba(29, 158, 117, 0.2); color: var(--success); }
.badge-confirmed { background: rgba(29, 158, 117, 0.2); color: var(--success); }
.badge-failed { background: rgba(163, 45, 45, 0.2); color: var(--danger); }
.badge-discarded { background: rgba(110, 110, 120, 0.2); color: var(--fog); }
/* [DESIGN-BUILD-1-DASHBOARD, Statuses] `Superseded` gets its own colour --
   see `statusBadgeClass`'s own comment for why it used to fall through to
   `badge-discarded`. `Deleted` still falls through there deliberately: it
   is a withdrawal with nothing following, the same shape as `Rejected`,
   unlike `Superseded`, which always has a live successor waiting. */
.badge-superseded { background: rgba(212, 83, 126, 0.2); color: var(--m200); }

/* [MAX-SCOPE-COMPLETENESS W4b] The supporting-document block. Styled
   rather than left to the browser's defaults because this is a D242
   integrity surface: an approver has to NOTICE that evidence exists
   before they can be said to have reviewed it, and an unstyled bare
   <ul> under a dense line-item table is exactly the thing an eye skips.
   `.muted` gets a rule here too -- it was already used elsewhere in
   this file with no rule at all. */
.attachments-block {
  margin: 0.75rem 0;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--info);
  background: var(--charcoal);
}
.attachments-block > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
ul.attachments { list-style: none; margin: 0; padding: 0; }
ul.attachments li { padding: 0.15rem 0; }
ul.attachments a { text-decoration: underline; }
.muted { color: var(--fog); }
.badge-pair {
  background: transparent;
  border: 1px solid var(--muted-foreground);
  color: var(--muted-foreground);
}

.pair-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

/* [DESIGN-BUILD-1-DASHBOARD, FailedBucket ruling 1] "The reason is the
   most prominent thing on the card, because it is the only thing the
   accountant acts on" -- a danger-toned block, not the plain unstyled
   `.warnings-block` an approver-overridable warning gets; a Failed entry
   is not something to override, it is something to act on. */
.failure-reason-banner {
  border: 1px solid var(--danger);
  background: rgba(163, 45, 45, 0.12);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.failure-reason-banner label {
  display: block;
  color: var(--danger);
  font-weight: 700;
  font-size: 0.8125rem;
}
.failure-reason-banner ul { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.failure-reason-banner li {
  padding: 0.375rem 0;
  border-bottom: 1px solid rgba(163, 45, 45, 0.25);
  font-size: 0.8125rem;
}
.failure-reason-banner li:last-child { border-bottom: none; }
.failure-reason-banner li .ts { color: var(--muted-foreground); margin-right: 0.5rem; }

/* [DESIGN-BUILD-1-DASHBOARD, BatchFlow] The header strip above the entry
   list -- batch id, entry count, per-currency chips, and (while anything
   is still Staged) the "Approve all remaining" action. */
.batch-flow-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.batch-flow-header .primary { margin-left: auto; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.chip b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--foreground); }

/* [BatchFlow ruling 2] "the rest one line each" -- every visible entry
   that is not the currently-focused one. */
.collapsed-entry-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}
.collapsed-entry-name { flex: 1; min-width: 0; }
.collapsed-entry-focusable { cursor: pointer; }
.collapsed-entry-focusable:hover { border-color: var(--muted-foreground); }

/* [BatchFlow ruling] "Last one done lands on a batch summary." */
.batch-done-summary .actions-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* [DESIGN-BUILD-1-DASHBOARD, Loading] A same-batch reload (after an
   action) disables the still-visible card in place rather than blanking
   it -- see `loadPreview`'s own comment. */
.preview-loading { opacity: 0.5; pointer-events: none; }

/* ===================================================================
   THE JE-VIEW CARD ITSELF -- the reusable "anatomy" (From Cowork
   directive: prototype for substrat's own canonical JE screen). Kept
   free of erp-je-poster-specific assumptions where reasonable -- host
   chrome (batch summary, pair links, actions toolbar) lives outside it.
   =================================================================== */
.je-card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}
/* [DESIGN-BUILD-1-DASHBOARD, BatchFlow] The one expanded entry's own
   visual anchor -- there is only ever one on screen at a time (the rest
   are one-liners), but the highlight still helps it read as "the thing
   you are working on" against the header/collapsed rows around it. */
.focused-entry .je-card { border-color: var(--m600); }
.je-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.je-card-header .narration { font-weight: 600; font-size: 0.9375rem; }
.je-card-actions { display: flex; gap: 0.5rem; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.375rem 2rem;
  font-size: 0.8125rem;
  margin-bottom: 1.25rem;
}
.field label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.125rem;
}

table.lines { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin-bottom: 0.25rem; }
table.lines th {
  text-align: left;
  color: var(--muted-foreground);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}
table.lines td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}
table.lines th.amount, table.lines td.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.lines td.account-code { color: var(--muted-foreground); }
.totals-row td {
  font-weight: 700;
  border-top: 2px solid var(--border);
  border-bottom: none;
}
.totals-row .balance-ok { color: var(--success); }
.totals-row .balance-bad { color: var(--danger); }

.status-history { margin-top: 0.75rem; font-size: 0.75rem; }
.status-history label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.status-history ul { list-style: none; margin: 0.375rem 0 0; padding: 0; }
.status-history li {
  padding: 0.25rem 0;
  color: var(--muted-foreground);
  display: flex;
  gap: 0.625rem;
  border-bottom: 1px solid var(--border);
}
.status-history li:last-child { border-bottom: none; }
.status-history .ts { color: var(--foreground); min-width: 13rem; }

/* [live-battery ask] Edit -- an inline TABLE revealed by an entry's own
   "Edit" button, shaped like the read-only line table above it rather
   than a raw-JSON blob; covers all fields (date/narration/lines)
   without a per-field widget beyond the line table's own columns. */
.edit-toggle { margin-left: auto; }
.edit-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.edit-form label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.375rem;
}
.edit-form .field-grid input,
.edit-lines-table input {
  width: 100%;
  background: var(--charcoal);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  padding: 0.375rem 0.5rem;
  box-sizing: border-box;
}
.edit-lines-table .edit-debit,
.edit-lines-table .edit-credit {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.edit-add-line { margin-bottom: 1rem; }
.edit-remove-line {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}
.edit-result:empty { display: none; }
.edit-result {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
  margin-top: 0.5rem;
}

/* [JC-12 Section 5] COA-assist lookup panel. */
.coa-lookup {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.coa-lookup label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.375rem;
}
.coa-lookup .coa-query {
  background: var(--charcoal);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
}
.coa-results { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.8125rem; }
.coa-results li { padding: 0.25rem 0; color: var(--muted-foreground); }

.actions-toolbar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
button {
  background: var(--smoke);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.6);
  padding: 0.4375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
button.primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }

/* [Brad ruling, bridge 2026-09-11] The void confirmation modal.
   [Live production bug, caught 2026-09-11 by Brad on a brand-new tab
   with zero clicks] `.modal-overlay`'s own `display: flex` has the SAME
   specificity as the browser default `[hidden] { display: none }`, and
   author rules win cascade ties over UA rules -- so the JS's own
   `el.hidden = true/false` convention (correctly used here, per this
   file's own standing rule to never toggle `style.display`) was
   silently defeated by this CSS, and the overlay rendered unconditionally
   regardless of the `hidden` attribute. The explicit `[hidden]` rule
   below restores it -- higher specificity than the bare class, so it
   wins regardless of source order. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay[hidden] {
  display: none;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 28rem;
  width: 90%;
}
.modal-box h2 { font-size: 1rem; margin: 0 0 0.75rem; }
.modal-box input { width: 100%; margin: 0.75rem 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
input {
  background: var(--charcoal);
  color: var(--mist);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.6);
  padding: 0.375rem 0.5rem;
}
/* [DESIGN-SHELL-1] The top-level nav between the three real pages
   (Dashboard/Connections/Users) -- matches the artboards' spacing and
   type scale rather than the plain `<a>` list this replaces. */
.main-nav {
  display: flex;
  gap: var(--s-2, 0.5rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-6, 1.5rem);
  padding-bottom: 0;
}
.main-nav a {
  display: inline-block;
  padding: 0.5rem 0.25rem;
  margin-right: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
}
.main-nav a:hover { color: var(--foreground); }
.main-nav a.active {
  color: var(--foreground);
  border-bottom-color: var(--primary);
}

/* [ADMIN-USER-ORG-MATRIX] `#nav_users_link` starts `hidden` in the
   template and is unhidden only by `renderAuthStatus`'s own script, once
   `/session/whoami` confirms `can_manage_users`. No rule elsewhere in
   this stylesheet sets `display` on this id today, so the browser's own
   default `[hidden] { display: none }` already applies -- this explicit
   rule is insurance against that silently stopping being true the
   moment a future rule targets this id, the exact bug class the
   `.modal-overlay[hidden]` rule above exists to prevent. */
#nav_users_link[hidden] {
  display: none;
}

/* [DESIGN-SHELL-1] Same insurance as `#nav_users_link` above, for the
   four `#view_*` containers `showView` toggles -- exactly one of the
   four is ever visible at a time. Neither id has a `display`-setting
   rule elsewhere in this stylesheet today, so the browser's own default
   `[hidden] { display: none }` already applies either way -- these
   explicit rules are the same standing insurance against a future rule
   silently defeating that, not a fix for a live bug the way the modal's
   own rule was. */
#view_dashboard[hidden], #view_connections[hidden], #view_users[hidden], #view_batch[hidden] {
  display: none;
}
.admin-users-table { border-collapse: collapse; margin: 0.75rem 0; }
.admin-users-table th, .admin-users-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

/* [BATCHFLOW-REVIEW-GAPS] item 4 -- a visible expand/collapse affordance
   on every collapsed row, not just a bare cursor-pointer with no visual
   cue that it does anything.
   [DESIGN-SHELL-1 review, visual checklist item c] The glyph used to be
   the unicode character `&#9656;` (`▶`), which this file's own fonts
   (Inter/JetBrains Mono, self-hosted) do not include a glyph for --
   rendering fell through to whatever fallback the browser's font-matching
   picked, a faint dot rather than a chevron. `.chevron svg` below is an
   inline SVG instead (see `collapsedEntryRowHtml`'s own markup) -- a
   shape drawn by this stylesheet's own vector path, not a character any
   font has to supply. */
.collapsed-entry-row .chevron {
  display: inline-flex;
  color: var(--muted-foreground);
  margin-right: 0.125rem;
  flex: none;
}
.collapsed-entry-row .chevron svg {
  width: 0.625rem;
  height: 0.625rem;
  display: block;
}

/* [BATCHFLOW-REVIEW-GAPS] item 2 -- a superseded version, collapsed
   under its successor, behind "show previous version". */
.previous-version-toggle {
  background: none;
  border: none;
  color: var(--muted-foreground);
  text-decoration: underline;
  font-size: 0.75rem;
  padding: 0.375rem 0 0;
  cursor: pointer;
}
.previous-version-block { margin: 0.375rem 0 0.75rem; }

/* [BATCHFLOW-REVIEW-GAPS] item 6 -- the breadcrumb shown only when this
   batch was reached via a pair/successor link, plus the highlight on the
   entry that link landed on. */
.batch-breadcrumb {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}
.batch-breadcrumb a { margin-left: 0.375rem; }
.jumped-entry .je-card { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* [BATCHFLOW-REVIEW-GAPS] item 5 -- per-entry Reject keeps its reason
   field (the OLD batch-wide bottom bar's `#reject_reason` input is gone;
   this is its replacement, one per entry, same `edit-form` disclosure
   pattern). */
.reject-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.reject-form .reject-reason-input { flex: 1; }
/* [W-VISIBLE screenshot proof, live bug caught] `.reject-form`'s own
   `display: flex` above has the SAME specificity as the browser default
   `[hidden] { display: none }`, and author rules win cascade ties over
   UA rules -- the exact `.modal-overlay[hidden]` bug class this
   stylesheet has hit before. Without this rule the reason field rendered
   permanently open on every actionable card, never actually hidden by
   `reject-form`'s own `hidden` attribute default. */
.reject-form[hidden] {
  display: none;
}

/* =====================================================================
   [T-09] Approved connectors design (approved-2026-10-28, sc.css tokens).
   Appended last so it wins over the earlier layers without renaming the
   classes the batch-flow renderers still emit. Same-origin, no inline
   styles (APPROVAL_PAGE_CSP).
   ===================================================================== */
:root {
  --m: #d4537e;
  --m-dark: #4b1528;
  --m-light: #fbeaf0;
  --info: #378add;
  --ok: #1d9e75;
  --warn: #ba7517;
  --danger: #a32d2d;
  --r: 10px;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
html { background: var(--graphite); }
body {
  margin: 0; padding: 0; max-width: none;
  background: var(--graphite); color: var(--paper);
  font: 400 14px/1.5 var(--sans);
}
.mono, .num, code { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--paper); text-decoration-color: var(--m); text-underline-offset: 3px; }
a:hover { color: var(--m-light); }
:focus-visible { outline: 2px solid var(--m); outline-offset: 2px; }
h1 { font: 500 26px/1.25 var(--sans); letter-spacing: -0.01em; margin: 0 0 6px; }
h1.display { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font: 500 18px/1.3 var(--sans); margin: 0 0 8px; }
h3 { font: 500 15px/1.3 var(--sans); margin: 0 0 4px; }
p { margin: 0 0 8px; }
.sub { color: var(--mist); }
.sub b, .hint b { color: var(--paper); font-weight: 500; }
.lead-sub { font-size: 15px; max-width: 640px; }
.hint { color: var(--mist); font-size: 12.5px; }
.muted { color: var(--mist); }
.eyebrow { font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--mist); margin: 0 0 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--charcoal); padding: 8px 12px; border-radius: 8px; }
[hidden] { display: none !important; }
/* Every element the T-09 shell toggles with `.hidden` gets its own override
   (gate test `every_js_hidden_toggle_target_has_a_working_hidden_css_override`). */
#connect_buttons[hidden],
#main_nav[hidden],
#nav_team_link[hidden],
#public_refused[hidden],
#public_steps[hidden],
#team_add_btn[hidden],
#tp_remove_confirm[hidden],
#welcome_consumer_hint[hidden],
#welcome_team_step[hidden],
.view[hidden], .public-grid[hidden], .field-inline[hidden] { display: none !important; }

/* Shell. `#main_nav` resets the DESIGN-SHELL-1 tab-bar rules above. */
#main_nav { border-bottom: 0; margin: 0; padding: 0; gap: 4px; }
#main_nav a { font-size: 14px; font-weight: 500; margin: 0; padding: 10px 12px; border-bottom: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
main { padding: 32px 0 64px; }
.top { border-bottom: 1px solid var(--smoke); background: var(--graphite); }
.top-inner { display: flex; align-items: center; gap: 32px; min-height: 60px; flex-wrap: wrap; }
.wm { font: 500 20px/1 var(--sans); letter-spacing: -0.04em; color: var(--paper); text-decoration: none; display: inline-flex; align-items: baseline; gap: 2px; }
.wm i { font-style: normal; color: var(--m); }
.wm small { font: 400 12px/1 var(--mono); color: var(--mist); letter-spacing: 0; margin-left: 8px; text-transform: lowercase; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--mist); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: var(--paper); }
.nav a[aria-current] { color: var(--paper); background: var(--charcoal); box-shadow: inset 0 -2px 0 var(--m); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--mist); }
.who b { color: var(--paper); font-weight: 500; }
#shell_banners:not(:empty) { padding-top: 16px; display: grid; gap: 8px; }
.view.narrow { max-width: 760px; }
.view > * + * { margin-top: 16px; }
.back { font-size: 13px; }
.back a { text-decoration: none; color: var(--mist); }
.back a:hover { color: var(--paper); }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.divider { border-top: 1px solid var(--smoke); padding-top: 16px; }

/* Buttons. `.btn` plus the legacy `button`/`.primary`/`.danger` names the
   batch renderers emit. Primary is graphite on magenta (4.85:1, ruling 2.3). */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--smoke); background: var(--smoke); color: var(--paper);
  font: 500 14px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover, button:hover { border-color: var(--fog); color: var(--paper); }
.btn.p, button.primary, a.primary { background: var(--m); border-color: var(--m); color: var(--graphite); }
.btn.p:hover, button.primary:hover { background: var(--m-light); border-color: var(--m-light); color: var(--graphite); }
.btn.d, button.danger { background: var(--danger); border-color: var(--danger); color: var(--paper); }
.btn.ghost, button.ghost { background: transparent; }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn.sm, button.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled], button[disabled] { opacity: .45; cursor: not-allowed; }
button.linkish { background: none; border: 0; min-height: 0; padding: 0; color: var(--paper); text-decoration: underline; text-decoration-color: var(--m); text-underline-offset: 3px; font-weight: 400; }

/* Badges: pill, coloured dot only. Legacy status classes map onto the dots. */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; background: var(--smoke); color: var(--paper); font: 500 12px/1 var(--sans);
  text-transform: none; letter-spacing: 0; white-space: nowrap; border: 0;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mist); flex: none; }
.badge.ok::before, .badge-posted::before, .badge-confirmed::before { background: var(--ok); }
.badge.warn::before, .badge-approved::before { background: var(--warn); }
.badge.dngr::before, .badge-failed::before { background: var(--danger); }
.badge.info::before, .badge-posting::before { background: var(--info); }
.badge.m::before, .badge-staged::before { background: var(--m); }
.badge-staged, .badge-approved, .badge-posting, .badge-posted, .badge-confirmed, .badge-failed,
.badge-discarded, .badge-superseded { background: var(--smoke); color: var(--paper); }
.badges { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* Chips */
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--smoke); background: var(--graphite); font-size: 12.5px; color: var(--paper); white-space: nowrap; }
.chip b { font-family: var(--mono); font-weight: 500; color: var(--paper); }
.chip-attention { border-color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Notes (banners) */
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 8px; background: var(--graphite); border: 1px solid var(--smoke); }
.note p:last-child { margin-bottom: 0; }
.note.warn { border-color: var(--warn); }
.note.dngr { border-color: var(--danger); }
.note.ok { border-color: var(--ok); }
.note.info { border-color: var(--info); }
.note.brand { border-color: var(--m-dark); }
.ic { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--mist); margin-top: 1px; }
.note.ok .ic, .ic-check { border-color: var(--ok); }
.note.warn .ic { border-color: var(--warn); }
.note.dngr .ic { border-color: var(--paper); }
.ic-lock { border-color: var(--m); border-radius: 5px; }

/* Cards */
.card { background: var(--charcoal); border: 1px solid var(--smoke); border-radius: var(--r); padding: 20px; }
.card.tight { padding: 0; overflow: hidden; }
.card.empty { text-align: left; }
.danger-card { border-color: var(--danger); }
.refused-card { max-width: 640px; }

/* Tables */
.tbl-box { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mist); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--smoke); white-space: nowrap; }
.tbl td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--smoke); }
.entry-dashboard-table td:nth-child(3) { min-width: 120px; }
.entry-dashboard-table td:last-child, .entry-dashboard-table td:nth-child(5) { white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tr.row-live td { background: var(--graphite); }
.tbl tr.form-row td { background: var(--graphite); }
.empty-cell { color: var(--mist); }
.rowlink { color: var(--paper); font-weight: 500; text-decoration: none; }
.rowlink:hover { text-decoration: underline; text-decoration-color: var(--m-light); }
.entry-dashboard-table tr.dashboard-row { cursor: default; }
.entry-dashboard-table td.amount { text-align: left; }
/* SHELL-3 fix 5: one total per line, never wrapped inside a line. */
.totals { display: flex; flex-direction: column; gap: 2px; }
.total-line { display: block; white-space: nowrap; }
.total-line .seg { white-space: nowrap; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--smoke); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a, .dashboard-tab { color: var(--mist); font-weight: 500; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; text-decoration: none; background: none; border-radius: 0; }
.tabs a:hover { color: var(--paper); }
.tabs a[aria-current] { color: var(--paper); border-bottom-color: var(--m); }
.tabs .num { margin-left: 6px; color: var(--mist); font-size: 12px; }

/* Forms */
label { font: 500 13px/1.4 var(--sans); color: var(--paper); }
input[type=text], input[type=email], input[type=search], select, textarea {
  height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--fog);
  background: var(--graphite); color: var(--paper); font: 400 14px var(--sans); width: 100%; box-sizing: border-box;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-inline { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font: 500 13px/1.4 var(--sans); margin-bottom: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--smoke); border-radius: 8px; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--m); flex: none; }
.check.off { opacity: .6; cursor: default; }
.firm-name-card { margin-bottom: 16px; flex-wrap: wrap; }
.firm-name-card .full { flex-basis: 100%; margin: 0; }
.stale-line { display: inline-flex; gap: 6px; align-items: center; color: var(--mist); font-size: 12px; }
.stale-line .ic { width: 14px; height: 14px; border-color: var(--warn); }
.count-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--m); color: #0F0F12; font: 500 11px/18px var(--mono); text-align: center; }
.tight-stack { gap: 2px; }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 12px 0; }
.form-result:empty { display: none; }

/* People */
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--smoke); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; flex: none; }
.person { display: flex; gap: 10px; align-items: flex-start; }
ul.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.people li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dot3 { display: flex; gap: 6px; }
.dot3 span { width: 10px; height: 10px; border-radius: 50%; background: var(--m); }
.role-help { margin-top: 16px; }
.role-help p { flex: 1; min-width: 260px; }

/* Public / welcome */
.public-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; padding-top: 48px; align-items: start; }
.public-lead { display: flex; flex-direction: column; gap: 20px; max-width: 560px; }
.public-lead > * { margin: 0; }
.public-foot { margin-top: 64px; gap: 20px; }
.step { display: flex; gap: 14px; padding: 18px 20px; align-items: flex-start; }
.step.divider { border-top: 1px solid var(--smoke); padding-top: 18px; }
.pin { width: 24px; height: 24px; border-radius: 50%; background: var(--smoke); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; font: 500 12px/1 var(--mono); flex: none; }
.pin.on { background: var(--m); color: var(--graphite); }
.check-line { display: flex; gap: 10px; align-items: flex-start; }

/* Batch page */
.batch-flow-header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 16px; }
.batch-flow-header .primary { margin-left: auto; }
.je-card { background: var(--charcoal); border: 1px solid var(--smoke); border-radius: var(--r); padding: 16px 20px; }
.focused-entry .je-card { border-color: var(--m); }
.action-card:has(.entry-void-action) { border-color: var(--danger); }
.je-card-header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.je-card-header .narration { font: 500 16px/1.35 var(--sans); flex: 1 1 280px; }
.je-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.void-explainer { margin: 10px 0; color: var(--paper); }
.entry-result { margin: 8px 0 12px; display: grid; gap: 6px; }
.entry-result p, .action-results p { margin: 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--smoke); background: var(--graphite); }
.result-ok { border-color: var(--ok) !important; }
.result-warn { border-color: var(--warn) !important; }
.result-error { border-color: var(--danger) !important; }
.action-results:empty { display: none; }
.action-results { display: grid; gap: 6px; margin-top: 12px; }
.history-key { margin-top: 8px; color: var(--mist); font-size: 12px; overflow-wrap: anywhere; }
.reject-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.reject-form label { width: 100%; }
.collapsed-entry-row { background: var(--charcoal); border: 1px solid var(--smoke); border-radius: 8px; }

/* Legacy blocks restyled as notes. */
.warnings-block, .failure-reason-banner, .pair-warning-banner { background: var(--graphite); border: 1px solid var(--warn); border-radius: 8px; padding: 12px 14px; margin: 10px 0; color: var(--paper); }
.failure-reason-banner { border-color: var(--danger); }
.warnings-block label, .failure-reason-banner label { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--paper); font-size: 14px; }
ul.plain-list { margin: 4px 0 0; padding-left: 18px; color: var(--mist); }
.batch-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.status-filter { min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--graphite); border: 1px solid var(--smoke); font-size: 13px; font-weight: 500; color: var(--mist); }
.status-filter.active { border-color: var(--m); color: var(--paper); }
.field-grid label, .status-history label { font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mist); }

/* Dialogs */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 48px 24px; z-index: 40; }
.modal-box { width: 100%; max-width: 560px; background: var(--charcoal); border: 1px solid var(--smoke); border-radius: 12px; box-shadow: 0 24px 64px rgba(0, 0, 0, .5); padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.modal-box h2 { font-size: 18px; margin: 0; }
.modal-box input { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--smoke); padding-top: 16px; margin-top: 4px; }
ul.modal-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-family: var(--mono); font-size: 14px; }
ul.modal-lines li { white-space: nowrap; overflow-wrap: normal; }

/* Phone (A12: 44px targets; 5e: full-width actions, totals one per line). */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  main { padding: 20px 0 40px; }
  h1 { font-size: 22px; }
  h1.display { font-size: 30px; }
  .top-inner { gap: 12px; min-height: 56px; }
  .wm small { display: none; }
  .who span { display: none; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .btn, button { min-height: 44px; }
  .btn.sm, button.sm { min-height: 44px; }
  .je-card-actions { width: 100%; flex-direction: column; }
  .je-card-actions .btn, .je-card-actions button { width: 100%; min-height: 48px; }
  .batch-flow-header .primary { margin-left: 0; width: 100%; min-height: 48px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: 16px 16px 10px 10px; max-width: none; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; min-height: 48px; }
  ul.modal-lines li { white-space: normal; }
  .field-inline { min-width: 0; width: 100%; }
  .field-grid { grid-template-columns: 1fr !important; }
  /* Approvals at 390: each batch is a stacked card so Totals stay on screen,
     one per line (SHELL-3 fix 5). */
  .entry-dashboard-table thead { display: none; }
  .entry-dashboard-table, .entry-dashboard-table tbody, .entry-dashboard-table tr, .entry-dashboard-table td { display: block; width: 100%; box-sizing: border-box; }
  .entry-dashboard-table tr { border-bottom: 1px solid var(--smoke); padding: 8px 0; }
  .entry-dashboard-table td { border-bottom: 0; padding: 4px 16px; min-width: 0 !important; }
  .entry-dashboard-table .badges { flex-direction: row; flex-wrap: wrap; }
  .total-line { white-space: normal; }
  .je-card-header .narration { flex-basis: 100%; }
  .public-grid { padding-top: 16px; gap: 32px; }
}
