/* Sunset Grove Maya shared components (ticket #479, PRD v1.1 Section 18, Mission Control direction of Oct 16 2026).
   Uses ONLY var(--sg-*) semantic tokens from sg-tokens.css: no hex, no raw brand value. Anatomy of each component: docs/agency-app/design-skill.md.
   Accessibility: 44px touch targets (--sg-tap), one visible focus ring, reduced motion respected, state is never colour alone.
   Sections: 1 base and type, 2 layout helpers, 3 core controls, 4 shell (rail, top bar, bottom nav, shell grid), 5 briefing (hero, metric,
   spark, chart, attention, stages), 6 content (media card, inspector, kv), 7 conversation (bubble, side list, context card, composer),
   8 states (banner, error, loading, steps), 9 overlays, 10 reduced motion, 11 Mission Control (command bar, segmented selector, mission hero,
   mission metric, agency pulse, Maya cockpit, evidence states). */

/* ===== 1. Base and type ===== */
*, *::before, *::after { box-sizing: border-box; }
body.sg-body { margin: 0; background: radial-gradient(60% 45% at 88% -8%, var(--sg-glow), transparent 70%), radial-gradient(45% 40% at -6% 104%, var(--sg-glow-gold), transparent 70%), var(--sg-bg); background-attachment: fixed; color: var(--sg-text); font-family: var(--sg-font-body); font-size: var(--sg-fs-m); line-height: var(--sg-lh-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; word-spacing: 0.05em; }
.sg-h1, .sg-h2, .sg-h3, .sg-display { font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); margin: 0 0 var(--sg-space-3); line-height: var(--sg-lh-snug); color: var(--sg-text); }
.sg-display { font-size: var(--sg-fs-display); line-height: var(--sg-lh-tight); }
.sg-h1 { font-size: var(--sg-fs-2xl); }
.sg-h2 { font-size: var(--sg-fs-xl); }
.sg-h3 { font-size: var(--sg-fs-l); }
.sg-eyebrow { display: block; margin: 0 0 var(--sg-space-2); color: var(--sg-gold-text); font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); letter-spacing: var(--sg-tracking-label); text-transform: uppercase; }
.sg-lead { font-size: var(--sg-fs-l); max-width: var(--sg-measure); }
.sg-muted { color: var(--sg-text-muted); }
.sg-num { font-variant-numeric: tabular-nums; }
.sg-link { color: var(--sg-link); text-decoration: underline; text-underline-offset: 3px; }
.sg-link--block { display: inline-flex; align-items: center; min-height: var(--sg-tap); }
.sg-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sg-skip { position: absolute; left: -999px; top: var(--sg-space-2); background: var(--sg-elevated); color: var(--sg-text); padding: var(--sg-space-2) var(--sg-space-3); border-radius: var(--sg-radius-m); z-index: var(--sg-z-toast); }
.sg-skip:focus { left: var(--sg-space-3); }
.sg-icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* One visible focus ring everywhere */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid transparent; box-shadow: var(--sg-focus-ring); }

/* ===== 2. Layout helpers ===== */
.sg-stack { display: flex; flex-direction: column; gap: var(--sg-space-4); }
.sg-stack--tight { gap: var(--sg-space-2); }
.sg-stack--loose { gap: var(--sg-space-6); }
.sg-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-2); }
.sg-grid { display: grid; gap: var(--sg-space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--sg-min, 240px)), 1fr)); }
.sg-grid--tiles { --sg-min: 260px; }
.sg-grid--media { --sg-min: 220px; }
/* Three across on wide screens (the six report tiles are 3 by 2), two on tablet, one on phone */
.sg-grid--thirds { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .sg-grid--thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .sg-grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sg-split { display: grid; gap: var(--sg-space-5); align-items: start; }
@media (min-width: 1024px) { .sg-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .sg-split--wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }

/* Page header: title and purpose, dated source line, primary action, Ask Maya hook */
.sg-page { max-width: var(--sg-content-max); margin: 0 auto; display: flex; flex-direction: column; gap: var(--sg-space-6); }
.sg-page__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sg-space-4); }
.sg-page__title { font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-3xl); line-height: var(--sg-lh-tight); margin: 0; }
.sg-page__purpose { margin: var(--sg-space-2) 0 0; max-width: var(--sg-measure); color: var(--sg-text-muted); }
.sg-page__actions { display: flex; flex-wrap: wrap; gap: var(--sg-space-2); }
.sg-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sg-space-2); margin: 0 0 var(--sg-space-3); }
.sg-section__title { font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-xl); margin: 0; }
/* Dated source line: "Source, read time (Eastern), state badge". Required under every data block. */
.sg-source { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-1) var(--sg-space-2); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
@media (max-width: 760px) { .sg-page__title { font-size: var(--sg-fs-2xl); } .sg-page { gap: var(--sg-space-5); } }

/* ===== 3. Core controls ===== */
/* Card: the soft-lit surface */
.sg-card { background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-l); padding: var(--sg-space-4); box-shadow: var(--sg-shadow-soft); color: var(--sg-text); }
.sg-card--roomy { padding: var(--sg-space-5); }
.sg-card--flat { box-shadow: none; }
.sg-card--link { cursor: pointer; transition: box-shadow var(--sg-dur) var(--sg-ease), transform var(--sg-dur) var(--sg-ease), border-color var(--sg-dur) var(--sg-ease); }
.sg-card--link:hover { box-shadow: var(--sg-shadow-lift); border-color: var(--sg-border-lit); transform: translateY(-1px); }
.sg-card--glass { background: var(--sg-glass); border-color: var(--sg-border-lit); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.sg-card__title { font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-l); margin: 0 0 var(--sg-space-2); }

/* Buttons. The primary button is navy (cream on navy surfaces), never gold. */
.sg-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sg-space-2); min-height: var(--sg-tap); min-width: var(--sg-tap);
  padding: 0 var(--sg-space-4); border-radius: var(--sg-radius-m); border: 1px solid var(--sg-border-strong); background: var(--sg-surface-2); color: var(--sg-text);
  font: var(--sg-fw-semibold) var(--sg-fs-m) var(--sg-font-body); line-height: 1.2; cursor: pointer; text-decoration: none; transition: box-shadow var(--sg-dur) var(--sg-ease), transform var(--sg-dur) var(--sg-ease), background var(--sg-dur) var(--sg-ease); }
.sg-btn:hover { border-color: var(--sg-accent); }
.sg-btn:disabled, .sg-btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.sg-btn--primary { background: var(--sg-accent); color: var(--sg-accent-text); border-color: var(--sg-accent); box-shadow: var(--sg-shadow-1), 0 0 20px -8px var(--sg-glow); }
.sg-btn--primary:not(:disabled):not([aria-disabled="true"]):hover { box-shadow: var(--sg-shadow-2), 0 0 24px -6px var(--sg-glow); transform: translateY(-1px); }
.sg-btn--secondary { background: transparent; color: var(--sg-text); border-color: var(--sg-border-strong); }
.sg-btn--secondary:hover { background: var(--sg-accent-soft); }
.sg-btn--ghost { background: transparent; border-color: transparent; color: var(--sg-text); }
.sg-btn--ghost:hover { background: var(--sg-accent-soft); border-color: transparent; }
.sg-btn--block { display: flex; width: 100%; }

/* Chip (suggested question chips, filters) */
.sg-chip { display: inline-flex; align-items: center; gap: var(--sg-space-2); min-height: var(--sg-tap); padding: 0 var(--sg-space-4); border-radius: var(--sg-radius-pill);
  border: 1px solid var(--sg-border-strong); background: var(--sg-surface); color: var(--sg-text); font: var(--sg-fw-medium) var(--sg-fs-s) var(--sg-font-body); cursor: pointer; text-decoration: none; }
.sg-chip:hover, .sg-chip[aria-pressed="true"] { background: var(--sg-accent-soft); border-color: var(--sg-accent); }
.sg-tag { display: inline-flex; align-items: center; padding: 2px var(--sg-space-2); border-radius: var(--sg-radius-s); background: color-mix(in srgb, var(--sg-shell-bg) 88%, transparent); color: var(--sg-shell-text); font: var(--sg-fw-semibold) var(--sg-fs-xs) var(--sg-font-body); }

