/* ════════════════════════════════════════════════════════════════════════════
   AGENTS TAB — Agent Workbench Session 2
   `.ag-*` prefix. Module shadow per CLAUDE.md.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Unified panel (flume-persistent-chat S1) ──
   The Agents tab is ONE shape in every mode: the agent-room two-column layout
   (swapping left content + a persistent chat rail) on the full-viewport chrome
   from history.css `#panel-agent.active`. The home no longer opts OUT of that
   chrome — its content scrolls inside `.ag-room-main` alongside the docked
   chat. `.ag-unified-left` is the swapping left column (home grid ⇄ a room);
   for the home it wraps a single `.ag-room-main` scroller, for a room it
   carries the subview bar above that scroller (AgentRoomLeft). */
.ag-unified-left{
  flex:1;min-width:0;min-height:0;
  display:flex;flex-direction:column;
}

/* Tab header */
.ag-tab-root{
  display:flex;flex-direction:column;gap:20px;
  /* No max-width cap — match Dashboard's full-panel-width behaviour. The
     1280px cap previously here made the Agents tab feel artificially
     narrow on wider screens vs every other tab. */
}
.ag-tab-header{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:16px;padding-bottom:8px;
}
.ag-tab-header-titles{display:flex;flex-direction:column;gap:4px}
.ag-tab-title{
  font-size:22px;font-weight:700;color:var(--text);margin:0;
  letter-spacing:-0.01em;
}
.ag-tab-sub{font-size:13px;color:var(--text3);margin:0}
.ag-tab-header-actions{display:flex;gap:8px}

/* ── Team pulse (DESIGN.md §23c) ──
   One live sentence under the title: strong numbers in --text, prose in
   --text3, breathing green dot. Queue fragment is a real button that
   scrolls to the queue section. */
.ag-pulse{display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:0 4px;line-height:1.6}
.ag-pulse-dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--green);
  align-self:center;margin-right:5px;flex-shrink:0;
  animation:agPresencePulse 2.6s ease-in-out infinite;
}
.ag-pulse-strong{color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}
.ag-pulse-strong--risk{color:var(--amber)}
.ag-pulse-link{
  background:none;border:none;padding:0;margin:0;
  font:inherit;color:inherit;cursor:pointer;
  text-decoration:underline dotted color-mix(in srgb,var(--text3) 60%,transparent);
  text-underline-offset:3px;
  transition:color 0.15s;
}
.ag-pulse-link:hover{color:var(--text)}
@media (prefers-reduced-motion:reduce){
  .ag-pulse-dot{animation:none}
}

/* Refresh — icon-only header action. */
.ag-refresh-btn--spinning svg{animation:motionSpin calc(var(--motion-draw)*0.9) linear infinite}
@media (prefers-reduced-motion:reduce){
  .ag-refresh-btn--spinning svg{animation:none}
}

.ag-tab-error{
  background:var(--red-bg);color:var(--red);
  border:1px solid color-mix(in srgb,var(--red) 25%,transparent);
  border-radius:var(--radius-lg);padding:12px 14px;font-size:13px;
  display:flex;align-items:center;gap:10px;
}
.ag-tab-loading{
  color:var(--text3);font-size:13px;padding:24px 12px;
}
.ag-link-btn{
  background:none;border:none;color:var(--accent);cursor:pointer;
  font-family:inherit;font-size:inherit;padding:0;text-decoration:underline;
}

.ag-home{display:flex;flex-direction:column;gap:24px}

/* ── Page-load entry stagger ──────────────────────────────────────────────
   Mirrors the dashboard's `dashFadeInUp` pattern (`dashboard.css:44`) — same
   shape, namespaced. Sequence: header → per-squad title → cards per row
   (cascading left-to-right + top-to-bottom) → work queue last. Total cascade
   ~0.75s. `backwards` fill keeps elements invisible before their delay fires
   so nothing flashes in pre-delay. Guarded for `prefers-reduced-motion`.

   Re-runs on first mount of each element. Collapse-then-uncollapse a squad
   will re-trigger because the grid wrapper unmounts (`{!isCollapsed && …}`
   in AgentSquadGrid.tsx) — acceptable: a fresh appearance reads like a fresh
   appearance. */
@keyframes agFadeInUp{
  from{opacity:0;transform:translateY(12px)}
  to  {opacity:1;transform:translateY(0)}
}

/* S9 entrance policy: the cascade is gated on :not(.motion-entered)
   (entrance-once.ts) — the stay-mounted panel's display re-show no longer
   replays it; fresh nodes (squad uncollapse, new cards) still cascade. */
.ag-tab-header:not(.motion-entered),
.ag-squad-header:not(.motion-entered),
.ag-squad-grid .ag-card:not(.motion-entered),
.ag-queue:not(.motion-entered){
  animation:agFadeInUp var(--motion-slow) ease backwards;
}

.ag-tab-header{animation-duration:calc(var(--motion-slow)*0.8);animation-delay:0s}

/* Stagger order matches the visual DOM order (Generalist top → Optimisers →
   Watchers → Analysts → queue). Selectors are tied to the squad MODIFIER
   class (not nth-of-type) so moving sections around in AgentSquadGrid.tsx
   doesn't silently leave cards firing at delay:0 — which is exactly the
   regression that happened when Ask Flume moved to the top and Health
   Officer (3rd Watchers card) + Brief Author (2nd Analysts card) lost
   their delay rules. */

/* Optimisers — 3 cards */
.ag-squad--optimiser .ag-squad-header            {animation-delay:0.10s}
.ag-squad--optimiser .ag-card:nth-child(1)       {animation-delay:0.14s}
.ag-squad--optimiser .ag-card:nth-child(2)       {animation-delay:0.20s}
.ag-squad--optimiser .ag-card:nth-child(3)       {animation-delay:0.26s}

/* Watchers — 3 cards */
.ag-squad--watcher .ag-squad-header              {animation-delay:0.28s}
.ag-squad--watcher .ag-card:nth-child(1)         {animation-delay:0.32s}
.ag-squad--watcher .ag-card:nth-child(2)         {animation-delay:0.38s}
.ag-squad--watcher .ag-card:nth-child(3)         {animation-delay:0.44s}

/* Analysts — 2 cards */
.ag-squad--analyst .ag-squad-header              {animation-delay:0.46s}
.ag-squad--analyst .ag-card:nth-child(1)         {animation-delay:0.50s}
.ag-squad--analyst .ag-card:nth-child(2)         {animation-delay:0.56s}

/* Queue lands after the squads — punctuates the cascade. */
.ag-queue{animation-delay:0.62s}

@media (prefers-reduced-motion:reduce){
  /* :not() matches the S9 entrance-gated rule's specificity so the guard
     still wins; room-entry consumers included (same keyframe family). */
  .ag-tab-header:not(.motion-entered),
  .ag-squad-header:not(.motion-entered),
  .ag-squad-grid .ag-card:not(.motion-entered),
  .ag-queue:not(.motion-entered),
  .ag-room .ag-subview-bar:not(.motion-entered),
  .ag-room-content:not(.motion-entered),
  .ag-room-chat:not(.motion-entered),
  .ag-room-hero:not(.motion-entered),
  .ag-hero-case:not(.motion-entered){
    animation:none;
  }
}

/* ── Sub-view bar (room + Ask Flume back-to-home) ──
   Transparent — no surface block, no divider line (per Tom 2026-06-12):
   the bar's contents merge with the page background like the rest of the
   panel. Back is a plain text link, matching the cards' "View activity →"
   hint language. */
.ag-subview-bar{
  display:flex;align-items:center;gap:12px;
  padding:12px 24px 4px;flex-shrink:0;
}
.ag-subview-back{
  background:none;border:none;padding:0;
  color:var(--text3);cursor:pointer;font-family:inherit;
  font-size:12px;font-weight:500;white-space:nowrap;
  transition:color 0.15s;
}
.ag-subview-back:hover{color:var(--text)}
.ag-subview-title{font-size:13px;font-weight:600;color:var(--text)}

/* ════════════════════════════════════════════════════════════════════════════
   WORK QUEUE — operational lead of the home view
   ════════════════════════════════════════════════════════════════════════════ */

.ag-queue{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  padding:18px 20px;
  display:flex;flex-direction:column;gap:14px;
}

/* Section head — the stat strip is gone (the team pulse header carries the
   aggregates from the same stats object, so the two can never disagree). */
.ag-queue-head{
  display:flex;align-items:baseline;gap:10px;
  padding-bottom:6px;border-bottom:1px solid var(--border);
}
.ag-queue-title{font-size:15px;font-weight:600;color:var(--text);margin:0}
.ag-queue-count{font-size:12px;color:var(--text3);font-variant-numeric:tabular-nums}

/* Squad hue custom props for queue rows + digests (badge tinting). */
.ag-queue-row--squad-optimiser {--ag-hue:var(--accent);--ag-hue-bg:var(--accent-bg)}
.ag-queue-row--squad-watcher   {--ag-hue:var(--blue);  --ag-hue-bg:var(--blue-bg)}
.ag-queue-row--squad-analyst   {--ag-hue:var(--purple);--ag-hue-bg:var(--purple-bg)}
.ag-queue-row--squad-generalist{--ag-hue:var(--orange);--ag-hue-bg:var(--orange-bg)}

.ag-queue-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.ag-queue-row{
  display:grid;grid-template-columns:36px 1fr auto;
  gap:14px;align-items:center;
  padding:12px 14px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  transition:border-color 0.15s,box-shadow 0.15s;
}
.ag-queue-row:hover{border-color:var(--border2);box-shadow:var(--shadow)}
.ag-queue-row-badge{
  width:36px;height:36px;border-radius:10px;
  background:var(--ag-hue-bg,var(--accent-bg));color:var(--ag-hue,var(--accent));
  display:inline-flex;align-items:center;justify-content:center;
}

/* Digest — one agent's ≥3 items collapsed into an expandable row. */
.ag-digest{display:flex;flex-direction:column;gap:8px}
.ag-digest-row{
  display:grid;grid-template-columns:36px 1fr auto;
  gap:14px;align-items:center;
  padding:12px 14px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  cursor:pointer;
  transition:border-color 0.15s,box-shadow 0.15s;
}
.ag-digest-row:hover{border-color:var(--border2);box-shadow:var(--shadow)}
.ag-digest-top{
  font-size:11px;color:var(--text3);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  min-width:0;max-width:420px;
}
.ag-digest-chev{
  color:var(--text3);font-size:11px;align-self:center;
  display:inline-block;
  transition:transform 0.18s ease;
}
.ag-digest-chev--open{transform:rotate(180deg)}
.ag-digest-items{
  list-style:none;margin:0;padding:0 0 0 18px;
  display:flex;flex-direction:column;gap:8px;
  border-left:2px solid var(--ag-hue-bg,var(--border));
  margin-left:16px;
}
.ag-queue-row--nested{padding:10px 12px}
.ag-queue-row-main{display:flex;flex-direction:column;gap:4px;min-width:0}
.ag-queue-row-action{font-size:14px;font-weight:600;color:var(--text);line-height:1.35}
.ag-queue-row-summary{font-size:12px;color:var(--text2);line-height:1.4}
.ag-queue-row-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:2px}
.ag-queue-row-agent{font-size:11px;color:var(--text3);font-weight:500}
.ag-queue-row-actions{display:flex;gap:6px;flex-shrink:0}

