/* =============================================================================
 * JVK Capital — Apple Human Interface Guidelines design tokens + components
 *
 * Loaded once from the page <head>. All admin (Command Center) and investor
 * (portal) surfaces share these primitives so the product feels coherent.
 *
 * Principles: Clarity · Deference · Depth.
 * Source of truth for every metric: tabular numerals, semantic colors, hairline
 * separators (not drop shadows), continuous corners, materials over fills.
 * ============================================================================= */

:root {
  /* — Typography ——————————————————————————————————————————————— */
  --hig-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
              "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --hig-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* iOS / macOS type scale (rem from 16px base) */
  --hig-large-title: 2.125rem;   /* 34 */
  --hig-title-1: 1.75rem;        /* 28 */
  --hig-title-2: 1.375rem;       /* 22 */
  --hig-title-3: 1.25rem;        /* 20 */
  --hig-headline: 1.0625rem;     /* 17 semibold */
  --hig-body: 1.0625rem;         /* 17 */
  --hig-callout: 1rem;           /* 16 */
  --hig-subhead: 0.9375rem;      /* 15 */
  --hig-footnote: 0.8125rem;     /* 13 */
  --hig-caption: 0.75rem;        /* 12 */
  --hig-caption-2: 0.6875rem;    /* 11 */

  --hig-tracking-tight: -0.01em;
  --hig-tracking-default: 0;
  --hig-tracking-wide: 0.02em;

  /* — 8-pt spacing scale ——————————————————————————————————————— */
  --hig-s-0: 2px;
  --hig-s-1: 4px;
  --hig-s-2: 8px;
  --hig-s-3: 12px;
  --hig-s-4: 16px;
  --hig-s-5: 24px;
  --hig-s-6: 32px;
  --hig-s-7: 48px;
  --hig-s-8: 64px;

  /* — Radii (continuous corners) —————————————————————————————— */
  --hig-r-control: 10px;
  --hig-r-card: 16px;
  --hig-r-sheet: 20px;
  --hig-r-pill: 999px;

  /* — Motion ————————————————————————————————————————————————— */
  --hig-ease-standard: cubic-bezier(.4, 0, .2, 1);
  --hig-ease-emphasized: cubic-bezier(.2, 0, 0, 1);
  --hig-dur-fast: 120ms;
  --hig-dur: 220ms;
  --hig-dur-slow: 320ms;

  /* — Elevation (uses background layering, not heavy shadows) ——— */
  --hig-shadow-sheet: 0 24px 48px -16px rgba(0, 0, 0, .55),
                      0 4px 12px -2px rgba(0, 0, 0, .35);

  /* — Status semantic colors (used sparingly as accents, never fills) — */
  --hig-green: #34c759;
  --hig-green-soft: rgba(52, 199, 89, .14);
  --hig-blue: #0a84ff;
  --hig-blue-soft: rgba(10, 132, 255, .16);
  --hig-yellow: #ffd60a;
  --hig-yellow-soft: rgba(255, 214, 10, .16);
  --hig-orange: #ff9f0a;
  --hig-orange-soft: rgba(255, 159, 10, .16);
  --hig-red: #ff453a;
  --hig-red-soft: rgba(255, 69, 58, .14);
  --hig-purple: #bf5af2;
  --hig-purple-soft: rgba(191, 90, 242, .16);

  /* Returns / P&L (only use these two for monetary deltas) */
  --hig-up: var(--hig-green);
  --hig-down: var(--hig-red);
}

/* — Dark mode (default to match the existing chrome) ——————————— */
:root,
:root[data-theme="dark"] {
  --hig-bg: #09090b;
  --hig-bg-elevated: #111114;
  --hig-bg-grouped: #1a1a1d;
  --hig-bg-tertiary: #232327;
  --hig-separator: rgba(255, 255, 255, .08);
  --hig-separator-strong: rgba(255, 255, 255, .14);
  --hig-label: #fafafa;
  --hig-label-secondary: rgba(235, 235, 245, .60);
  --hig-label-tertiary: rgba(235, 235, 245, .30);
  --hig-fill-thin: rgba(255, 255, 255, .04);
  --hig-fill: rgba(255, 255, 255, .08);
  --hig-fill-strong: rgba(255, 255, 255, .14);
  --hig-material-thin: rgba(20, 20, 22, .55);
  --hig-material-regular: rgba(20, 20, 22, .72);
  --hig-material-thick: rgba(20, 20, 22, .88);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --hig-bg: #f5f5f7;
    --hig-bg-elevated: #ffffff;
    --hig-bg-grouped: #f2f2f7;
    --hig-bg-tertiary: #e5e5ea;
    --hig-separator: rgba(60, 60, 67, .12);
    --hig-separator-strong: rgba(60, 60, 67, .24);
    --hig-label: #1d1d1f;
    --hig-label-secondary: rgba(60, 60, 67, .60);
    --hig-label-tertiary: rgba(60, 60, 67, .30);
    --hig-fill-thin: rgba(0, 0, 0, .03);
    --hig-fill: rgba(0, 0, 0, .06);
    --hig-fill-strong: rgba(0, 0, 0, .10);
    --hig-material-thin: rgba(255, 255, 255, .55);
    --hig-material-regular: rgba(255, 255, 255, .72);
    --hig-material-thick: rgba(255, 255, 255, .88);
  }
}

/* — Universal niceties ——————————————————————————————————————— */
.hig {
  font-family: var(--hig-font);
  color: var(--hig-label);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hig-num,
.hig-card .hig-kpi-value,
.hig-card td,
.hig-list td {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

/* — Typography helpers ——————————————————————————————————————— */
.hig-text-large-title { font-size: var(--hig-large-title); font-weight: 700; letter-spacing: var(--hig-tracking-tight); line-height: 1.2; }
.hig-text-title-1     { font-size: var(--hig-title-1);     font-weight: 600; letter-spacing: var(--hig-tracking-tight); line-height: 1.25; }
.hig-text-title-2     { font-size: var(--hig-title-2);     font-weight: 600; line-height: 1.3; }
.hig-text-title-3     { font-size: var(--hig-title-3);     font-weight: 600; line-height: 1.35; }
.hig-text-headline    { font-size: var(--hig-headline);    font-weight: 600; line-height: 1.4; }
.hig-text-body        { font-size: var(--hig-body);        font-weight: 400; line-height: 1.45; }
.hig-text-callout     { font-size: var(--hig-callout);     font-weight: 400; line-height: 1.4; }
.hig-text-subhead     { font-size: var(--hig-subhead);     font-weight: 400; line-height: 1.4; color: var(--hig-label-secondary); }
.hig-text-footnote    { font-size: var(--hig-footnote);    font-weight: 400; line-height: 1.35; color: var(--hig-label-secondary); }
.hig-text-caption     { font-size: var(--hig-caption);     font-weight: 400; line-height: 1.3; color: var(--hig-label-tertiary); text-transform: uppercase; letter-spacing: var(--hig-tracking-wide); }

/* — Materials (vibrancy) ————————————————————————————————————— */
.hig-material-thin {
  background: var(--hig-material-thin);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.hig-material-regular {
  background: var(--hig-material-regular);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
}
.hig-material-thick {
  background: var(--hig-material-thick);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
}

/* — Cards & lists ———————————————————————————————————————————— */
.hig-card {
  background: var(--hig-bg-elevated);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-card);
  padding: var(--hig-s-5);
  color: var(--hig-label);
}
.hig-card + .hig-card { margin-top: var(--hig-s-4); }
.hig-card.is-grouped { padding: 0; overflow: hidden; }
.hig-card.is-padless { padding: 0; }
.hig-card-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--hig-s-3);
  margin-bottom: var(--hig-s-4);
}
.hig-card-title h3 {
  margin: 0;
  font-size: var(--hig-headline);
  font-weight: 600;
  letter-spacing: var(--hig-tracking-tight);
}
.hig-card-title .hig-text-footnote { margin: 0; }

/* KPI tile (used in Fund Pulse rail) */
.hig-kpi {
  display: flex; flex-direction: column; gap: var(--hig-s-2);
  padding: var(--hig-s-4) var(--hig-s-5);
  min-width: 184px;
  flex: 1 1 184px;
  border-right: 1px solid var(--hig-separator);
}
.hig-kpi:last-child { border-right: 0; }
.hig-kpi-label { font-size: var(--hig-caption); font-weight: 600; color: var(--hig-label-tertiary); text-transform: uppercase; letter-spacing: var(--hig-tracking-wide); }
.hig-kpi-value { font-size: var(--hig-title-1); font-weight: 600; letter-spacing: var(--hig-tracking-tight); color: var(--hig-label); line-height: 1.1; }
.hig-kpi-sub   { font-size: var(--hig-footnote); color: var(--hig-label-secondary); display: flex; align-items: center; gap: var(--hig-s-1); }
.hig-kpi-sub.is-up   { color: var(--hig-up); }
.hig-kpi-sub.is-down { color: var(--hig-down); }