/* State badges: LIVE, PREVIEW, ESTIMATE, SAMPLE, STALE, UNAVAILABLE, ERROR. The word is always shown; border style adds a second cue. */
.sg-badge { display: inline-flex; align-items: center; gap: var(--sg-space-1); padding: 2px var(--sg-space-2); border-radius: var(--sg-radius-pill);
  border: 1px solid currentColor; background: var(--sg-surface); color: var(--sg-text-muted);
  font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); line-height: 1.4; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.sg-badge--live { color: var(--sg-success); background: var(--sg-success-soft); }
.sg-badge--preview { color: var(--sg-info); background: var(--sg-info-soft); }
.sg-badge--estimate { color: var(--sg-warning); background: var(--sg-warning-soft); border-style: dashed; }
.sg-badge--sample { color: var(--sg-info); background: var(--sg-info-soft); border-style: dashed; }
.sg-badge--stale { color: var(--sg-warning); background: var(--sg-warning-soft); }
.sg-badge--unavailable { color: var(--sg-text-muted); background: var(--sg-neutral-soft); border-style: dotted; }
.sg-badge--error { color: var(--sg-danger); background: var(--sg-danger-soft); }

/* Count pill (attention count, unread) */
.sg-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--sg-radius-pill); background: var(--sg-danger); color: var(--sg-surface); font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); line-height: 1; }
.sg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sg-gold); flex: none; }

/* Stat: huge plain headline number, label, source and freshness line */
.sg-stat { display: flex; flex-direction: column; gap: var(--sg-space-1); }
.sg-stat__label { color: var(--sg-text-muted); font-size: var(--sg-fs-m); }
.sg-stat__value { font-family: var(--sg-font-display); font-size: var(--sg-fs-display); line-height: var(--sg-lh-tight); color: var(--sg-text); font-variant-numeric: tabular-nums; }
.sg-stat__source { color: var(--sg-text-muted); font-size: var(--sg-fs-xs); }

/* Form controls */
.sg-field { display: flex; flex-direction: column; gap: var(--sg-space-1); }
.sg-label { font-size: var(--sg-fs-s); font-weight: var(--sg-fw-semibold); color: var(--sg-text); }
.sg-input, .sg-select, .sg-textarea { width: 100%; min-height: var(--sg-tap); padding: 0 var(--sg-space-3); border: 1px solid var(--sg-border-strong); border-radius: var(--sg-radius-m);
  background: var(--sg-surface); color: var(--sg-text); font: var(--sg-fw-regular) 1rem var(--sg-font-body); }
.sg-textarea { padding: var(--sg-space-3); min-height: 88px; resize: vertical; }
.sg-input::placeholder, .sg-textarea::placeholder { color: var(--sg-text-muted); }

/* Tabs */
.sg-tabs { display: flex; gap: var(--sg-space-1); border-bottom: 1px solid var(--sg-border); overflow-x: auto; }
.sg-tabs [role="tab"] { min-height: var(--sg-tap); padding: 0 var(--sg-space-4); background: transparent; border: 0; border-bottom: 3px solid transparent;
  color: var(--sg-text-muted); font: var(--sg-fw-semibold) var(--sg-fs-m) var(--sg-font-body); cursor: pointer; white-space: nowrap; }
.sg-tabs [role="tab"][aria-selected="true"] { color: var(--sg-text); border-bottom-color: var(--sg-live); }

/* ===== 4. Shell: nav list, rail, top bar, bottom nav, shell grid (all dark navy through the .sg-on-dark token scope) ===== */
/* .sg-nav is the labelled nav list: expanded nav, tablet drawer content. The shell may keep its own layout classes beside it. */
.sg-nav { display: flex; flex-direction: column; gap: var(--sg-space-1); padding: var(--sg-space-3); background: var(--sg-bg); color: var(--sg-text); border-right: 1px solid var(--sg-border); }
.sg-nav a { display: flex; align-items: center; gap: var(--sg-space-3); min-height: var(--sg-tap); padding: 0 var(--sg-space-3); border-radius: var(--sg-radius-m);
  color: var(--sg-text-muted); text-decoration: none; font-weight: var(--sg-fw-semibold); }
.sg-nav a[aria-current="page"] { background: var(--sg-accent-soft); color: var(--sg-text); box-shadow: inset 3px 0 0 var(--sg-live); }
.sg-nav a:hover { color: var(--sg-text); }
@media (max-width: 760px) {
  .sg-nav { position: fixed; left: 0; right: 0; bottom: 0; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--sg-border); z-index: var(--sg-z-nav); padding: var(--sg-space-1); }
  .sg-nav a { flex-direction: column; justify-content: center; gap: 0; padding: 0 var(--sg-space-1); font-size: var(--sg-fs-xs); flex: 1 1 0; min-width: var(--sg-tap); }
}

/* Rail: compact icon plus label navigation, 1280px and above (also kept on tablet) */
.sg-rail { width: var(--sg-rail-w); display: flex; flex-direction: column; gap: var(--sg-space-1); padding: var(--sg-space-3) var(--sg-space-1); background: linear-gradient(180deg, var(--sg-surface), var(--sg-bg)); color: var(--sg-text); border-right: 1px solid var(--sg-border); }
.sg-rail__brand { display: grid; place-items: center; min-height: 52px; margin-bottom: var(--sg-space-2); color: var(--sg-gold); font-family: var(--sg-font-display); font-size: var(--sg-fs-xl); text-decoration: none; letter-spacing: 0.02em; }
.sg-rail__item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: var(--sg-space-2) 2px;
  border-radius: var(--sg-radius-m); border: 0; background: transparent; color: var(--sg-text-muted); text-decoration: none; text-align: center;
  font: var(--sg-fw-semibold) 0.6875rem var(--sg-font-body); letter-spacing: -0.02em; line-height: 1.15; cursor: pointer; transition: background var(--sg-dur) var(--sg-ease), color var(--sg-dur) var(--sg-ease); }
.sg-rail__item:hover { background: var(--sg-surface); color: var(--sg-text); }
.sg-rail__item[aria-current="page"] { background: var(--sg-accent-soft); color: var(--sg-text); box-shadow: inset 3px 0 0 var(--sg-live), 0 0 18px -8px var(--sg-glow); }
.sg-rail__item .sg-count { position: absolute; top: 4px; right: 8px; }
.sg-rail__foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: var(--sg-space-2); padding-top: var(--sg-space-3); }

/* Top bar: workspace title, active report date, attention indicator, profile, Ask Maya */
.sg-topbar { display: flex; align-items: center; gap: var(--sg-space-3); min-height: var(--sg-topbar-h); padding: 0 var(--sg-space-5); background: color-mix(in srgb, var(--sg-bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--sg-text); border-bottom: 1px solid var(--sg-border); }
.sg-topbar__title { display: flex; align-items: baseline; gap: var(--sg-space-3); min-width: 0; margin: 0; font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-xl); white-space: nowrap; }
.sg-topbar__crumb { font: var(--sg-fw-medium) var(--sg-fs-s) var(--sg-font-body); color: var(--sg-text-muted); overflow: hidden; text-overflow: ellipsis; }
.sg-topbar__date { display: inline-flex; align-items: center; gap: var(--sg-space-2); min-height: 32px; padding: 0 var(--sg-space-3); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-pill); color: var(--sg-text); background: var(--sg-surface); font-size: var(--sg-fs-s); white-space: nowrap; }
.sg-topbar__spacer { flex: 1 1 auto; }
.sg-topbar__attention { display: inline-flex; align-items: center; gap: var(--sg-space-2); min-height: var(--sg-tap); padding: 0 var(--sg-space-3); border-radius: var(--sg-radius-m); border: 1px solid var(--sg-border); background: transparent; color: var(--sg-text); font: var(--sg-fw-semibold) var(--sg-fs-s) var(--sg-font-body); cursor: pointer; text-decoration: none; }
.sg-topbar__attention:hover { background: var(--sg-surface); }
.sg-topbar__who { display: flex; align-items: center; gap: var(--sg-space-2); font-size: var(--sg-fs-s); line-height: 1.25; }
.sg-topbar__who small { display: block; color: var(--sg-text-muted); font-size: var(--sg-fs-xs); }
@media (max-width: 1279px) { .sg-topbar__crumb, .sg-topbar__who span:not(.sg-avatar) { display: none; } }
.sg-topbar__attention, .sg-topbar .sg-btn { white-space: nowrap; }
@media (max-width: 760px) {
  .sg-topbar { padding: 0 var(--sg-space-3); gap: var(--sg-space-2); min-height: 56px; }
  .sg-topbar__title { font-size: var(--sg-fs-l); }
  .sg-topbar__crumb, .sg-topbar__date-label, .sg-topbar__date .sg-badge, .sg-topbar__who span:not(.sg-avatar), .sg-topbar__ask, .sg-topbar__attention span:not(.sg-count) { display: none; }
  .sg-topbar__attention { padding: 0 var(--sg-space-2); }
}

