/* SRS Access portal — control-room visual identity.
   T-02-20260707-010 (rebuild) · T-02-20260708-005 (design uplift).

   Senate Recording Studio control room: federal navy ink on cool studio gray,
   ENGRAVED brass accents (gradient strokes, decorative only — never body text),
   Palatino-display masthead, and the tally-lamp status system rendered as real
   lens lamps: green = on air / ready, amber = pending, red = attention. One
   signature moment (the two-door landing split, breathing green lamps);
   everything else stays quiet. A persisted studio-dim theme remaps the palette
   under html[data-theme="dim"] for the control room after hours. */

:root {
  /* --- palette (brief §2) --- */
  --ink: #1b2434;              /* body text */
  --ink-muted: #5a6477;        /* secondary text (≥4.5:1 on panel) */
  --surface: #e9ecf1;          /* cool studio gray page background */
  --panel: #ffffff;            /* cards, tables */
  --panel-edge: #d3d9e2;       /* hairlines */
  --navy: #1f3257;             /* primary actions, links */
  --navy-deep: #131e36;        /* console chrome (topbar, dark bands) */
  --brass: #a8843a;            /* decorative strokes only */
  --brass-bright: #c9a959;     /* engraved-brass gradient highlight */
  --brass-ink: #7c6023;        /* eyebrows, icon strokes (AA on panel) */
  --tally-green: #2e7d4f;
  --tally-amber: #b97a1d;
  --tally-red: #ba3b2c;
  --lamp-off: #9aa4b2;
  --focus: #2c5ec9;

  /* --- derived / component tokens (remapped in dim) --- */
  --link: var(--navy);
  --brand-ink: var(--navy-deep);      /* masthead + public wordmark on light */
  --field-bg: #ffffff;
  --btn-bg: #1f3257;
  --btn-bg-hover: #131e36;
  --row-hover: rgba(31, 50, 87, 0.04);
  --card-highlight: rgba(255, 255, 255, 0.7);
  --secondary-hover: rgba(31, 50, 87, 0.05);
  --chip-active-bg: rgba(168, 132, 58, 0.12);
  --error-bg: #faeeec;
  --error-border: var(--tally-red);
  --error-text: #7c2317;
  --ok-bg: #ecf4ef;
  --ok-border: var(--tally-green);
  --ok-text: #1d5236;
  --sk-base: var(--panel-edge);
  --sk-shimmer: rgba(255, 255, 255, 0.5);
  --overlay: rgba(19, 30, 54, 0.55);

  --radius: 10px;
  --font-display: 'Palatino Linotype', Palatino, 'Book Antiqua', 'URW Palladio L', Georgia, serif;
  --font-body: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
}

/* Studio-dim theme (brief §4.1): the control room after hours. The palette is
   remapped; brass and lamps are unchanged (brass glows on dark). Every text
   token holds ≥4.5:1. Explicit choice persists in localStorage.srsTheme; the
   default follows prefers-color-scheme via the boot script in index.html. */
html[data-theme="dim"] {
  --ink: #e5eaf2;
  --ink-muted: #9aa6bc;
  --surface: #141a26;
  --panel: #1c2434;
  --panel-edge: #2a3450;
  --focus: #6f9be8;
  --link: #7fa3e0;
  --brand-ink: #e5eaf2;
  --brass-ink: #cba667;          /* lighter brass — AA on the dim panel */
  --field-bg: #10151f;
  --btn-bg: #33548f;
  --btn-bg-hover: #40639f;
  --row-hover: rgba(127, 163, 224, 0.1);
  --card-highlight: rgba(255, 255, 255, 0.04);
  --secondary-hover: rgba(127, 163, 224, 0.1);
  --chip-active-bg: rgba(201, 169, 89, 0.18);
  --error-bg: rgba(186, 59, 44, 0.16);
  --error-text: #f0b4ab;
  --ok-bg: rgba(46, 125, 79, 0.18);
  --ok-text: #a7dcbe;
  --sk-shimmer: rgba(255, 255, 255, 0.06);
  --overlay: rgba(4, 8, 16, 0.66);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* The page itself never scrolls sideways. Wide content (tables) scrolls
     inside its own container, never the page. */
  overflow-x: hidden;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: 8px 16px; z-index: 50;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- shared primitives ---------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; color: var(--ink); }
h1 { font-size: 2.1rem; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-size: 1.4rem; margin: 0 0 10px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
/* The "fader line": a short engraved-brass rule beneath section headings — a
   mixing-console cue, kept short so it never becomes a hairline maze. */
h2::after {
  content: ""; display: block; width: 40px; height: 2px; margin-top: 7px;
  background: linear-gradient(90deg, var(--brass-bright), var(--brass));
  border-radius: 2px;
}
.modal h2::after, h2.no-rule::after { display: none; }
p { margin: 0 0 12px; }
a { color: var(--link); }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; font-variant-numeric: tabular-nums; }

