/* AXIS Obsidian System — final application-wide visual authority. */
:root {
  --axis-obsidian-0: #000;
  --axis-obsidian-1: #000;
  --axis-obsidian-2: #000;
  --axis-obsidian-3: #000;
  --axis-obsidian-soft: #000;
  --axis-gold: #d8aa4a;
  --axis-gold-bright: #f0cf78;
  --axis-gold-line: rgba(216, 170, 74, .24);
  --axis-gold-line-soft: rgba(216, 170, 74, .13);
  --axis-platinum: #e6e1d7;
  --axis-copy: #a9a49a;
  --axis-muted: #77736b;
  --axis-ui-font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --axis-data-font: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --axis-card-radius: 12px;
  --axis-panel-radius: 14px;
  --axis-card-shadow: inset 0 1px 0 rgba(255, 255, 255, .018);
}

body:not([data-route="home"]):not([data-route="login"]),
body[data-axis-market],
body[data-route="dashboard"],
body[data-route="macro"],
body[data-route="journal"],
body[data-route="sentinel"] {
  color: var(--axis-platinum);
  background: #000 !important;
  font-family: var(--axis-ui-font);
  font-size: 13px;
  line-height: 1.42;
  letter-spacing: -.008em;
}

body:not([data-route="home"]):not([data-route="login"]) :is(button, input, select, textarea) {
  font: inherit;
}

body:not([data-route="home"]):not([data-route="login"]) :is(
  .site-header, .site-nav, .top-nav, .market-hub, .axis-workspace-rail,
  .site-main, .app-shell, .page-shell, .workspace-shell, .dashboard-shell,
  .macro-shell, .macro-workspace, .journal-shell, .sentinel-shell,
  .intel-shell, .intel-page, .intel-content, .institutional-page,
  .positioning-page, .market-metric-page, .rates-carry-page, .relative-value-page
) {
  background-color: #000 !important;
  background-image: none !important;
}

body:not([data-route="home"]):not([data-route="login"]) :is(
  .market-hub-trigger, .market-hub-link, .axis-workspace-link, .workspace-link,
  .nav-link, .selector, .selector-trigger, .selector-trigger-market,
  button, input, select, textarea
) {
  background-color: #000 !important;
  background-image: none !important;
  border-color: var(--axis-gold-line-soft) !important;
  color: var(--axis-platinum);
}

body:not([data-route="home"]):not([data-route="login"]) :is(
  .market-hub-trigger, .market-hub-link, .axis-workspace-link, .workspace-link,
  .nav-link, .selector, .selector-trigger, .selector-trigger-market, button
):is(:hover, :focus-visible, .is-active, [aria-current="page"], [aria-expanded="true"]) {
  background-color: #000 !important;
  border-color: rgba(240, 207, 120, .44) !important;
  color: var(--axis-gold-bright) !important;
}

/* True-black surfaces: hairlines and typography create hierarchy, not grey slabs. */
body:not([data-route="home"]):not([data-route="login"]) :is(
  .dashboard-workspace-bar, .dashboard-header, .dashboard-toolbar,
  .dashboard-tile, .dashboard-card, .market-dashboard-tile,
  .intel-shell, .intel-hero, .intel-panel, .intel-card, .intel-metric,
  .intel-reading, .intel-story, .intel-table-wrap, .institutional-card,
  .macro-command, .macro-panel, .macro-card, .macro-stat, .macro-metric,
  .macro-event, .macro-event-row, .macro-news-card, .macro-news-summary,
  .macro-calendar-workbench, .macro-reactions-workbench, .macro-reaction-table,
  .macro-reaction-detail, .macro-release-news-panel, .macro-filter-bar,
  .macro-summary-strip, .macro-hero, .macro-section, .macro-workbench,
  .journal-panel, .journal-card, .journal-metric, .journal-summary,
  .sentinel-panel, .sentinel-card, .sentinel-metric, .sentinel-kpi,
  .paper-panel, .social-card, .knowledge-card,
  .cd, .sc, .tc, .detail-cell, .api-card,
  [class$="-panel"], [class*="-panel "],
  [class$="-card"], [class*="-card "],
  [class$="-tile"], [class*="-tile "],
  [class$="-metric"], [class*="-metric "],
  [class$="-stat"], [class*="-stat "],
  [class$="-summary"], [class*="-summary "],
  [class$="-workbench"], [class*="-workbench "]
) {
  background-color: #000 !important;
  background-image: none !important;
  border-color: var(--axis-gold-line-soft) !important;
  box-shadow: var(--axis-card-shadow) !important;
}