/* Avatar: Maya's identity is an image (the real avatar), a person is an initial */
.sg-avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--sg-surface-2); color: var(--sg-text);
  border: 2px solid var(--sg-gold); box-shadow: 0 0 0 3px var(--sg-glow); font: var(--sg-fw-semibold) var(--sg-fs-m) var(--sg-font-display); }
.sg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-avatar--lg { width: 64px; height: 64px; font-size: var(--sg-fs-xl); }
.sg-avatar--sm { width: 32px; height: 32px; font-size: var(--sg-fs-s); border-width: 1px; }

/* Bottom nav (phone): Home, Studio, Maya, More. Labels always visible. */
.sg-bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--sg-z-nav); display: flex; background: var(--sg-bg); color: var(--sg-text); border-top: 1px solid var(--sg-border); padding-bottom: env(safe-area-inset-bottom, 0px); }
.sg-bottomnav__item { position: relative; flex: 1 1 0; min-width: 0; min-height: var(--sg-bottomnav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: var(--sg-space-1); border: 0; background: transparent; color: var(--sg-text-muted); text-decoration: none; font: var(--sg-fw-semibold) 0.6875rem var(--sg-font-body); cursor: pointer; }
.sg-bottomnav__item[aria-current="page"] { color: var(--sg-text); box-shadow: inset 0 3px 0 var(--sg-live); }
.sg-bottomnav__item .sg-count { position: absolute; top: 6px; left: calc(50% + 6px); }
@media (min-width: 761px) { .sg-bottomnav { display: none; } }

/* Shell grid: rail | top bar over main | optional conversation panel (1280px and above) */
.sg-shell { display: grid; min-height: 100vh; grid-template-columns: var(--sg-rail-w) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "rail top" "rail main"; background: transparent; color: var(--sg-text); }
.sg-shell__rail { grid-area: rail; position: sticky; top: 0; height: 100vh; z-index: var(--sg-z-nav); }
.sg-shell__rail > .sg-rail { height: 100%; overflow-y: auto; }
.sg-shell__top { grid-area: top; position: sticky; top: 0; z-index: var(--sg-z-sticky); }
.sg-shell__main { grid-area: main; min-width: 0; padding: var(--sg-space-5) var(--sg-space-6) var(--sg-space-7); }
.sg-shell__panel { grid-area: panel; display: none; }
@media (min-width: 1280px) {
  .sg-shell { grid-template-columns: var(--sg-rail-w) minmax(0, 1fr) var(--sg-cockpit-w); grid-template-areas: "rail top top" "rail main panel"; }
  .sg-shell__panel { display: block; position: sticky; top: var(--sg-topbar-h); height: calc(100vh - var(--sg-topbar-h)); overflow: auto; background: var(--sg-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-left: 1px solid var(--sg-border-lit); }
  .sg-shell[data-panel="closed"] { grid-template-columns: var(--sg-rail-w) minmax(0, 1fr); grid-template-areas: "rail top" "rail main"; }
  .sg-shell[data-panel="closed"] .sg-shell__panel { display: none; }
}
@media (max-width: 760px) {
  .sg-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .sg-shell__rail { display: none; }
  .sg-shell__main { padding: var(--sg-space-4) var(--sg-space-4) calc(var(--sg-bottomnav-h) + var(--sg-space-7)); overflow-x: clip; }
}

/* ===== 5. Briefing: hero, metric tile, sparkline, chart frame, attention, stage strip ===== */
/* Hero: Maya speaks first. Navy, soft glow, glass recommendation panel. */
.sg-hero { position: relative; overflow: hidden; display: grid; gap: var(--sg-space-5); padding: var(--sg-space-6); border-radius: var(--sg-radius-xl); border: 1px solid var(--sg-border); color: var(--sg-text);
  background: radial-gradient(90% 120% at 100% 0%, var(--sg-glow), transparent 58%), radial-gradient(70% 90% at 0% 100%, var(--sg-glow-gold), transparent 60%), linear-gradient(160deg, var(--sg-surface-2), var(--sg-bg)); box-shadow: var(--sg-shadow-lift); }
.sg-hero__who { display: flex; gap: var(--sg-space-4); align-items: flex-start; min-width: 0; }
.sg-hero__greeting { font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-2xl); line-height: var(--sg-lh-snug); margin: 0 0 var(--sg-space-2); color: var(--sg-text); }
.sg-hero__sentence { margin: 0 0 var(--sg-space-3); max-width: var(--sg-measure); font-size: var(--sg-fs-l); line-height: var(--sg-lh-body); color: var(--sg-text); }
.sg-hero__reco { display: flex; flex-direction: column; gap: var(--sg-space-3); padding: var(--sg-space-5); border-radius: var(--sg-radius-l); border: 1px solid var(--sg-border); background: var(--sg-glass); border-color: var(--sg-border-lit); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--sg-shadow-soft); }
.sg-hero__reco-title { font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-xl); line-height: var(--sg-lh-snug); margin: 0; }
.sg-hero__reco p { margin: 0; color: var(--sg-text-muted); }
@media (min-width: 900px) { .sg-hero { grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); align-items: stretch; } .sg-hero__greeting { font-size: var(--sg-fs-3xl); } }
@media (max-width: 760px) { .sg-hero { padding: var(--sg-space-5) var(--sg-space-4); border-radius: var(--sg-radius-l); } .sg-hero__reco { padding: var(--sg-space-4); } .sg-hero .sg-avatar--lg { width: 48px; height: 48px; } }

/* Metric tile: value, label, window, source line, change, sparkline slot. Clickable tiles use <a> or <button> with .sg-metric--link. */
.sg-metric { display: flex; flex-direction: column; gap: var(--sg-space-2); min-width: 0; padding: var(--sg-space-4); background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-l); box-shadow: var(--sg-shadow-soft);
  color: var(--sg-text); text-align: left; text-decoration: none; font: inherit; }
.sg-metric--link { cursor: pointer; transition: box-shadow var(--sg-dur) var(--sg-ease), transform var(--sg-dur) var(--sg-ease), border-color var(--sg-dur) var(--sg-ease); }
.sg-metric--link:hover { box-shadow: var(--sg-shadow-lift); border-color: var(--sg-border-lit); transform: translateY(-1px); }
.sg-metric__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sg-space-2); }
.sg-metric__label { font-size: var(--sg-fs-s); font-weight: var(--sg-fw-semibold); line-height: var(--sg-lh-snug); }
.sg-metric__window { display: inline-flex; align-items: center; align-self: flex-start; padding: 1px var(--sg-space-2); border-radius: var(--sg-radius-pill); background: var(--sg-neutral-soft); border: 1px solid var(--sg-border); color: var(--sg-text-muted); font: var(--sg-fw-semibold) var(--sg-fs-xs) var(--sg-font-body); white-space: nowrap; }
.sg-metric__value { margin: 0; font-family: var(--sg-font-display); font-size: var(--sg-fs-3xl); line-height: var(--sg-lh-tight); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sg-metric__value--null { font-size: var(--sg-fs-xl); color: var(--sg-text-muted); }
.sg-metric__spark { min-height: 40px; margin-top: auto; color: var(--sg-chart-line); }
.sg-metric__source { margin: 0; padding-top: var(--sg-space-2); border-top: 1px solid var(--sg-border); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-metric__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sg-space-2); }

/* Change versus a comparable prior reading. The words carry the meaning, the glyph is decoration. */
.sg-change { display: inline-flex; align-items: center; gap: var(--sg-space-1); font-size: var(--sg-fs-s); font-weight: var(--sg-fw-semibold); color: var(--sg-text-muted); }
.sg-change--up { color: var(--sg-success); }
.sg-change--up::before { content: "\25B2"; font-size: 0.7em; }
.sg-change--down { color: var(--sg-danger); }
.sg-change--down::before { content: "\25BC"; font-size: 0.7em; }
.sg-change--flat::before { content: "\25AC"; font-size: 0.7em; }
.sg-change--unknown::before { content: "\2022"; }