/* Inset grouped list (Agent Operating Status, Sheet Map) */
.hig-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hig-list > li, .hig-list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--hig-s-3);
  padding: var(--hig-s-3) var(--hig-s-5);
  min-height: 56px;
  border-top: 1px solid var(--hig-separator);
  transition: background-color var(--hig-dur-fast) var(--hig-ease-standard);
}
.hig-list > li:first-child, .hig-list-row:first-child { border-top: 0; }
.hig-list > li.is-tappable, .hig-list-row.is-tappable { cursor: pointer; }
.hig-list > li.is-tappable:hover, .hig-list-row.is-tappable:hover { background: var(--hig-fill-thin); }
.hig-list-leading { width: 28px; height: 28px; display: grid; place-items: center; color: var(--hig-label-secondary); }
.hig-list-body { min-width: 0; }
.hig-list-title { font-size: var(--hig-headline); font-weight: 600; color: var(--hig-label); margin: 0; }
.hig-list-subtitle { font-size: var(--hig-footnote); color: var(--hig-label-secondary); margin: 2px 0 0; }
.hig-list-trailing { display: flex; align-items: center; gap: var(--hig-s-3); color: var(--hig-label-tertiary); }
.hig-list-chevron { width: 12px; height: 12px; opacity: .5; }

/* — Status pill ———————————————————————————————————————————— */
.hig-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--hig-r-pill);
  font-size: var(--hig-caption);
  font-weight: 600;
  letter-spacing: var(--hig-tracking-wide);
  text-transform: uppercase;
  background: var(--hig-fill);
  color: var(--hig-label-secondary);
  white-space: nowrap;
}
.hig-status-pill::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.hig-status-pill.is-healthy  { background: var(--hig-green-soft);  color: var(--hig-green); }
.hig-status-pill.is-running  { background: var(--hig-blue-soft);   color: var(--hig-blue); }
.hig-status-pill.is-stale    { background: var(--hig-yellow-soft); color: var(--hig-yellow); }
.hig-status-pill.is-degraded { background: var(--hig-orange-soft); color: var(--hig-orange); }
.hig-status-pill.is-fail     { background: var(--hig-red-soft);    color: var(--hig-red); }
.hig-status-pill.is-disabled { background: var(--hig-fill);        color: var(--hig-label-tertiary); }

/* Soft "drift" badge for sheet round-trip warnings */
.hig-drift-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: var(--hig-r-pill);
  font-size: var(--hig-caption-2);
  font-weight: 600;
  background: var(--hig-yellow-soft);
  color: var(--hig-yellow);
}

/* — Segmented control ———————————————————————————————————————— */
.hig-segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--hig-fill);
  border-radius: var(--hig-r-control);
  gap: 0;
}
.hig-segmented button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--hig-label-secondary);
  font: inherit;
  font-size: var(--hig-subhead);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--hig-dur-fast) var(--hig-ease-standard),
              color var(--hig-dur-fast) var(--hig-ease-standard);
  min-height: 30px;
}
.hig-segmented button[aria-selected="true"],
.hig-segmented button.is-active {
  background: var(--hig-bg-elevated);
  color: var(--hig-label);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15), 0 0 0 1px var(--hig-separator);
}
.hig-segmented button:focus-visible {
  outline: 2px solid var(--hig-blue);
  outline-offset: 2px;
}

/* — Buttons ————————————————————————————————————————————————— */
.hig-button {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--hig-s-2);
  min-height: 36px;
  padding: 0 var(--hig-s-4);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-control);
  background: var(--hig-fill);
  color: var(--hig-label);
  font: 600 var(--hig-subhead)/1 var(--hig-font);
  cursor: pointer;
  transition: background-color var(--hig-dur-fast) var(--hig-ease-standard),
              transform var(--hig-dur-fast) var(--hig-ease-standard);
}
.hig-button:hover { background: var(--hig-fill-strong); }
.hig-button:active { transform: scale(.98); }
.hig-button.is-primary { background: var(--hig-blue); color: #fff; border-color: transparent; }
.hig-button.is-primary:hover { background: #2891ff; }
.hig-button.is-ghost { background: transparent; }
.hig-button.is-danger { color: var(--hig-red); }
.hig-button:disabled { opacity: .4; cursor: not-allowed; }
.hig-button:focus-visible { outline: 2px solid var(--hig-blue); outline-offset: 2px; }

/* Icon-only round button (Run Now in agent rows) */
.hig-icon-button {
  width: 32px; height: 32px;
  border-radius: var(--hig-r-pill);
  display: grid; place-items: center;
  background: var(--hig-fill);
  color: var(--hig-label-secondary);
  border: 0;
  cursor: pointer;
  transition: background-color var(--hig-dur-fast) var(--hig-ease-standard);
}
.hig-icon-button:hover { background: var(--hig-fill-strong); color: var(--hig-label); }
.hig-icon-button:focus-visible { outline: 2px solid var(--hig-blue); outline-offset: 2px; }

/* — Form controls ———————————————————————————————————————————— */
.hig-field {
  display: flex; flex-direction: column; gap: 6px;
}
.hig-field-label {
  font-size: var(--hig-footnote);
  font-weight: 600;
  color: var(--hig-label-secondary);
}
.hig-input, .hig-textarea, .hig-select {
  appearance: none;
  font: 400 var(--hig-body)/1.4 var(--hig-font);
  color: var(--hig-label);
  background: var(--hig-bg-grouped);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-control);
  padding: 10px 12px;
  width: 100%;
  min-height: 38px;
  transition: border-color var(--hig-dur-fast) var(--hig-ease-standard);
}
.hig-textarea { min-height: 120px; resize: vertical; font: 400 var(--hig-subhead)/1.5 var(--hig-font); }
.hig-input:focus, .hig-textarea:focus, .hig-select:focus {
  outline: 0;
  border-color: var(--hig-blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .25);
}

/* Toggle switch */
.hig-switch {
  --w: 44px;
  --h: 26px;
  position: relative;
  width: var(--w);
  height: var(--h);
  display: inline-block;
  flex: 0 0 var(--w);
}
.hig-switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; margin: 0; }
.hig-switch-track {
  position: absolute; inset: 0;
  background: var(--hig-fill-strong);
  border-radius: var(--hig-r-pill);
  transition: background-color var(--hig-dur) var(--hig-ease-standard);
}
.hig-switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: calc(var(--h) - 4px);
  height: calc(var(--h) - 4px);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  transition: transform var(--hig-dur) var(--hig-ease-standard);
}
.hig-switch input:checked ~ .hig-switch-track { background: var(--hig-green); }
.hig-switch input:checked ~ .hig-switch-thumb { transform: translateX(calc(var(--w) - var(--h))); }
.hig-switch input:focus-visible ~ .hig-switch-track { box-shadow: 0 0 0 3px rgba(10, 132, 255, .35); }

/* Tag chip */
.hig-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  background: var(--hig-fill);
  color: var(--hig-label-secondary);
  border-radius: var(--hig-r-pill);
  font-size: var(--hig-caption);
  font-weight: 500;
}
.hig-chip.is-ticker { font-family: var(--hig-font-mono); letter-spacing: .03em; color: var(--hig-label); background: var(--hig-blue-soft); }

/* — Modal sheet (Schedule Editor) —————————————————————————————
 * CRITICAL: The default state is `<div class="hig-sheet-backdrop" hidden>`,
 * but `.hig-sheet-backdrop` sets `display: grid` with higher specificity than
 * the UA `[hidden] { display: none }` rule. Without the explicit override
 * below the backdrop ALWAYS renders fullscreen + transparent + z-index 9000,
 * capturing every click on the Command Center and making the page feel
 * frozen. Don't remove the [hidden] rule. */
.hig-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  display: grid;
  place-items: center;
  z-index: 9000;
  opacity: 0;
  transition: opacity var(--hig-dur) var(--hig-ease-standard);
}
.hig-sheet-backdrop[hidden] { display: none !important; }
.hig-sheet-backdrop.is-open { opacity: 1; }
.hig-sheet {
  background: var(--hig-bg-elevated);
  border-radius: var(--hig-r-sheet);
  border: 1px solid var(--hig-separator);
  box-shadow: var(--hig-shadow-sheet);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(.98);
  transition: transform var(--hig-dur) var(--hig-ease-emphasized);
}
.hig-sheet-backdrop.is-open .hig-sheet { transform: translateY(0) scale(1); }
.hig-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--hig-s-4) var(--hig-s-5);
  border-bottom: 1px solid var(--hig-separator);
}
.hig-sheet-header h2 { margin: 0; font-size: var(--hig-headline); font-weight: 600; }
.hig-sheet-body { padding: var(--hig-s-5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--hig-s-4); }
.hig-sheet-footer {
  display: flex; gap: var(--hig-s-2); justify-content: flex-end;
  padding: var(--hig-s-3) var(--hig-s-5);
  border-top: 1px solid var(--hig-separator);
  background: var(--hig-bg-grouped);
}

/* — Inspector column (Quick Capture) ————————————————————————— */
.hig-inspector {
  display: flex; flex-direction: column; gap: var(--hig-s-4);
}

/* — Section helper (for sidebar auto-hide) ——————————————————— */
.hig-section { display: block; }
.hig-section[hidden] { display: none !important; }

/* — Toast ————————————————————————————————————————————————————— */
.hig-toast-host {
  position: fixed; bottom: var(--hig-s-5); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: var(--hig-s-2);
  z-index: 9500; pointer-events: none;
}
.hig-toast {
  background: var(--hig-material-thick);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
  color: var(--hig-label);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-control);
  padding: 10px 14px;
  font-size: var(--hig-subhead);
  font-weight: 500;
  box-shadow: var(--hig-shadow-sheet);
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--hig-s-2);
  animation: hig-toast-in var(--hig-dur) var(--hig-ease-emphasized);
}
.hig-toast.is-success { border-color: var(--hig-green-soft); }
.hig-toast.is-fail    { border-color: var(--hig-red-soft); }