body:not([data-route="home"]):not([data-route="login"]) :is(
  .dashboard-tile, .dashboard-card, .market-dashboard-tile,
  .intel-card, .intel-metric, .intel-reading, .institutional-card,
  .macro-card, .macro-stat, .macro-metric, .macro-event, .macro-event-row,
  .macro-news-card, .journal-card, .journal-metric,
  .sentinel-card, .sentinel-metric, .sentinel-kpi,
  .cd, .sc, .tc, .detail-cell, .api-card
) {
  border-radius: var(--axis-card-radius) !important;
  transition: border-color 180ms ease, box-shadow 180ms ease !important;
}

body:not([data-route="home"]):not([data-route="login"]) :is(
  .dashboard-tile, .dashboard-card, .market-dashboard-tile,
  .intel-card, .intel-metric, .intel-reading, .institutional-card,
  .macro-card, .macro-stat, .macro-metric, .macro-event, .macro-event-row,
  .macro-news-card, .journal-card, .journal-metric,
  .sentinel-card, .sentinel-metric, .sentinel-kpi,
  .cd, .sc, .tc, .detail-cell, .api-card
)::before {
  animation: none !important;
}

@media (hover: hover) and (pointer: fine) {
  body:not([data-route="home"]):not([data-route="login"]) :is(
    .dashboard-tile, .dashboard-card, .market-dashboard-tile,
    .intel-card, .intel-metric, .intel-reading, .institutional-card,
    .macro-card, .macro-stat, .macro-metric, .macro-event, .macro-event-row,
    .macro-news-card, .journal-card, .journal-metric,
    .sentinel-card, .sentinel-metric, .sentinel-kpi,
    .cd, .sc, .tc, .detail-cell, .api-card
  ):hover {
    border-color: rgba(240, 207, 120, .34) !important;
    box-shadow: inset 0 1px 0 rgba(240, 207, 120, .055) !important;
  }
}

/* Dashboard modules share one compact rhythm; content gets the saved space. */
body[data-route="dashboard"] .dashboard-grid,
body:has(.dashboard-grid) .dashboard-grid {
  align-items: stretch !important;
  grid-auto-rows: 270px !important;
  gap: 10px !important;
}

body[data-route="dashboard"] .dashboard-tile,
body:has(.dashboard-grid) .dashboard-tile {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  max-height: 270px !important;
  min-height: 270px !important;
  overflow: hidden !important;
  padding: 10px !important;
}

/* The motion runtime owns hover transforms. This overrides older lift-only
   dashboard rules while preserving the live pointer variables. */
body:not([data-route="home"]):not([data-route="login"]) .axis-motion-tilt {
  transform: perspective(1100px) rotateX(var(--axis-tilt-x, 0deg))
    rotateY(var(--axis-tilt-y, 0deg))
    translate3d(0, var(--axis-tilt-lift, 0), 0) !important;
}

body[data-route="dashboard"] .dashboard-tile:not(.axis-motion-tilt):hover {
  transform: none !important;
}

body[data-route="dashboard"] .dashboard-tile :is(canvas, svg, .module-chart, .dashboard-chart),
body:has(.dashboard-grid) .dashboard-tile :is(canvas, svg, .module-chart, .dashboard-chart) {
  flex: 1 1 auto;
  min-height: 0;
}

body[data-route="macro"] :is(.macro-view, .macro-content, .macro-main, .macro-layout),
body[data-route="macro"] :is(.macro-calendar-head, .macro-table-head, .macro-reaction-head, .macro-news-head) {
  background: #000 !important;
  background-image: none !important;
  border-color: var(--axis-gold-line-soft) !important;
  box-shadow: none !important;
}

/* The positioning terminal must not inherit its former blue-grey shell. */
body[data-route="fund-positions"] :is(
  .flow-terminal-main, .fund-position-terminal-shell, .fund-terminal-toolbar,
  .fund-regime-ribbon, .fund-terminal-layout, .fund-history-panel,
  .fund-landscape-panel, .fund-data-section, .flow-summary-block,
  .fund-regime-primary, .fund-regime-signal, .fund-history-chart-frame
),
body[data-route="fund-positions"] .fund-group-grid > * {
  background: #000 !important;
  background-image: none !important;
  border-color: var(--axis-gold-line-soft) !important;
  box-shadow: none !important;
}