/* Sparkline (inline SVG, viewBox set by the view). Gaps stay gaps: draw a separate path per run of known days. */
.sg-spark { display: block; width: 100%; height: 40px; color: var(--sg-chart-line); overflow: visible; }
.sg-spark__line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sg-spark__area { fill: var(--sg-chart-area); stroke: none; }
.sg-spark__gap { fill: none; stroke: var(--sg-border-strong); stroke-width: 1.5; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.sg-spark__dot { fill: currentColor; }
.sg-spark-empty { display: flex; align-items: center; min-height: 40px; border-bottom: 1px dashed var(--sg-border-strong); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }

/* Chart frame (figure): explicit units, date range, legend and a missing-data band. Plot is inline SVG. */
.sg-chart { margin: 0; display: flex; flex-direction: column; gap: var(--sg-space-2); }
.sg-chart__caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sg-space-2); }
.sg-chart__title { font-weight: var(--sg-fw-semibold); font-size: var(--sg-fs-m); }
.sg-chart__units, .sg-chart__range { font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-chart__plot { display: block; width: 100%; height: 160px; color: var(--sg-chart-line); overflow: visible; }
.sg-chart__grid { stroke: var(--sg-chart-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sg-chart__axis { fill: var(--sg-text-muted); font-family: var(--sg-font-body); font-size: 11px; }
.sg-chart__gapband { fill: var(--sg-neutral-soft); stroke: var(--sg-border-strong); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.sg-chart__legend { display: flex; flex-wrap: wrap; gap: var(--sg-space-3); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }

/* Needs-your-attention queue: real owner decisions only, with the consequence of waiting */
.sg-attention { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sg-space-3); }
.sg-attention__item { display: flex; flex-wrap: wrap; gap: var(--sg-space-3) var(--sg-space-4); align-items: center; justify-content: space-between; padding: var(--sg-space-4);
  background: var(--sg-surface); border: 1px solid var(--sg-border); border-left: 4px solid var(--sg-gold); border-radius: var(--sg-radius-l); box-shadow: var(--sg-shadow-soft); }
.sg-attention__item[data-level="warning"] { border-left-color: var(--sg-warning); }
.sg-attention__item[data-level="danger"] { border-left-color: var(--sg-danger); }
.sg-attention__item[data-level="info"] { border-left-color: var(--sg-info); }
.sg-attention__item > :first-child { flex: 1 1 260px; min-width: 0; }
.sg-attention__title { margin: 0; font-weight: var(--sg-fw-semibold); font-size: var(--sg-fs-l); line-height: var(--sg-lh-snug); }
.sg-attention__why { margin: var(--sg-space-1) 0 0; color: var(--sg-text-muted); font-size: var(--sg-fs-m); }
.sg-attention__meta { margin: var(--sg-space-1) 0 0; font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-attention__actions { display: flex; flex-wrap: wrap; gap: var(--sg-space-2); }
.sg-attention__clear { display: flex; align-items: center; gap: var(--sg-space-3); padding: var(--sg-space-4); border: 1px dashed var(--sg-border-strong); border-radius: var(--sg-radius-l); background: var(--sg-surface); color: var(--sg-text-muted); }
.sg-attention__clear strong { color: var(--sg-text); }
@media (max-width: 760px) { .sg-attention__actions { width: 100%; } .sg-attention__actions .sg-btn { flex: 1 1 140px; } }

/* Stage strip: the agency's week as counts (drafted, accepted, scheduled, verified live, held) from the ledger and receipts */
.sg-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px; background: var(--sg-border);
  border: 1px solid var(--sg-border); border-radius: var(--sg-radius-l); overflow: hidden; box-shadow: var(--sg-shadow-soft); }
.sg-stage { display: flex; flex-direction: column; gap: var(--sg-space-1); padding: var(--sg-space-4); background: var(--sg-surface); min-width: 0; }
.sg-stage__count { font-family: var(--sg-font-display); font-size: var(--sg-fs-2xl); line-height: var(--sg-lh-tight); font-variant-numeric: tabular-nums; }
.sg-stage__label { font-size: var(--sg-fs-s); color: var(--sg-text-muted); line-height: var(--sg-lh-snug); }
.sg-stage__bar { display: block; height: 4px; margin-top: var(--sg-space-1); border-radius: var(--sg-radius-pill); background: var(--sg-neutral-soft); overflow: hidden; }
.sg-stage__bar::before { content: ""; display: block; height: 100%; width: var(--sg-pct, 0%); background: var(--sg-accent); }
.sg-stage[data-state="done"] .sg-stage__count { color: var(--sg-success); }
.sg-stage[data-state="held"] .sg-stage__count { color: var(--sg-warning); }
.sg-stage[data-state="blocked"] .sg-stage__count { color: var(--sg-danger); }
.sg-stage[data-state="unknown"] .sg-stage__count { color: var(--sg-text-muted); font-size: var(--sg-fs-l); }

/* ===== 6. Content: media card, inspector, key-value ===== */
/* Media card: real post media (or an honest "no image" state), tags, status, caption excerpt, times in Eastern, actions */
.sg-media { display: flex; flex-direction: column; min-width: 0; background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-l); box-shadow: var(--sg-shadow-soft); overflow: hidden; color: var(--sg-text); text-align: left; font: inherit; text-decoration: none; }
.sg-media--link { cursor: pointer; transition: box-shadow var(--sg-dur) var(--sg-ease), transform var(--sg-dur) var(--sg-ease); }
.sg-media--link:hover { box-shadow: var(--sg-shadow-lift); border-color: var(--sg-border-lit); transform: translateY(-1px); }
.sg-media__frame { position: relative; aspect-ratio: var(--sg-media-ratio, 4 / 5); background: var(--sg-media-bg); overflow: hidden; }
.sg-media__frame--wide { --sg-media-ratio: 16 / 9; }
.sg-media__frame--square { --sg-media-ratio: 1 / 1; }
.sg-media__frame img, .sg-media__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-media__none { position: absolute; inset: 0; display: grid; place-content: center; gap: var(--sg-space-1); padding: var(--sg-space-4); text-align: center; color: var(--sg-text-muted); font-size: var(--sg-fs-s); }
.sg-media__tags { position: absolute; top: var(--sg-space-2); left: var(--sg-space-2); right: var(--sg-space-2); display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sg-space-1); pointer-events: none; }
.sg-media__rank { position: absolute; bottom: var(--sg-space-2); left: var(--sg-space-2); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sg-shell-bg); color: var(--sg-shell-gold); font: var(--sg-fw-bold) var(--sg-fs-s) var(--sg-font-body); }
.sg-media__body { display: flex; flex-direction: column; gap: var(--sg-space-2); padding: var(--sg-space-3) var(--sg-space-4) var(--sg-space-4); flex: 1; }
.sg-media__title { margin: 0; font-weight: var(--sg-fw-semibold); font-size: var(--sg-fs-m); line-height: var(--sg-lh-snug); }
.sg-media__caption { margin: 0; color: var(--sg-text-muted); font-size: var(--sg-fs-s); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-media__meta { margin: 0; display: flex; flex-wrap: wrap; gap: var(--sg-space-1) var(--sg-space-3); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-media__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--sg-space-2); align-items: center; justify-content: space-between; }

/* Inspector: the right-hand detail panel (desktop), a drawer (tablet) and a full-height screen (phone). Use --modal for the overlay form. */
.sg-inspector { display: flex; flex-direction: column; min-height: 0; background: var(--sg-surface); color: var(--sg-text); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-l); box-shadow: var(--sg-shadow-soft); overflow: hidden; }
.sg-inspector__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sg-space-3); padding: var(--sg-space-3) var(--sg-space-4); border-bottom: 1px solid var(--sg-border); }
.sg-inspector__title { margin: 0; font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-l); }
.sg-inspector__body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sg-space-4); display: flex; flex-direction: column; gap: var(--sg-space-4); }
.sg-inspector__media { border-radius: var(--sg-radius-m); overflow: hidden; background: var(--sg-media-bg); }
.sg-inspector__media img, .sg-inspector__media video { display: block; width: 100%; max-height: 60vh; object-fit: contain; }
.sg-inspector__foot { display: flex; flex-wrap: wrap; gap: var(--sg-space-2); padding: var(--sg-space-3) var(--sg-space-4); padding-bottom: calc(var(--sg-space-3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--sg-border); background: var(--sg-surface); }
.sg-inspector__foot .sg-btn { flex: 1 1 120px; }
.sg-inspector--modal { position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--sg-z-drawer); width: min(440px, 100vw); border-radius: 0; border-width: 0 0 0 1px; box-shadow: var(--sg-shadow-2); }
@media (max-width: 760px) { .sg-inspector--modal { left: 0; width: 100%; z-index: var(--sg-z-viewer); border-left-width: 0; } }