/* Chips (impact + risk) */
.ag-chip{
  display:inline-block;padding:2px 8px;border-radius:6px;
  font-size:10px;font-weight:600;letter-spacing:0.02em;white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.ag-chip--impact{background:var(--green-bg);color:var(--green)}
.ag-chip--impact-neg{background:var(--red-bg);color:var(--red)}
.ag-chip--risk-lo{background:var(--surface3);color:var(--text3)}
.ag-chip--risk-med{background:var(--amber-bg);color:var(--amber)}
.ag-chip--risk-hi{background:var(--red-bg);color:var(--red)}

/* Empty state */
.ag-queue--empty{padding:0;border:none;background:none;box-shadow:none}
.ag-queue-empty-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  padding:32px 24px;
  display:flex;flex-direction:column;align-items:center;gap:6px;
  text-align:center;
}
.ag-queue-empty-icon{
  width:48px;height:48px;border-radius:50%;
  background:var(--green-bg);color:var(--green);
  display:inline-flex;align-items:center;justify-content:center;
  font-size:22px;font-weight:700;margin-bottom:6px;
}
.ag-queue-empty-title{font-size:15px;font-weight:600;color:var(--text)}
.ag-queue-empty-sub{font-size:13px;color:var(--text3)}

/* ════════════════════════════════════════════════════════════════════════════
   SQUAD GRID
   ════════════════════════════════════════════════════════════════════════════ */

.ag-squads{display:flex;flex-direction:column;gap:18px}

.ag-squad{display:flex;flex-direction:column;gap:12px}
.ag-squad-header{
  display:flex;align-items:baseline;gap:10px;
  background:none;border:none;padding:6px 4px;cursor:pointer;
  font-family:inherit;text-align:left;
  border-radius:6px;
  transition:background 0.12s;
}
.ag-squad-header:hover{background:var(--surface-hover)}
.ag-squad-header--static{cursor:default}
.ag-squad-header--static:hover{background:none}
.ag-squad-chev{
  color:var(--text3);font-size:11px;display:inline-block;
  transition:transform 0.18s ease;
}
.ag-squad--collapsed .ag-squad-chev{transform:rotate(-90deg)}
.ag-squad-label{font-size:14px;font-weight:600;color:var(--text)}
.ag-squad-blurb{font-size:12px;color:var(--text3);flex:1}
.ag-squad-count{
  font-size:11px;color:var(--text3);font-weight:600;
  background:var(--surface3);padding:2px 8px;border-radius:6px;
}

/* Container-driven reflow (flume-persistent-chat S1). The persistent chat rail
   narrows the home's left column WITHOUT shrinking the viewport, so the squad
   grid must reflow off its CONTAINER width, not the window — else 3 fixed
   columns crush to ~190px and card names truncate to two letters. The home
   scroller is the query container; the room reuses `.ag-room-main` untouched. */
.ag-room-main--home{container-type:inline-size}

.ag-squad-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

/* 3 columns only when each clears ~260px; otherwise drop to 2, then 1.
   Container queries are baseline-supported and the home always provides the
   container, so no viewport @media fallback (it would fight these at narrow
   widths — equal specificity, source-order races). */
@container (max-width:820px){
  .ag-squad-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@container (max-width:520px){
  .ag-squad-grid{grid-template-columns:minmax(0,1fr)}
  .ag-queue-row{grid-template-columns:32px 1fr;grid-template-rows:auto auto}
  .ag-queue-row-actions{grid-column:1 / -1;justify-content:flex-end}
}

/* ════════════════════════════════════════════════════════════════════════════
   AGENT CARD
   ════════════════════════════════════════════════════════════════════════════ */

.ag-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  padding:16px;
  display:flex;flex-direction:column;gap:10px;
  cursor:pointer;
  transition:border-color 0.15s,box-shadow 0.15s,transform 0.15s;
  outline:none;
  position:relative; /* harmless containing block (added for the retired S5 spotlight) */
}
.ag-card:hover{
  border-color:var(--border2);
  box-shadow:var(--shadow-lg);
}
.ag-card:focus-visible{
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-glow);
}
.ag-card--paused{opacity:0.78}
.ag-card--error{border-color:color-mix(in srgb,var(--red) 30%,var(--border))}

/* ── Squad hues (DESIGN.md §23c) ──
   Custom properties consumed by the avatar, pending chip, and the agent-
   flavoured accents inside micro-visuals. All map to existing theme tokens
   so every theme inherits a coherent palette. */
.ag-card--squad-optimiser {--ag-hue:var(--accent);--ag-hue-bg:var(--accent-bg)}
.ag-card--squad-watcher   {--ag-hue:var(--blue);  --ag-hue-bg:var(--blue-bg)}
.ag-card--squad-analyst   {--ag-hue:var(--purple);--ag-hue-bg:var(--purple-bg)}
.ag-card--squad-generalist{--ag-hue:var(--orange);--ag-hue-bg:var(--orange-bg)}

.ag-card-head{display:flex;align-items:center;gap:10px}

/* Avatar + presence dot. The dot is the live status signal (replaces the
   text pill): green breathing = on duty, amber = asleep/needs setup,
   blue = watching, grey = paused, red = error. */
.ag-card-avatar{
  position:relative;
  width:38px;height:38px;border-radius:12px;
  background:var(--ag-hue-bg,var(--accent-bg));color:var(--ag-hue,var(--accent));
  display:inline-flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.ag-card--needs_setup .ag-card-avatar,
.ag-card--paused .ag-card-avatar,
.ag-card--user-disabled .ag-card-avatar{
  background:var(--surface3);color:var(--text3);
}
.ag-presence{
  position:absolute;right:-3px;bottom:-3px;
  width:10px;height:10px;border-radius:50%;
  border:2px solid var(--surface);
  background:var(--text3);
}
.ag-presence--active{
  background:var(--green);
  animation:agPresencePulse 2.6s ease-in-out infinite;
}
.ag-presence--needs_setup{background:var(--amber)}
.ag-presence--insufficient_data{background:var(--blue)}
.ag-presence--paused{background:var(--text3)}
.ag-presence--error{background:var(--red)}
@keyframes agPresencePulse{
  0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--green) 40%,transparent)}
  50%    {box-shadow:0 0 0 4px color-mix(in srgb,var(--green) 0%,transparent)}
}
@media (prefers-reduced-motion:reduce){
  .ag-presence--active{animation:none}
}