/* Journal typography is the system reference. */
body:not([data-route="home"]):not([data-route="login"]) :is(h1, .page-title, .workspace-title) {
  font-family: var(--axis-ui-font) !important;
  font-size: clamp(21px, 1.45vw, 29px) !important;
  line-height: 1.08 !important;
  font-weight: 640 !important;
  letter-spacing: -.03em !important;
}

body:not([data-route="home"]):not([data-route="login"]) :is(h2, .panel-title, .card-title, .module-title) {
  font-family: var(--axis-ui-font) !important;
  font-size: clamp(14px, .92vw, 18px) !important;
  line-height: 1.18 !important;
  font-weight: 620 !important;
  letter-spacing: -.016em !important;
}

body:not([data-route="home"]):not([data-route="login"]) :is(p, .description, .subtitle, .helper, .meta) {
  line-height: 1.44;
}

body:not([data-route="home"]):not([data-route="login"]) :is(
  .eyebrow, .kicker, .label, th, .metric-label, .stat-label,
  [class$="-label"], [class*="-label "]
) {
  font-family: var(--axis-data-font) !important;
  font-size: 10px;
  color: #9b8a68;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body:not([data-route="home"]):not([data-route="login"]) :is(
  code, pre, table, .metric-value, .stat-value, .price, .value,
  [class$="-value"], [class*="-value "],
  [class$="-number"], [class*="-number "]
) {
  font-family: var(--axis-data-font) !important;
  font-variant-numeric: tabular-nums lining-nums;
}

body:not([data-route="home"]):not([data-route="login"]) :is(
  .dashboard-toolbar, .dashboard-workspace-bar, .macro-filter-bar,
  .terminal-toolbar, .chart-toolbar, .axis-drawing-toolbar-slot
) {
  min-height: 0 !important;
  gap: 6px !important;
}

body:not([data-route="home"]):not([data-route="login"]) :is(.divider, hr) {
  border-color: var(--axis-gold-line-soft) !important;
  background-color: var(--axis-gold-line-soft) !important;
}

@media (max-width: 900px) {
  body[data-route="dashboard"] .dashboard-grid,
  body:has(.dashboard-grid) .dashboard-grid {
    grid-auto-rows: 380px !important;
  }

  body[data-route="dashboard"] .dashboard-tile,
  body:has(.dashboard-grid) .dashboard-tile {
    height: 380px !important;
    min-height: 380px !important;
    max-height: 380px !important;
  }
}

/* Cascade lock: legacy page styles contain route-specific !important material
   fills. Keep this final authority more specific so no grey/blue slab survives. */
body[data-route]:not([data-route="home"]):not([data-route="login"]) :is(
  .site-background.site-background, .site-header.site-header, .site-nav.site-nav,
  .market-hub.market-hub, .site-main.site-main, .view.view,
  .dashboard-view.dashboard-view, .dashboard-grid.dashboard-grid,
  .dashboard-workspace.dashboard-workspace,
  .dashboard-workspace-bar.dashboard-workspace-bar,
  .dashboard-cockpit.dashboard-cockpit, .dashboard-lens.dashboard-lens,
  .dashboard-header.dashboard-header, .dashboard-toolbar.dashboard-toolbar,
  .dashboard-tile.dashboard-tile,
  .dashboard-card.dashboard-card, .dashboard-module.dashboard-module,
  .dashboard-tile-head.dashboard-tile-head,
  .market-metric-chart-frame.market-metric-chart-frame,
  .open-interest-chart-frame.open-interest-chart-frame,
  .flow-module-chart.flow-module-chart,
  .intel-hero.intel-hero, .intel-panel.intel-panel, .intel-card.intel-card,
  .macro-command.macro-command, .macro-command-bar.macro-command-bar,
  .macro-summary-strip.macro-summary-strip,
  .macro-hero.macro-hero, .macro-section.macro-section,
  .macro-filter-bar.macro-filter-bar,
  .macro-panel.macro-panel, .macro-card.macro-card, .macro-stat.macro-stat,
  .journal-panel.journal-panel, .journal-card.journal-card,
  .sentinel-panel.sentinel-panel, .sentinel-card.sentinel-card,
  .cd.cd, .sc.sc, .tc.tc, .detail-cell.detail-cell,
  [class][class$="-panel"], [class][class*="-panel "],
  [class][class$="-card"], [class][class*="-card "],
  [class][class$="-tile"], [class][class*="-tile "],
  [class][class$="-metric"], [class][class*="-metric "],
  [class][class$="-stat"], [class][class*="-stat "],
  [class][class$="-summary"], [class][class*="-summary "],
  [class][class$="-workbench"], [class][class*="-workbench "],
  [class][class*="chart-frame"]
) {
  background-color: #000 !important;
  background-image: none !important;
  border-color: var(--axis-gold-line-soft) !important;
  box-shadow: var(--axis-card-shadow) !important;
}