/* Key-value list (provenance, versions, ids tucked in details) */
.sg-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sg-space-1) var(--sg-space-4); margin: 0; font-size: var(--sg-fs-s); }
.sg-kv dt { color: var(--sg-text-muted); }
.sg-kv dd { margin: 0; overflow-wrap: anywhere; }
.sg-details { border: 1px solid var(--sg-border); border-radius: var(--sg-radius-m); background: var(--sg-surface); }
.sg-details > summary { display: flex; align-items: center; min-height: var(--sg-tap); padding: 0 var(--sg-space-3); cursor: pointer; font-size: var(--sg-fs-s); font-weight: var(--sg-fw-semibold); }
.sg-details > :not(summary) { padding: 0 var(--sg-space-3) var(--sg-space-3); }

/* ===== 7. Conversation (Muse structure): side list, thread, bubbles, composer, context panel ===== */
/* .sg-chat: side list | stage | context. Context shows from 1280px; the side list from 761px; the phone shows the stage only (side list opens as a drawer). */
.sg-chat { display: grid; min-height: 0; background: var(--sg-bg); grid-template-columns: minmax(0, 1fr); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-l); overflow: hidden; }
.sg-chat__list, .sg-chat__context { display: none; min-height: 0; overflow: auto; }
.sg-chat__stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sg-chat__bar { display: flex; align-items: center; gap: var(--sg-space-2); min-height: 56px; padding: var(--sg-space-2) var(--sg-space-3); background: var(--sg-surface); border-bottom: 1px solid var(--sg-border); }
.sg-chat__bar-title { flex: 1; min-width: 0; margin: 0; font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-l); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 761px) { .sg-chat { grid-template-columns: var(--sg-sidebar-w) minmax(0, 1fr); } .sg-chat__list { display: block; } }
@media (min-width: 1280px) { .sg-chat { grid-template-columns: var(--sg-sidebar-w) minmax(0, 1fr) var(--sg-panel-w); } .sg-chat__context { display: block; } }
.sg-chat--screen { border: 0; border-radius: 0; }
@media (max-width: 760px) { .sg-chat--screen { position: fixed; inset: 0; z-index: var(--sg-z-viewer); } .sg-chat--screen[hidden] { display: none; } }

.sg-sidelist { display: flex; flex-direction: column; gap: var(--sg-space-1); padding: var(--sg-space-3); background: var(--sg-surface); border-right: 1px solid var(--sg-border); min-height: 100%; }
.sg-sidelist__label { margin: var(--sg-space-3) var(--sg-space-2) var(--sg-space-1); font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); letter-spacing: var(--sg-tracking-label); text-transform: uppercase; color: var(--sg-text-muted); }
.sg-sidelist__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--sg-space-2); align-items: center; min-height: calc(var(--sg-tap) + var(--sg-space-3)); width: 100%; padding: var(--sg-space-2) var(--sg-space-3); border: 0; border-radius: var(--sg-radius-m);
  background: transparent; color: var(--sg-text); text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.sg-sidelist__item:hover { background: var(--sg-surface-2); }
.sg-sidelist__item[aria-current="true"], .sg-sidelist__item[aria-current="page"] { background: var(--sg-accent-soft); }
.sg-sidelist__item--main { box-shadow: inset 3px 0 0 var(--sg-gold); }
.sg-sidelist__title { font-weight: var(--sg-fw-semibold); font-size: var(--sg-fs-m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-sidelist__snippet { grid-column: 1; font-size: var(--sg-fs-s); color: var(--sg-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-sidelist__time { grid-column: 2; grid-row: 1; font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-sidelist__dot { grid-column: 2; grid-row: 2; justify-self: end; }
.sg-sidelist__new { margin-top: var(--sg-space-2); }

.sg-thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sg-space-4); padding: var(--sg-space-5) var(--sg-space-5) var(--sg-space-4); overscroll-behavior: contain; }
.sg-bubble { display: grid; gap: var(--sg-space-1); max-width: min(680px, 90%); }
.sg-bubble__who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-2); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-bubble__who strong { color: var(--sg-text); font-size: var(--sg-fs-s); }
.sg-bubble__body { padding: var(--sg-space-3) var(--sg-space-4); border-radius: var(--sg-radius-l); border: 1px solid var(--sg-border); background: var(--sg-bubble-maya); color: var(--sg-text); box-shadow: var(--sg-shadow-1); overflow-wrap: anywhere; }
.sg-bubble__body p { margin: 0 0 var(--sg-space-2); }
.sg-bubble__body p:last-child { margin-bottom: 0; }
.sg-bubble--maya .sg-bubble__body { border-top-left-radius: var(--sg-radius-s); }
.sg-bubble--user { align-self: flex-end; }
.sg-bubble--user .sg-bubble__who { justify-content: flex-end; }
.sg-bubble--user .sg-bubble__body { background: var(--sg-bubble-user); color: var(--sg-bubble-user-text); border-color: transparent; border-top-right-radius: var(--sg-radius-s); }
.sg-bubble--system { align-self: center; max-width: min(560px, 92%); text-align: center; }
.sg-bubble--system .sg-bubble__body { background: var(--sg-neutral-soft); color: var(--sg-text-muted); border-style: dashed; box-shadow: none; font-size: var(--sg-fs-s); }
.sg-bubble__quote { margin: 0 0 var(--sg-space-2); padding-left: var(--sg-space-2); border-left: 3px solid var(--sg-gold); font-size: var(--sg-fs-s); color: inherit; }
.sg-bubble__status { display: inline-flex; align-items: center; gap: var(--sg-space-1); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-bubble__status[data-state="failed"] { color: var(--sg-danger); }
.sg-bubble__status[data-state="sending"], .sg-bubble__status[data-state="pending"], .sg-bubble__status[data-state="drafting"] { color: var(--sg-warning); }
.sg-bubble__status[data-state="sent"], .sg-bubble__status[data-state="verified"] { color: var(--sg-success); }
.sg-bubble__card { margin-top: var(--sg-space-2); }
.sg-day { align-self: center; padding: 2px var(--sg-space-3); border-radius: var(--sg-radius-pill); background: var(--sg-neutral-soft); color: var(--sg-text-muted); font-size: var(--sg-fs-xs); }
@media (max-width: 760px) { .sg-thread { padding: var(--sg-space-4) var(--sg-space-3); } .sg-bubble { max-width: 94%; } }

/* Composer: fixed at the bottom of the stage; padding respects the phone keyboard safe area */
.sg-composer { display: flex; flex-direction: column; gap: var(--sg-space-2); padding: var(--sg-space-3) var(--sg-space-4); padding-bottom: calc(var(--sg-space-3) + env(safe-area-inset-bottom, 0px)); background: var(--sg-surface); border-top: 1px solid var(--sg-border); }
.sg-composer__context { display: flex; flex-wrap: wrap; gap: var(--sg-space-2); }
.sg-composer__row { display: flex; align-items: flex-end; gap: var(--sg-space-2); }
.sg-composer__row .sg-textarea { min-height: var(--sg-tap); height: var(--sg-tap); resize: none; }

/* Context card (right panel): what Maya is working on, approvals, the linked post, goal or idea */
.sg-context-card { display: flex; flex-direction: column; gap: var(--sg-space-4); padding: var(--sg-space-4); background: var(--sg-surface); color: var(--sg-text); min-height: 100%; }
.sg-context-card__title { margin: 0; font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-l); }
.sg-context-card__section { display: flex; flex-direction: column; gap: var(--sg-space-2); padding-top: var(--sg-space-3); border-top: 1px solid var(--sg-border); }
.sg-context-card__section:first-of-type { padding-top: 0; border-top: 0; }
.sg-context-card__label { margin: 0; font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); letter-spacing: var(--sg-tracking-label); text-transform: uppercase; color: var(--sg-gold-text); }

/* Task card inside a bubble: a request with its true lifecycle */
.sg-taskcard { display: flex; flex-direction: column; gap: var(--sg-space-2); padding: var(--sg-space-3); background: var(--sg-surface); color: var(--sg-text); border: 1px solid var(--sg-border); border-left: 4px solid var(--sg-gold); border-radius: var(--sg-radius-m); }
.sg-taskcard__title { margin: 0; font-weight: var(--sg-fw-semibold); font-size: var(--sg-fs-m); }

/* ===== 8. States: banner, error, loading, lifecycle steps ===== */
/* Banner: stale source, preview feature, view-only (no permission), error, info. Always a title and a reason. */
.sg-banner { display: flex; align-items: flex-start; gap: var(--sg-space-3); padding: var(--sg-space-3) var(--sg-space-4); border: 1px solid var(--sg-border); border-left: 4px solid var(--sg-info); border-radius: var(--sg-radius-m); background: var(--sg-info-soft); color: var(--sg-text); font-size: var(--sg-fs-s); }
.sg-banner__title { display: block; font-weight: var(--sg-fw-bold); margin-bottom: 2px; }
.sg-banner--stale { border-left-color: var(--sg-warning); background: var(--sg-warning-soft); }
.sg-banner--preview { border-left-color: var(--sg-info); background: var(--sg-info-soft); }
.sg-banner--viewonly { border-left-color: var(--sg-text-muted); background: var(--sg-neutral-soft); }
.sg-banner--error { border-left-color: var(--sg-danger); background: var(--sg-danger-soft); }
.sg-banner--success { border-left-color: var(--sg-success); background: var(--sg-success-soft); }

/* Empty: says what is missing and why, never blank */
.sg-empty { text-align: center; padding: var(--sg-space-6) var(--sg-space-4); border: 1px dashed var(--sg-border-strong); border-radius: var(--sg-radius-l); color: var(--sg-text-muted); background: var(--sg-surface); }
.sg-empty__title { font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-l); color: var(--sg-text); margin: 0 0 var(--sg-space-2); }
.sg-empty p { margin: 0 auto var(--sg-space-3); max-width: 48ch; }