@keyframes hig-toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* — Focus ————————————————————————————————————————————————————— */
:focus-visible {
  outline-color: var(--hig-blue);
}

/* — Inline links ————————————————————————————————————————————— */
.hig-text-link {
  color: var(--hig-blue);
  text-decoration: none;
  font-weight: 500;
}
.hig-text-link:hover { text-decoration: underline; }

/* — Reduced motion ——————————————————————————————————————————— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* — Touch ————————————————————————————————————————————————————— */
@media (pointer: coarse) {
  .hig-button, .hig-icon-button, .hig-list > li.is-tappable, .hig-segmented button {
    min-height: 44px;
  }
}

/* =============================================================================
 * Drill-down panels (Decision Log, Daily Briefing)
 *
 * Both surfaces share the .empire-dashboard host (so they inherit the same
 * flex+scroll behaviour as Command Center) and add a `.cc-drilldown` body
 * with HIG-compliant filters, lists, and a server-rendered briefing area.
 * ============================================================================= */
.cc-drilldown .cc-drilldown-body {
  display: flex;
  flex-direction: column;
  gap: var(--hig-s-3);
  padding: 0;
}
.cc-drilldown-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--hig-s-3);
  padding: var(--hig-s-3);
  background: var(--hig-bg-grouped);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-control);
}
.cc-drilldown-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--hig-label-secondary);
  font-size: var(--hig-footnote);
  min-width: 140px;
}
.cc-drilldown-filters .hig-input {
  min-width: 140px;
}
.cc-drilldown-list {
  background: var(--hig-bg-grouped);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-control);
  overflow: hidden;
}
.cc-drilldown-list .hig-list { background: transparent; border: 0; }
.cc-drilldown-list .hig-text-footnote { padding: var(--hig-s-3); }
.cc-decision-row {
  display: grid;
  grid-template-columns: 110px 64px 1fr 88px;
  gap: var(--hig-s-3);
  align-items: center;
  padding: var(--hig-s-3);
  border-top: 1px solid var(--hig-separator);
}
.cc-decision-row:first-child { border-top: 0; }
.cc-decision-row .ticker { font-weight: 600; font-variant-numeric: tabular-nums; }
.cc-decision-row .action {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--hig-fill-tertiary); color: var(--hig-label-secondary);
}
.cc-decision-row .action.is-BUY,
.cc-decision-row .action.is-ADD { background: var(--hig-green-soft); color: var(--hig-green); }
.cc-decision-row .action.is-SELL,
.cc-decision-row .action.is-TRIM { background: var(--hig-red-soft); color: var(--hig-red); }
.cc-decision-row .reason { color: var(--hig-label-primary); font-size: var(--hig-footnote); }
.cc-decision-row .at { color: var(--hig-label-secondary); font-size: var(--hig-footnote); text-align: right; }
@media (max-width: 600px) {
  .cc-decision-row { grid-template-columns: 80px 56px 1fr; }
  .cc-decision-row .at { grid-column: 1 / -1; text-align: left; }
}

.cc-briefing-render {
  background: var(--hig-bg-grouped);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-control);
  padding: var(--hig-s-4);
}
.cc-briefing-render h1, .cc-briefing-render h2, .cc-briefing-render h3 {
  margin: var(--hig-s-3) 0 var(--hig-s-2);
  font-family: var(--hig-font);
}
.cc-briefing-render h1 { font-size: var(--hig-title-1); }
.cc-briefing-render h2 { font-size: var(--hig-title-2, var(--hig-headline)); }
.cc-briefing-render p, .cc-briefing-render li { font-size: var(--hig-body); line-height: 1.5; }
.cc-briefing-render code, .cc-briefing-render pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--hig-fill-tertiary);
  border-radius: 6px;
  padding: 2px 6px;
}
.cc-briefing-render pre { padding: var(--hig-s-3); overflow-x: auto; white-space: pre-wrap; }

/* =============================================================================
 * Daily Briefing card grid (Bloomberg density, HIG primitives)
 *
 * Severity-tinted 3px left border (info=blue, warn=yellow, urgent=red).
 * Tabular numerals on numbers, monospace SF Mono only for ticker chips.
 * ============================================================================= */
.cc-briefing-cards {
  display: grid;
  gap: var(--hig-s-3);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.cc-briefing-card {
  background: var(--hig-bg);
  border: 1px solid var(--hig-separator);
  border-left: 3px solid var(--hig-blue);
  border-radius: var(--hig-r-control);
  padding: var(--hig-s-3) var(--hig-s-4);
  min-width: 0;
}
.cc-briefing-card.cc-sev-warn   { border-left-color: var(--hig-yellow); }
.cc-briefing-card.cc-sev-urgent { border-left-color: var(--hig-red); }
.cc-briefing-card.cc-sev-info   { border-left-color: var(--hig-blue); }
.cc-briefing-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--hig-s-2);
  margin-bottom: var(--hig-s-2);
}
.cc-briefing-card-head h3 {
  margin: 0;
  font-size: var(--hig-headline);
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex; align-items: baseline; gap: var(--hig-s-2);
}
.cc-briefing-card-head .cc-card-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 6px;
  border-radius: 999px;
  background: var(--hig-fill);
  color: var(--hig-label-secondary);
  font-size: 11px; font-weight: 600;
}
.cc-sev-warn .cc-card-count   { background: var(--hig-yellow-soft); color: var(--hig-yellow); }
.cc-sev-urgent .cc-card-count { background: var(--hig-red-soft);    color: var(--hig-red); }
.cc-sev-info .cc-card-count   { background: var(--hig-blue-soft);   color: var(--hig-blue); }
.cc-briefing-card-body {
  color: var(--hig-label-primary);
  font-size: var(--hig-body);
  line-height: 1.55;
}
.cc-briefing-card-body p { margin: 0 0 var(--hig-s-2); }
.cc-briefing-card-body p:last-child { margin-bottom: 0; }
.cc-briefing-card-body ul { margin: 0; padding-left: 18px; }
.cc-briefing-card-body li { margin: 4px 0; font-variant-numeric: tabular-nums; }
.cc-briefing-card-body li ul { margin-top: 4px; }
.cc-briefing-card-body li ul li {
  color: var(--hig-label-secondary);
  font-size: var(--hig-subhead);
}
.cc-briefing-card-body code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--hig-fill-tertiary);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.cc-briefing-card-body strong { font-weight: 600; }
.cc-briefing-card-body a { color: var(--hig-blue); text-decoration: none; }
.cc-briefing-card-body a:hover { text-decoration: underline; }

/* =============================================================================
 * Run-now visible feedback — spinner glyph + persistent toast.
 *
 * The legacy 2s `toast()` was easy to miss; we use a longer-lived top-right
 * stack for "agent done in 1.2s" confirmations and a CSS-only spinner that
 * any button can adopt by toggling `.is-running` + `aria-busy="true"`.
 * ============================================================================= */
.is-running::before {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  animation: jvk-spin 0.8s linear infinite;
  opacity: 0.85;
}
@keyframes jvk-spin { to { transform: rotate(360deg); } }
.is-running { cursor: progress !important; opacity: 0.9; }