.muted { color: var(--ink-muted); }
.small { font-size: 0.86rem; }
.hint { color: var(--ink-muted); font-weight: 400; font-size: 0.82rem; }
.callout {
  border: 1px solid var(--panel-edge);
  border-left: 3px solid var(--brass);
  border-radius: 8px;
  background: var(--secondary-hover);
  padding: 10px 12px;
}

/* Eyebrow: an uppercase brass section label above a heading or stat. */
.eyebrow {
  display: block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--brass-ink);
}

/* --- utility classes (migrated from repeated inline styles) --- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.center { text-align: center; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.split { justify-content: space-between; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mw-form { max-width: 640px; }
.mw-wizard { max-width: 720px; }
.mw-filter { max-width: 420px; }
.mw-narrow { max-width: 160px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  border-radius: var(--radius); border: 1px solid transparent;
  padding: 10px 18px; cursor: pointer; text-decoration: none;
  background: var(--btn-bg); color: #fff;
  transition: background 0.12s ease, transform 0.04s ease;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn.secondary { background: var(--panel); color: var(--link); border-color: var(--panel-edge); }
.btn.secondary:hover { border-color: var(--navy); background: var(--secondary-hover); }
.btn.danger { background: var(--tally-red); color: #fff; }
.btn.danger:hover { background: #9c2e21; }
.btn.link { background: none; border: none; color: var(--link); text-decoration: underline; padding: 4px 6px; font-weight: 500; }
.btn.link:hover { background: none; }
.btn.small-btn { padding: 6px 12px; font-size: 0.86rem; }
.btn.icon-btn {
  width: 36px; height: 36px; padding: 0; border-radius: 8px;
}
.material-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex: 0 0 18px;
}
.material-icon-small {
  width: 14px; height: 14px; flex-basis: 14px;
}
.material-icon svg { width: 100%; height: 100%; stroke: currentColor; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.field .hint { margin-top: 3px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], select, textarea {
  font: inherit; color: var(--ink);
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--field-bg);
}
input::placeholder, textarea::placeholder { color: var(--ink-muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--link); }
fieldset { border: 1px solid var(--panel-edge); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; }
fieldset legend { font-weight: 600; font-size: 0.9rem; padding: 0 6px; }

/* Grant groups (AC14): the role editor organizes what a role grants by the
   same function vocabulary as the home sections — engraved uppercase legend,
   quiet bordered group. */
fieldset.grant-group legend {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.13em; color: var(--brass-ink);
}
fieldset.grant-group .check { margin-bottom: 8px; }
fieldset.grant-group .check:last-of-type { margin-bottom: 0; }
fieldset.grant-group .field:last-child { margin-bottom: 2px; }

/* Show-password reveal (brief §4.8): a keyboard-operable button inside the
   field; the input keeps its name/autocomplete so forms are unchanged. */
/* Scoped under .field so it out-ranks the `.field > span` label-text rule and
   the wrapper stays neutral (the input keeps its normal 1rem/400 font). */
.field .password-field { position: relative; display: block; font-weight: 400; font-size: 1rem; margin-bottom: 0; }
.password-field input { padding-right: 44px; }
.reveal-toggle {
  position: absolute; top: 0; right: 0; height: 100%; width: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--ink-muted);
  border-radius: 0 8px 8px 0;
}
.reveal-toggle:hover { color: var(--ink); }
.reveal-toggle[aria-pressed="true"] { color: var(--link); }
.reveal-toggle svg { width: 20px; height: 20px; }

.card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: inset 0 1px 0 var(--card-highlight);
}

.error-note {
  background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-text);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 14px;
}
.ok-note {
  background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok-text);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 14px;
}

/* Tally lamp — the portal's one status language, rendered as a lit lens:
   radial highlight, inner shadow, soft outer glow when lit. */
.lamp {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 46%),
    var(--lamp-off);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.34), inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.08);
  vertical-align: baseline; margin-right: 7px; flex: none;
}
.lamp.green {
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 46%), var(--tally-green);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 7px rgba(46, 125, 79, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.lamp.amber {
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 46%), var(--tally-amber);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 7px rgba(185, 122, 29, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.lamp.red {
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 46%), var(--tally-red);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 7px rgba(186, 59, 44, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.lamp.gray, .lamp.off { background: var(--lamp-off); box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.28); }
.lamp.big { width: 18px; height: 18px; }

/* Breathing glow — green LANDING-door lamps only (brief §"Signature moments").
   Disabled under prefers-reduced-motion via the global rule above. */
@keyframes lamp-breathe {
  0%, 100% { box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 5px rgba(46, 125, 79, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.06); }
  50% { box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 13px rgba(46, 125, 79, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.06); }
}
.door .door-lamp .lamp.green { animation: lamp-breathe 3.2s ease-in-out infinite; }

.status-line { display: inline-flex; align-items: center; }

/* ---------- table ---------- */
/* Tables scroll inside their wrap (brief §5.4) — never crush cells or clip
   action buttons, and never let the page itself scroll sideways. The wrap is
   also the containing block for absolutely-positioned descendants (.sr-only
   labels in sort buttons/lamps) — without it they resolve against the document
   and silently widen the PAGE scroll area on narrow viewports. */
.table-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  position: relative;
}
table.data {
  width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--panel);
  font-variant-numeric: tabular-nums; table-layout: fixed;
  min-width: 560px;
}
/* Action columns are sized to their buttons (views pass cellClass/width);
   they must never truncate an interactive control. */