/* Error: what failed, that nothing was changed, and a retry */
.sg-error { padding: var(--sg-space-4); border: 1px solid var(--sg-danger); border-radius: var(--sg-radius-l); background: var(--sg-danger-soft); color: var(--sg-text); }
.sg-error__title { font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-l); color: var(--sg-text); margin: 0 0 var(--sg-space-2); }
.sg-error p { margin: 0 0 var(--sg-space-3); }

/* Loading: skeleton blocks inside an aria-busy region */
.sg-loading { display: grid; gap: var(--sg-space-3); }
.sg-skeleton { display: block; min-height: 1em; border-radius: var(--sg-radius-s); background: linear-gradient(90deg, var(--sg-surface-2), var(--sg-border), var(--sg-surface-2)); background-size: 200% 100%; animation: sg-shimmer 1.4s linear infinite; }
@keyframes sg-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Lifecycle steps: suggested, requested, accepted by the engine, in progress, verified externally (or failed) */
.sg-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sg-space-2); counter-reset: sg-step; }
.sg-steps__item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--sg-space-2); align-items: start; font-size: var(--sg-fs-s); color: var(--sg-text-muted); counter-increment: sg-step; }
.sg-steps__item::before { content: counter(sg-step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--sg-border-strong); background: var(--sg-surface); color: var(--sg-text-muted); font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); }
.sg-steps__item[data-state="done"] { color: var(--sg-text); }
.sg-steps__item[data-state="done"]::before { content: "\2713"; background: var(--sg-success-soft); border-color: var(--sg-success); color: var(--sg-success); }
.sg-steps__item[data-state="current"] { color: var(--sg-text); font-weight: var(--sg-fw-semibold); }
.sg-steps__item[data-state="current"]::before { background: var(--sg-accent); border-color: var(--sg-accent); color: var(--sg-accent-text); }
.sg-steps__item[data-state="failed"] { color: var(--sg-danger); font-weight: var(--sg-fw-semibold); }
.sg-steps__item[data-state="failed"]::before { content: "!"; background: var(--sg-danger-soft); border-color: var(--sg-danger); color: var(--sg-danger); }
.sg-steps__note { display: block; font-weight: var(--sg-fw-regular); color: var(--sg-text-muted); font-size: var(--sg-fs-xs); }

/* ===== 9. Overlays: drawer, sheet, viewer, toast ===== */
.sg-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--sg-elevated); color: var(--sg-text); border-left: 1px solid var(--sg-border);
  box-shadow: var(--sg-shadow-2); padding: var(--sg-space-4); overflow-y: auto; z-index: var(--sg-z-drawer); transform: translateX(100%); transition: transform 0.2s ease; }
.sg-drawer[data-open="true"] { transform: none; }
.sg-drawer[hidden] { display: none; }

.sg-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 85vh; background: var(--sg-elevated); color: var(--sg-text); border-top: 1px solid var(--sg-border);
  border-radius: var(--sg-radius-l) var(--sg-radius-l) 0 0; box-shadow: var(--sg-shadow-2); padding: var(--sg-space-4); padding-bottom: calc(var(--sg-space-4) + env(safe-area-inset-bottom, 0px)); overflow-y: auto; z-index: var(--sg-z-sheet);
  transform: translateY(100%); transition: transform 0.2s ease; }
.sg-sheet[data-open="true"] { transform: none; }
.sg-sheet[hidden] { display: none; }
.sg-sheet__grab { display: block; width: 40px; height: 4px; margin: 0 auto var(--sg-space-3); border-radius: var(--sg-radius-pill); background: var(--sg-border-strong); }
.sg-sheet--full { top: 0; max-height: none; border-radius: 0; }

.sg-viewer { position: fixed; inset: 0; z-index: var(--sg-z-viewer); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sg-space-3);
  background: var(--sg-bg); color: var(--sg-text); padding: var(--sg-space-4); }
.sg-viewer[hidden] { display: none; }
.sg-viewer__close { position: absolute; top: var(--sg-space-3); right: var(--sg-space-3); }
.sg-viewer__media { max-width: 100%; max-height: 75vh; border-radius: var(--sg-radius-m); }

.sg-toast { position: fixed; left: 50%; bottom: calc(var(--sg-space-7) + var(--sg-space-4)); transform: translateX(-50%); z-index: var(--sg-z-toast); max-width: min(92vw, 420px);
  background: var(--sg-elevated); color: var(--sg-text); border: 1px solid var(--sg-border); border-left: 4px solid var(--sg-info); border-radius: var(--sg-radius-m);
  box-shadow: var(--sg-shadow-2); padding: var(--sg-space-3) var(--sg-space-4); }
.sg-toast--error { border-left-color: var(--sg-danger); }
.sg-toast--success { border-left-color: var(--sg-success); }

/* ===== 10. Reduced motion: no animation or transition ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .sg-skeleton { background: var(--sg-surface-2); }
  .sg-card--link:hover, .sg-metric--link:hover, .sg-media--link:hover, .sg-btn--primary:hover { transform: none; }
}

/* Responsive visibility helpers */
.sg-only-phone { display: none !important; }
@media (max-width: 760px) { .sg-only-phone { display: inline-flex !important; } .sg-only-desktop { display: none !important; } }

/* Horizontal media card (next scheduled post): image left on tablet and desktop, stacked on the phone */
.sg-media--row { flex-direction: row; }
.sg-media--row > .sg-media__frame { width: 40%; flex: none; }
@media (max-width: 760px) { .sg-media--row { flex-direction: column; } .sg-media--row > .sg-media__frame { width: 100%; } }
.sg-inspector[hidden], .sg-chat[hidden], .sg-bottomnav[hidden], .sg-rail[hidden] { display: none; }

/* ===== 11. Mission Control: evidence state, command bar, segmented and command select, mission hero, mission metric, agency pulse, Maya cockpit ===== */
/* Evidence state: a dot and the word, for live verified, pending, in progress, scheduled, historical, stale, unavailable, failed.
   The dot shape and the border style are the second cue, so state is never colour alone. Use data-state on .sg-state. */
.sg-state { display: inline-flex; align-items: center; gap: var(--sg-space-2); padding: 2px var(--sg-space-3) 2px var(--sg-space-2); border-radius: var(--sg-radius-pill); border: 1px solid currentColor; background: var(--sg-surface); color: var(--sg-text-muted);
  font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); line-height: 1.4; letter-spacing: 0.04em; white-space: nowrap; }