body[data-route="macro"] .macro-panel::before,
body[data-route="macro"] .macro-panel::after {
  background-color: transparent !important;
  background-image: none !important;
}

body[data-route]:not([data-route="home"]):not([data-route="login"]) .site-background :is(
  .background-grid, .background-glow
) {
  display: none !important;
}

/* Whole-site OLED lock, including landing, login, locked states and legacy
   terminal strips that do not use the newer semantic card class names. */
body,
body :is(
  .site-background.site-background, .site-header.site-header,
  .axis-workspace-nav.axis-workspace-nav, .axis-motion-surface.axis-motion-surface,
  .axis-hero-terminal.axis-hero-terminal,
  .axis-hero-terminal-screen.axis-hero-terminal-screen,
  .sentinel-locked.sentinel-locked,
  .journal-metrics-bar.journal-metrics-bar, .nav.nav,
  .dom-market-strip.dom-market-strip, .dom-execution-strip.dom-execution-strip,
  .dashboard-fund-positioning-chart.dashboard-fund-positioning-chart,
  .fund-panel-head.fund-panel-head,
  [class][class$="-strip"], [class][class*="-strip "]
) {
  background-color: #000 !important;
  background-image: none !important;
}

body :is(canvas, [class][class*="chart-frame"]) {
  background-color: #000 !important;
  background-image: none !important;
}

body figcaption {
  background-color: #000 !important;
  background-image: none !important;
}

body :is(
  .chart-embed.chart-embed,
  .spot-depth-canvas-shell.spot-depth-canvas-shell,
  .options-chain-table.options-chain-table,
  .options-chain-table.options-chain-table th,
  .dom-toast.dom-toast,
  .replay-hero-status.replay-hero-status,
  .replay-definition.replay-definition > div
) {
  background-color: #000 !important;
  background-image: none !important;
}

body[data-route="macro"] .macro-panel span {
  background-color: #000 !important;
  background-image: none !important;
}

body[data-route="journal"][data-route="journal"] .chart-embed.chart-embed,
body[data-route="options-chain"][data-route="options-chain"] .options-chain-table.options-chain-table,
body[data-route="options-chain"][data-route="options-chain"] .options-chain-table.options-chain-table th,
body[data-route="spot-depth"][data-route="spot-depth"] .spot-depth-canvas-shell.spot-depth-canvas-shell,
body[data-route="macro"][data-route="macro"] :is(
  .macro-context-strip.macro-context-strip > span,
  .macro-pulse-lens-grid.macro-pulse-lens-grid > div,
  .macro-now-next-grid.macro-now-next-grid > div,
  .macro-history-loading.macro-history-loading
) {
  background-color: #000 !important;
  background-image: none !important;
}

body[data-route="macro"] :is(
  [data-macro-refresh], .macro-intelligence-notice, .macro-history-loading
) {
  display: none !important;
}

@media (max-width: 720px) {
  body[data-route="macro"] .macro-top-nav.macro-top-nav {
    position: relative !important;
    top: 0 !important;
    margin-bottom: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body * { scroll-behavior: auto !important; }
  body :is(.dashboard-tile, .dashboard-card, .market-dashboard-tile,
    .intel-card, .intel-metric, .macro-card, .macro-stat, .macro-metric,
    .journal-card, .sentinel-card, .cd, .sc, .tc, .detail-cell) {
    transition: none !important;
    transform: none !important;
  }
}