table.data th.cell-actions, table.data td.cell-actions {
  overflow: visible; text-overflow: clip;
}
table.data th {
  text-align: left; font-weight: 700; color: var(--ink-muted); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 10px 12px; border-bottom: 2px solid var(--panel-edge);
  position: sticky; top: 0; background: var(--panel); z-index: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.data td {
  padding: 10px 12px; border-bottom: 1px solid var(--panel-edge); vertical-align: middle;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.data br { display: none; }
table.data td div,
table.data td p,
table.data td ul,
table.data td ol {
  display: inline;
  margin: 0;
  padding: 0;
}
table.data td li { display: inline; }
table.data tbody tr { transition: background 0.1s ease; }
table.data tbody tr:hover { background: var(--row-hover); }
table.data tr:last-child td { border-bottom: none; }
.table-empty { text-align: center; padding: 26px 16px; }
.table-empty .lamp { margin: 0 auto 8px; display: block; }
.table-sort {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 0; color: inherit;
  font: inherit; font-weight: inherit; text-transform: inherit; letter-spacing: inherit;
  cursor: pointer;
}
.table-sort:hover { color: var(--ink); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.table-filter-panel {
  margin: 0 0 10px;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  background: var(--panel);
}
.table-filter-panel > summary {
  cursor: pointer;
  padding: 8px 11px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.table-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--panel-edge);
}
.table-filter {
  min-width: 0; display: grid; gap: 6px;
}
.table-filter-label > span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.table-filter input[type="search"] {
  padding: 6px 8px; font-size: 0.82rem; border-radius: 6px;
  min-width: 0;
}
.table-filter details { font-size: 0.78rem; color: var(--ink-muted); }
.table-filter summary {
  cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.table-filter-options {
  margin-top: 6px; padding: 8px; max-height: 180px; overflow: auto;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  white-space: normal;
}
.table-filter-options .check { gap: 7px; margin: 0 0 5px; font-size: 0.8rem; }
.table-filter-options .check:last-child { margin-bottom: 0; }
.table-active-filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px;
}
.table-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--brass); border-radius: 999px;
  background: var(--chip-active-bg); color: var(--ink);
  padding: 4px 10px; font: inherit; font-size: 0.78rem; cursor: pointer;
}
.table-chip::after { content: "\00d7"; color: var(--ink-muted); font-weight: 700; }
.table-result-count { margin: 6px 0 0; }
/* One shared recipe for small metadata tokens (origin marks, type badges,
   compact tokens, repeat counters): 0.76rem, 2px 8px, hairline on surface.
   Rectangles = static badges; pills = token lists. */
.origin-mark {
  display: inline-flex; align-items: center;
  border: 1px solid var(--panel-edge); border-radius: 6px;
  padding: 2px 8px; font-size: 0.76rem; line-height: 1.35;
  color: var(--ink-muted); background: var(--surface);
}
.origin-mark-built-in {
  /* Real brass token (#a8843a), not the off-brand #c48f40 it used to hardcode. */
  border-color: rgba(168, 132, 58, 0.55);
  color: var(--ink); background: var(--chip-active-bg);
}
.origin-inline-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: var(--brass);
  vertical-align: -2px;
}
.origin-inline-icon .material-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}
.table-cell-main,
.table-cell-sub {
  display: inline;
  min-width: 0;
}
.table-cell-sub {
  margin-left: 8px;
  color: var(--ink-muted);
  font-size: 0.82rem;
}
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.table-actions .btn.icon-btn {
  width: 30px;
  height: 30px;
}
.inline-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  margin: 0;
  display: inline-block;
  vertical-align: -2px;
}
.processing-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  color: var(--ink-muted);
  font-size: 0.78rem;
}
.member-list {
  display: grid;
  gap: 8px;
}
.member-entry {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.member-entry .btn.icon-btn {
  width: 28px;
  height: 28px;
}
.role-group-members {
  margin-top: 12px;
}
.role-group-members h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.role-group-form {
  margin-bottom: 14px;
}
.security-type-badge {
  display: inline-flex; align-items: center;
  border: 1px solid var(--panel-edge); border-radius: 6px;
  padding: 2px 8px; color: var(--ink); background: var(--surface);
  font-size: 0.76rem; font-weight: 700;
}

/* ---------- skeleton loading (brief §3) — reduced-motion: static ---------- */
.skeleton { display: block; }
.sk {
  display: block; background: var(--sk-base); border-radius: 6px;
  position: relative; overflow: hidden;
}
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--sk-shimmer), transparent);
  animation: sk-shimmer 1.4s infinite;
}
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }
.sk-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 16px;
  padding: 13px 12px; border-bottom: 1px solid var(--panel-edge);
}
.sk-cell { height: 14px; }
.sk-cell:first-child { width: 62%; }
.skeleton-stat { padding: 16px; }
.sk-label { height: 10px; width: 55%; margin-bottom: 10px; }
.sk-value { height: 22px; width: 72%; }