.sg-state::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; background: currentColor; }
.sg-state[data-state="live"] { color: var(--sg-state-live); background: var(--sg-state-live-soft); }
.sg-state[data-state="pending"] { color: var(--sg-state-pending); background: var(--sg-state-pending-soft); }
.sg-state[data-state="pending"]::before { background: transparent; }
.sg-state[data-state="progress"] { color: var(--sg-state-progress); background: var(--sg-state-progress-soft); }
.sg-state[data-state="progress"]::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.sg-state[data-state="scheduled"] { color: var(--sg-state-scheduled); background: var(--sg-state-scheduled-soft); }
.sg-state[data-state="scheduled"]::before { border-radius: 1px; transform: rotate(45deg); }
.sg-state[data-state="historical"] { color: var(--sg-state-historical); background: var(--sg-state-historical-soft); }
.sg-state[data-state="historical"]::before { border-radius: 1px; background: transparent; }
.sg-state[data-state="stale"] { color: var(--sg-state-stale); background: var(--sg-state-stale-soft); border-style: dashed; }
.sg-state[data-state="stale"]::before { background: transparent; border-style: dashed; }
.sg-state[data-state="unavailable"] { color: var(--sg-state-unavailable); background: var(--sg-state-unavailable-soft); border-style: dotted; }
.sg-state[data-state="unavailable"]::before { background: transparent; border-style: dotted; }
.sg-state[data-state="failed"] { color: var(--sg-state-failed); background: var(--sg-state-failed-soft); }
.sg-state[data-state="failed"]::before { border-radius: 1px; }

/* Top navigation: compact horizontal links inside the top bar (identity, Home, Creative Studio, Performance, Intelligence, Meetings, Muse Conversations, Operations). Strong active state. */
.sg-topnav { display: flex; flex: 0 1 auto; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sg-topnav::-webkit-scrollbar { display: none; }
.sg-topbar__title { flex: none; }
@media (max-width: 1279px) { .sg-topnav a { padding: 0 var(--sg-space-2); } }
.sg-topnav a { display: inline-flex; align-items: center; min-height: var(--sg-tap); padding: 0 var(--sg-space-3); border-radius: var(--sg-radius-m); color: var(--sg-text-muted); text-decoration: none; font: var(--sg-fw-semibold) var(--sg-fs-s) var(--sg-font-body); white-space: nowrap; transition: background var(--sg-dur) var(--sg-ease), color var(--sg-dur) var(--sg-ease); }
.sg-topnav a:hover { color: var(--sg-text); background: var(--sg-surface-2); }
.sg-topnav a[aria-current="page"] { color: var(--sg-text); background: var(--sg-accent-soft); box-shadow: inset 0 -2px 0 var(--sg-live), 0 0 16px -8px var(--sg-glow); }

/* Command bar: report date, publishing week, data freshness, agency connection, time period, refresh, reviewer. Glass, one hairline between items. */
.sg-command-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sg-space-3) var(--sg-space-4); padding: var(--sg-space-3) var(--sg-space-4); background: var(--sg-glass); border: 1px solid var(--sg-border-lit); border-radius: var(--sg-radius-l);
  box-shadow: var(--sg-shadow-soft); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); color: var(--sg-text); }
.sg-command-bar--sticky { position: sticky; top: var(--sg-topbar-h); z-index: var(--sg-z-sticky); }
.sg-command-bar__item { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: var(--sg-space-4); border-right: 1px solid var(--sg-border); }
.sg-command-bar__item:last-child { border-right: 0; padding-right: 0; }
.sg-command-bar__label { font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); letter-spacing: var(--sg-tracking-label); text-transform: uppercase; color: var(--sg-gold-text); }
.sg-command-bar__value { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-2); min-height: var(--sg-tap); font: var(--sg-fw-semibold) var(--sg-fs-s) var(--sg-font-body); color: var(--sg-text); }
.sg-command-bar__spacer { flex: 1 1 auto; }
@media (max-width: 760px) {
  .sg-command-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sg-space-3); padding: var(--sg-space-3); }
  .sg-command-bar__item { padding-right: 0; border-right: 0; }
  .sg-command-bar__wide, .sg-command-bar__item:has(.sg-select--command) { grid-column: 1 / -1; }
  .sg-command-bar .sg-select--command { width: 100%; }
  .sg-command-bar__spacer { display: none; }
  .sg-command-bar--sticky { position: static; }
}

/* Segmented selector (time period): one choice from a few. Use buttons with aria-pressed. An option with no real data behind it is disabled and says why. */
.sg-segmented { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 3px; border: 1px solid var(--sg-border-strong); border-radius: var(--sg-radius-m); background: var(--sg-bg); }
.sg-segmented__item { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; min-height: calc(var(--sg-tap) - 8px); padding: 0 var(--sg-space-3); border: 0; border-radius: var(--sg-radius-s); background: transparent; color: var(--sg-text-muted);
  font: var(--sg-fw-semibold) var(--sg-fs-s) var(--sg-font-body); white-space: nowrap; cursor: pointer; transition: background var(--sg-dur) var(--sg-ease), color var(--sg-dur) var(--sg-ease), box-shadow var(--sg-dur) var(--sg-ease); }
.sg-segmented__item:hover { color: var(--sg-text); background: var(--sg-surface-2); }
.sg-segmented__item[aria-pressed="true"], .sg-segmented__item[aria-checked="true"], .sg-segmented__item[aria-current="true"] { background: var(--sg-accent-soft); color: var(--sg-text); box-shadow: inset 0 0 0 1px var(--sg-live), 0 0 16px -6px var(--sg-glow); }
.sg-segmented__item:disabled, .sg-segmented__item[aria-disabled="true"] { background: transparent; color: var(--sg-text-muted); cursor: not-allowed; text-decoration: underline dotted; text-underline-offset: 3px; box-shadow: none; }

/* Command select: a compact dropdown for the week and report date, same height as the controls beside it */
.sg-select--command { appearance: none; -webkit-appearance: none; width: auto; min-width: 0; max-width: 100%; padding: 0 34px 0 var(--sg-space-3); background-color: var(--sg-bg); color: var(--sg-text); font: var(--sg-fw-semibold) var(--sg-fs-s) var(--sg-font-body); border-radius: var(--sg-radius-m); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--sg-text-muted) 50%), linear-gradient(135deg, var(--sg-text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.sg-select--command:hover { border-color: var(--sg-live); }
.sg-select--command option, .sg-select--command optgroup { background: var(--sg-surface); color: var(--sg-text); }
.sg-command-bar .sg-btn { min-height: var(--sg-tap); }

/* Mission hero: the business objective, three outcomes with a verified target only when one exists, Maya's reading, ranked next moves, one primary action */
.sg-mission { position: relative; overflow: hidden; display: grid; gap: var(--sg-space-5); padding: var(--sg-space-6); border-radius: var(--sg-radius-xl); border: 1px solid var(--sg-border-lit); color: var(--sg-text);
  background: radial-gradient(80% 110% at 100% 0%, var(--sg-glow), transparent 60%), radial-gradient(60% 80% at 0% 100%, var(--sg-glow-gold), transparent 62%), linear-gradient(165deg, var(--sg-surface-2), var(--sg-bg)); box-shadow: var(--sg-shadow-lift); }
.sg-mission::before { content: ""; position: absolute; left: var(--sg-space-6); right: var(--sg-space-6); top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--sg-live), transparent); }
.sg-mission__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sg-space-3); }
.sg-mission__objective { margin: 0 0 var(--sg-space-2); font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-2xl); line-height: var(--sg-lh-snug); color: var(--sg-text); max-width: 30ch; }
.sg-mission__context { margin: 0; max-width: var(--sg-measure); color: var(--sg-text-muted); }
.sg-mission__outcomes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sg-space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.sg-mission__outcome { display: flex; flex-direction: column; gap: var(--sg-space-1); min-width: 0; padding: var(--sg-space-4); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-l); background: var(--sg-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sg-mission__outcome-label { font: var(--sg-fw-semibold) var(--sg-fs-s) var(--sg-font-body); line-height: var(--sg-lh-snug); color: var(--sg-text-muted); }
.sg-mission__outcome-value { margin: 0; font-family: var(--sg-font-display); font-size: var(--sg-fs-3xl); line-height: var(--sg-lh-tight); font-variant-numeric: tabular-nums; color: var(--sg-text); overflow-wrap: anywhere; }
.sg-mission__outcome-value--null { font-size: var(--sg-fs-xl); color: var(--sg-text-muted); }
.sg-mission__outcome-source { margin: 0; font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-mission__progress { display: block; height: 6px; margin-top: var(--sg-space-1); border-radius: var(--sg-radius-pill); background: var(--sg-neutral-soft); overflow: hidden; }
.sg-mission__progress::before { content: ""; display: block; height: 100%; width: var(--sg-pct, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--sg-live), var(--sg-pulse)); box-shadow: 0 0 12px var(--sg-glow); }
.sg-mission__progress-note { margin: 0; font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-mission__read { display: flex; gap: var(--sg-space-3); align-items: flex-start; padding: var(--sg-space-4); border-radius: 0 var(--sg-radius-m) var(--sg-radius-m) 0; border-left: 3px solid var(--sg-live); background: color-mix(in srgb, var(--sg-live) 9%, transparent); }
.sg-mission__read p { margin: 0; font-size: var(--sg-fs-l); line-height: var(--sg-lh-body); }
.sg-mission__moves { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sg-space-2); counter-reset: sg-move; }
.sg-mission__move { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--sg-space-3); align-items: center; padding: var(--sg-space-3) var(--sg-space-4); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-m); background: var(--sg-surface); counter-increment: sg-move; }
.sg-mission__move::before { content: counter(sg-move); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--sg-gold); color: var(--sg-gold-text); font: var(--sg-fw-bold) var(--sg-fs-s) var(--sg-font-body); }
.sg-mission__move-title { margin: 0; font-weight: var(--sg-fw-semibold); line-height: var(--sg-lh-snug); }
.sg-mission__move-why { margin: 2px 0 0; font-size: var(--sg-fs-s); color: var(--sg-text-muted); }
.sg-mission__actions { display: flex; flex-wrap: wrap; gap: var(--sg-space-2); }
@media (max-width: 760px) {
  .sg-mission { padding: var(--sg-space-5) var(--sg-space-4); border-radius: var(--sg-radius-l); }
  .sg-mission::before { left: var(--sg-space-4); right: var(--sg-space-4); }
  .sg-mission__move { grid-template-columns: 28px minmax(0, 1fr); }
  .sg-mission__move > :last-child { grid-column: 1 / -1; }
  .sg-mission__actions .sg-btn { flex: 1 1 140px; }
}