.ag-card-id{
  display:flex;flex-direction:column;gap:1px;
  flex:1;min-width:0;
}
.ag-card-name{
  font-size:14px;font-weight:600;color:var(--text);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
/* Teammate-style presence line ("On duty · ran 6h ago · next in 4h"). */
.ag-card-status{
  font-size:11.5px;color:var(--text3);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* Quiet icon actions (Talk / Configure) — visible but subdued; full opacity
   on hover or keyboard focus. Hover-capable pointers only get the fade. */
.ag-card-tools{display:inline-flex;gap:6px;flex-shrink:0;align-self:flex-start}
.ag-icon-btn{
  width:28px;height:28px;border-radius:8px;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--surface);border:1px solid var(--border);
  color:var(--text2);cursor:pointer;
  transition:opacity 0.15s,border-color 0.15s,color 0.15s,background 0.12s;
}
.ag-icon-btn:hover{border-color:var(--border2);color:var(--text);background:var(--surface-hover)}
.ag-icon-btn:disabled{opacity:0.5;cursor:not-allowed}
@media (hover:hover){
  .ag-card .ag-card-tools .ag-icon-btn{opacity:0.55}
  .ag-card:hover .ag-card-tools .ag-icon-btn,
  .ag-card:focus-within .ag-card-tools .ag-icon-btn{opacity:1}
}

/* Dependency pill — still used by the per-agent activity feed header. */
.ag-pill{
  display:inline-block;padding:2px 8px;border-radius:8px;
  font-size:10px;font-weight:600;letter-spacing:0.02em;white-space:nowrap;
}
.ag-pill--active{background:var(--green-bg);color:var(--green)}
.ag-pill--paused{background:var(--surface3);color:var(--text3)}
.ag-pill--needs_setup{background:var(--amber-bg);color:var(--amber)}
.ag-pill--insufficient_data{background:var(--blue-bg);color:var(--blue)}
.ag-pill--error{background:var(--red-bg);color:var(--red)}

/* First-person weekly line (falls back to the role summary / dependency
   reason — see agent-voice.ts). */
.ag-card-voice{font-size:12.5px;color:var(--text2);line-height:1.5}

.ag-card-last{font-size:13px;color:var(--text);line-height:1.45}
.ag-card-last-text{color:var(--text)}
.ag-card-last-when{color:var(--text3);font-size:12px}
.ag-card-last-fallback{color:var(--text3);font-style:italic}
/* Session 6.7: when a micro-visual sits above, the last-action text becomes a
   subdued one-line caption rather than the headline of the card. Only used
   by slugs in MICROVISUAL_KEEPS_LAST_ACTION (empty in Wave 1). */
.ag-card-last--with-visual{font-size:12px;color:var(--text3);line-height:1.4;margin-top:2px}

/* ── Session 6.7 — micro-visuals (`.ag-mv-*`) ────────────────────────── */
.ag-mv{display:flex;flex-direction:column;gap:6px}

/* Allocator — bars */
.ag-mv-bars{gap:4px}
.ag-mv-bar-row{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(64px,2fr) auto;
  column-gap:10px;align-items:center;font-size:12px;
}
.ag-mv-bar-name{
  color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.ag-mv-bar-track{
  height:6px;background:var(--surface3);border-radius:100px;overflow:hidden;
}
.ag-mv-bar-fill{
  height:100%;background:var(--ag-hue,var(--accent));border-radius:100px;
  transition:width 0.6s cubic-bezier(0.22,1,0.36,1);
}
.ag-mv-bar-label{
  color:var(--text2);font-variant-numeric:tabular-nums;font-size:11.5px;text-align:right;
}

/* Pacing Watchdog — pace track (mirrors .stat-pace-* on Monthly Budget hero) */
.ag-mv-pace{gap:6px}
.ag-mv-pace-head{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  font-size:12px;
}
.ag-mv-pace-name{
  color:var(--text2);min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.ag-mv-pace-badge{
  flex-shrink:0;font-size:11px;font-weight:500;
  padding:1px 7px;border-radius:100px;
  font-variant-numeric:tabular-nums;
}
.ag-mv-pace-badge--on            {background:color-mix(in srgb,var(--green) 15%,transparent);color:var(--green)}
.ag-mv-pace-badge--slightly-ahead{background:color-mix(in srgb,var(--amber) 15%,transparent);color:var(--amber)}
.ag-mv-pace-badge--ahead         {background:color-mix(in srgb,var(--red)   15%,transparent);color:var(--red)}
.ag-mv-pace-badge--slightly-behind{background:color-mix(in srgb,var(--amber) 15%,transparent);color:var(--amber)}
.ag-mv-pace-badge--behind        {background:color-mix(in srgb,var(--red)   15%,transparent);color:var(--red)}

.ag-mv-pace-track{
  position:relative;height:4px;background:var(--border);border-radius:2px;
  overflow:visible;
}
.ag-mv-pace-fill{
  height:100%;border-radius:2px;width:0;
  transition:width 0.6s cubic-bezier(0.22,1,0.36,1);
}
.ag-mv-pace-fill--on-track                           {background:var(--green)}
.ag-mv-pace-fill--slightly-under,
.ag-mv-pace-fill--slightly-over                      {background:var(--amber)}
.ag-mv-pace-fill--underpacing,
.ag-mv-pace-fill--overpacing                         {background:var(--red)}

.ag-mv-pace-ideal{
  position:absolute;top:-2px;bottom:-2px;width:2px;
  background:color-mix(in srgb,var(--text) 45%,transparent);
  border-radius:1px;
  transform:translateX(-1px);
  pointer-events:none;
}
.ag-mv-pace-caption{
  font-size:11.5px;color:var(--text3);
  font-variant-numeric:tabular-nums;
}

/* Health Officer — check list */
.ag-mv-checks{gap:3px}
.ag-mv-check-row{
  display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text2);
  line-height:1.4;
}
.ag-mv-check-dot{
  width:15px;height:15px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:9px;font-weight:700;flex-shrink:0;
}
.ag-mv-check-dot--green{background:var(--green-bg);color:var(--green)}
.ag-mv-check-dot--amber{background:var(--amber-bg);color:var(--amber)}
.ag-mv-check-dot--red  {background:color-mix(in srgb,var(--red) 14%,transparent);color:var(--red)}
.ag-mv-check-label{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* Search Waste Hunter — term list */
.ag-mv-terms{gap:2px}
.ag-mv-term{
  display:flex;align-items:center;gap:6px;font-size:12px;line-height:1.4;
  font-family:'JetBrains Mono','SF Mono',Menlo,monospace;
  color:var(--text2);
}
.ag-mv-term-marker{
  width:11px;flex-shrink:0;text-align:center;
  font-size:10px;color:var(--text3);
}
.ag-mv-term-text{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.ag-mv-term--applied .ag-mv-term-text{
  text-decoration:line-through;color:var(--text3);
}
.ag-mv-term--applied .ag-mv-term-marker{color:var(--green)}
.ag-mv-term--pending .ag-mv-term-marker{color:var(--ag-hue,var(--accent))}

/* Creative Fatigue Analyst — thumb grid */
.ag-mv-thumbs{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(72px,1fr));
  gap:6px;
}
.ag-mv-thumb{
  position:relative;
  display:flex;flex-direction:column;justify-content:space-between;
  padding:6px 8px;min-height:38px;
  background:var(--surface2);border:1px solid var(--border);border-radius:6px;
  font-size:11px;color:var(--text2);line-height:1.25;
  overflow:hidden;
}
.ag-mv-thumb--fatigued{opacity:0.55}
.ag-mv-thumb-tag{
  position:absolute;top:4px;right:5px;
  width:14px;height:14px;border-radius:3px;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:9px;font-weight:700;
  background:color-mix(in srgb,var(--text3) 18%,transparent);
  color:var(--text2);
}
.ag-mv-thumb-tag--meta{
  background:color-mix(in srgb,var(--accent) 22%,transparent);
  color:var(--accent);
}
.ag-mv-thumb-tag--google{
  background:color-mix(in srgb,var(--green) 22%,transparent);
  color:var(--green);
}
.ag-mv-thumb-title{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  padding-right:18px;font-weight:500;
}
.ag-mv-thumb-badge{
  align-self:flex-start;
  margin-top:2px;
  font-size:9px;letter-spacing:0.04em;text-transform:uppercase;
  color:var(--amber);
  background:var(--amber-bg);
  padding:1px 5px;border-radius:3px;font-weight:600;
}

/* Market Intelligence — competitor curves */
.ag-mv-competitors{gap:3px}
.ag-mv-comp-svg{width:100%;height:36px;display:block}
.ag-mv-comp-threshold{
  stroke:var(--text3);stroke-width:1;opacity:0.55;
}
.ag-mv-comp-path{
  fill:none;stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round;
}
.ag-mv-comp-path--0{stroke:var(--ag-hue,var(--accent))}
.ag-mv-comp-path--1{stroke:var(--amber)}
.ag-mv-comp-meta{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  font-size:11.5px;color:var(--text2);min-height:18px;
}
.ag-mv-comp-domains{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;
}
.ag-mv-comp-chip{
  flex-shrink:0;
  font-size:10px;color:var(--ag-hue,var(--accent));font-weight:600;
  background:color-mix(in srgb,var(--ag-hue,var(--accent)) 14%,transparent);
  padding:1px 6px;border-radius:4px;
  white-space:nowrap;
}

/* Model Architect — mini Hill curve */
.ag-mv-hill{gap:3px}
.ag-mv-hill-svg{width:100%;height:36px;display:block}
.ag-mv-hill-path{
  fill:none;stroke:var(--ag-hue,var(--accent));stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round;
}
/* Tracer dot — ping-pongs along the curve via SMIL <animateMotion> declared
   inline on the element. A soft glow around the dot makes the motion feel
   ambient rather than mechanical. Hidden when the user prefers reduced
   motion (SMIL has no CSS animation-play-state equivalent, so we drop
   visibility rather than try to pause). */
.ag-mv-hill-tracer{
  fill:var(--ag-hue,var(--accent));
  filter:drop-shadow(0 0 3px color-mix(in srgb, var(--ag-hue,var(--accent)) 70%, transparent));
}
.ag-mv-hill-caption{
  font-size:12px;color:var(--text2);
}
@media (prefers-reduced-motion:reduce){
  .ag-mv-hill-tracer{display:none}
}

/* Brief Author — excerpt + read link */
.ag-mv-brief{gap:6px}
.ag-mv-brief-text{
  margin:0;font-size:12px;color:var(--text2);line-height:1.45;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;text-overflow:ellipsis;
}
.ag-mv-brief-link{
  align-self:flex-start;
  font-size:11px;color:var(--ag-hue,var(--accent));font-weight:600;
  letter-spacing:0.01em;
}

/* Ask Flume — CTA bubble + typing dots */
/* ── Ask Flume live composer (replaces the old cta-bubble) ──────────────────
   Two-element row: textarea + circular send button. Sits inside the card's
   normal flow; click-anywhere on the card NO LONGER bubbles up to "View
   activity" from this region (the component stops propagation). The send
   handoff opens the full Flume page and auto-fires the message there. */
.ag-mv-composer{
  /* `.ag-mv` base sets `flex-direction:column` so the textarea + send would
     stack vertically (doubling the wrap height for no reason). Pin to row. */
  display:flex;flex-direction:row;align-items:flex-end;gap:8px;
  padding:6px 8px;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:10px;
  transition:border-color 0.12s,box-shadow 0.12s;
}
.ag-mv-composer:focus-within{
  border-color:color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.ag-mv-composer-input{
  flex:1 1 auto;min-width:0;width:100%;
  background:transparent;border:none;outline:none;resize:none;
  font:inherit;color:var(--text);
  font-size:13px;line-height:1.4;text-align:left;
  padding:4px 2px;
  max-height:120px;
}
.ag-mv-composer-input::placeholder{color:var(--text3)}
.ag-mv-composer-send{
  flex:0 0 auto;
  width:30px;height:30px;
  display:inline-flex;align-items:center;justify-content:center;
  border:none;border-radius:8px;
  background:var(--accent);color:#fff;cursor:pointer;
  box-shadow:0 1px 2px rgba(0,0,0,0.08);
  transition:background 0.12s,opacity 0.12s,transform 0.12s;
}
.ag-mv-composer-send:hover:not(:disabled){background:var(--accent2)}
.ag-mv-composer-send:active:not(:disabled){transform:scale(0.94)}
.ag-mv-composer-send:disabled{opacity:0.4;cursor:not-allowed}
/* ROASt theme — match the gradient affordance of the View activity button +
   "+ New Portfolio". */
.theme-roast .ag-mv-composer-send:not(:disabled){
  background:var(--accent-grad);background-clip:padding-box;
}
.theme-roast .ag-mv-composer-send:hover:not(:disabled){
  filter:brightness(1.04) saturate(1.06);
  box-shadow:0 6px 18px rgba(243,119,113,0.28);
}

.ag-mv-cta{
  display:flex;align-items:center;gap:8px;
  padding:8px 12px;
  background:color-mix(in srgb,var(--accent) 10%,transparent);
  border:1px solid color-mix(in srgb,var(--accent) 22%,transparent);
  border-radius:14px 14px 14px 4px;
  font-size:12.5px;color:var(--text2);
}
.ag-mv-cta-text{flex:1 1 auto;color:var(--text2)}
.ag-mv-cta-dots{
  display:inline-flex;align-items:center;gap:3px;flex-shrink:0;
}
/* S9 (Tom's ruling 2026-08-30): the infinite CTA bounce keyframe was
   DELETED — decoration, §34.1 principle 1. Dots render static. */
.ag-mv-cta-dots span{
  width:4px;height:4px;border-radius:50%;
  background:color-mix(in srgb,var(--accent) 70%,transparent);
  opacity:0.6;
}

.ag-card-action-chip{
  align-self:flex-start;
  font-size:11px;color:var(--amber);font-weight:600;
  background:var(--amber-bg);padding:4px 10px;border-radius:6px;
  text-decoration:none;
  transition:filter 0.12s;
}
.ag-card-action-chip:hover{filter:brightness(1.08)}

/* Card footer — pending-review chip (or one-click Resume) left, view hint
   right. `margin-top:auto` pins it to the card bottom so short cards stay
   tidy regardless of micro-visual height. */
.ag-card-foot{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  margin-top:auto;padding-top:10px;
  border-top:1px solid var(--border);
  min-height:30px;
}
.ag-chip-pending{
  font-size:11px;font-weight:600;
  color:var(--ag-hue,var(--accent));
  background:var(--ag-hue-bg,var(--accent-bg));
  padding:3px 9px;border-radius:100px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-variant-numeric:tabular-nums;
}
.ag-chip-resume{
  font-family:inherit;font-size:11px;font-weight:600;cursor:pointer;
  color:var(--green);
  background:color-mix(in srgb,var(--green) 12%,transparent);
  border:1px solid color-mix(in srgb,var(--green) 40%,transparent);
  padding:3px 10px;border-radius:100px;line-height:1.4;
  transition:filter 0.12s;
}
.ag-chip-resume:hover{filter:brightness(1.08)}
.ag-card-view-hint{
  font-size:11px;color:var(--text3);font-weight:500;white-space:nowrap;
  transition:color 0.15s;
}
.ag-card:hover .ag-card-view-hint{color:var(--ag-hue,var(--accent))}
/* Composer card (Ask Flume): hint sits top-right in the head row — the
   footer bar is gone. */
.ag-card-view-hint--head{margin-left:auto;align-self:flex-start;padding-top:2px}

.ag-card-btn{
  font-family:inherit;font-size:12px;font-weight:500;
  padding:8px 16px;border-radius:9px;cursor:pointer;
  border:1px solid transparent;letter-spacing:0.01em;line-height:1;
  transition:background 0.12s,border-color 0.12s,color 0.12s,box-shadow 0.12s,filter 0.12s;
}
.ag-card-btn:active{transform:scale(0.97)}
/* Geometry + colour match `.btn-primary` (components.css) so the View
   activity button reads as the same affordance as "+ New Portfolio". */
.ag-card-btn-primary{
  background:var(--accent);color:#fff;border-color:transparent;
  box-shadow:0 1px 2px rgba(0,0,0,0.08);
}
.ag-card-btn-primary:hover{background:var(--accent2);box-shadow:0 6px 18px rgba(0,0,0,0.14)}
.ag-card-btn-primary:disabled{opacity:0.55;cursor:not-allowed}
.ag-card-btn-secondary{
  background:var(--surface);color:var(--text2);border:1px solid var(--border);
}
.ag-card-btn-secondary:hover{
  background:var(--surface-hover);border-color:var(--border2);color:var(--text);
}
.ag-card-btn-secondary:disabled{opacity:0.55;cursor:not-allowed}

/* Session 6 — user-disabled card treatment. Distinct from the adapter's own
   'paused' state (that means "agent's dependency is paused"); this means
   "user explicitly disabled the agent". The footer swaps to a Resume chip. */
.ag-card--user-disabled{opacity:0.78}
/* Asleep (needs_setup) cards dim slightly — visuals match the "wake" copy. */
.ag-card--needs_setup{opacity:0.88}

/* ════════════════════════════════════════════════════════════════════════════
   CONFIGURE MODAL — Agent Workbench Session 6 (`.ag-cfg-*` prefix)
   Two flavours: generic (Enabled + autonomy section) + Allocator
   (read-only portfolio-shortcut table per D11 carve-out).
   ════════════════════════════════════════════════════════════════════════════ */
.ag-cfg-modal{
  /* Sits on top of `.modal-overlay`. Width chosen so the Allocator
     per-portfolio table doesn't horizontal-scroll for typical (5-20)
     portfolio counts; generic body looks fine narrower but stays put. */
  width:min(620px, calc(100vw - 48px));
  max-height:calc(100vh - 96px);
  display:flex;flex-direction:column;
  background:var(--modal-bg);border-radius:14px;border:1px solid var(--border);
  backdrop-filter:blur(20px);
  overflow:hidden;
}
.ag-cfg-modal .modal-header{
  display:flex;justify-content:space-between;align-items:flex-start;
  padding:20px 24px 14px;border-bottom:1px solid var(--border);
  flex:0 0 auto;
}
.ag-cfg-modal .modal-close{
  background:none;border:none;font-size:24px;color:var(--text3);cursor:pointer;
  padding:0 4px;border-radius:6px;line-height:1;
}
.ag-cfg-modal .modal-close:hover{color:var(--text)}
.ag-cfg-body{padding:6px 24px 18px;overflow-y:auto;flex:1 1 auto}
.ag-cfg-empty{
  font-size:13px;color:var(--text2);padding:24px 0;text-align:center;
}

/* v2 (DESIGN.md §23c "Configure modal") — settings-sheet rows: one-line
   title + optional muted subline, control right-aligned, hairline dividers.
   NO paragraph descriptions — long copy lives in title= tooltips. */
.ag-cfg-row{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding:12px 0;border-bottom:1px solid var(--border);
}
.ag-cfg-row:last-child{border-bottom:none}
.ag-cfg-row--lead{padding-top:14px}
.ag-cfg-row-label{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 auto}
.ag-cfg-row-title{
  font-size:13.5px;font-weight:500;color:var(--text);
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}
.ag-cfg-row-sub{font-size:12px;color:var(--text3);line-height:1.45}

/* Pill switch — the label IS the state. Never an unlabeled checkbox. */
.ag-cfg-pill{
  flex:0 0 auto;
  min-width:46px;text-align:center;
  font-family:inherit;font-size:12px;font-weight:600;line-height:1.5;
  padding:3px 12px;border-radius:100px;
  border:1px solid transparent;cursor:pointer;
  background:var(--surface3);color:var(--text3);
  transition:background 0.15s,color 0.15s,filter 0.12s;
}
.ag-cfg-pill--on{
  background:color-mix(in srgb,var(--green) 14%,transparent);
  color:var(--green);
}
.ag-cfg-pill:hover:not(:disabled){filter:brightness(1.06)}
.ag-cfg-pill:disabled{opacity:0.55;cursor:not-allowed}
.ag-cfg-pill:focus-visible{
  outline:none;box-shadow:0 0 0 3px var(--accent-glow);
}

/* Small chips inline with a row title (tier / admin-only). */
.ag-cfg-chip{
  font-size:10px;font-weight:600;letter-spacing:0.02em;
  padding:1px 7px;border-radius:100px;
}
.ag-cfg-chip--tier{
  background:color-mix(in srgb,var(--purple) 14%,transparent);color:var(--purple);
}
.ag-cfg-chip--admin{
  background:var(--amber-bg);color:var(--amber);
}

/* Sections: muted sentence-case label, hairline top rule, no intro copy. */
.ag-cfg-section{margin-top:14px;padding-top:10px;border-top:1px solid var(--border)}
.ag-cfg-section-label{
  font-size:12px;font-weight:500;color:var(--text3);margin:2px 0 0;
}
.ag-cfg-section-hint{
  font-size:12px;color:var(--text3);line-height:1.45;margin:6px 0 10px;
}

/* Weekly-cap number input (commits on Enter/blur). */
.ag-cfg-cap-input{
  width:72px;padding:5px 10px;border-radius:8px;border:1px solid var(--border);
  background:var(--surface);color:var(--text);font-size:13px;
  font-variant-numeric:tabular-nums;text-align:right;
}
.ag-cfg-cap-input:disabled{opacity:0.55;cursor:not-allowed}

/* Always-on chip (Health Officer — no scheduled job to pause). */
.ag-cfg-always-on{
  flex:0 0 auto;
  font-size:12px;font-weight:600;
  color:var(--green);
  background:color-mix(in srgb,var(--green) 14%,transparent);
  padding:3px 12px;border-radius:100px;
}

/* Auto-apply usage meter (rolling-7d count vs weekly cap). */
.ag-cfg-meter{display:flex;flex-direction:column;gap:5px;padding:10px 0 4px}
.ag-cfg-meter-track{
  height:6px;border-radius:3px;background:var(--surface3);overflow:hidden;
}
.ag-cfg-meter-fill{
  height:100%;border-radius:3px;background:var(--green);
  transition:width 0.4s cubic-bezier(0.22,1,0.36,1);
}
.ag-cfg-meter-caption{
  font-size:11.5px;color:var(--text3);font-variant-numeric:tabular-nums;
}

/* Allocator table */
.ag-cfg-bp-table{
  display:flex;flex-direction:column;gap:0;
  border:1px solid var(--border);border-radius:10px;overflow:hidden;
}
.ag-cfg-bp-row{
  display:grid;grid-template-columns:1.5fr 0.7fr 0.9fr 0.7fr 0.8fr;
  align-items:center;padding:8px 12px;border-bottom:1px solid var(--border);
  font-size:12.5px;
}
.ag-cfg-bp-row:last-child{border-bottom:none}
.ag-cfg-bp-row--head{
  background:var(--surface);font-weight:600;color:var(--text2);font-size:11.5px;
  text-transform:uppercase;letter-spacing:0.04em;
}
.ag-cfg-bp-cell{padding:4px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ag-cfg-bp-cell--name{color:var(--text);font-weight:500}
.ag-cfg-bp-chip{
  display:inline-block;padding:2px 8px;border-radius:10px;
  background:var(--surface3);color:var(--text3);font-size:11px;font-weight:500;
}
.ag-cfg-bp-chip--on{background:var(--green-bg);color:var(--green)}

/* Confirm overlay for autonomy first-time-on.
   P2 audit follow-up: prior rule layered `backdrop-filter:blur(4px)` here on
   top of the parent `.ag-cfg-modal`'s `backdrop-filter:blur(20px)`. Per
   CLAUDE.md ("`backdrop-filter` inside a stacking context — PORTAL REQUIRED"),
   nested backdrop-filters only blur within the parent's composite layer and
   render inconsistently across themes. The semi-transparent `--bg 70%`
   background gives enough visual separation on its own; blur was decorative
   and theme-fragile. Removed 2026-05-18. */
.ag-cfg-confirm{
  position:absolute;inset:0;background:color-mix(in srgb, var(--bg) 82%, transparent);
  display:flex;align-items:center;justify-content:center;padding:24px;
}
.ag-cfg-confirm-card{
  background:var(--surface);border:1px solid var(--border);border-radius:12px;
  padding:22px 24px;max-width:440px;box-shadow:var(--shadow-lg);
}
.ag-cfg-confirm-title{
  font-size:15px;font-weight:600;color:var(--text);margin:0 0 10px;
}
.ag-cfg-confirm-body{
  font-size:13px;color:var(--text2);line-height:1.55;margin:0 0 18px;
}
.ag-cfg-confirm-actions{display:flex;justify-content:flex-end;gap:10px}


/* ════════════════════════════════════════════════════════════════════════════
   AGENT ROOM — per-agent split view (2026-06-12 rework, DESIGN.md §23c
   "Agent room"). Replaces the Session 3 boxy drilldown (.ag-feed identity/
   stats/filters/list cards): the left column is ONE continuous surface with
   hairline dividers; the scoped chat docks as a full-height rail on the
   right. Room mode inherits the full-viewport #panel-agent.active chrome
   from history.css — no agents-mode reset here on purpose.
   ════════════════════════════════════════════════════════════════════════════ */

/* NB: `.ag-room` is now applied to the `#panel-agent` element itself (the
   unified panel). It must NOT set `display` — `.ag-room` and `.panel{display:none}`
   have equal specificity and agents.css loads after base.css, so a `display`
   here would defeat `.panel{display:none}` and keep the panel visible on every
   other tab. Showing the panel is the sole job of `#panel-agent.active`
   (history.css), which already provides `display:flex;flex-direction:column`. */
.ag-room{
  flex:1;min-height:0;
  position:relative;
}

/* ── Entry fade — gentle-but-fast, reusing the home cascade's agFadeInUp.
   AgentRoom remounts per agent (key={slug}), so this fires on every room
   open. Bar leads, content follows, the chat window lands last. ── */
.ag-room .ag-subview-bar:not(.motion-entered),
.ag-room-content:not(.motion-entered),
.ag-room-chat:not(.motion-entered){
  animation:agFadeInUp calc(var(--motion-slow)*0.8) ease backwards;
}
.ag-room .ag-subview-bar{animation-duration:var(--motion-base)}
.ag-room-content{animation-delay:0.05s}
.ag-room-chat{animation-delay:0.1s}
@media (prefers-reduced-motion:reduce){
  /* :not() matches the S9 entrance-gated rule's specificity so the guard wins */
  .ag-room .ag-subview-bar:not(.motion-entered),
  .ag-room-content:not(.motion-entered),
  .ag-room-chat:not(.motion-entered){animation:none}
}

.ag-room--squad-optimiser {--ag-hue:var(--accent);--ag-hue-bg:var(--accent-bg)}
.ag-room--squad-watcher   {--ag-hue:var(--blue);  --ag-hue-bg:var(--blue-bg)}
.ag-room--squad-analyst   {--ag-hue:var(--purple);--ag-hue-bg:var(--purple-bg)}
.ag-room--squad-generalist{--ag-hue:var(--orange);--ag-hue-bg:var(--orange-bg)}

.ag-subview-actions{margin-left:auto;display:flex;gap:8px}

.ag-room-body{display:flex;flex:1;min-height:0;position:relative}
.ag-room-main{flex:1;min-width:0;overflow-y:auto;padding:22px 28px 48px}
/* Full width — the left column stretches to meet the floating chat window
   (per Tom 2026-06-12; an 880px cap left dead space in the middle). */
.ag-room-content{display:flex;flex-direction:column}

/* ── Identity header ── */
.ag-room-head{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.ag-room-avatar{
  position:relative;
  width:42px;height:42px;border-radius:12px;
  background:var(--ag-hue-bg,var(--accent-bg));color:var(--ag-hue,var(--accent));
  display:inline-flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
/* Presence ring sits on the page background here, not a card surface. */
.ag-room-avatar .ag-presence{border-color:var(--bg)}
.ag-room-head--needs_setup .ag-room-avatar,
.ag-room-head--paused .ag-room-avatar{
  background:var(--surface3);color:var(--text3);
}
.ag-room-id{display:flex;flex-direction:column;gap:3px;min-width:0}
.ag-room-name{
  font-size:17px;font-weight:650;color:var(--text);margin:0;
  letter-spacing:-0.01em;line-height:1.2;
}
.ag-room-status{font-size:12px;color:var(--text3);margin:0}
.ag-room-chips{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap}
.ag-room-chip{
  font-size:11px;font-weight:500;border-radius:999px;
  padding:3px 10px;white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.ag-room-chip--hue{
  background:var(--ag-hue-bg,var(--accent-bg));
  color:var(--ag-hue,var(--accent));
}
.ag-room-chip--pending{background:var(--amber-bg);color:var(--amber)}

/* ── First-person week line ── */
.ag-room-voice{
  font-size:13px;color:var(--text2);line-height:1.6;
  margin:14px 0 0;max-width:680px;
}

/* ── Sections: continuous surface, hairline dividers — NO stacked cards ── */
.ag-room-section{
  border-top:1px solid var(--border);
  margin-top:18px;padding-top:14px;
}
.ag-room-section-head{display:flex;align-items:center;gap:12px;margin-bottom:6px}
.ag-room-section-title{
  font-size:11px;font-weight:600;color:var(--text3);margin:0;
  text-transform:uppercase;letter-spacing:0.05em;
}

/* ── Review rows (this agent's queue items) ── */
.ag-room-review-list{list-style:none;margin:0;padding:0}
.ag-room-review-row{
  display:flex;align-items:center;gap:9px;
  padding:7px 0;min-height:34px;
}
.ag-room-review-row + .ag-room-review-row{
  border-top:1px solid color-mix(in srgb,var(--border) 55%,transparent);
}
.ag-room-review-dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--amber);flex-shrink:0;
}
.ag-room-review-label{
  font-size:13px;color:var(--text);min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ag-room-review-actions{
  margin-left:auto;display:flex;gap:6px;flex-shrink:0;
}
/* Quiet bordered Review/Dismiss — eight gradient primaries in a column is
   shouting; the room keeps the home queue's ACTIONS but not its volume. */
.ag-room-review-actions .ag-card-btn-primary{
  background:transparent;color:var(--ag-hue,var(--accent));
  border:1px solid color-mix(in srgb,var(--ag-hue,var(--accent)) 35%,transparent);
  box-shadow:none;
}
.ag-room-review-actions .ag-card-btn-primary:hover{
  background:var(--ag-hue-bg,var(--accent-bg));
  border-color:color-mix(in srgb,var(--ag-hue,var(--accent)) 55%,transparent);
}

/* ── Filter chips (inline, no box) ── */
.ag-room-winchips{margin-left:auto;display:flex;gap:4px}
.ag-room-typechips{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:2px 0 8px}
.ag-room-chipbtn{
  font-family:inherit;font-size:11px;font-weight:500;
  background:transparent;color:var(--text3);
  border:1px solid var(--border);border-radius:999px;
  padding:3px 9px;cursor:pointer;
  transition:background 0.12s,border-color 0.12s,color 0.12s;
  font-variant-numeric:tabular-nums;
}
.ag-room-chipbtn:hover{border-color:var(--border2);color:var(--text)}
.ag-room-chipbtn--active{
  background:var(--ag-hue-bg,var(--accent-bg));
  border-color:color-mix(in srgb,var(--ag-hue,var(--accent)) 35%,transparent);
  color:var(--ag-hue,var(--accent));
}
.ag-room-chipbtn-count{opacity:0.7;margin-left:2px}
.ag-room-chipclear{
  background:none;border:none;color:var(--text3);cursor:pointer;
  font-family:inherit;font-size:11px;text-decoration:underline;padding:0 2px;
}
.ag-room-chipclear:hover{color:var(--text)}

/* ── Timeline ── */
.ag-room-tl{display:flex;flex-direction:column;gap:14px}
.ag-room-tl-date{
  font-size:11px;font-weight:500;color:var(--text3);
  margin:4px 0 2px;
}
.ag-room-tl-rows{list-style:none;margin:0;padding:0}
.ag-room-trow{border-radius:8px}
.ag-room-trow-head{
  display:flex;align-items:center;gap:9px;
  padding:6px 8px;margin:0 -8px;border-radius:8px;
  transition:background 0.12s;
}
.ag-room-trow-head[role="button"]{cursor:pointer}
.ag-room-trow-head[role="button"]:hover{background:var(--surface2)}
.ag-room-trow--expanded .ag-room-trow-head{background:var(--surface2)}
.ag-room-trow-dot{
  width:6px;height:6px;border-radius:50%;flex-shrink:0;
}
.ag-room-trow-dot--green{background:var(--green)}
.ag-room-trow-dot--amber{background:var(--amber)}
.ag-room-trow-dot--red  {background:var(--red)}
.ag-room-trow-dot--muted{background:var(--text3);opacity:0.55}
.ag-room-trow-dot--hue  {background:var(--ag-hue,var(--accent))}
.ag-room-trow-sum{
  font-size:13px;color:var(--text);line-height:1.45;
  min-width:0;flex:1;
}
.ag-room-trow-time{
  font-size:11px;color:var(--text3);white-space:nowrap;
  font-variant-numeric:tabular-nums;flex-shrink:0;
}
.ag-room-trow-detail{
  margin:2px 0 6px 15px;
  padding:8px 0 4px 12px;
  border-left:2px solid var(--ag-hue-bg,var(--border));
  display:flex;flex-direction:column;gap:8px;
}
.ag-room-trow-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ag-room-trow-type{
  font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.04em;
  color:var(--text3);
}
.ag-room-trow-reversible{
  font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.04em;
  background:color-mix(in srgb,var(--blue) 14%,transparent);
  color:var(--blue);
  padding:2px 8px;border-radius:999px;white-space:nowrap;
  cursor:help;
}

/* Deep-link button inside the expanded detail (shared with the Why panel). */
.ag-feed-action{
  font-family:inherit;font-size:11px;font-weight:500;
  background:transparent;color:var(--text2);
  border:1px solid var(--border);border-radius:6px;
  padding:4px 10px;cursor:pointer;
  transition:background 0.12s,border-color 0.12s,color 0.12s;
}
.ag-feed-action:hover{border-color:var(--border2);color:var(--text);background:var(--surface)}
.ag-feed-action--link{color:var(--accent2);border-color:color-mix(in srgb,var(--accent) 35%,transparent)}
.ag-feed-action--link:hover{
  background:color-mix(in srgb,var(--accent) 10%,transparent);
  border-color:var(--accent);color:var(--accent);
}

/* Why? reason panel (AgentActivityWhy — class names unchanged) */
.ag-feed-why{
  font-size:12px;color:var(--text2);line-height:1.5;
  display:flex;flex-direction:column;gap:8px;
}
.ag-feed-why--loading{color:var(--text3);font-style:italic}
.ag-feed-why--error{color:var(--red)}
.ag-feed-why--empty{color:var(--text3)}
.ag-feed-why-text{white-space:pre-line}
.ag-feed-why-link{
  align-self:flex-start;
  font-family:inherit;font-size:11px;color:var(--accent);
  background:none;border:none;padding:0;cursor:pointer;text-decoration:underline;
}
.ag-feed-why-link:hover{color:var(--accent2)}

/* ── Empty state — plain text, no box ── */
.ag-room-empty{
  padding:22px 0 8px;
  display:flex;flex-direction:column;gap:5px;
}
.ag-room-empty-title{font-size:13px;font-weight:500;color:var(--text2)}
.ag-room-empty-sub{font-size:12px;color:var(--text3)}

/* ── Chat rail — a FLOATING window, not an edge-attached section.
   Standard module shadow (CLAUDE.md): var(--shadow-lg) for the persistent
   floating feel + border + radius-lg; inset from the panel edges so the
   page background reads around it (matches the approved mock's two-panel
   look — the left column stays flat on the page by design). ── */
.ag-room-chat{
  width:380px;flex-shrink:0;min-height:0;
  display:flex;flex-direction:column;
  margin:14px 18px 18px 4px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}
.ag-room-chat .agent-tab{flex:1;min-height:0}

.agent-tab-rail-head{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:10px 14px;border-bottom:1px solid var(--border);flex-shrink:0;
}
.agent-tab-rail-title{
  display:flex;align-items:center;gap:7px;
  font-size:12.5px;font-weight:600;color:var(--text);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;
}
.agent-tab-rail-title svg{color:var(--ag-hue,var(--accent));flex-shrink:0}

/* Rail compaction — same chat machinery, tighter clothes. The CSV-upload
   clip is Flume's campaign-assignment import — hidden in scoped rails. */
.agent-tab--rail .agent-tab-messages{padding:14px 14px 10px}
.agent-tab--rail .agent-tab-column{max-width:none}
.agent-tab--rail .agent-tab-input-bar{padding:10px 12px 14px}
/* Chat content cross-fade (flume-persistent-chat S1) — the chat FRAME persists
   across home⇄room, so when the scope flips the body (keyed by scope in
   AgentTab) remounts and replays this quick fade, dissolving the old agent's
   content into the new. Opacity-only → no layout cost. */
@keyframes agentChatScopeFade{from{opacity:0}to{opacity:1}}
.agent-tab-body--scope-fade{animation:agentChatScopeFade var(--motion-fast) ease}
@media (prefers-reduced-motion:reduce){
  .agent-tab-body--scope-fade{animation:none}
}

.agent-tab--rail .agent-tab-upload-btn{display:none}
/* General (unscoped) Flume rail keeps the CSV-assign upload clip — it's an Ask
   Flume feature; scoped agent rails stay clip-free. Source-order AFTER the hide
   rule (equal specificity) so it wins. */
.agent-tab--rail-general .agent-tab-upload-btn{display:flex}
.agent-tab--rail .agent-welcome{padding:8px 2px}
.agent-tab--rail .agent-welcome-avatar{width:48px;height:48px;border-radius:14px}
.agent-tab--rail .agent-welcome-title{font-size:15px}
.agent-tab--rail .agent-welcome-sub{font-size:12px}
.agent-tab--rail .agent-welcome-reports-divider{margin:18px 0 10px}
/* S3 — narrow-rail suggested prompts: the preset cards become wrapping
   title-only chips (the full prompt is still what gets sent on click). */
.agent-tab--rail .agent-welcome-grid{display:flex;flex-wrap:wrap;gap:7px}
.agent-tab--rail .agent-preset-card{
  flex-direction:row;align-items:center;width:auto;
  padding:6px 12px;border-radius:999px;gap:0;
}
.agent-tab--rail .agent-preset-title{font-size:12px;white-space:nowrap}
.agent-tab--rail .agent-preset-desc{display:none}
.agent-tab--rail .agent-msg{font-size:12.5px}

/* ── Responsive: rail → floating Talk pill + overlay ≤1100px ── */
.ag-room-chat-toggle{display:none}
@media (max-width:1100px){
  .ag-room-chat{display:none}
  .ag-room--chat-open .ag-room-chat{
    display:flex;
    position:absolute;top:10px;right:10px;bottom:10px;
    margin:0;
    width:min(420px,92vw);z-index:60;
    box-shadow:var(--shadow-xl);
  }
  .ag-room-chat-toggle{
    display:inline-flex;align-items:center;gap:6px;
    position:absolute;right:18px;bottom:18px;z-index:61;
    font-family:inherit;font-size:12px;font-weight:600;
    color:var(--ag-hue,var(--accent));
    background:var(--surface);
    border:1px solid color-mix(in srgb,var(--ag-hue,var(--accent)) 35%,transparent);
    border-radius:999px;padding:9px 16px;cursor:pointer;
    box-shadow:var(--shadow-lg);
    transition:border-color 0.15s,background 0.15s;
  }
  .ag-room-chat-toggle:hover{
    background:var(--ag-hue-bg,var(--accent-bg));
  }
  /* While the overlay is open the pill lifts above its input bar so Close
     never sits on top of the send button. */
  .ag-room--chat-open .ag-room-chat-toggle{bottom:78px;right:14px}
}
@media (max-width:720px){
  .ag-room-main{padding:16px 16px 80px}
  .ag-room-chips{margin-left:0;width:100%}
  .ag-room-review-row{flex-wrap:wrap;height:auto}
  .ag-room-review-actions{margin-left:15px}
}

/* ── Documents / reports drawer (flume-persistent-chat S2, DESIGN.md §23c) ──
   The left region is wrapped so the drawer overlays EXACTLY it (the wrapper's
   bounds) and never the docked chat. The drawer slides leftward from the chat
   edge; the off-screen (closed) state is clipped by the wrap's overflow + the
   panel's overflow:hidden. The chat rail stays docked on the right — read +
   chat side-by-side. */
.ag-room-left-wrap{
  flex:1;min-width:0;min-height:0;
  position:relative;overflow:hidden;
  display:flex;flex-direction:column;
}
.ag-room-left-wrap .ag-unified-left{flex:1}

/* Scrim — dims the left content behind the floating drawer card so it doesn't
   peek through the drawer's inset edges; click-away closes. Covers the left
   region only (sibling inside the wrap), never the chat. */
.ag-docs-scrim{
  position:absolute;inset:0;z-index:29;
  background:color-mix(in srgb, var(--bg) 50%, transparent);
  opacity:0;pointer-events:none;
  transition:opacity 0.35s ease;
}
.ag-docs-scrim--open{opacity:1;pointer-events:auto}
@media (prefers-reduced-motion:reduce){ .ag-docs-scrim{transition:none} }

.ag-docs-drawer{
  position:absolute;
  /* Inset to match the docked chat card (same 14/18 top/bottom rhythm + 4px
     gap to it via the wrap edge) with the SAME radius/border/shadow, so the
     drawer + chat read as one paired surface — not a full-bleed slab. */
  top:14px;right:0;bottom:18px;left:18px;
  z-index:30;
  display:flex;min-height:0;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
  /* Gentle slide-in: a SHORT 56px leftward travel + fade so it eases in and
     cushions to a stop — not a full-width "explode" and (ease-out) no
     overshoot. will-change promotes it to its own GPU layer so sliding it
     NEVER repaints the content behind it (the full-width travel + big shadow
     was repainting the squad grid each frame → the "background wobble"). When
     closed: faded + visibility:hidden (held through the close transition) so
     it's invisible and non-interactive at rest. */
  opacity:0;visibility:hidden;
  transform:translateX(56px);
  will-change:transform,opacity;
  transition:transform .34s cubic-bezier(.22,.61,.36,1), opacity .26s ease, visibility 0s linear .34s;
}
.ag-docs-drawer--open{
  opacity:1;visibility:visible;transform:translateX(0);
  transition:transform .34s cubic-bezier(.22,.61,.36,1), opacity .26s ease, visibility 0s;
}
@media (prefers-reduced-motion:reduce){
  .ag-docs-drawer{transition:none}
}

/* Docs list pane — reuses AgentSidebar (.agent-tab-sidebar). Override the base
   width:0 collapse + transition:width (history.css) for this always-open pane;
   specificity (0,2,0) beats the base (0,1,0). */
.ag-docs-drawer-list{
  width:300px;flex-shrink:0;min-height:0;
  display:flex;flex-direction:column;
}
.ag-docs-drawer-list .agent-tab-sidebar{
  width:100%;flex:1;min-height:0;
  border-left:none;border-right:1px solid var(--border);
  overflow:hidden;transition:none;
}

/* Report reader pane — reuses the report bar / scroll / export-btn from
   reports.css verbatim. */
.ag-docs-drawer-read{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}
.ag-docs-drawer-empty{
  flex:1;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:8px;
  text-align:center;padding:48px 32px;
}
.ag-docs-drawer-empty-title{font-size:14px;font-weight:600;color:var(--text2)}
.ag-docs-drawer-empty-sub{font-size:12.5px;color:var(--text3);max-width:340px;line-height:1.5}

/* Rail-head Documents toggle — icon-only to fit the 380px rail head. Active
   tint follows the room hue (matches the rail title svg). */
.agent-tab-rail-docs-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:28px;height:28px;flex-shrink:0;
  color:var(--text3);background:none;
  border:1px solid var(--border);border-radius:6px;
  cursor:pointer;
  transition:color 0.15s,background 0.15s,border-color 0.15s;
}
.agent-tab-rail-docs-btn:hover{color:var(--text);background:var(--surface2)}
.agent-tab-rail-docs-btn.active{
  color:var(--ag-hue,var(--accent));
  background:var(--ag-hue-bg,var(--accent-bg));
  border-color:color-mix(in srgb,var(--ag-hue,var(--accent)) 28%,var(--border));
}

/* Mobile (≤720px): the side-by-side panes would crush the reader, so STACK —
   list on top (capped, scrolls) + report below (fills). CSS-only, no back btn. */
@media (max-width:720px){
  .ag-docs-drawer{flex-direction:column;top:8px;right:4px;bottom:8px;left:8px}
  .ag-docs-drawer-list{width:auto;max-height:38%}
  .ag-docs-drawer-list .agent-tab-sidebar{
    width:100%;border-right:none;border-bottom:1px solid var(--border);
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   AGENT ROOM HEROES — Goal-1 bespoke per-agent sections (agent-room plan
   §3.2, DESIGN.md §23c). Each hero is a SECTION on the room's continuous
   surface (inherits .ag-room-section's hairline divider) — never a stacked
   boxed card. Hue flows from the room root's --ag-hue tokens. Signature
   animations are one-shot + prefers-reduced-motion guarded — no free-running
   loops (idle-cheap).
   ════════════════════════════════════════════════════════════════════════════ */

.ag-room-hero:not(.motion-entered){animation:agFadeInUp calc(var(--motion-slow)*0.8) ease backwards}
@media (prefers-reduced-motion:reduce){.ag-room-hero{animation:none}}

/* Shared quiet CTA — the room's bordered-primary voice (matches the review
   rows' quiet Review buttons, not the home queue's gradient). */
.ag-hero-cta{
  font-family:inherit;font-size:11.5px;font-weight:600;
  background:transparent;color:var(--ag-hue,var(--accent));
  border:1px solid color-mix(in srgb,var(--ag-hue,var(--accent)) 35%,transparent);
  border-radius:7px;padding:4px 11px;cursor:pointer;white-space:nowrap;
  transition:background 0.12s,border-color 0.12s;
}
.ag-hero-cta:hover{
  background:var(--ag-hue-bg,var(--accent-bg));
  border-color:color-mix(in srgb,var(--ag-hue,var(--accent)) 55%,transparent);
}
.ag-hero-muted{margin-left:auto;font-size:11.5px;color:var(--text3)}

/* ── Brief Author: the filed issue. The masthead's editorial double rule IS
   this section's divider (the generic hairline is suppressed). ── */
.ag-room-hero--brief{border-top:none;padding-top:8px}
.ag-hero-brief-masthead{position:relative;padding-top:14px}
.ag-hero-brief-masthead::before{
  content:'';position:absolute;top:0;left:0;right:0;height:2px;
  background:var(--text);
}
.ag-hero-brief-masthead::after{
  content:'';position:absolute;top:4px;left:0;right:0;height:1px;
  background:color-mix(in srgb,var(--text) 45%,transparent);
}
.ag-hero-brief-eyebrow{
  font-size:10.5px;font-weight:700;letter-spacing:0.14em;text-transform:uppercase;
  color:var(--ag-hue,var(--accent));margin-bottom:6px;
}
.ag-hero-brief-title{
  font-size:21px;font-weight:650;letter-spacing:-0.015em;color:var(--text);
  margin:0;line-height:1.2;
}
.ag-hero-brief-byline{font-size:11.5px;color:var(--text3);font-style:italic;margin-top:3px}
.ag-hero-brief-doc{max-width:720px;margin-top:14px}

/* Previous issues stand ON a shelf line — file-tab spines, rounded tops. */
.ag-hero-brief-shelf{margin-top:20px}
.ag-hero-brief-shelf-label{
  display:block;
  font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;
  color:var(--text3);margin-bottom:8px;
}
.ag-hero-brief-shelf-row{
  display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end;
  border-bottom:2px solid var(--border2);
  padding:0 6px;max-width:720px;
}
.ag-hero-brief-issue{
  font-family:inherit;font-size:11px;font-weight:500;color:var(--text2);
  background:var(--surface);
  border:1px solid var(--border);border-bottom:none;
  border-radius:6px 6px 0 0;
  padding:5px 10px 6px;cursor:pointer;
  font-variant-numeric:tabular-nums;
  transition:background 0.12s,color 0.12s,transform 0.12s;
}
.ag-hero-brief-issue:hover{
  background:var(--surface2);color:var(--text);transform:translateY(-2px);
}

/* ── Search Waste Hunter: the kill list — waste tickets with perforated
   dividers, a flagged-spend counter, and a struck-through handled strip. ── */
.ag-hero-waste-counter{
  margin-left:auto;font-size:11.5px;color:var(--text3);
  font-variant-numeric:tabular-nums;white-space:nowrap;
}
.ag-hero-waste-counter-num{color:var(--ag-hue,var(--accent));font-weight:650}
.ag-hero-waste-group{margin-top:10px}
.ag-hero-waste-group + .ag-hero-waste-group{margin-top:18px}
.ag-hero-waste-group-head{display:flex;align-items:center;gap:10px;margin-bottom:2px;flex-wrap:wrap}
.ag-hero-waste-group-name{font-size:12.5px;font-weight:600;color:var(--text)}
.ag-hero-waste-group-ctas{margin-left:auto;display:flex;gap:6px;flex-shrink:0}
.ag-hero-waste-list{list-style:none;margin:0;padding:0}
.ag-hero-waste-ticket{
  display:flex;align-items:center;gap:9px;
  padding:6px 0;min-height:30px;
}
/* Perforation between tickets. */
.ag-hero-waste-ticket + .ag-hero-waste-ticket{
  border-top:1px dashed color-mix(in srgb,var(--border2) 80%,transparent);
}
.ag-hero-waste-type{
  font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.04em;
  border-radius:5px;padding:2px 7px;flex-shrink:0;
}
.ag-hero-waste-type--pause{background:var(--amber-bg);color:var(--amber)}
.ag-hero-waste-type--negative{background:color-mix(in srgb,var(--red) 12%,transparent);color:var(--red)}
.ag-hero-waste-term{
  font-size:13px;font-weight:500;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0;
  max-width:46%;
}
.ag-hero-waste-spend{
  font-size:11.5px;font-weight:600;color:var(--red);
  font-variant-numeric:tabular-nums;flex-shrink:0;
}
.ag-hero-waste-reason{
  font-size:11.5px;color:var(--text3);min-width:0;flex:1;text-align:right;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ag-hero-waste-more{font-size:11px;color:var(--text3);padding:5px 0 0}
.ag-hero-waste-handled{
  margin-top:16px;padding-top:10px;
  border-top:1px solid color-mix(in srgb,var(--border) 55%,transparent);
}
.ag-hero-waste-handled-label{
  font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;
  color:var(--text3);
}
.ag-hero-waste-handled-list{
  list-style:none;margin:8px 0 0;padding:0;
  display:flex;flex-wrap:wrap;gap:6px 16px;
}
.ag-hero-waste-handled-item{display:inline-flex;align-items:center;gap:7px}
.ag-hero-waste-handled-term{
  font-size:12px;color:var(--text3);
  text-decoration:line-through;
  text-decoration-color:color-mix(in srgb,var(--green) 65%,transparent);
  text-decoration-thickness:1.5px;
}
/* Rubber stamp — slightly off-square, like it was pressed by hand. */
.ag-hero-waste-stamp{
  font-size:8.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.1em;
  color:var(--green);
  border:1px solid color-mix(in srgb,var(--green) 55%,transparent);
  border-radius:3px;padding:1px 5px;
  transform:rotate(-4deg);opacity:0.85;
}

/* ── Creative Fatigue Analyst: the gallery wall — fatigue renders as
   LITERAL fading (--fatigue 0..1 set per frame from the suggestion score).
   A grid of small framed slots is the thumb-grid idiom scaled up, not the
   banned stacked-section cards. ── */
.ag-hero-fatigue-group{margin-top:12px}
.ag-hero-fatigue-group + .ag-hero-fatigue-group{margin-top:18px}
.ag-hero-fatigue-group-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.ag-hero-fatigue-group-name{font-size:12.5px;font-weight:600;color:var(--text)}
.ag-hero-fatigue-group-head .ag-hero-cta{margin-left:auto}
.ag-hero-fatigue-group--paused .ag-hero-fatigue-group-name{
  font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;
  color:var(--text3);
}
.ag-hero-fatigue-wall{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;
  max-width:860px;
}
/* Frame + inset mat around the artwork. */
.ag-hero-fatigue-frame{
  position:relative;border-radius:4px;
  border:1px solid var(--border2);
  box-shadow:inset 0 0 0 3px var(--surface2);
  background:var(--surface);
  padding:13px 14px;min-height:56px;
  display:flex;align-items:center;
}
.ag-hero-fatigue-frame-art{
  display:flex;flex-direction:column;gap:4px;min-width:0;
  opacity:calc(1 - var(--fatigue,0)*0.62);
  filter:saturate(calc(1 - var(--fatigue,0)*0.8));
}
.ag-hero-fatigue-frame-title{
  font-size:12.5px;font-weight:600;color:var(--text);line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;
}
.ag-hero-fatigue-frame-meta{font-size:10.5px;color:var(--text3)}
.ag-hero-fatigue-frame-signals{display:flex;gap:5px;flex-wrap:wrap;margin-top:2px}
.ag-hero-fatigue-signal{
  font-size:9.5px;font-weight:600;color:var(--text3);
  background:var(--surface3);border-radius:4px;padding:1px 6px;
  white-space:nowrap;
}
.ag-hero-fatigue-signal--rating{background:var(--amber-bg);color:var(--amber)}
.ag-hero-fatigue-frame--paused{border-style:dashed}
.ag-hero-fatigue-stamp{
  position:absolute;top:7px;right:7px;
  font-size:8.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.1em;
  color:var(--text3);background:var(--surface);
  border:1px solid var(--border2);
  border-radius:3px;padding:1px 5px;
  transform:rotate(6deg);
}

/* ── Health Officer: report-card grade + ECG vitals. The trace draws once on
   entry (dash draw over pathLength=1) — no looping animation. ── */
.ag-hero-health-top{display:flex;align-items:center;gap:24px;margin:8px 0 4px;flex-wrap:wrap}
.ag-hero-health-grade{
  display:flex;flex-direction:column;align-items:center;gap:2px;
  flex-shrink:0;min-width:74px;
}
.ag-hero-health-grade-letter{font-size:38px;font-weight:750;line-height:1;letter-spacing:-0.02em}
.ag-hero-health-grade--good .ag-hero-health-grade-letter{color:var(--green)}
.ag-hero-health-grade--warn .ag-hero-health-grade-letter{color:var(--amber)}
.ag-hero-health-grade--bad  .ag-hero-health-grade-letter{color:var(--red)}
.ag-hero-health-grade-label{
  font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.07em;
  color:var(--text3);
}
.ag-hero-health-vitals{flex:1;min-width:220px;display:flex;flex-direction:column;gap:4px;max-width:560px}
.ag-hero-health-ecg{width:100%;height:44px;display:block}
.ag-hero-health-ecg-base{stroke:var(--border);stroke-width:1;fill:none}
.ag-hero-health-ecg-line{
  stroke:var(--ag-hue,var(--accent));stroke-width:1.6;fill:none;
  stroke-linejoin:round;stroke-linecap:round;
  stroke-dasharray:1;stroke-dashoffset:0;
  animation:agEcgDraw calc(var(--motion-draw)*1.45) ease-out;
}
@keyframes agEcgDraw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@media (prefers-reduced-motion:reduce){.ag-hero-health-ecg-line{animation:none}}
.ag-hero-health-counts{display:flex;gap:14px;flex-wrap:wrap}
.ag-hero-health-count{font-size:11.5px;font-weight:600;font-variant-numeric:tabular-nums}
.ag-hero-health-count--critical{color:var(--red)}
.ag-hero-health-count--warning{color:var(--amber)}
.ag-hero-health-count--info{color:var(--blue)}
.ag-hero-health-count--clear{color:var(--green);font-weight:500}
.ag-hero-health-allclear{font-size:13px;color:var(--green);padding:8px 0 2px}
.ag-hero-health-allclear::before{content:'✓';margin-right:7px;font-weight:700}
.ag-hero-health-list{list-style:none;margin:6px 0 0;padding:0}
.ag-hero-health-row{display:flex;align-items:center;gap:9px;padding:6px 0;min-height:32px}
.ag-hero-health-row + .ag-hero-health-row{
  border-top:1px solid color-mix(in srgb,var(--border) 55%,transparent);
}
.ag-hero-health-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}
.ag-hero-health-dot--critical{background:var(--red)}
.ag-hero-health-dot--warning{background:var(--amber)}
.ag-hero-health-dot--info{background:var(--blue)}
.ag-hero-health-desc{
  font-size:13px;color:var(--text);min-width:0;flex:1;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ag-hero-health-platform{
  font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;
  color:var(--text3);background:var(--surface3);
  border-radius:5px;padding:2px 7px;flex-shrink:0;
}
.ag-hero-health-more{font-size:11px;color:var(--text3);padding:7px 0 0}

/* ── Pacing Watchdog: the pace board — every budgeted portfolio as a race
   lane. A fill = MTD spend, a runner dot rides its leading edge, and a
   should-be-here tick marks the prorated ideal. Deviants tinted; on-pace
   lanes dim. The whole row is the gold-standard focusPortfolio deep link. ── */
.ag-hero-pace-early{font-size:13px;color:var(--text2);padding:10px 0 2px}
.ag-hero-pace-legend{display:flex;gap:16px;margin:8px 0 4px}
.ag-hero-pace-legend-item{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--text3)}
.ag-hero-pace-legend-runner{
  width:9px;height:9px;border-radius:50%;
  background:var(--ag-hue,var(--accent));box-shadow:0 0 0 2px var(--surface);
}
.ag-hero-pace-legend-ideal{width:2px;height:11px;border-radius:1px;background:var(--text)}
.ag-hero-pace-board{display:flex;flex-direction:column;gap:3px;margin-top:4px}
.ag-hero-pace-row{
  display:flex;align-items:center;gap:12px;width:100%;
  font-family:inherit;text-align:left;cursor:pointer;
  background:transparent;border:none;border-radius:8px;
  padding:7px 8px;transition:background 0.12s;
}
.ag-hero-pace-row:hover{background:var(--surface2)}
.ag-hero-pace-row--on{opacity:0.62}
.ag-hero-pace-row--on:hover{opacity:1}
.ag-hero-pace-name{
  flex:0 0 140px;width:140px;font-size:12.5px;font-weight:500;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ag-hero-pace-lane{
  position:relative;flex:1;height:14px;border-radius:7px;
  background:var(--surface3);overflow:visible;min-width:80px;
}
.ag-hero-pace-fill{
  position:absolute;top:0;left:0;height:100%;border-radius:7px;
  /* §34.2 token re-time (S3). Deliberately still a width transition: the lane
     is a 14px pill (scaleX would visibly deform the rounded cap) and the lane
     keeps overflow:visible for the ideal tick, ruling out translateX. Not in
     the base.css fast-tier clamp. S9 classification: keep-retimed. */
  transition:width calc(var(--motion-slow)) var(--ease-spring);
}
.ag-hero-pace-row--behind .ag-hero-pace-fill{background:color-mix(in srgb,var(--blue) 30%,transparent)}
.ag-hero-pace-row--ahead .ag-hero-pace-fill{background:color-mix(in srgb,var(--amber) 32%,transparent)}
.ag-hero-pace-row--on .ag-hero-pace-fill{background:color-mix(in srgb,var(--green) 26%,transparent)}
/* The should-be-here marker — a strong vertical tick standing above the lane. */
.ag-hero-pace-ideal{
  position:absolute;top:-3px;bottom:-3px;width:2px;border-radius:1px;
  background:var(--text);transform:translateX(-50%);opacity:0.7;
}
.ag-hero-pace-runner{
  position:absolute;top:50%;width:11px;height:11px;border-radius:50%;
  transform:translate(-50%,-50%);box-shadow:0 0 0 2px var(--surface);
}
.ag-hero-pace-row--behind .ag-hero-pace-runner{background:var(--blue)}
.ag-hero-pace-row--ahead .ag-hero-pace-runner{background:var(--amber)}
.ag-hero-pace-row--on .ag-hero-pace-runner{background:var(--green)}
.ag-hero-pace-badge{
  flex:0 0 auto;font-size:10.5px;font-weight:600;border-radius:5px;padding:2px 8px;
  font-variant-numeric:tabular-nums;white-space:nowrap;min-width:74px;text-align:center;
}
.ag-hero-pace-badge--behind{background:var(--blue-bg);color:var(--blue)}
.ag-hero-pace-badge--ahead{background:var(--amber-bg);color:var(--amber)}
.ag-hero-pace-badge--on{background:var(--surface3);color:var(--text3)}

/* ── Allocator: the allocation board — monthly-budget bars, a staged-delta
   amber chip when recs await (CTA = the portfolio card), and last night's
   move as a status-tinted flow line. ── */
.ag-hero-alloc-board{display:flex;flex-direction:column;gap:14px;margin-top:8px}
.ag-hero-alloc-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:5px}
.ag-hero-alloc-name{
  font-size:12.5px;font-weight:600;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ag-hero-alloc-daily{
  font-size:11.5px;font-weight:600;color:var(--ag-hue,var(--accent));
  font-variant-numeric:tabular-nums;flex-shrink:0;
}
.ag-hero-alloc-bar{height:8px;border-radius:5px;background:var(--surface3);overflow:hidden}
.ag-hero-alloc-bar-fill{
  height:100%;border-radius:5px;
  background:linear-gradient(90deg,color-mix(in srgb,var(--ag-hue,var(--accent)) 55%,transparent),var(--ag-hue,var(--accent)));
  transition:width 0.4s cubic-bezier(0.34,1.18,0.64,1);
}
.ag-hero-alloc-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:6px;flex-wrap:wrap}
.ag-hero-alloc-run{display:inline-flex;align-items:center;gap:7px;font-size:11.5px;color:var(--text2);min-width:0}
.ag-hero-alloc-run-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--text3)}
.ag-hero-alloc-run--ok .ag-hero-alloc-run-dot{background:var(--green)}
.ag-hero-alloc-run--warn .ag-hero-alloc-run-dot{background:var(--amber)}
.ag-hero-alloc-run--bad .ag-hero-alloc-run-dot{background:var(--red)}
.ag-hero-alloc-staged{
  font-family:inherit;font-size:11px;font-weight:600;cursor:pointer;
  display:inline-flex;align-items:center;gap:5px;white-space:nowrap;
  background:var(--amber-bg);color:var(--amber);
  border:1px solid color-mix(in srgb,var(--amber) 35%,transparent);
  border-radius:7px;padding:3px 10px;transition:background 0.12s,border-color 0.12s;
}
.ag-hero-alloc-staged:hover{
  background:color-mix(in srgb,var(--amber) 18%,transparent);
  border-color:color-mix(in srgb,var(--amber) 55%,transparent);
}
.ag-hero-alloc-staged-delta{font-variant-numeric:tabular-nums}
.ag-hero-alloc-next{
  display:flex;align-items:center;gap:8px;
  margin-top:14px;padding-top:10px;
  border-top:1px solid color-mix(in srgb,var(--border) 55%,transparent);
  font-size:11.5px;color:var(--text3);
}
.ag-hero-alloc-next-dot{
  width:7px;height:7px;border-radius:50%;background:var(--ag-hue,var(--accent));
  box-shadow:0 0 0 3px var(--ag-hue-bg,var(--accent-bg));
}

/* ── Model Architect: the model gallery — Hill-curve small-multiples on a
   blueprint grid (line solidity = fit confidence) + a calibration strip. The
   curves draw once on entry. ── */
.ag-hero-model-gallery{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;
  max-width:860px;margin-top:8px;
}
.ag-hero-model-cell{display:flex;flex-direction:column;gap:3px;min-width:0}
.ag-hero-model-chart{
  height:60px;border:1px solid var(--border2);border-radius:5px;
  background-color:var(--surface);
  background-image:
    linear-gradient(color-mix(in srgb,var(--ag-hue,var(--accent)) 14%,transparent) 1px,transparent 1px),
    linear-gradient(90deg,color-mix(in srgb,var(--ag-hue,var(--accent)) 14%,transparent) 1px,transparent 1px);
  background-size:100% 15px,20px 100%;
  overflow:hidden;
}
.ag-hero-model-curve{display:block;width:100%;height:60px}
.ag-hero-model-line{
  stroke:var(--ag-hue,var(--accent));stroke-width:1.8;fill:none;
  stroke-linejoin:round;stroke-linecap:round;
  stroke-dasharray:1;stroke-dashoffset:0;animation:agEcgDraw calc(var(--motion-draw)*1.2) ease-out;
}
.ag-hero-model-cell-name{
  font-size:12px;font-weight:600;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ag-hero-model-cell-stats{font-size:10.5px;color:var(--text3);font-variant-numeric:tabular-nums}
.ag-hero-model-calib{
  margin-top:16px;padding-top:12px;
  border-top:1px solid color-mix(in srgb,var(--border) 55%,transparent);
}
.ag-hero-model-calib-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:6px}
.ag-hero-model-calib-title{
  font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--text3);
}
.ag-hero-model-calib-verdict{font-size:11.5px;font-weight:500}
.ag-hero-model-calib-verdict--good{color:var(--green)}
.ag-hero-model-calib-verdict--warn{color:var(--amber)}
.ag-hero-model-calib-verdict--bad{color:var(--red)}
.ag-hero-model-calib-svg{display:block;width:100%;max-width:420px;height:40px}
.ag-hero-model-calib-zero{stroke:var(--border2);stroke-width:1;stroke-dasharray:2 3}
.ag-hero-model-calib-line{
  stroke-width:1.8;fill:none;stroke-linejoin:round;stroke-linecap:round;
  stroke-dasharray:1;stroke-dashoffset:0;animation:agEcgDraw calc(var(--motion-draw)*1.35) ease-out;
}
.ag-hero-model-calib-line--good{stroke:var(--green)}
.ag-hero-model-calib-line--warn{stroke:var(--amber)}
.ag-hero-model-calib-line--bad{stroke:var(--red)}
@media (prefers-reduced-motion:reduce){
  .ag-hero-model-line,.ag-hero-model-calib-line{animation:none}
}

/* ── Market Intelligence: the radar — competitors as blips (distance from
   centre = auction pressure), a contacts list, pressure curves, and a
   movements timeline. One-shot boot sweep + finite entrant pulse only. ── */
.ag-hero-radar-top{display:flex;gap:20px;align-items:center;margin-top:8px;flex-wrap:wrap}
.ag-hero-radar-scope{flex:0 0 auto;width:200px;height:200px}
.ag-hero-radar-rings circle,.ag-hero-radar-rings line{
  fill:none;stroke:color-mix(in srgb,var(--ag-hue,var(--accent)) 28%,transparent);stroke-width:1;
}
.ag-hero-radar-sweep{
  fill:color-mix(in srgb,var(--ag-hue,var(--accent)) 22%,transparent);
  transform-origin:100px 100px;animation:agRadarSweep calc(var(--motion-draw)*1.65) ease-out forwards;
}
.ag-hero-radar-you{fill:var(--text2)}
.ag-hero-radar-dot{fill:var(--ag-hue,var(--accent));stroke:var(--surface);stroke-width:1.5}
.ag-hero-radar-blip--new .ag-hero-radar-dot{fill:var(--amber)}
.ag-hero-radar-num{fill:var(--surface);font-size:6px;font-weight:700;pointer-events:none}
.ag-hero-radar-pulse{
  fill:none;stroke:var(--amber);stroke-width:1.4;
  animation:agRadarPulse calc(var(--motion-draw)*1.8) ease-out 3;
}
.ag-hero-radar-contacts{list-style:none;margin:0;padding:0;flex:1;min-width:200px;display:flex;flex-direction:column;gap:6px}
.ag-hero-radar-contact{display:flex;align-items:center;gap:9px}
.ag-hero-radar-contact-num{
  flex:0 0 auto;width:18px;height:18px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:700;
  background:var(--ag-hue-bg,var(--accent-bg));color:var(--ag-hue,var(--accent));
}
.ag-hero-radar-contact-domain{
  font-size:12.5px;color:var(--text);flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ag-hero-radar-contact-new{
  font-size:8.5px;font-weight:700;letter-spacing:0.06em;
  background:var(--amber-bg);color:var(--amber);border-radius:4px;padding:1px 5px;flex-shrink:0;
}
.ag-hero-radar-contact-share{font-size:11.5px;font-weight:600;color:var(--text2);font-variant-numeric:tabular-nums;flex-shrink:0}
.ag-hero-radar-empty{font-size:13px;color:var(--text2);padding:14px 0}
.ag-hero-radar-curves{margin-top:16px;padding-top:12px;border-top:1px solid color-mix(in srgb,var(--border) 55%,transparent)}
.ag-hero-radar-curves-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:8px}
.ag-hero-radar-curves-title{font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--text3)}
.ag-hero-radar-curves-key{font-size:10.5px;color:var(--text3)}
.ag-hero-radar-curve-row{display:flex;align-items:center;gap:12px;padding:3px 0}
.ag-hero-radar-curve-domain{
  flex:0 0 120px;width:120px;font-size:12px;color:var(--text2);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ag-hero-radar-curve-svg{flex:1;height:30px;min-width:80px}
.ag-hero-radar-curve-line{stroke:var(--ag-hue,var(--accent));stroke-width:1.6;fill:none;stroke-linejoin:round;stroke-linecap:round}
.ag-hero-radar-curve-thr{stroke:var(--text3);stroke-width:1;stroke-dasharray:3 3}
.ag-hero-radar-moves{margin-top:16px;padding-top:12px;border-top:1px solid color-mix(in srgb,var(--border) 55%,transparent)}
.ag-hero-radar-moves-title{font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--text3)}
.ag-hero-radar-moves-list{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.ag-hero-radar-move{display:flex;align-items:center;gap:9px}
.ag-hero-radar-move-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0;background:var(--text3)}
.ag-hero-radar-move--entered .ag-hero-radar-move-dot{background:var(--amber)}
.ag-hero-radar-move--spiked .ag-hero-radar-move-dot{background:var(--red)}
.ag-hero-radar-move--left .ag-hero-radar-move-dot{background:var(--green)}
.ag-hero-radar-move-text{font-size:12.5px;color:var(--text2);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ag-hero-radar-move-text strong{color:var(--text);font-weight:600}
.ag-hero-radar-move-date{margin-left:auto;font-size:11px;color:var(--text3);font-variant-numeric:tabular-nums;flex-shrink:0}
@keyframes agRadarSweep{from{transform:rotate(0deg);opacity:0.45}to{transform:rotate(360deg);opacity:0}}
@keyframes agRadarPulse{from{r:4;opacity:0.7}to{r:14;opacity:0}}
@media (prefers-reduced-motion:reduce){
  .ag-hero-radar-sweep{animation:none;opacity:0}
  .ag-hero-radar-pulse{animation:none;opacity:0}
}

/* ── Anomaly Investigator: the case board. An investigation LOG — recent
   anomalies as case files on a vertical timeline spine. The spine draws down
   once on entry; each case settles with agFadeInUp. Read-only — explains,
   never acts. ── */
.ag-hero-cases{
  list-style:none;margin:10px 0 0;padding:0;position:relative;
}
/* The timeline spine — a single hairline that draws down once. */
.ag-hero-cases::before{
  content:'';position:absolute;left:6px;top:7px;bottom:9px;width:2px;
  background:color-mix(in srgb,var(--ag-hue,var(--accent)) 32%,transparent);
  border-radius:2px;transform-origin:top;animation:agSpineDraw calc(var(--motion-slow)*1.2) ease-out backwards;
}
.ag-hero-case{position:relative;padding:0 0 16px 26px;animation:agFadeInUp calc(var(--motion-slow)*0.9) ease backwards}
.ag-hero-case:last-child{padding-bottom:0}
.ag-hero-case:nth-child(2){animation-delay:0.04s}
.ag-hero-case:nth-child(3){animation-delay:0.08s}
.ag-hero-case:nth-child(4){animation-delay:0.12s}
.ag-hero-case:nth-child(n+5){animation-delay:0.16s}
/* The node dot sits ON the spine, aligned with the head row. */
.ag-hero-case-node{
  position:absolute;left:1px;top:4px;width:11px;height:11px;border-radius:50%;
  background:var(--ag-hue,var(--accent));
  box-shadow:0 0 0 3px var(--panel-bg,var(--bg)),0 0 0 4px color-mix(in srgb,var(--ag-hue,var(--accent)) 30%,transparent);
}
.ag-hero-case-body{min-width:0}
.ag-hero-case-head{display:flex;align-items:center;gap:8px;margin-bottom:3px}
.ag-hero-case-metric{
  font-size:10px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;
  color:var(--ag-hue,var(--accent));
  background:color-mix(in srgb,var(--ag-hue,var(--accent)) 13%,transparent);
  border-radius:5px;padding:2px 7px;white-space:nowrap;
}
.ag-hero-case-time{margin-left:auto;font-size:11px;color:var(--text3);font-variant-numeric:tabular-nums;flex-shrink:0}
.ag-hero-case-title{font-size:14px;font-weight:600;color:var(--text);line-height:1.35}
.ag-hero-case-theory{margin-top:5px;font-size:12.5px;color:var(--text2);line-height:1.4}
.ag-hero-case-theory-label{
  font-size:9.5px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;
  color:var(--text3);margin-right:7px;
}
.ag-hero-case-theory-text{color:var(--text2)}
.ag-hero-case-narrative{
  margin:6px 0 0;font-size:12.5px;color:var(--text2);line-height:1.5;
  padding-left:9px;border-left:2px solid color-mix(in srgb,var(--ag-hue,var(--accent)) 24%,transparent);
}
.ag-hero-case-cta{margin-top:8px}
.ag-hero-case-empty{font-size:13px;color:var(--text2);padding:14px 0}
@keyframes agSpineDraw{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@media (prefers-reduced-motion:reduce){
  .ag-hero-cases::before{animation:none}
  .ag-hero-case{animation:none}
}

/* ── anomaly-spark micro-visual (card) — 14-day daily anomaly-count bars. ── */
.ag-mv-spark{display:flex;flex-direction:column;gap:6px}
.ag-mv-spark-bars{display:flex;align-items:flex-end;gap:2px;height:30px}
.ag-mv-spark-bar{
  flex:1;min-width:0;border-radius:2px 2px 0 0;
  background:color-mix(in srgb,var(--text3) 30%,transparent);
}
.ag-mv-spark-bar--hit{background:color-mix(in srgb,var(--ag-hue,var(--accent)) 55%,transparent)}
.ag-mv-spark-bar--latest.ag-mv-spark-bar--hit{background:var(--ag-hue,var(--accent))}
.ag-mv-spark-caption{display:flex;align-items:baseline;gap:8px;min-width:0}
.ag-mv-spark-total{font-size:11px;font-weight:600;color:var(--ag-hue,var(--accent));white-space:nowrap;flex-shrink:0}
.ag-mv-spark-latest{font-size:11px;color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media (max-width:720px){
  .ag-hero-waste-reason{display:none}
  .ag-hero-waste-term{max-width:none}
  .ag-hero-fatigue-wall{grid-template-columns:repeat(auto-fill,minmax(124px,1fr))}
  .ag-hero-health-top{gap:16px}
  .ag-hero-pace-name{flex-basis:96px;width:96px}
  .ag-hero-pace-badge{min-width:0}
  .ag-hero-model-gallery{grid-template-columns:repeat(auto-fill,minmax(128px,1fr))}
  .ag-hero-radar-top{gap:12px}
  .ag-hero-radar-scope{margin:0 auto}
  .ag-hero-radar-curve-domain{flex-basis:84px;width:84px}
}

/* ── Motion S9 sweep: reduced-motion guards for kept width fills ── */
@media (prefers-reduced-motion:reduce){
  .ag-mv-bar-fill,.ag-mv-pace-fill,.ag-cfg-meter-fill,.ag-hero-pace-fill,
  .ag-hero-alloc-bar-fill{transition:none}
}