/* ---------- toast ---------- */
/* Above the modal overlay (z 80): action feedback fired from a dialog must
   never render dimmed behind its own scrim. Errors get their own assertive
   live region so screen readers announce failures immediately; both regions
   share one fixed stack. */
#toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
#toast-region, #toast-region-alert { display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-deep); color: #fff; border-radius: 8px;
  padding: 12px 14px 12px 18px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); max-width: 380px;
  display: flex; align-items: flex-start; gap: 12px;
}
.toast.error { background: var(--tally-red); }
.toast .toast-msg { flex: 1; }
.toast .toast-dismiss {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 1.15rem; line-height: 1; padding: 0 2px; opacity: 0.8;
}
.toast .toast-dismiss:hover { opacity: 1; }

/* ---------- modal dialog (brief §4.2) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 80;
}
.modal {
  /* Single padding token: the sticky action bar and the mobile override derive
     from it, so the footer always sits flush with the modal edge. */
  --modal-pad: 28px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--panel-edge); border-radius: var(--radius);
  padding: var(--modal-pad); width: 100%; max-width: 560px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  /* Every dialog scrolls inside itself on short viewports — content and
     actions are never clipped offscreen. */
  max-height: min(90vh, 900px); overflow: auto; overscroll-behavior: contain;
}
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
/* Detail modals are the drill-down surface — give them real room: most of the
   viewport width (capped for line length) and height, so event payloads and
   multi-column detail grids read without cramped scrolling. */
.row-detail-modal { max-width: min(980px, 100%); max-height: min(90vh, 1040px); overflow: auto; }
/* Sticky action bar: on scrolling detail modals the decision buttons stay in
   reach instead of scrolling out of view below the fold. */