.cmdk-toast-host {
  position: fixed;
  top: calc(58px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  z-index: 9600;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}
.cmdk-toast {
  pointer-events: auto;
  background: var(--hig-bg);
  color: var(--hig-label-primary);
  border: 1px solid var(--hig-separator);
  border-left: 3px solid var(--hig-blue);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 10px 12px;
  font-family: var(--hig-font);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition: opacity .25s ease, transform .25s ease;
  font-variant-numeric: tabular-nums;
}
.cmdk-toast-success { border-left-color: var(--hig-green, #34c759); }
.cmdk-toast-fail    { border-left-color: var(--hig-red,   #ff3b30); }

/* =============================================================================
 * Command palette trigger pill — discoverable, non-blocking, top-right.
 * ============================================================================= */
.cmdk-trigger {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  z-index: 55;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--hig-bg-grouped);
  color: var(--hig-label-secondary);
  border: 1px solid var(--hig-separator);
  font-family: var(--hig-font);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.10);
  transition: background .15s ease, color .15s ease, transform .12s ease;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.cmdk-trigger:hover {
  color: var(--hig-label-primary);
  background: var(--hig-fill);
  transform: translateY(-1px);
}
.cmdk-trigger kbd {
  padding: 1px 5px; border-radius: 4px;
  background: var(--hig-fill); color: var(--hig-label-tertiary);
  font-family: var(--hig-font); font-size: 10px; font-weight: 600;
}
@media (max-width: 640px) {
  .cmdk-trigger span { display: none; }
  .cmdk-trigger kbd { display: none; }
  .cmdk-trigger { padding: 8px; }
}
/* Investor mode hides the palette trigger — investors don't have routes to
 * most of the palette's destinations, so the affordance would confuse. */
body.pb-investor-mode .cmdk-trigger,
body.pb-investor-mode .cmdk-dialog { display: none !important; }

/* =============================================================================
 * Command palette (⌘K) — single bar that searches/jumps everywhere
 *
 * Apple HIG vibrancy/blur backdrop, Linear/Raycast interaction model.
 * Keyboard-first; ↑↓ to move, ⏎ to invoke, Esc to close.
 * ============================================================================= */
.cmdk-dialog {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  border: 0; padding: 0; margin: 0;
  background: transparent; color: inherit;
}
/* Belt-and-braces: closed <dialog> must never paint a transparent overlay
 * that intercepts clicks on the surface behind it. UA stylesheets already
 * say `dialog:not([open]) { display: none }`, but author rules above can
 * accidentally override; we restate it explicitly to be safe. */
.cmdk-dialog:not([open]) { display: none !important; }
.cmdk-dialog::backdrop {
  background: rgba(15, 17, 21, 0.45);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}
.cmdk-form {
  position: absolute;
  top: calc(10vh + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  max-height: 70vh;
  display: flex; flex-direction: column;
  background: var(--hig-bg);
  border: 1px solid var(--hig-separator);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.18);
  overflow: hidden;
  font-family: var(--hig-font);
}
@media (prefers-color-scheme: dark) {
  .cmdk-form { background: rgba(40,40,45,0.98); }
}
.cmdk-input-wrap {
  display: flex; align-items: center; gap: var(--hig-s-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--hig-separator);
}
.cmdk-glyph { color: var(--hig-label-secondary); flex-shrink: 0; }
.cmdk-input {
  flex: 1 1 auto; min-width: 0;
  background: transparent; border: 0; outline: 0;
  font-size: 17px; line-height: 1.2;
  color: var(--hig-label-primary);
  font-family: var(--hig-font);
  padding: 6px 0;
  caret-color: var(--hig-blue);
}
.cmdk-input::placeholder { color: var(--hig-label-tertiary); }
.cmdk-input::-webkit-search-cancel-button { display: none; }
.cmdk-esc {
  font-family: var(--hig-font); font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  background: var(--hig-fill); color: var(--hig-label-tertiary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.cmdk-results {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 4px 6px;
}
.cmdk-empty {
  padding: var(--hig-s-5) var(--hig-s-4);
  text-align: center;
  color: var(--hig-label-tertiary);
  font-size: var(--hig-subhead);
}
.cmdk-group { padding: 4px 0; }
.cmdk-group-head {
  padding: 8px 16px 4px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--hig-label-tertiary); font-weight: 600;
}
.cmdk-group-list { list-style: none; margin: 0; padding: 0; }
.cmdk-row {
  display: flex; align-items: center; gap: var(--hig-s-2);
  padding: 8px 12px;
  margin: 0 6px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 0;
}
.cmdk-row.is-active {
  background: var(--hig-fill);
}
.cmdk-row-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--hig-fill);
  color: var(--hig-label-secondary);
  flex-shrink: 0;
}
.cmdk-row.is-active .cmdk-row-glyph {
  background: var(--hig-blue-soft);
  color: var(--hig-blue);
}
.cmdk-row-text {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column;
}
.cmdk-row-title {
  font-size: 14px; font-weight: 500;
  color: var(--hig-label-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.cmdk-row-sub {
  font-size: 12px;
  color: var(--hig-label-tertiary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmdk-badge {
  display: inline-flex; align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--hig-fill); color: var(--hig-label-tertiary);
}
.cmdk-row-kbd { color: var(--hig-label-tertiary); opacity: 0; }
.cmdk-row.is-active .cmdk-row-kbd { opacity: 1; }
.cmdk-footer {
  display: flex; gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--hig-separator);
  background: var(--hig-bg-grouped);
  font-size: 11px; color: var(--hig-label-tertiary);
}
.cmdk-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  margin: 0 2px;
  border-radius: 3px;
  background: var(--hig-fill);
  font-family: var(--hig-font);
  font-size: 10px;
  color: var(--hig-label-secondary);
}

/* =============================================================================
 * Shared HIG shell for standalone /decisions and /briefing URLs
 *
 * When the user lands on the URL directly (deep-link, share-link), wrap the
 * server-rendered body in a sticky brand bar + Close-to-Home button so the
 * page never feels orphaned. Matches the inline drill-down language.
 * ============================================================================= */
.hig-page-shell {
  min-height: 100vh;
  background: var(--hig-bg-grouped);
  color: var(--hig-label-primary);
  font-family: var(--hig-font);
  display: flex;
  flex-direction: column;
}
/* Brand bar — the page-shell chrome around server-rendered admin views.
 *
 * The rest of the codebase ships dark-by-default via :root tokens (line ~84
 * of this file), so the brand bar must also be dark-by-default. Previously
 * it defaulted to a light material and only flipped on `prefers-color-scheme:
 * dark`, which produced near-invisible text on light-mode systems whose
 * inherited `--hig-label` was still white. Now we use the same token-driven
 * dark surface as the rest of the page, with explicit text colors so we
 * don't depend on any inherited value. */
.hig-brand-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--hig-s-3);
  padding: var(--hig-s-3) var(--hig-s-4);
  background: var(--hig-material-thick);
  color: var(--hig-label);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--hig-separator);
  font-feature-settings: "ss01", "ss02";
}
.hig-brand-bar .brand {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--hig-headline);
  color: var(--hig-label);
  letter-spacing: var(--hig-tracking-tight);
  min-width: 0;
}
.hig-brand-bar .brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hig-blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
  flex-shrink: 0;
}
.hig-brand-bar .brand-product {
  font-weight: 600;
  color: var(--hig-label);
  white-space: nowrap;
}
.hig-brand-bar .brand-sep {
  color: var(--hig-label-tertiary);
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
}
.hig-brand-bar .brand-page {
  font-weight: 500;
  color: var(--hig-label-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Ghost-button "Back" — a macOS-Sonoma squircle chip with crisp contrast. */
.hig-brand-bar .hig-button.is-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--hig-fill);
  color: var(--hig-label);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-pill);
  font: 500 var(--hig-footnote)/1 var(--hig-font);
  text-decoration: none;
  transition: background var(--hig-dur) var(--hig-ease-standard),
              border-color var(--hig-dur) var(--hig-ease-standard);
}
.hig-brand-bar .hig-button.is-ghost:hover { background: var(--hig-fill-strong); border-color: var(--hig-separator-strong); }
.hig-brand-bar .hig-button.is-ghost:active { transform: translateY(0.5px); }
.hig-page-body {
  flex: 1 1 auto; min-height: 0;
  padding: var(--hig-s-5) var(--hig-s-4) calc(var(--hig-s-6) + env(safe-area-inset-bottom));
  max-width: 1200px; width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* =============================================================================
 * Stock Card v2 (sc2-*) — PLTR-grade ticker research surface
 *
 * Sibling of the legacy .sc-* namespace; the two are intentionally orthogonal
 * so the old card can keep rendering while the v2 page rolls out.
 *
 * Principles applied:
 *  - Hairline separators over drop shadows (Apple HIG "deference").
 *  - Semantic colour is reserved for verdicts/scenarios; everything else
 *    speaks in neutral fills so the data is the loudest thing on screen.
 *  - Tabular numerals for every metric / monetary value.
 *  - All charts inherit `currentColor` and CSS vars → dark/light agnostic.
 * ============================================================================= */

/* — Scenario palette (used by SVG charts + scenario cards) ——————————— */
:root {
  --sc2-bull: #30d158;        /* slightly cooler/cleaner than #34c759 — better on dark */
  --sc2-bull-soft: rgba(48, 209, 88, .18);
  --sc2-bull-glow: rgba(48, 209, 88, .35);
  --sc2-base: #0a84ff;
  --sc2-base-soft: rgba(10, 132, 255, .18);
  --sc2-base-glow: rgba(10, 132, 255, .35);
  --sc2-bear: #ff453a;
  --sc2-bear-soft: rgba(255, 69, 58, .18);
  --sc2-bear-glow: rgba(255, 69, 58, .35);
  --sc2-claim-pos: rgba(48, 209, 88, .10);
  --sc2-claim-neg: rgba(255, 69, 58, .10);
  --sc2-claim-mixed: rgba(255, 214, 10, .10);
  --sc2-claim-neutral: rgba(235, 235, 245, .06);
  --sc2-edit-underline: rgba(10, 132, 255, .55);

  /* Premium materials — subtle 2-stop gradients used across cards/tiles */
  --sc2-card-grad: linear-gradient(180deg, rgba(255,255,255,.025) 0%, rgba(255,255,255,0) 60%);
  --sc2-card-edge: 0 0 0 1px var(--hig-separator) inset,
                   0 1px 0 0 rgba(255,255,255,.04) inset;
  --sc2-card-hover: 0 0 0 1px var(--hig-separator-strong) inset,
                    0 1px 0 0 rgba(255,255,255,.06) inset;
  --sc2-page-bg: radial-gradient(ellipse 80% 40% at 50% -10%,
                  rgba(10, 132, 255, .04) 0%, transparent 60%);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --sc2-card-grad: linear-gradient(180deg, rgba(255,255,255,.6) 0%, rgba(255,255,255,0) 60%);
    --sc2-card-edge: 0 0 0 1px var(--hig-separator) inset,
                     0 1px 0 0 rgba(255,255,255,.5) inset;
    --sc2-page-bg: radial-gradient(ellipse 80% 40% at 50% -10%,
                    rgba(10, 132, 255, .05) 0%, transparent 60%);
  }
}