/* Mission metric: a metric tile with a lit top edge, a live-blue trend and an explain affordance. Same anatomy as .sg-metric. */
.sg-metric--mission { position: relative; overflow: hidden; background: var(--sg-glass); border-color: var(--sg-border-lit); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sg-metric--mission::before { content: ""; position: absolute; left: var(--sg-space-4); right: var(--sg-space-4); top: 0; height: 2px; border-radius: 0 0 var(--sg-radius-s) var(--sg-radius-s); background: linear-gradient(90deg, var(--sg-live), transparent); }
.sg-metric--mission .sg-metric__value { font-size: var(--sg-fs-display); }
.sg-metric--mission .sg-metric__value--null { font-size: var(--sg-fs-xl); }
.sg-metric--mission .sg-metric__spark, .sg-metric--mission .sg-spark { color: var(--sg-live); }
.sg-metric__explain { display: inline-flex; align-items: center; gap: var(--sg-space-1); font: var(--sg-fw-semibold) var(--sg-fs-xs) var(--sg-font-body); color: var(--sg-link); }
.sg-metric__explain::after { content: "\2192"; }

/* Agency pulse: the source-backed event list. The dot rings out ONCE when a real change is observed (set data-fresh="true", clear it on the next change);
   a static "New" marker (.sg-pulse__new) carries the same message when motion is reduced. No polling and no model call lives in this component. */
.sg-pulse { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sg-pulse__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sg-space-2); margin: 0 0 var(--sg-space-3); }
.sg-pulse__live { display: inline-flex; align-items: center; gap: var(--sg-space-2); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-pulse__live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sg-live); box-shadow: 0 0 10px var(--sg-glow); }
.sg-pulse__item { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: var(--sg-space-3); padding-bottom: var(--sg-space-4); }
.sg-pulse__item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--sg-border); }
.sg-pulse__item:last-child { padding-bottom: 0; }
.sg-pulse__item:last-child::before { display: none; }
.sg-pulse__dot { position: relative; justify-self: center; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; color: var(--sg-state-live); background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.sg-pulse__dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; pointer-events: none; }
.sg-pulse__item[data-fresh="true"] .sg-pulse__dot::after { animation: sg-pulse-once 1.4s var(--sg-ease) 1 both; }
@keyframes sg-pulse-once { from { transform: scale(0.8); opacity: 0.9; } to { transform: scale(3); opacity: 0; } }
.sg-pulse__item[data-state="live"] .sg-pulse__dot { color: var(--sg-state-live); }
.sg-pulse__item[data-state="pending"] .sg-pulse__dot { color: var(--sg-state-pending); }
.sg-pulse__item[data-state="progress"] .sg-pulse__dot { color: var(--sg-state-progress); }
.sg-pulse__item[data-state="scheduled"] .sg-pulse__dot { color: var(--sg-state-scheduled); }
.sg-pulse__item[data-state="historical"] .sg-pulse__dot { color: var(--sg-state-historical); }
.sg-pulse__item[data-state="stale"] .sg-pulse__dot { color: var(--sg-state-stale); }
.sg-pulse__item[data-state="unavailable"] .sg-pulse__dot { color: var(--sg-state-unavailable); background: transparent; border: 2px dotted currentColor; box-shadow: none; }
.sg-pulse__item[data-state="failed"] .sg-pulse__dot { color: var(--sg-state-failed); border-radius: 2px; }
.sg-pulse__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg-pulse__title { margin: 0; font-weight: var(--sg-fw-semibold); font-size: var(--sg-fs-m); line-height: var(--sg-lh-snug); }
.sg-pulse__meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-1) var(--sg-space-2); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
.sg-pulse__new { display: none; padding: 0 var(--sg-space-2); border-radius: var(--sg-radius-pill); background: var(--sg-accent-soft); border: 1px solid var(--sg-live); color: var(--sg-text); font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); letter-spacing: 0.04em; }
.sg-pulse__item[data-fresh="true"] .sg-pulse__new { display: inline-flex; }

/* Maya cockpit: the intelligence panel beside the workspace (about 35 percent). Identity and real availability, current assessment, recent verified
   activity, suggested questions, four quick actions, the composer and the way to the full Muse workspace. Never show a simulated answer as live. */
.sg-cockpit { display: flex; flex-direction: column; gap: var(--sg-space-4); min-height: 100%; padding: var(--sg-space-5) var(--sg-space-4) var(--sg-space-4); background: var(--sg-glass); color: var(--sg-text); }
.sg-cockpit__head { display: flex; align-items: center; gap: var(--sg-space-3); }
.sg-cockpit__who { min-width: 0; display: flex; flex-direction: column; gap: var(--sg-space-1); align-items: flex-start; }
.sg-cockpit__name { margin: 0; font-family: var(--sg-font-display); font-weight: var(--sg-fw-regular); font-size: var(--sg-fs-xl); line-height: var(--sg-lh-tight); }
.sg-cockpit__assessment { position: relative; padding: var(--sg-space-4); border: 1px solid var(--sg-border-lit); border-radius: var(--sg-radius-l); background: var(--sg-surface); box-shadow: var(--sg-shadow-soft); }
.sg-cockpit__assessment p { margin: 0; font-size: var(--sg-fs-l); line-height: var(--sg-lh-body); }
.sg-cockpit__section { display: flex; flex-direction: column; gap: var(--sg-space-2); padding-top: var(--sg-space-3); border-top: 1px solid var(--sg-border); }
.sg-cockpit__label { margin: 0; font: var(--sg-fw-bold) var(--sg-fs-xs) var(--sg-font-body); letter-spacing: var(--sg-tracking-label); text-transform: uppercase; color: var(--sg-gold-text); }
.sg-cockpit__asks { display: flex; flex-wrap: wrap; gap: var(--sg-space-2); }
.sg-cockpit__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sg-space-2); }
.sg-cockpit__actions .sg-btn { padding: 0 var(--sg-space-3); font-size: var(--sg-fs-s); }
.sg-cockpit__composer { position: sticky; bottom: 0; margin-top: auto; display: flex; flex-direction: column; gap: var(--sg-space-2); padding: var(--sg-space-3); border: 1px solid var(--sg-border-lit); border-radius: var(--sg-radius-l); background: var(--sg-surface); box-shadow: var(--sg-shadow-soft); }
.sg-cockpit__row { display: flex; align-items: flex-end; gap: var(--sg-space-2); }
.sg-cockpit__row .sg-textarea { min-height: var(--sg-tap); height: var(--sg-tap); resize: none; background: var(--sg-bg); }
.sg-cockpit__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sg-space-2); font-size: var(--sg-fs-xs); color: var(--sg-text-muted); }
@media (max-width: 420px) { .sg-cockpit__actions { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  .sg-pulse__item[data-fresh="true"] .sg-pulse__dot::after { animation: none; opacity: 0; }
  .sg-segmented__item { transition: none; }
}