.row-detail-modal .modal-actions {
  position: sticky; bottom: calc(-1 * var(--modal-pad));
  margin: 14px calc(-1 * var(--modal-pad)) calc(-1 * var(--modal-pad));
  padding: 12px var(--modal-pad) 16px;
  background: var(--panel); border-top: 1px solid var(--panel-edge);
}
.modal-header { flex-wrap: nowrap; align-items: flex-start; }
.modal-header > div { min-width: 0; }
.modal-header .icon-btn { flex: none; }
.row-detail-mode {
  display: inline-flex; align-items: center; margin: 4px 0 12px;
  border: 1px solid var(--panel-edge); border-radius: 999px;
  padding: 3px 10px; color: var(--ink-muted); font-size: 0.78rem;
}
.row-detail-body, .row-detail-edit { margin-top: 10px; }
.row-detail-edit {
  border-top: 1px solid var(--panel-edge);
  padding-top: 12px;
}
.modal-edit-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; align-items: start;
}
.modal-edit-grid .field { margin-bottom: 0; }
.lifecycle-timeline {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 10px; margin: 10px 0 18px;
}
.lifecycle-icons {
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  margin-top: 2px;
}
.timeline-item {
  position: relative; padding-left: 18px; min-height: 48px;
}
.lifecycle-icons .timeline-item {
  padding-left: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 7px;
  align-items: start;
}
.timeline-item::before {
  content: ""; position: absolute; left: 5px; top: 16px; bottom: -14px;
  width: 1px; background: var(--panel-edge);
}
.lifecycle-icons .timeline-item::before { display: none; }
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  position: absolute; left: 0; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--panel); background: var(--ink-muted);
  box-shadow: 0 0 0 1px var(--panel-edge);
}
.timeline-dot-green { background: var(--tally-green); }
.timeline-dot-amber { background: var(--tally-amber); }
.timeline-dot-red { background: var(--tally-red); }
.timeline-dot-off { background: var(--ink-muted); }
.timeline-icon {
  width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-muted); background: var(--surface);
  border: 1px solid var(--panel-edge);
}
.timeline-icon-green { color: var(--tally-green); border-color: rgba(46, 125, 79, 0.35); }
.timeline-icon-amber { color: var(--tally-amber); border-color: rgba(185, 122, 29, 0.35); }
.timeline-icon-red { color: var(--tally-red); border-color: rgba(186, 59, 44, 0.35); }
.timeline-title { display: block; font-weight: 700; font-size: 0.84rem; min-width: 0; }
.lifecycle-icons .timeline-title { grid-column: 2; }
.timeline-meta { display: block; color: var(--ink-muted); font-size: 0.78rem; margin-top: 2px; min-width: 0; }
.lifecycle-icons .timeline-meta { grid-column: 2; }
.modal-accordion {
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  margin-top: 10px;
  background: var(--panel);
}
.modal-accordion > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}
.modal-accordion > summary::marker { color: var(--ink-muted); }
.modal-accordion-body {
  border-top: 1px solid var(--panel-edge);
  padding: 12px;
}
.effective-access-summary {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}
.effective-access-summary > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}
.effective-label {
  color: var(--ink-muted);
  font-weight: 700;
}
.compact-token {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0 6px 5px 0;
  padding: 2px 8px;
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76rem;
}
.aws-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}
.aws-health-card {
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  min-width: 0;
}
.aws-health-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.aws-health-title {
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.aws-health-value {
  margin-top: 8px;
  font-weight: 700;
}
.aws-health-summary {
  margin: 5px 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}
.aws-detail-block h3 {
  margin: 14px 0 8px;
}
.aws-raw-detail {
  background: var(--surface);
}
.email-history-section { margin-top: 18px; }
.email-history-section h3 { margin-bottom: 8px; }
.email-history-table th, .email-history-table td { font-size: 0.82rem; }
.email-status {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600;
}
/* Email statuses speak the same tally-lamp language as everything else:
   the lens recipe from .lamp, at 9px. */
.email-status::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 46%), var(--lamp-off);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.email-status-sent::before {
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 46%), var(--tally-green);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 5px rgba(46, 125, 79, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.email-status-queued::before, .email-status-held::before {
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 46%), var(--tally-amber);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 5px rgba(185, 122, 29, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.email-status-bounced::before, .email-status-complained::before, .email-status-failed::before {
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 46%), var(--tally-red);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 0 5px rgba(186, 59, 44, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.event-repeat {
  display: inline-flex; align-items: center; margin-left: 6px;
  padding: 1px 8px; border-radius: 999px; border: 1px solid var(--panel-edge);
  color: var(--ink-muted); font-size: 0.76rem; font-weight: 700;
}
.event-nested { margin: 0; }
.event-nested div { margin-bottom: 4px; }
.event-nested dt { color: var(--ink-muted); font-size: 0.7rem; font-weight: 700; }
.event-nested dd { margin: 0 0 4px; }
.event-payload-list { margin: 0; padding-left: 18px; }

/* ---------- theme toggle (lamp-styled) ---------- */
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; }
.portal-topbar .theme-toggle { color: #dfe6f1; }

/* ---------- public pages (landing, recovery, applicant, workspaces) ---------- */

.public-shell {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 0 20px 40px;
}

.public-bar {
  width: 100%; max-width: 880px; display: flex; align-items: center; gap: 14px;
  padding: 14px 0 26px;
}
.public-bar.hero { justify-content: flex-end; padding-bottom: 0; }
.public-bar .spacer { flex: 1; }
.bar-brand {
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.05em;
  color: var(--brand-ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.bar-brand .brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--brass-bright), var(--brass));
}
.bar-brand:hover { text-decoration: underline; }
.session-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.86rem; color: var(--ink-muted); }
.session-chip .mono { color: var(--ink); }
.public-shell .public-body { width: 100%; max-width: 880px; }
.public-shell.narrow .public-body { max-width: 460px; }

/* Engraved masthead: Palatino display face, letterspaced subline, and a DOUBLE
   brass hairline (1px bright over the base) reading as engraved metal. */
.wordmark { text-align: center; margin: 34px 0; }
.wordmark .mark-title {
  font-family: var(--font-display); font-size: 2.6rem; letter-spacing: 0.05em;
  color: var(--brand-ink); margin: 0; line-height: 1.05;
}
.wordmark .mark-sub {
  color: var(--ink-muted); letter-spacing: 0.26em; text-transform: uppercase;
  font-size: 0.72rem; margin-top: 8px;
}
.wordmark .mark-rule {
  width: 88px; height: 3px; border: none; margin: 15px auto 0; border-radius: 2px;
  background: linear-gradient(var(--brass-bright), var(--brass-bright) 1px, var(--brass) 1px, var(--brass));
}

/* The signature: two studio doors. */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; }
.door {
  display: block; text-align: left; text-decoration: none; cursor: pointer;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--panel-edge); border-top: 4px solid var(--navy);
  border-radius: var(--radius); padding: 26px 24px 22px;
  font: inherit; width: 100%;
  box-shadow: inset 0 1px 0 var(--card-highlight);
  transition: border-top-color 0.14s ease, box-shadow 0.14s ease;
}
.door:hover { border-top-color: var(--brass); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14); }
.door .door-lamp { margin-bottom: 14px; }
.door .door-title { font-family: var(--font-display); font-size: 1.4rem; display: block; margin-bottom: 6px; }
.door .door-desc { color: var(--ink-muted); font-size: 0.94rem; }