.sc2-page {
  display: block;
  font: var(--hig-body) var(--hig-font);
  color: var(--hig-label);
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 0 var(--hig-s-7);
  font-variant-numeric: tabular-nums;
  background: var(--sc2-page-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle fade-in cascade on first load — premium without being theatrical.
 * Disabled for prefers-reduced-motion users. */
@media (prefers-reduced-motion: no-preference) {
  .sc2-section, .sc2-header {
    animation: sc2-fade-up 480ms var(--hig-ease-emphasized) both;
  }
  .sc2-header { animation-delay: 0ms; }
  .sc2-section:nth-of-type(1)  { animation-delay: 40ms; }
  .sc2-section:nth-of-type(2)  { animation-delay: 80ms; }
  .sc2-section:nth-of-type(3)  { animation-delay: 120ms; }
  .sc2-section:nth-of-type(4)  { animation-delay: 160ms; }
  .sc2-section:nth-of-type(5)  { animation-delay: 200ms; }
  .sc2-section:nth-of-type(n+6){ animation-delay: 240ms; }
}
@keyframes sc2-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.sc2-hidden { display: none !important; }
.sc2-muted  { color: var(--hig-label-tertiary); font-style: italic; }
.sc2-moat-h {
  display: block;
  font-size: var(--hig-caption-2);
  text-transform: uppercase;
  letter-spacing: var(--hig-tracking-wide);
  color: var(--hig-label-tertiary);
  margin-bottom: 2px;
}

/* — Section frame ————————————————————————————————————— */
.sc2-section {
  margin: var(--hig-s-7) 0 0;
  padding-top: 0;
}
.sc2-section:first-of-type { margin-top: var(--hig-s-4); }
.sc2-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--hig-s-3);
  margin-bottom: var(--hig-s-4);
  padding-bottom: 2px;
}
.sc2-section-head h2 {
  font: 600 var(--hig-title-3)/1.1 var(--hig-font);
  letter-spacing: var(--hig-tracking-tight);
  margin: 0;
  color: var(--hig-label);
  display: inline-flex; align-items: baseline; gap: var(--hig-s-2);
}
.sc2-section-head h2::before {
  content: "";
  display: inline-block;
  width: 3px; height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--hig-blue) 0%, rgba(10,132,255,.45) 100%);
  transform: translateY(2px);
}
.sc2-section-head summary,
summary.sc2-section-head { list-style: none; cursor: pointer; }
.sc2-section-head summary::-webkit-details-marker,
summary.sc2-section-head::-webkit-details-marker { display: none; }
.sc2-reseed {
  appearance: none; background: var(--hig-fill); color: var(--hig-label-secondary);
  border: 1px solid var(--hig-separator); border-radius: var(--hig-r-pill);
  font: 500 var(--hig-footnote)/1 var(--hig-font);
  width: 26px; height: 26px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--hig-dur) var(--hig-ease-standard),
              color var(--hig-dur) var(--hig-ease-standard),
              transform var(--hig-dur) var(--hig-ease-standard);
}
.sc2-reseed:hover { background: var(--hig-fill-strong); color: var(--hig-label); transform: rotate(60deg); }
.sc2-reseed[disabled] { opacity: .5; cursor: progress; transform: none; }

/* — Card containers ———————————————————————————————————— */
.sc2-card {
  background: var(--hig-bg-elevated) var(--sc2-card-grad);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-card);
  padding: var(--hig-s-4);
  box-shadow: var(--sc2-card-edge);
  transition: box-shadow var(--hig-dur) var(--hig-ease-standard);
}

