/* Arc theme: one quiet design language for the whole dashboard. Loaded last so it
   can collapse the earlier layers to a single type scale and a neutral palette.
   Visual only. Values follow the visual system in
   .claude/skills/landing-page-design (Part B).

   Type scale (Tailwind steps, size/line height):
     12/16 labels, meta · 14/20 body, controls, cells · 16/24 titles
     20/28 metric values · 24/32 verdict headline
   Weights: 400, 500 for emphasis, 600 for buttons. One typeface: Geist. No italics.
   Spacing: 2 4 8 12 16 24 32 40 48 64 80 96. Radius: 16 cards, 8 nested, full pills.
   Backgrounds are flat. Color carries meaning only: success, danger, warning.
   Motion: cubic-bezier(.22, 1, .36, 1); 300ms for color, 500ms for movement. */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&display=swap");

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --font-body: Geist, ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-body);
  --t-xs: 12px;
  --t-sm: 14px;
  --t-md: 16px;
  --t-lg: 20px;
  --t-xl: 24px;
  --lh-xs: 16px;
  --lh-sm: 20px;
  --lh-md: 24px;
  --lh-lg: 28px;
  --lh-xl: 32px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-color: .3s;
  --dur-move: .5s;

  /* Dark surfaces come only from the approved set: #181818 #1F1F1F #272727 #313131. */
  --bg: #181818;
  --bg-2: #181818;
  --surface: #1f1f1f;
  --surface-2: #272727;
  --surface-3: #313131;
  --surface-soft: #272727;
  --panel: var(--surface);
  --panel-soft: var(--surface-2);
  --line: #2e2e2e;
  --line-soft: #262626;
  --border: var(--line);
  --line-strong: #474747;
  --text: oklch(96% 0 0);
  --muted: oklch(68% .005 75);
  --muted-2: oklch(56% .005 75);
  --cyan: oklch(92% 0 0);
  --cyan-soft: #272727;
  --accent-soft: #272727;
  --green: oklch(74% .12 150);
  --green-soft: oklch(74% .12 150 / .12);
  --red: oklch(70% .15 28);
  --red-soft: oklch(70% .15 28 / .12);
  --amber: oklch(80% .12 78);
  --amber-soft: oklch(80% .12 78 / .12);
  --purple: oklch(72% .08 290);
  --shadow: 0 1px 2px oklch(0% 0 0 / .25);
  --shadow-raised: 0 8px 16px oklch(0% 0 0 / .3), 0 1px 4px oklch(0% 0 0 / .2);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --hero-from: #ffffff;
  --hero-to: #9b9b9b;
  --track: var(--surface-2);

  --obs-display: var(--font-display);
  --obs-mono: var(--font-body);
  --obs-signal: var(--text);
  --obs-signal-deep: var(--text);
  --obs-teal: var(--muted);
  --obs-violet: var(--muted);
  --obs-ink: var(--text);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(98.6% 0 0);
  --bg-2: oklch(98.6% 0 0);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(97.8% 0 0);
  --surface-3: oklch(96% 0 0);
  --surface-soft: oklch(97.8% 0 0);
  --line: oklch(93.5% 0 0);
  --line-soft: oklch(95.5% 0 0);
  --line-strong: oklch(82% 0 0);
  --text: oklch(15% 0 0);
  --muted: oklch(46% 0 0);
  --muted-2: oklch(59% 0 0);
  --cyan: oklch(20% 0 0);
  --cyan-soft: oklch(96% 0 0);
  --accent-soft: oklch(96% 0 0);
  --green: oklch(49% .19 150);
  --green-soft: oklch(49% .19 150 / .09);
  --red: oklch(54% .21 25);
  --red-soft: oklch(54% .21 25 / .09);
  --amber: oklch(58% .18 75);
  --amber-soft: oklch(58% .18 75 / .1);
  --purple: oklch(50% .12 290);
  --shadow: 0 1px 2px oklch(0% 0 0 / .035);
  --shadow-raised: 0 8px 16px oklch(0% 0 0 / .065), 0 1px 4px oklch(0% 0 0 / .035);
  --hero-from: #000000;
  --hero-to: #666666;
  /* Segmented tracks need more contrast than surface-2 against the light page. */
  --track: oklch(95% 0 0);
}