.public-footer { margin-top: 26px; text-align: center; color: var(--ink-muted); font-size: 0.85rem; }

.signin-card { max-width: 460px; margin: 0 auto; }
.signin-card .actions { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 10px; flex-wrap: wrap; }

.qr-box { text-align: center; margin: 14px 0; }
.qr-box svg { width: 200px; height: 200px; }
.manual-key { word-break: break-all; }

.access-hub-header { margin: 8px 0 22px; }
/* The intro text yields to the page action so a long sub-line never wraps the
   primary button below the header (it stays top-right until phone widths). */
.access-hub-header > div:first-child { flex: 1 1 320px; min-width: 0; }
.access-hub-header > .btn { flex: 0 0 auto; align-self: flex-start; margin-top: 6px; }
.access-hub-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px; margin-bottom: 18px;
}
.access-workspace-card { border-top: 4px solid var(--tally-green); }
.access-account-card { border-top: 4px solid var(--brass); }
.access-self-service { margin-bottom: 24px; }
.access-self-service .action-grid { margin-top: 14px; }
.self-service-tile { min-height: 168px; }
.registration-details { margin-top: 14px; color: var(--ink-muted); }
.registration-details summary,
.manual-key-details summary { cursor: pointer; font-size: 0.86rem; font-weight: 600; }
.launch-workspace-btn { min-width: 220px; }

/* ---------- portal shell ---------- */

.portal-shell { min-height: 100vh; display: flex; flex-direction: column; }
.portal-topbar {
  background: var(--navy-deep); color: #fff;
  display: flex; align-items: center; gap: 18px; padding: 10px 22px;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--brass-bright), var(--brass)) 1;
}
.portal-topbar .brand {
  font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.05em;
  color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 10px;
}
.portal-topbar .brand .brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--brass-bright), var(--brass));
}
.portal-topbar .spacer { flex: 1; }
.portal-topbar .who { font-size: 0.88rem; color: #c4cddd; }
.portal-topbar .who .mono { color: #fff; }
.portal-topbar .btn.link { color: #dfe6f1; }
/* The topbar is navy-deep in BOTH themes; the default focus blue only hits
   2.8:1 there. Use the dim-theme focus blue (4.4:1 on navy-deep). */
.portal-topbar :focus-visible { outline-color: #8db4f5; }

/* Use more of the page on wide screens (up to 80% of the viewport) so data
   tables fit at their natural width without scrolling; capped so ultra-wide
   monitors do not stretch text lines. Full width (minus padding) on phones. */
.portal-main { flex: 1; width: 100%; max-width: min(1600px, 80vw); margin: 0 auto; padding: 28px 22px 48px; }
@media (max-width: 1000px) { .portal-main { max-width: 100%; } }
.portal-main .crumb { margin-bottom: 18px; }
.portal-main .crumb a { text-decoration: none; color: var(--ink-muted); }
.portal-main .crumb a:hover { color: var(--navy); text-decoration: underline; }

/* Portal home — apps grouped by function section (AC14). Each section reads
   like a mixing-desk channel strip: a small engraved label, then a brass
   hairline running the rest of the row, then that function's tiles. */
.home-intro { margin-bottom: 26px; }
.home-tiles { display: grid; gap: 28px; }
.home-section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.home-section-title {
  font-family: var(--font-body); font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--brass-ink);
  margin: 0; white-space: nowrap;
}
.home-section-rule {
  flex: 1; height: 1px; min-width: 40px;
  background: linear-gradient(90deg, var(--brass), transparent);
  opacity: 0.55;
}
.home-section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink); text-align: left;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  padding: 20px; cursor: pointer; font: inherit; width: 100%;
  box-shadow: inset 0 1px 0 var(--card-highlight);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}
.tile:hover { border-color: var(--navy); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1); transform: translateY(-1px); }
.tile:focus-visible { border-color: var(--focus); }
@media (prefers-reduced-motion: reduce) { .tile:hover { transform: none; } }
.tile .tile-icon { width: 40px; height: 40px; margin-bottom: 12px; display: block; }
.tile .tile-icon svg { width: 100%; height: 100%; stroke: var(--brass-ink); }
.tile .tile-title { font-family: var(--font-display); font-size: 1.12rem; display: block; margin-bottom: 4px; }
.tile .tile-desc { color: var(--ink-muted); font-size: 0.88rem; }
.tile .tile-count { margin-top: auto; padding-top: 10px; font-size: 0.84rem; color: var(--ink-muted); display: flex; align-items: center; }
.tile .tile-count:empty { display: none; }

/* Wizard (Update a user) — pill chips keep numbers (a real sequence); the
   active step gets a brass underline, completed steps a small check. */