/* — Header ————————————————————————————————————————— */
.sc2-header {
  padding: var(--hig-s-5) 0 var(--hig-s-5);
  border-bottom: 1px solid var(--hig-separator);
  margin-bottom: var(--hig-s-4);
  position: relative;
}
/* Subtle glow under the header — a Sonoma-style accent without weight */
.sc2-header::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
              transparent 0%,
              var(--hig-separator-strong) 50%,
              transparent 100%);
  pointer-events: none;
}
.sc2-header-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--hig-s-5); flex-wrap: wrap;
}
.sc2-header-id { display: flex; align-items: baseline; gap: var(--hig-s-3); flex-wrap: wrap; min-width: 0; }
.sc2-ticker {
  font: 700 2.625rem/1 var(--hig-font);    /* 42px display number */
  letter-spacing: -0.035em;                /* tighter for premium feel */
  margin: 0;
  color: var(--hig-label);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
.sc2-name {
  color: var(--hig-label-secondary);
  font: 500 var(--hig-subhead)/1.1 var(--hig-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sc2-header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sc2-price {
  display: inline-flex; align-items: baseline; gap: 8px;
  font: 600 1.625rem/1 var(--hig-font);   /* 26px */
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.sc2-price-num { color: var(--hig-label); }
.sc2-chg-up, .sc2-chg-down {
  display: inline-flex; align-items: center; gap: 2px;
  font: 600 var(--hig-footnote)/1 var(--hig-font);
  padding: 3px 8px; border-radius: var(--hig-r-pill);
  letter-spacing: 0;
}
.sc2-chg-up   { color: var(--hig-up);   background: var(--sc2-bull-soft); }
.sc2-chg-down { color: var(--hig-down); background: var(--sc2-bear-soft); }
.sc2-chg-up::before  { content: "▲"; font-size: 9px; opacity: .85; }
.sc2-chg-down::before{ content: "▼"; font-size: 9px; opacity: .85; }

.sc2-save-indicator {
  font-size: var(--hig-caption-2); color: var(--hig-label-tertiary);
  letter-spacing: 0.04em;
  opacity: .5;
  transition: opacity var(--hig-dur) var(--hig-ease-standard),
              color var(--hig-dur) var(--hig-ease-standard);
}
.sc2-save-indicator.is-saving { color: var(--hig-blue); opacity: 1; }
.sc2-save-indicator.is-error  { color: var(--hig-red);  opacity: 1; }
.sc2-save-indicator.is-saved  { opacity: .7; }

.sc2-header-chips {
  display: flex; align-items: center; gap: var(--hig-s-2); flex-wrap: wrap;
  margin-top: var(--hig-s-3);
}
.sc2-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: var(--hig-r-pill);
  font: 500 var(--hig-footnote)/1 var(--hig-font);
  letter-spacing: 0.01em;
  background: var(--hig-fill);
  color: var(--hig-label-secondary);
  border: 1px solid var(--hig-separator);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.sc2-chip-conv-5 { background: var(--sc2-bull-soft); color: var(--sc2-bull); border-color: rgba(48, 209, 88, .35); }
.sc2-chip-conv-4 { background: var(--sc2-base-soft); color: var(--sc2-base); border-color: rgba(10, 132, 255, .35); }
.sc2-chip-conv-3 { color: var(--hig-label); }
.sc2-chip-weight { background: var(--hig-fill-strong); color: var(--hig-label); font-variant-numeric: tabular-nums; }
.sc2-chip-kill   {
  background: var(--hig-red-soft); color: var(--hig-red);
  border-color: rgba(255, 69, 58, .45);
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.sc2-chip-tone-bullish    { background: var(--sc2-bull-soft); color: var(--sc2-bull); }
.sc2-chip-tone-cautious   { background: var(--hig-yellow-soft); color: var(--hig-yellow); }
.sc2-chip-tone-defensive  { background: var(--hig-orange-soft); color: var(--hig-orange); }
.sc2-chip-tone-neutral    { background: var(--hig-fill); color: var(--hig-label-secondary); }
.sc2-meta-line {
  color: var(--hig-label-tertiary);
  font: 500 var(--hig-caption-2)/1 var(--hig-font-mono);
  letter-spacing: 0.02em;
  margin-left: 2px;
}

/* — Editable affordance ——————————————————————————————— */
.sc2-editable {
  border-radius: 5px;
  padding: 2px 4px;
  margin: 0 -4px;
  outline: none;
  display: inline-block;
  min-width: 16px;
  transition: background var(--hig-dur) var(--hig-ease-standard),
              box-shadow var(--hig-dur) var(--hig-ease-standard);
  box-shadow: inset 0 0 0 1px transparent;
}
.sc2-editable:hover    { background: var(--hig-fill-thin); box-shadow: inset 0 0 0 1px var(--hig-separator); }
.sc2-editable:focus    { background: var(--hig-bg-elevated); box-shadow: inset 0 0 0 2px var(--sc2-edit-underline); }
.sc2-editable-empty    { color: var(--hig-label-tertiary); font-style: italic; }
.sc2-editable-numeric  { font-variant-numeric: tabular-nums; }
div.sc2-editable { display: block; padding: var(--hig-s-3) var(--hig-s-4); margin: 0; }

/* — Thesis ————————————————————————————————————————— */
.sc2-section-thesis div.sc2-editable {
  font: 500 var(--hig-headline)/1.65 var(--hig-font);
  background: var(--hig-bg-elevated) var(--sc2-card-grad);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-card);
  padding: var(--hig-s-5);
  color: var(--hig-label);
  box-shadow: var(--sc2-card-edge);
  letter-spacing: 0.005em;
}
.sc2-section-thesis div.sc2-editable:focus { box-shadow: var(--sc2-card-edge), inset 0 0 0 2px var(--sc2-edit-underline); }

/* — SVG-chart wrapper card ——————————————————————————— */
.sc2-svg-chart { width: 100%; height: auto; display: block; }
.sc2-chart-wrap {
  background: var(--hig-bg-elevated) var(--sc2-card-grad);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-card);
  padding: var(--hig-s-5);
  box-shadow: var(--sc2-card-edge);
}

/* — Valuation flow SVG ————————————————————————————— */
.sc2-flow-svg { color: var(--hig-label); }
.sc2-flow-rect {
  fill: var(--hig-bg-grouped);
  stroke: var(--hig-separator);
  stroke-width: 1;
}
.sc2-flow-rect-soft { fill: var(--hig-fill-thin); }
.sc2-flow-rect-emph { fill: url(#sc2-flow-emph-grad); stroke: var(--hig-separator-strong); stroke-width: 1.25; }
.sc2-flow-big   { font: 700 26px/1 var(--hig-font); fill: var(--hig-label); font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.sc2-flow-label { font: 600 10px/1 var(--hig-font); fill: var(--hig-label-tertiary); letter-spacing: 0.1em; text-transform: uppercase; }
.sc2-flow-op    { font: 200 32px/1 var(--hig-font); fill: var(--hig-label-tertiary); }
.sc2-flow-hairline { stroke: var(--hig-separator); stroke-width: 1; }
.sc2-flow-multval { font: 700 22px/1 var(--hig-font); fill: var(--hig-label); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sc2-flow-mlabel  { font: 600 10px/1 var(--hig-font); fill: var(--hig-label-tertiary); letter-spacing: 0.1em; text-transform: uppercase; }

/* — Key-metric tiles ———————————————————————————————— */
.sc2-tile-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--hig-s-3);
}
@media (max-width: 900px) { .sc2-tile-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .sc2-tile-grid { grid-template-columns: repeat(2, 1fr); } }
.sc2-tile {
  background: var(--hig-bg-elevated) var(--sc2-card-grad);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-card);
  padding: var(--hig-s-3) var(--hig-s-4);
  box-shadow: var(--sc2-card-edge);
  transition: box-shadow var(--hig-dur) var(--hig-ease-standard),
              transform var(--hig-dur) var(--hig-ease-standard);
  position: relative; overflow: hidden;
}
.sc2-tile:hover { box-shadow: var(--sc2-card-hover); transform: translateY(-1px); }
.sc2-tile-label {
  font: 600 var(--hig-caption-2)/1 var(--hig-font);
  color: var(--hig-label-tertiary);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.sc2-tile-value {
  font: 700 1.375rem/1.1 var(--hig-font);    /* 22px */
  margin-top: 8px;
  color: var(--hig-label);
  font-variant-numeric: tabular-nums; letter-spacing: -0.025em;
}
.sc2-tile-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 6px;
  font: 400 var(--hig-caption)/1.2 var(--hig-font);
  color: var(--hig-label-secondary);
}
.sc2-spark { color: var(--hig-blue); flex-shrink: 0; opacity: .85; }
.sc2-spark-empty { display: none; }

/* — Peer comp ———————————————————————————————————— */
.sc2-peer-svg { color: var(--hig-label); }
.sc2-peer-bar { fill: url(#sc2-peer-bar-grad); }
.sc2-peer-bar-us { fill: url(#sc2-peer-bar-grad-us); }
.sc2-peer-tk    { font: 600 12px/1 var(--hig-font-mono); fill: var(--hig-label-secondary); letter-spacing: 0.02em; }
.sc2-peer-tk-us { fill: var(--hig-blue); font-weight: 700; }
.sc2-peer-val   { font: 600 12px/1 var(--hig-font); fill: var(--hig-label-secondary); font-variant-numeric: tabular-nums; }
.sc2-peer-median { stroke: var(--hig-label-tertiary); stroke-width: 1; opacity: .7; }
.sc2-peer-median-lbl { font: 600 9px/1 var(--hig-font); fill: var(--hig-label-tertiary); letter-spacing: 0.12em; }
.sc2-peer-prem-prem { fill: var(--hig-red-soft); stroke: rgba(255,69,58,.4); stroke-width: 1; }
.sc2-peer-prem-disc { fill: var(--sc2-bull-soft); stroke: rgba(48,209,88,.4); stroke-width: 1; }
.sc2-peer-prem-lbl  { font: 700 11px/1 var(--hig-font); fill: var(--hig-label); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }

/* — Moat ————————————————————————————————————————— */
.sc2-moat-row {
  display: grid; grid-template-columns: 180px 1fr; gap: var(--hig-s-4);
  padding: var(--hig-s-4) 0;
  border-bottom: 1px solid var(--hig-separator);
}
.sc2-moat-row:last-of-type { border-bottom: none; padding-bottom: 0; }
.sc2-moat-row:first-of-type { padding-top: 0; }
.sc2-moat-k {
  font: 600 var(--hig-caption-2)/1.3 var(--hig-font);
  color: var(--hig-label-tertiary);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.sc2-moat-v { font: 400 var(--hig-callout)/1.55 var(--hig-font); color: var(--hig-label); }
.sc2-moat-peers { margin-top: var(--hig-s-4); padding-top: var(--hig-s-4); border-top: 1px solid var(--hig-separator); }
.sc2-list { list-style: none; padding: 0; margin: 4px 0 0; }
.sc2-moat-peer { padding: 6px 0; font-size: var(--hig-subhead); line-height: 1.5; }
.sc2-moat-peer-tk   {
  font: 600 var(--hig-caption)/1 var(--hig-font-mono);
  color: var(--hig-blue);
  background: var(--hig-blue-soft);
  padding: 3px 7px; border-radius: 5px;
  margin-right: 8px;
  letter-spacing: 0.02em;
}
.sc2-moat-peer-name { font-weight: 600; color: var(--hig-label); }
.sc2-moat-peer-why  { color: var(--hig-label-secondary); }

/* — Scenarios ————————————————————————————————————— */
.sc2-scenarios-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--hig-s-3);
}
@media (max-width: 760px) { .sc2-scenarios-grid { grid-template-columns: 1fr; } }
.sc2-scenario-card {
  position: relative;
  background: var(--hig-bg-elevated) var(--sc2-card-grad);
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-card);
  padding: var(--hig-s-5) var(--hig-s-4) var(--hig-s-4);
  box-shadow: var(--sc2-card-edge);
  overflow: hidden;
  transition: box-shadow var(--hig-dur) var(--hig-ease-standard),
              transform var(--hig-dur) var(--hig-ease-standard);
}
.sc2-scenario-card:hover { transform: translateY(-1px); box-shadow: var(--sc2-card-hover); }
/* Top accent: 3px gradient bar instead of solid — softens the visual weight */
.sc2-scenario-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent 0%, currentColor 12%, currentColor 88%, transparent 100%);
}
.sc2-scenario-bull { color: var(--sc2-bull); }
.sc2-scenario-base { color: var(--sc2-base); }
.sc2-scenario-bear { color: var(--sc2-bear); }
.sc2-scenario-card > * { color: var(--hig-label); }   /* keep body content neutral */

.sc2-scenario-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--hig-s-2); }
.sc2-scenario-tag  {
  font: 700 var(--hig-caption-2)/1 var(--hig-font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sc2-scenario-bull .sc2-scenario-tag { color: var(--sc2-bull); }
.sc2-scenario-base .sc2-scenario-tag { color: var(--sc2-base); }
.sc2-scenario-bear .sc2-scenario-tag { color: var(--sc2-bear); }
.sc2-scenario-ret  {
  font: 700 var(--hig-title-3)/1 var(--hig-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.sc2-ret-up   { color: var(--hig-up); }
.sc2-ret-down { color: var(--hig-down); }
.sc2-scenario-tgt {
  display: flex; align-items: baseline; gap: 8px;
  font: 700 1.875rem/1 var(--hig-font);     /* 30px display */
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  margin-bottom: var(--hig-s-3);
}
.sc2-scenario-horizon {
  font: 500 var(--hig-caption-2)/1 var(--hig-font);
  color: var(--hig-label-tertiary);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.sc2-scenario-headline  {
  font: 600 var(--hig-callout)/1.4 var(--hig-font);
  letter-spacing: -0.005em;
  margin-bottom: var(--hig-s-2);
}
.sc2-scenario-narrative {
  font: 400 var(--hig-subhead)/1.6 var(--hig-font);
  color: var(--hig-label-secondary);
  margin-bottom: var(--hig-s-3);
}
.sc2-scenario-mult {
  font: 400 var(--hig-caption)/1.5 var(--hig-font);
  color: var(--hig-label-tertiary);
  padding-top: var(--hig-s-2);
  border-top: 1px solid var(--hig-separator);
}
.sc2-scenario-mult b {
  display: block;
  font: 700 var(--hig-caption-2)/1 var(--hig-font);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--hig-label-tertiary);
  margin-bottom: 4px;
}

/* — Scenario projection chart ——————————————————————— */
.sc2-proj-svg { color: var(--hig-label); }
.sc2-proj-grid     { stroke: var(--hig-separator); stroke-width: 1; }
.sc2-proj-axis     { font: 500 10px/1 var(--hig-font-mono); fill: var(--hig-label-tertiary); letter-spacing: 0.02em; }
.sc2-proj-today    { stroke: var(--hig-label-tertiary); stroke-width: 1; stroke-dasharray: 2 4; opacity: .6; }
.sc2-proj-today-lbl{ font: 700 10px/1 var(--hig-font); fill: var(--hig-label-tertiary); letter-spacing: 0.16em; }
.sc2-proj-hist-fill{ fill: url(#sc2-proj-hist-grad); opacity: .6; }
.sc2-proj-hist     { stroke: var(--hig-label); stroke-width: 1.4; fill: none; opacity: .9; }
.sc2-proj-fwd      { stroke-width: 2.25; stroke-linecap: round; fill: none; }
.sc2-proj-bull     { stroke: var(--sc2-bull); filter: drop-shadow(0 0 6px var(--sc2-bull-glow)); }
.sc2-proj-base     { stroke: var(--sc2-base); filter: drop-shadow(0 0 6px var(--sc2-base-glow)); }
.sc2-proj-bear     { stroke: var(--sc2-bear); filter: drop-shadow(0 0 6px var(--sc2-bear-glow)); }
.sc2-proj-tgt      { font: 700 12px/1 var(--hig-font); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.sc2-proj-bull-lbl { fill: var(--sc2-bull); }
.sc2-proj-base-lbl { fill: var(--sc2-base); }
.sc2-proj-bear-lbl { fill: var(--sc2-bear); }
.sc2-proj-legend-bg{ fill: var(--hig-bg-elevated); stroke: var(--hig-separator); stroke-width: 1; }
.sc2-proj-legend-lbl { font: 600 11px/1 var(--hig-font); fill: var(--hig-label-secondary); letter-spacing: 0.02em; }
.sc2-proj-bull-dot { fill: var(--sc2-bull); }
.sc2-proj-base-dot { fill: var(--sc2-base); }
.sc2-proj-bear-dot { fill: var(--sc2-bear); }
.sc2-proj-tgt-dot  { stroke-width: 2; }
.sc2-proj-tgt-dot.sc2-proj-bull-dot { stroke: var(--hig-bg-elevated); }
.sc2-proj-tgt-dot.sc2-proj-base-dot { stroke: var(--hig-bg-elevated); }
.sc2-proj-tgt-dot.sc2-proj-bear-dot { stroke: var(--hig-bg-elevated); }

/* — Signal nodes & claims ——————————————————————————— */
.sc2-case-block { margin-top: var(--hig-s-3); }
.sc2-case-summary {
  display: flex; align-items: center; gap: var(--hig-s-3); cursor: pointer;
  padding: 10px var(--hig-s-3);
  border-radius: var(--hig-r-control);
  background: var(--hig-fill-thin);
  border: 1px solid transparent;
  list-style: none;
  transition: background var(--hig-dur) var(--hig-ease-standard),
              border-color var(--hig-dur) var(--hig-ease-standard);
}
.sc2-case-summary:hover { background: var(--hig-fill); border-color: var(--hig-separator); }
.sc2-case-summary::-webkit-details-marker { display: none; }
.sc2-case-summary::before {
  content: "›"; color: var(--hig-label-tertiary);
  font: 500 18px/1 var(--hig-font); width: 12px;
  transition: transform var(--hig-dur) var(--hig-ease-standard);
}
.sc2-case-block[open] > .sc2-case-summary::before { transform: rotate(90deg); display: inline-block; }
.sc2-case-label {
  font: 700 var(--hig-subhead)/1 var(--hig-font);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.sc2-case-block-bull .sc2-case-label { color: var(--sc2-bull); }
.sc2-case-block-base .sc2-case-label { color: var(--sc2-base); }
.sc2-case-block-bear .sc2-case-label { color: var(--sc2-bear); }
.sc2-case-count { color: var(--hig-label-tertiary); font: 500 var(--hig-footnote)/1 var(--hig-font-mono); }
.sc2-nodes { padding: var(--hig-s-3) 0 0 var(--hig-s-4); }
.sc2-node {
  margin: var(--hig-s-2) 0;
  border: 1px solid var(--hig-separator);
  border-radius: var(--hig-r-control);
  background: var(--hig-bg-elevated) var(--sc2-card-grad);
  box-shadow: var(--sc2-card-edge);
  overflow: hidden;
}
.sc2-node-summary {
  display: flex; align-items: center; gap: var(--hig-s-2); cursor: pointer;
  padding: var(--hig-s-3) var(--hig-s-4); list-style: none; flex-wrap: wrap;
  transition: background var(--hig-dur) var(--hig-ease-standard);
}
.sc2-node-summary:hover { background: var(--hig-fill-thin); }
.sc2-node-summary::-webkit-details-marker { display: none; }
.sc2-node-name { font: 600 var(--hig-callout)/1.2 var(--hig-font); flex: 1; min-width: 0; }
.sc2-tag-direction, .sc2-tag-role, .sc2-claim-tag {
  display: inline-flex; padding: 3px 9px; border-radius: var(--hig-r-pill);
  font: 600 var(--hig-caption-2)/1 var(--hig-font);
  text-transform: lowercase; letter-spacing: 0.02em;
  background: var(--hig-fill); color: var(--hig-label-secondary);
  border: 1px solid var(--hig-separator);
}
.sc2-dir-strong-pos  { background: var(--sc2-bull-soft); color: var(--sc2-bull); border-color: rgba(52, 199, 89, .35); }
.sc2-dir-pos         { background: var(--sc2-bull-soft); color: var(--sc2-bull); }
.sc2-dir-mixed       { background: var(--hig-yellow-soft); color: var(--hig-yellow); }
.sc2-dir-neg         { background: var(--sc2-bear-soft); color: var(--sc2-bear); }
.sc2-dir-strong-neg  { background: var(--sc2-bear-soft); color: var(--sc2-bear); border-color: rgba(255, 69, 58, .35); }
.sc2-tag-role-core       { background: var(--hig-blue-soft); color: var(--hig-blue); }
.sc2-tag-role-supporting { background: var(--hig-fill); }
.sc2-tag-role-contextual { background: var(--hig-fill-thin); color: var(--hig-label-tertiary); }
.sc2-node-claim-count { color: var(--hig-label-tertiary); font-size: var(--hig-caption); margin-left: auto; }
.sc2-node-body { padding: 0 var(--hig-s-3) var(--hig-s-3); border-top: 1px solid var(--hig-separator); }
.sc2-node-why, .sc2-node-next { margin-top: var(--hig-s-2); font-size: var(--hig-subhead); }
.sc2-claims { margin-top: var(--hig-s-3); display: flex; flex-direction: column; gap: var(--hig-s-2); }
.sc2-claim {
  border-left: 3px solid var(--hig-separator-strong);
  padding: var(--hig-s-2) var(--hig-s-3);
  background: var(--sc2-claim-neutral);
  border-radius: 0 var(--hig-r-control) var(--hig-r-control) 0;
}
.sc2-claim-dir-pos     { border-left-color: var(--sc2-bull); background: var(--sc2-claim-pos); }
.sc2-claim-dir-neg     { border-left-color: var(--sc2-bear); background: var(--sc2-claim-neg); }
.sc2-claim-dir-mixed   { border-left-color: var(--hig-yellow); background: var(--sc2-claim-mixed); }
.sc2-claim-text   { font: 500 var(--hig-subhead)/1.4 var(--hig-font); }
.sc2-claim-meta   { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sc2-claim-tier-1 { background: var(--hig-blue-soft); color: var(--hig-blue); }
.sc2-claim-tier-2 { background: var(--hig-fill); }
.sc2-claim-tier-3 { background: var(--hig-fill-thin); color: var(--hig-label-tertiary); }
.sc2-claim-dir-tag-pos     { background: var(--sc2-bull-soft); color: var(--sc2-bull); }
.sc2-claim-dir-tag-neg     { background: var(--sc2-bear-soft); color: var(--sc2-bear); }
.sc2-claim-dir-tag-mixed   { background: var(--hig-yellow-soft); color: var(--hig-yellow); }
.sc2-claim-src    { font: 500 var(--hig-caption)/1 var(--hig-font); color: var(--hig-blue); text-decoration: none; }
.sc2-claim-src:hover { text-decoration: underline; }
.sc2-claim-mapping { margin-top: 6px; font: 400 var(--hig-caption)/1.4 var(--hig-font); color: var(--hig-label-tertiary); font-style: italic; }

/* — KPI tracker ——————————————————————————————————— */
.sc2-kpi-row {
  display: grid; grid-template-columns: 260px 1fr; gap: var(--hig-s-4);
  align-items: center; padding: var(--hig-s-4) 0;
  border-bottom: 1px solid var(--hig-separator);
}
.sc2-kpi-row:last-of-type { border-bottom: none; padding-bottom: 0; }
.sc2-kpi-row:first-of-type { padding-top: 0; }
.sc2-kpi-name { font: 600 var(--hig-callout)/1.25 var(--hig-font); }
.sc2-kpi-sub  { font: 400 var(--hig-caption)/1.4 var(--hig-font); color: var(--hig-label-secondary); margin-top: 4px; }
.sc2-kpi-empty { color: var(--hig-label-tertiary); }
.sc2-kpi-svg { color: var(--hig-label); }
.sc2-kpi-band-bear { fill: url(#sc2-kpi-bear-grad); }
.sc2-kpi-band-base { fill: url(#sc2-kpi-base-grad); }
.sc2-kpi-band-bull { fill: url(#sc2-kpi-bull-grad); }
.sc2-kpi-marker      { fill: var(--hig-label); stroke: var(--hig-bg-elevated); stroke-width: 2.5; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.sc2-kpi-marker-last { fill: var(--hig-label-tertiary); }
.sc2-kpi-marker-lbl  { font: 700 11px/1 var(--hig-font); fill: var(--hig-label); font-variant-numeric: tabular-nums; }
.sc2-kpi-axis        { font: 500 9px/1 var(--hig-font-mono); fill: var(--hig-label-tertiary); letter-spacing: 0.02em; }
.sc2-verdict      { fill: var(--hig-fill); stroke: var(--hig-separator); stroke-width: 1; }
.sc2-verdict-tracking_bull { fill: var(--sc2-bull-soft); stroke: rgba(48, 209, 88, .4); }
.sc2-verdict-tracking_base { fill: var(--sc2-base-soft); stroke: rgba(10, 132, 255, .4); }
.sc2-verdict-tracking_bear { fill: var(--sc2-bear-soft); stroke: rgba(255, 69, 58, .4); }
.sc2-verdict-pending       { fill: var(--hig-fill-thin); }
.sc2-verdict-lbl { font: 700 11px/1 var(--hig-font); fill: var(--hig-label); letter-spacing: 0.04em; }

/* — Earnings scorecard ———————————————————————————— */
.sc2-earn-summary { display: flex; align-items: center; gap: var(--hig-s-3); flex-wrap: wrap; }
.sc2-earn-verdict {
  font: 700 var(--hig-headline)/1 var(--hig-font);
  padding: 8px 16px; border-radius: var(--hig-r-pill);
  letter-spacing: 0.02em;
}
.sc2-earn-verdict-bull { background: var(--sc2-bull-soft); color: var(--sc2-bull); }
.sc2-earn-verdict-base { background: var(--sc2-base-soft); color: var(--sc2-base); }
.sc2-earn-verdict-bear { background: var(--sc2-bear-soft); color: var(--sc2-bear); }
.sc2-earn-verdict-pending {
  background: var(--hig-fill); color: var(--hig-label-secondary);
  border: 1px solid var(--hig-separator);
}
.sc2-earn-counts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sc2-earn-cnt    {
  font: 700 var(--hig-caption-2)/1 var(--hig-font-mono);
  padding: 5px 9px; border-radius: 6px;
  letter-spacing: 0.04em;
}
.sc2-earn-cnt-bull { background: var(--sc2-bull-soft); color: var(--sc2-bull); }
.sc2-earn-cnt-base { background: var(--sc2-base-soft); color: var(--sc2-base); }
.sc2-earn-cnt-bear { background: var(--sc2-bear-soft); color: var(--sc2-bear); }
.sc2-earn-headline {
  margin-top: var(--hig-s-3);
  font: 500 var(--hig-callout)/1.45 var(--hig-font);
  color: var(--hig-label);
}
.sc2-earn-rows { margin-top: var(--hig-s-3); }
.sc2-earn-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: var(--hig-s-3); align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--hig-separator);
}
.sc2-earn-row:last-of-type { border-bottom: none; }
.sc2-earn-kpi { font: 500 var(--hig-callout)/1.2 var(--hig-font); }
.sc2-earn-actual { font: 600 var(--hig-callout)/1 var(--hig-font-mono); font-variant-numeric: tabular-nums; }
.sc2-earn-band {
  font: 700 var(--hig-caption-2)/1 var(--hig-font);
  padding: 5px 10px; border-radius: var(--hig-r-pill);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.sc2-earn-quotes { margin-top: var(--hig-s-3); display: flex; flex-direction: column; gap: var(--hig-s-2); }
.sc2-earn-quote {
  margin: 0; padding: 8px 14px;
  border-left: 3px solid var(--hig-separator-strong);
  color: var(--hig-label-secondary); font-style: italic;
  font-size: var(--hig-subhead); line-height: 1.6;
}
.sc2-earnings-drop {
  border: 1.5px dashed var(--hig-separator-strong);
  border-radius: var(--hig-r-card);
  padding: var(--hig-s-4);
  text-align: center;
  color: var(--hig-label-secondary);
  background: var(--hig-fill-thin);
  transition: background var(--hig-dur) var(--hig-ease-standard),
              border-color var(--hig-dur) var(--hig-ease-standard),
              color var(--hig-dur) var(--hig-ease-standard);
}
.sc2-earnings-drop:hover { background: var(--hig-fill); border-color: var(--hig-blue); color: var(--hig-label); }
.sc2-earnings-drop.is-dragover { background: var(--hig-blue-soft); border-color: var(--hig-blue); color: var(--hig-blue); }
.sc2-earnings-pick { color: var(--hig-blue); cursor: pointer; font-weight: 500; }
.sc2-earn-drop-wrap { margin-top: var(--hig-s-3); }
.sc2-earnings-empty { padding: var(--hig-s-5); }

/* — Catalysts ————————————————————————————————————— */
.sc2-cat-list { list-style: none; padding: 0; margin: 0; }
.sc2-cat-item {
  display: flex; align-items: baseline; gap: var(--hig-s-4); padding: 12px 0;
  border-bottom: 1px solid var(--hig-separator);
  transition: background var(--hig-dur) var(--hig-ease-standard);
}
.sc2-cat-item:hover { background: var(--hig-fill-thin); }
.sc2-cat-item:last-of-type { border-bottom: none; }
.sc2-cat-when  {
  font: 600 var(--hig-caption)/1 var(--hig-font-mono);
  color: var(--hig-label-tertiary);
  letter-spacing: 0.04em;
  min-width: 130px;
  padding-left: 4px;
}
.sc2-cat-title { font: 500 var(--hig-callout)/1.4 var(--hig-font); flex: 1; }

/* — Red team / kill ———————————————————————————————— */
.sc2-red-row { margin-bottom: var(--hig-s-3); font: 400 var(--hig-callout)/1.6 var(--hig-font); }
.sc2-kill-block {
  margin-top: var(--hig-s-4);
  background: var(--hig-red-soft);
  border: 1px solid rgba(255, 69, 58, .45);
  border-radius: var(--hig-r-card);
  padding: var(--hig-s-4) var(--hig-s-5);
  position: relative;
}
.sc2-kill-block::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--hig-red); border-radius: var(--hig-r-card) 0 0 var(--hig-r-card);
}
.sc2-kill-label {
  font: 700 var(--hig-caption-2)/1 var(--hig-font);
  color: var(--hig-red); letter-spacing: 0.14em; text-transform: uppercase;
}
.sc2-kill-text  {
  margin-top: 8px;
  color: var(--hig-label);
  font: 500 var(--hig-callout)/1.45 var(--hig-font);
}

/* — Recent intel ——————————————————————————————————— */
.sc2-intel-list { list-style: none; padding: 0; margin: var(--hig-s-3) 0 0; }
.sc2-intel-row  {
  display: grid; grid-template-columns: 110px 1fr 1fr; gap: var(--hig-s-3);
  padding: 12px 0; border-bottom: 1px solid var(--hig-separator);
  align-items: baseline;
  transition: background var(--hig-dur) var(--hig-ease-standard);
}
.sc2-intel-row:hover { background: var(--hig-fill-thin); }
.sc2-intel-row:last-of-type { border-bottom: none; }
.sc2-intel-when {
  color: var(--hig-label-tertiary);
  font: 600 var(--hig-caption)/1 var(--hig-font-mono);
  letter-spacing: 0.04em;
}
.sc2-intel-title { font: 500 var(--hig-callout)/1.4 var(--hig-font); }
.sc2-intel-title a { color: var(--hig-blue); text-decoration: none; }
.sc2-intel-title a:hover { text-decoration: underline; }
.sc2-intel-sum  { font: 400 var(--hig-caption)/1.5 var(--hig-font); color: var(--hig-label-secondary); }
.sc2-sev-high     .sc2-intel-when, .sc2-sev-critical .sc2-intel-when { color: var(--hig-red); }
.sc2-sev-medium   .sc2-intel-when { color: var(--hig-yellow); }

/* — Footer ————————————————————————————————————————— */
.sc2-footer {
  display: flex; align-items: center; gap: var(--hig-s-4); flex-wrap: wrap;
  margin-top: var(--hig-s-7); padding-top: var(--hig-s-4);
  border-top: 1px solid var(--hig-separator);
}
.sc2-foot-link {
  color: var(--hig-blue); text-decoration: none;
  font: 500 var(--hig-callout)/1 var(--hig-font);
}
.sc2-foot-link:hover { text-decoration: underline; }
.sc2-foot-button {
  appearance: none;
  background: var(--hig-fill); color: var(--hig-label);
  border: 1px solid var(--hig-separator); border-radius: var(--hig-r-pill);
  padding: 8px 16px; font: 500 var(--hig-footnote)/1 var(--hig-font); cursor: pointer;
  transition: background var(--hig-dur) var(--hig-ease-standard),
              border-color var(--hig-dur) var(--hig-ease-standard);
}
.sc2-foot-button:hover { background: var(--hig-fill-strong); border-color: var(--hig-separator-strong); }
.sc2-foot-meta {
  margin-left: auto;
  font: 500 var(--hig-caption-2)/1 var(--hig-font-mono);
  color: var(--hig-label-tertiary);
  letter-spacing: 0.04em;
}

/* — Empty state ———————————————————————————————————— */
.sc2-empty { text-align: center; padding: var(--hig-s-8) var(--hig-s-4); color: var(--hig-label-secondary); }
.sc2-empty .sc2-foot-button { margin-top: var(--hig-s-3); }