/* Base: one family, one tracking, tabular numbers, no all-caps, no italics ------ */

html body {
  background: var(--bg) !important;
  color: var(--text);
  font: 400 var(--t-sm)/var(--lh-sm) var(--font-body);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
body::before,
body::after { display: none !important; }
::selection { background: color-mix(in oklch, var(--text) 18%, transparent); }

/* :not(#_) lifts these rules above the class-level !important sizes in older layers. */
body :not(svg, svg *, #_) {
  font-family: var(--font-body) !important;
  font-size: var(--t-sm) !important;
  font-weight: 400 !important;
  font-style: normal !important;
  letter-spacing: -.01em !important;
  text-transform: none !important;
  text-shadow: none !important;
  font-variant-numeric: tabular-nums;
}
html body :not(#_):is(h1, h2, h3, h4, h5, h6, summary > span) { text-wrap: balance; }
html body :not(#_):is(p, li, small) { text-wrap: pretty; }

/* Backgrounds are flat. The score ring keeps its conic fill because it is data. */
html body :not(#_):not(svg, svg *, canvas, .score-ring, .decision-title-row h2) {
  background-image: none !important;
  border-image: none !important;
}

/* Emphasis is a single step: 500. Buttons are 600. */
html body :not(#_):is(b, strong, th, label, summary, h1, h2, h3, h4, h5, h6),
html body :not(#_):is(.decision-cot-change-row > :first-child, .position-label, .driver-label, .score-component-name, .score-component-value) {
  font-weight: 500 !important;
}
html body :not(#_):is(.icon-button, .decision-columns-toggle, .wc-chart-tool, .wc-health-button, .instrument-tab > :first-child,
  .decision-nav nav button, .decision-horizons button, .range-buttons button, .report-taxonomy-buttons button) {
  font-weight: 600 !important;
}

/* Labels, captions and meta: 12/16 muted. */
html body :not(#_):is(small, th, caption, footer, .eyebrow, .decision-kicker, .panel-kicker, .wc-kicker, .control-label,
  .metric-label, .metric-sub, .macro-card-label, .score-ring-label, .report-taxonomy-label, .decision-horizon-label,
  .decision-cot-change-head > *, .decision-chips > * > span, .decision-edge-metrics span, .decision-scanner-note,
  .decision-direction, .decision-evidence-badge, .decision-condition-label, .wc-chart-help, .wc-regime-chip,
  .sentiment-drivers-title, .decision-header-meta, .decision-header-meta *, .instrument-tab small, .instrument-tab-meta,
  .instrument-tab-meta *, .status-pill, .status-pill *, .decision-semantic > span, .decision-invalidation > strong,
  .decision-week-path span, .decision-fold > summary small) {
  font-size: var(--t-xs) !important;
  line-height: var(--lh-xs);
}
html body :not(#_):is(small, caption, footer, .eyebrow, .decision-kicker, .panel-kicker, .wc-kicker, .control-label,
  .metric-label, .metric-sub, .macro-card-label, .score-ring-label, .report-taxonomy-label, .decision-horizon-label,
  .decision-cot-change-head > *, .decision-chips > * > span, .decision-edge-metrics span, .decision-scanner-note,
  .wc-chart-help, .sentiment-drivers-title, .decision-header-meta, .decision-semantic > span, .decision-fold > summary small) {
  color: var(--muted) !important;
}
html body :not(#_):is(.decision-kicker, .eyebrow, .panel-kicker, .wc-kicker, .decision-cot-change-head > *, .decision-semantic > span, th, .metric-label, .macro-card-label) {
  font-weight: 500 !important;
}

/* A few labels are capitals in the markup and hold no acronyms; show them in sentence case. */
html body :not(#_):is(.decision-strongest .decision-kicker, .decision-semantic > span:first-child, .decision-semantic > strong,
  .decision-edge-metrics > :last-child strong, .decision-direction, .decision-evidence-badge, .wc-kicker, .score-copy h4) {
  display: block;
  text-transform: lowercase !important;
}
html body :not(#_):is(.decision-strongest .decision-kicker, .decision-semantic > span:first-child, .decision-semantic > strong,
  .decision-edge-metrics > :last-child strong, .decision-direction, .decision-evidence-badge, .wc-kicker, .score-copy h4)::first-letter {
  text-transform: uppercase;
}
html body :not(#_).decision-direction { display: inline-block; }

/* Titles: 16/24. Values: 20/28. Headline: 24/32. */
html body :not(#_):is(h1, h3, h4, .section-heading h2, .decision-view-panel h2, .decision-fold > summary > span, .loading-card strong) {
  font-size: var(--t-md) !important;
  line-height: var(--lh-md);
  letter-spacing: -.015em !important;
  color: var(--text);
}
html body :not(#_):is(.metric-value, .macro-card-value, .score-ring-value, .decision-chips strong, .decision-semantic > strong,
  .decision-edge-metrics strong) {
  font-size: var(--t-lg) !important;
  font-weight: 500 !important;
  line-height: var(--lh-lg);
  letter-spacing: -.02em !important;
}
html body .decision-title-row h2:not(#_) {
  max-width: 680px;
  font-size: var(--t-xl) !important;
  font-weight: 500 !important;
  line-height: var(--lh-xl);
  letter-spacing: -.025em !important;
  color: var(--text) !important;
}
/* A neutral verdict is the page's hero heading: left to right text gradient.
   Bullish and bearish verdicts keep their semantic color instead. */
html body .decision-title-row h2.neutral:not(#_) {
  width: fit-content;
  background-image: linear-gradient(90deg, var(--hero-from), var(--hero-to)) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent;
}
.section-heading h2 {
  background: none !important;
  -webkit-text-fill-color: currentColor;
}

/* Semantic color is the only color. */
html body :not(#_):is(.positive, .bullish) { color: var(--green) !important; }
html body :not(#_):is(.negative, .bearish) { color: var(--red) !important; }
html body :not(#_):is(.caution, .warning) { color: var(--amber) !important; }
html body :not(#_):is(strong, span).neutral { color: var(--text) !important; }

/* Surfaces: one card style, borders all the way around, resting shadow -------- */

/* The top bar floats off the page edge on a translucent, blurred surface. Its edges
   line up with the cards below and its 24px inset matches their content. */
.topbar {
  margin: 8px 0 0 !important;
  padding: 8px 24px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  background: color-mix(in oklch, var(--surface) 82%, transparent) !important;
  box-shadow: var(--shadow) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
}
.brand-mark {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}
.brand-mark span { background: var(--text) !important; }
.eyebrow { color: var(--muted) !important; }

:is(.decision-current, .decision-view-panel, .decision-scanner, .decision-strongest, .decision-latest-cot,
  .decision-fold, .panel, .loading-card) {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow) !important;
  animation: none !important;
}
:is(.decision-current, .decision-latest-cot, .panel)::before,
:is(.metric-card, .panel)::after { display: none !important; }
.panel:hover { border-color: var(--line) !important; }

/* Cards nested in a card are flat: hairline only. Their gap to the parent edge is
   16px or more, so outer minus gap falls below 2 and they take the small radius. */
.decision-fold-body :is(.decision-view-panel, .decision-strongest, .panel),
:is(.decision-semantic, .metric-card, .macro-card, .decision-invalidation, .decision-watch, .decision-forward,
  .decision-week-path > article) {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  animation: none !important;
}
.decision-semantic.prospective,
.decision-semantic.historical { border-width: 1px !important; border-color: var(--line) !important; }

/* Older layers left 10 and 11px corners on inner blocks and 5px on badges; snap
   them to the Tailwind steps (8px nested, 6px badges). */
:is(.cot-cross-card, .cot-profile, .cot-edge-card, .cot-matrix-wrap, .cot-table-wrap, .toggle-chip, .control-select,
  .wc-health-cell, .section-number, .sentiment-drivers) { border-radius: var(--radius-sm) !important; }
:is(.cot-status, .decision-direction, .ledger, .wc-cross-actor-rank, .wc-regime-chip) { border-radius: 6px !important; }

.status-pill {
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}
.status-pill.live .status-dot { animation: none !important; box-shadow: none !important; }

/* Segmented controls: muted track, raised active pill ------------------------- */

:is(.instrument-tabs, .decision-nav nav, .decision-horizons, .range-buttons, .report-taxonomy-buttons) {
  padding: 4px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--track) !important;
  box-shadow: none !important;
}
/* The sticky view row keeps scrolled content faintly visible behind a blur. No side
   inset, so its tracks line up with the cards. */
.decision-nav {
  padding: 8px 0 !important;
  border: 0 !important;
  background: color-mix(in oklch, var(--bg) 82%, transparent) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
}
:is(.instrument-tab, .decision-nav nav button, .decision-horizons button, .range-buttons button, .report-taxonomy-buttons button) {
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--muted) !important;
}
:is(.instrument-tab, .decision-nav nav button, .decision-horizons button, .range-buttons button, .report-taxonomy-buttons button):hover { color: var(--text) !important; }
:is(.instrument-tab.active, .decision-nav nav button.active, .decision-horizons button.active, .range-buttons button.active, .report-taxonomy-buttons button.active) {
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-raised) !important;
}
html[data-theme="dark"] :is(.instrument-tab.active, .decision-nav nav button.active, .decision-horizons button.active, .range-buttons button.active, .report-taxonomy-buttons button.active) {
  background: var(--surface-3) !important;
}
.instrument-tab.active::after { display: none !important; }
/* The model-family toggle sits in a narrow card: three equal columns on one line,
   never a pill that wraps onto a second row. */
html body .decision-model-family:not(#_) {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100% !important;
  max-width: 100%;
}
html body .decision-model-family button:not(#_) {
  min-width: 0;
  padding: 8px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.instrument-tab small,
.instrument-tab-meta,
.instrument-tab-meta b { color: var(--muted-2) !important; }

/* Other buttons: hairline pill, 8px by 12px */
:is(.icon-button, .decision-columns-toggle, .wc-chart-tool, .wc-health-button) {
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  color: var(--text) !important;
}
.decision-columns-toggle { padding: 8px 12px !important; }
:is(.icon-button, .decision-columns-toggle, .wc-chart-tool, .wc-health-button):hover { background: var(--surface-2) !important; }
.decision-columns-toggle[aria-pressed="true"] { background: var(--surface-3) !important; }

/* States: every control eases color on the base curve and presses in on click. */
:is(button, summary, a, [role="tab"], [role="button"]) {
  transition: background-color var(--dur-color) var(--ease), color var(--dur-color) var(--ease),
    border-color var(--dur-color) var(--ease), opacity var(--dur-color) var(--ease),
    transform var(--dur-move) var(--ease) !important;
}
:is(button, [role="tab"], [role="button"]):not(:disabled):active { transform: scale(.98) !important; }
:is(button, summary, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--text) !important;
  outline-offset: 2px !important;
}

/* Verdict: headline, sentence, then four KPI cells ----------------------------- */

.decision-verdict { padding: 24px !important; overflow: hidden; }
.decision-verdict .decision-title-row p {
  max-width: 680px !important;
  margin-top: 8px !important;
  color: var(--muted) !important;
  font-size: var(--t-sm) !important;
  line-height: var(--lh-sm) !important;
}
.decision-verdict .decision-kicker { margin-bottom: 8px; }
.decision-chips {
  gap: 8px !important;
  margin: 24px 0 0 !important;
}
.decision-chips > * {
  padding: 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
}
.decision-chips > button { display: flex !important; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
.decision-chips > button:hover,
.decision-chips > button:focus-visible { background: var(--surface-2) !important; border-color: var(--line-strong) !important; }
.decision-chips strong { margin-top: 8px !important; }
.decision-chips small { margin-top: 4px !important; }

/* Lists and tables: hairline rows, no tinted hovers --------------------------- */

.decision-latest-cot { padding: 24px !important; }
.decision-cot-change-head {
  border-bottom: 1px solid var(--line) !important;
  background: transparent !important;
}
.decision-cot-change-row {
  border: 0 !important;
  border-bottom: 1px solid var(--line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.decision-cot-change-row:last-child { border-bottom: 0 !important; }
.decision-cot-change-row:hover,
.data-table tbody tr:hover td { background: var(--accent-soft) !important; }
.decision-cot-change-head > :not(:first-child),
.decision-cot-change-row :is(span, strong):not(:first-child) { text-align: right; }
/* Phone rows label each cell with a ::before, which the base reset cannot reach. */
.decision-cot-change-row > [data-label]::before {
  font: 400 var(--t-xs)/var(--lh-xs) var(--font-body) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--muted) !important;
}

/* Report type: label then track, no one-sided divider. */
.report-taxonomy-control {
  gap: 12px !important;
  padding: 0 !important;
  border: 0 !important;
}

/* The scanner spans both overview rows; stretch it so its bottom meets the table's. */
.decision-scanner { padding: 24px !important; align-self: stretch !important; }
.decision-scanner-list { gap: 4px !important; }
.decision-scanner-list button {
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.decision-scanner-list button.active { background: var(--surface-2) !important; border-color: var(--line) !important; }
.decision-scanner-list button:hover { background: var(--accent-soft) !important; }

.data-table th,
.data-table td { border-color: var(--line-soft) !important; }

/* Folds: plain titles, muted chevron, body rises into place -------------------- */

.decision-fold > summary { padding: 16px 24px !important; border-radius: var(--radius-lg) !important; }
.decision-fold > summary::before {
  border-color: var(--muted) !important;
  transition: transform var(--dur-move) var(--ease) !important;
}
.decision-fold > summary:hover { background: transparent !important; }
.decision-fold > summary:hover > span { color: var(--muted); }
.decision-fold-body { padding: 0 16px 16px !important; gap: 12px !important; }
.decision-fold[open] > .decision-fold-body { animation: arc-rise var(--dur-move) var(--ease) both; }
.market-fold { margin-top: 12px !important; }
@keyframes arc-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Loading: skeleton bars instead of spinners ----------------------------------- */

.loader {
  width: 160px !important;
  height: 8px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: var(--surface-3) !important;
  box-shadow: none !important;
  animation: arc-pulse 1.4s var(--ease) infinite alternate !important;
}
#currentEdgeCommand > .decision-loading::before {
  width: 96px !important;
  height: 8px !important;
  margin: 0 0 12px !important;
  display: block !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: var(--surface-3) !important;
  animation: arc-pulse 1.4s var(--ease) infinite alternate !important;
}
@keyframes arc-pulse {
  from { opacity: .45; }
  to { opacity: 1; }
}

/* Leftover decoration from earlier layers ------------------------------------- */

.decision-grade::before { background: var(--line-strong) !important; opacity: 1 !important; }
.decision-grade.strong::before { background: var(--green) !important; }
.decision-grade.mixed::before { background: var(--amber) !important; }
.percentile-fill { background: var(--text) !important; opacity: .55; }
.score-ring { filter: none !important; }
.section-number {
  border: 1px solid var(--line) !important;
  background: var(--surface-2) !important;
  color: var(--muted) !important;
}
.loading-overlay { background: color-mix(in oklch, var(--bg) 92%, transparent) !important; }
footer { border-top: 1px solid var(--line) !important; }

::-webkit-scrollbar-thumb { background: var(--line-strong) !important; border-color: var(--bg) !important; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2) !important; }

@media (max-width: 1100px) {
  .decision-chips > [data-health-chip] { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  html body .decision-title-row h2:not(#_) { font-size: var(--t-lg) !important; line-height: var(--lh-lg); }
  .topbar { padding: 8px 16px !important; }
  /* Tracks wrap to two rows on phones, so a pill shape no longer fits: card corners,
     with inner pills at 16 - 4 = 12px. */
  html body .instrument-bar:not(#_) { padding-inline: 0 !important; }
  html body :is(.instrument-tabs, .decision-horizons):not(#_) { border-radius: var(--radius-lg) !important; }
  html body :is(.instrument-tab, .decision-horizons button):not(#_) { border-radius: var(--radius-md) !important; }
  .decision-verdict { padding: 16px !important; }
  .decision-chips { margin: 16px 0 0 !important; }
  .decision-chips > * { padding: 12px !important; }
  .decision-latest-cot,
  .decision-scanner { padding: 16px !important; }
  .decision-fold > summary { padding: 16px !important; }
  .decision-fold-body { padding: 0 8px 8px !important; }
}
@media (prefers-reduced-motion: reduce) {
  :is(button, [role="tab"], [role="button"]):not(:disabled):active { transform: none !important; }
  .decision-fold > summary::before { transition: none !important; }
  .decision-fold[open] > .decision-fold-body { animation: arc-fade var(--dur-color) var(--ease) both; }
  :is(.loader, #currentEdgeCommand > .decision-loading::before) { animation: none !important; }
}
@keyframes arc-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