.wizard-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; padding: 0; list-style: none; }
.wizard-steps li {
  position: relative; font-size: 0.82rem; color: var(--ink-muted);
  padding: 5px 12px; border: 1px solid var(--panel-edge); border-radius: 999px; background: var(--panel);
}
.wizard-steps li[data-done="1"]::before { content: "\2713\00a0"; color: var(--tally-green); font-weight: 700; }
.wizard-steps li[aria-current="step"] { color: var(--ink); font-weight: 600; border-color: var(--brass); }
.wizard-steps li[aria-current="step"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  background: linear-gradient(90deg, var(--brass-bright), var(--brass)); border-radius: 2px;
}

/* T-02-20260518-028: compact affected-resources summary in the approval queue. */
.affected-resources { list-style: none; margin: 0; padding: 0; }
.affected-resources li { padding: 1px 0; line-height: 1.35; }

.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { border-bottom: 1px solid var(--panel-edge); }
.result-list li:last-child { border-bottom: none; }
.result-list button {
  display: flex; width: 100%; text-align: left; gap: 14px; align-items: center;
  background: none; border: none; font: inherit; padding: 12px 8px; cursor: pointer; border-radius: 6px;
}
.result-list button:hover { background: var(--surface); }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* Stat tiles — eyebrow label + display value, an engraved brass rule at the
   tile top. Quiet: never a dashboard wall. */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: inset 0 1px 0 var(--card-highlight);
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brass-bright), var(--brass));
}
.stat .stat-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted); }
.stat .stat-value { font-family: var(--font-display); font-size: 1.7rem; margin-top: 3px; font-variant-numeric: tabular-nums; }
/* A stat tile that filters the table below it: same card, plus affordance. */
button.stat-link { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
button.stat-link:hover, button.stat-link:focus-visible { border-color: var(--navy); }

.section { margin-bottom: 26px; }

/* Status chips (User admin — brief §4.4). */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.85rem;
  padding: 5px 12px; border: 1px solid var(--panel-edge); border-radius: 999px;
  background: var(--panel); color: var(--ink); cursor: pointer;
}
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { border-color: var(--brass); background: var(--chip-active-bg); font-weight: 600; }
.chip .chip-count { color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 22px; margin: 12px 0; }
/* A long free-text entry takes the whole modal width instead of wrapping
   inside one narrow grid column. */
.detail-grid div:has(> dd > .detail-fulltext) { grid-column: 1 / -1; }
/* Long free-text fields (security-event detail) wrap and scroll rather than
   truncate — the modal is the drill-down surface, so nothing is hidden. */
.detail-fulltext { display: block; white-space: pre-wrap; word-break: break-word; max-height: 440px; overflow: auto; }
.detail-grid dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin: 0; }
.detail-grid dd { margin: 1px 0 8px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 12px; }

.pending-block { text-align: center; padding: 34px 20px; }
.pending-block .lamp { margin: 0 auto 14px; display: block; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 14px;
  border: 3px solid var(--panel-edge); border-top-color: var(--navy);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Failed-job error detail (workspace management — brief §4.6). */
/* Clipped error text ends in an ellipsis (the row opens the full detail) —
   a mid-word hard cut reads as broken rendering. */
.job-error { display: block; margin-top: 4px; color: var(--error-text); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 700px) {
  .doors { grid-template-columns: 1fr; }
  .access-hub-grid { grid-template-columns: 1fr; }
  .portal-topbar { flex-wrap: wrap; row-gap: 4px; padding: 10px 14px; }
  .portal-topbar .who { order: 5; width: 100%; }
  .public-shell { padding-top: 28px; }
  .wordmark .mark-title { font-size: 2.1rem; }
  .portal-main { padding: 20px 14px 40px; }
  .modal { --modal-pad: 16px; }
  .modal-overlay { padding: 12px; }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 10px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* T-02-20260708-002: top-bar breadcrumbs, duration pair, roles table.
   T-02-20260708-005: the crumb separators/current page use a fixed light muted
   (the topbar is dark in BOTH themes) — this also retires the previously
   undefined --muted custom-property reference. */
.portal-topbar .crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.portal-topbar .crumb-sep { color: #b6c0d1; }
.portal-topbar .crumb-link { color: inherit; text-decoration: none; opacity: 0.85; }
.portal-topbar .crumb-link:hover { text-decoration: underline; }
.portal-topbar .crumb-here { color: #b6c0d1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duration-row { display: flex; gap: 12px; }
.duration-row .field.compact { flex: 1; margin: 0; }

/* ===== 2026-07-10 UI redesign (beta) ======================================= */

/* Sidebar shell (outline 3.B): persistent sidebar on desktop, drawer on
   mobile. Overrides the column layout the pre-beta shell used. */
.portal-shell.beta-shell { flex-direction: row; align-items: stretch; }
.portal-sidebar {
  width: 232px; flex: 0 0 232px; display: flex; flex-direction: column;
  background: var(--navy-deep, #16233c); color: #dfe6f1;
  padding: 18px 14px; gap: 14px; min-height: 100vh; position: sticky; top: 0;
  max-height: 100vh; overflow-y: auto; z-index: 30;
}
.side-brand { color: #fff; font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.side-brand .brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brass, #a8843a); display: inline-block; }
.beta-tag {
  font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--brass, #a8843a); color: #16233c; border-radius: 3px; padding: 1px 6px; font-weight: 700;
}
.side-nav { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.side-section { display: flex; flex-direction: column; gap: 2px; }
.side-title {
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #8fa0bd; margin: 4px 6px;
}
.side-link {
  color: #dfe6f1; text-decoration: none; padding: 7px 10px; border-radius: 6px;
  font-size: 0.93rem; border-left: 2px solid transparent;
}
.side-link:hover { background: rgba(255, 255, 255, 0.07); }
.side-link.active {
  background: rgba(168, 132, 58, 0.18); border-left-color: var(--brass, #a8843a); color: #fff;
}
.side-foot { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.side-foot .who { color: #c4cddd; }
.side-foot .who .mono { color: #fff; }
.side-foot .btn.link, .side-foot .theme-toggle { color: #dfe6f1; padding-left: 0; }
.portal-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.beta-shell .portal-topbar { position: sticky; top: 0; z-index: 20; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .portal-sidebar {
    position: fixed; inset: 0 auto 0 0; transform: translateX(-100%);
    transition: transform 0.18s ease; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  }
  .portal-sidebar.open { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) { .portal-sidebar { transition: none; } }

/* Inbox action lists (3.A) */
.inbox-group { margin: 18px 0; }
.inbox-group-title { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; }
.inbox-count {
  background: var(--chip-active-bg, rgba(168, 132, 58, 0.2)); color: inherit;
  border-radius: 999px; padding: 0 9px; font-size: 0.8rem; font-weight: 600;
}
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-row {
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  background: var(--panel, #fff); border: 1px solid var(--panel-edge, #d9dee8);
  border-radius: var(--radius, 8px); padding: 12px 16px; text-decoration: none; color: inherit;
}
.action-row:hover { background: var(--row-hover, rgba(0, 0, 0, 0.03)); }
.action-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.action-subject { font-weight: 600; }
.action-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; text-align: right; }
.inbox-quiet h2 { display: flex; align-items: center; gap: 8px; }

/* Badges (5.C provenance + request types) */
.badge {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.05em;
  border: 1px solid var(--panel-edge, #d9dee8); border-radius: 4px;
  padding: 1px 7px; text-transform: uppercase; font-weight: 600; color: var(--ink-muted, #5c6778);
}
.badge-brass { border-color: var(--brass, #a8843a); color: var(--brass-ink, #7a5f24); }
.badge-green { border-color: var(--tally-green, #2c7a3f); color: var(--tally-green, #2c7a3f); }
.badge-amber { border-color: var(--tally-amber, #b07f18); color: var(--tally-amber, #b07f18); }
.badge-red { border-color: var(--tally-red, #a53131); color: var(--tally-red, #a53131); }
.badge-muted { opacity: 0.75; }

/* Pipeline stepper (3.C.vi.b) */
.stepper {
  display: flex; gap: 0; list-style: none; padding: 0; margin: 12px 0 20px;
  overflow-x: auto;
}
.step { flex: 1 1 0; min-width: 110px; position: relative; padding: 0 8px 0 0; text-align: center; }
.step::before {
  content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px;
  background: var(--panel-edge, #d9dee8);
}
.step:first-child::before { display: none; }
.step-dot {
  display: block; width: 18px; height: 18px; border-radius: 50%; margin: 0 auto 6px;
  background: var(--panel, #fff); border: 2px solid var(--panel-edge, #b9c2d4); position: relative; z-index: 1;
}
.step-done .step-dot { background: var(--tally-green, #2c7a3f); border-color: var(--tally-green, #2c7a3f); }
.step-current .step-dot { border-color: var(--tally-amber, #b07f18); background: var(--tally-amber, #b07f18); }
.step-failed .step-dot { background: var(--tally-red, #a53131); border-color: var(--tally-red, #a53131); }
.step-recorded .step-dot { border-style: dashed; border-color: var(--tally-amber, #b07f18); }
.step-label { display: block; font-size: 0.85rem; font-weight: 600; }
.step-meta { display: block; font-size: 0.75rem; color: var(--ink-muted, #5c6778); margin-top: 2px; }

/* Misc beta components */
.action-bar { margin: 4px 0 16px; }
.tab-row { margin: 14px 0 10px; }
.tech-disclosure { margin: 10px 0; }
.tech-disclosure > summary { cursor: pointer; color: var(--ink-muted, #5c6778); font-size: 0.9rem; }
.people-controls { align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.people-search { min-width: 280px; flex: 0 1 360px; }
.audit-filters input { min-width: 170px; }
.new-request-grid { margin-top: 10px; }
.timeline-list { list-style: none; padding-left: 0; }
