/* =====================================================================
   DealerMap — PRODUCTION THEME LAYER  ·  "Refined Terminal" (violet/cyan)
   ---------------------------------------------------------------------
   Loaded AFTER app.css in base.html. Re-skins the entire site by
   overriding the existing token system to a refined purple/cyan palette.
   PURELY ADDITIVE & VISUAL — touches no markup, no JS, no behavior.
   To roll back: remove the single <link> in base.html.

   Strategy: app.css is fully token-driven (--bg/--text/--line/--teal/
   --amber/--accent-*). We re-define those tokens for every
   theme x color-scheme combo at matching specificity; because this file
   loads later, our values win the cascade and propagate everywhere,
   including the derived gradients/glows/shadows in app.css :root.
   ===================================================================== */

/* -------------------------------------------------------------------- *
 * 1. DARK — refined cool near-black + violet/cyan brand
 *    (covers all three saved color-schemes so every user sees it)
 * -------------------------------------------------------------------- */
:root,
html[data-theme="dark"],
html[data-theme="dark"][data-color-scheme="emerald"],
html[data-theme="dark"][data-color-scheme="classic"],
html[data-theme="dark"][data-color-scheme="mono"] {
  /* neutrals — deep blue-black tuned to match the React islands (#04070d-ish) */
  --bg:          #05080f;
  --bg-up:       #090e18;
  --bg-panel:    rgba(15, 21, 35, 0.94);
  --bg-card:     rgba(12, 17, 29, 0.96);
  --line:        rgba(46, 123, 255, 0.15);
  --line-s:      rgba(46, 123, 255, 0.30);
  --text:        #e7eefb;
  --bright:      #ffffff;
  --muted:       #96a6cb;
  --faint:       rgba(172, 186, 222, 0.42);   /* lifted for AA contrast */

  /* primary (violet #2e7bff) + secondary (cyan #6aa6ff) — matched to islands */
  --teal:        #2e7bff;
  --teal-d:      rgba(46, 123, 255, 0.16);
  --amber:       #6aa6ff;
  --amber-d:     rgba(106, 166, 255, 0.14);

  /* semantic price colours — matched to islands (mint up / pink down) */
  --green:       #3ddc84;
  --red:         #ff5d5d;

  --shadow:      0 30px 70px -28px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(46, 123, 255, 0.09);
  --shadow-sm:   0 10px 28px -14px rgba(0, 0, 0, 0.62);

  /* accent family — the engine that recolours the whole site */
  --accent-primary:        #2e7bff;
  --accent-primary-deep:   #1e63e0;
  --accent-primary-rgb:    46, 123, 255;
  --accent-secondary:      #6aa6ff;
  --accent-secondary-deep: #2e7bff;
  --accent-secondary-rgb:  106, 166, 255;

  --grid-line: rgba(46, 123, 255, 0.04);
  --grid-animation: gridPan 36s linear infinite;
  --ambient-flares:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(46, 123, 255, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 100%, rgba(106, 166, 255, 0.09) 0%, transparent 52%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(46, 123, 255, 0.05) 0%, transparent 55%);
}

/* -------------------------------------------------------------------- *
 * 2. LIGHT — soft cool-white + deep violet/teal brand
 * -------------------------------------------------------------------- */
html[data-theme="light"],
html[data-theme="light"][data-color-scheme="emerald"],
html[data-theme="light"][data-color-scheme="classic"],
html[data-theme="light"][data-color-scheme="mono"] {
  --bg:          #eef0f8;
  --bg-up:       #e6e9f4;
  --bg-panel:    rgba(255, 255, 255, 0.92);
  --bg-card:     rgba(255, 255, 255, 0.98);
  --line:        rgba(30, 99, 224, 0.12);
  --line-s:      rgba(30, 99, 224, 0.22);
  --text:        #1b1830;
  --bright:      #0a0816;
  --muted:       #5b5878;
  --faint:       rgba(27, 24, 48, 0.30);

  --teal:        #1e63e0;
  --teal-d:      rgba(124, 58, 237, 0.10);
  --amber:       #1666cc;
  --amber-d:     rgba(22, 102, 204, 0.10);
  --green:       #0f9d6b;
  --red:         #d23b56;

  --shadow:      0 22px 52px -26px rgba(40, 26, 90, 0.20), 0 0 0 1px rgba(30, 99, 224, 0.06);
  --shadow-sm:   0 8px 22px -12px rgba(40, 26, 90, 0.14);

  --accent-primary:        #1e63e0;
  --accent-primary-deep:   #1a56c9;
  --accent-primary-rgb:    124, 58, 237;
  --accent-secondary:      #1666cc;
  --accent-secondary-deep: #0e7490;
  --accent-secondary-rgb:  22, 102, 204;

  --grid-line: rgba(124, 58, 237, 0.05);
  --grid-animation: none;
  --ambient-flares:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(124, 58, 237, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 100%, rgba(22, 102, 204, 0.07) 0%, transparent 52%);
}

/* -------------------------------------------------------------------- *
 * 3. TYPOGRAPHY — Manrope for display headings (Manrope already loaded
 *    in base.html). Inter stays for body/UI, JetBrains Mono for data.
 * -------------------------------------------------------------------- */
h1, h2, h3,
.home-welcome-copy h1,
.auth-surface-title,
.login-cinematic-headline,
.login-cinematic-kicker,
.section-title, .panel-title, .card-title,
.home-monthly-letter-head h2,
.surface-showcase-copy h2 {
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}
.login-cinematic-headline { letter-spacing: -0.03em; }

/* gradient brand wordmark wherever a .brand / logo text appears */
.brand-plaque + .home-brand-copy strong,
.home-brand-copy strong {
  background: linear-gradient(120deg, var(--bright) 0%, #d6e4ff 55%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* -------------------------------------------------------------------- *
 * 4. SAFE GLOBAL POLISH (additive, low-risk)
 * -------------------------------------------------------------------- */
/* refined selection + scrollbars in brand violet */
::selection { background: rgba(var(--accent-primary-rgb), 0.32); color: #fff; }
html[data-theme="dark"] ::-webkit-scrollbar { width: 11px; height: 11px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.22); border-radius: 99px;
  border: 3px solid transparent; background-clip: padding-box;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.40); background-clip: padding-box; }

/* gentle frosted depth on the index tape (already has backdrop-filter) */
.site-index-tape { backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); }

/* smoother accent focus ring on the most common interactive elements */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.field-input:focus-visible,
.theme-switch-button:focus-visible,
a.home-nav-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.30);
}

/* refined primary button sheen-on-hover (uses existing gradient token) */
.btn-primary { position: relative; overflow: hidden; transition: transform 140ms cubic-bezier(0.22,0.61,0.36,1), box-shadow 140ms ease; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%);
  transform: translateX(-130%); pointer-events: none;
}
.btn-primary:hover::after { animation: dmThemeSheen 0.9s cubic-bezier(0.22,0.61,0.36,1); }
@keyframes dmThemeSheen { from { transform: translateX(-130%); } to { transform: translateX(130%); } }

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover::after { animation: none; }
  .btn-primary:hover { transform: none; }
}

/* =====================================================================
   5. GREEN ELIMINATION (audit-driven, 2026-05-31)
   Kills brand-green that bypasses the token system (own namespaces +
   hardcoded values + React island). Brand green -> VIOLET #2e7bff;
   semantic up/positive normalised to MINT #3ddc84; down -> PINK #ff5d5d.
   ===================================================================== */

/* ---- Home console (Flask rail uses its own --home-* namespace) ---- */
body.page-home-dashboard { --home-green: #3ddc84; }
html[data-theme="light"] body.page-home-dashboard { --home-green: #3ddc84; }

body.page-home-dashboard .home-primary-action {
  border-color: rgba(46, 123, 255, 0.5);
  background: rgba(46, 123, 255, 0.14);
}
body.page-home-dashboard .home-primary-action:hover,
body.page-home-dashboard .home-primary-action:focus-visible { border-color: rgba(46, 123, 255, 0.6); }

body.page-home-dashboard .home-nav-item.is-active {
  border-color: #2e7bff;
  background: linear-gradient(90deg, rgba(46, 123, 255, 0.18), rgba(46, 123, 255, 0.02));
  color: #eef2ff;
}
body.page-home-dashboard .home-nav-item.is-active::before { background: #2e7bff !important; }

body.page-home-dashboard .home-user strong { color: #9bb6f0; }
body.page-home-dashboard .home-user span { border-color: rgba(46, 123, 255, 0.58); color: #2e7bff; }

/* decorative green gradients -> violet/cyan */
body.page-home-dashboard .home-welcome-copy {
  background:
    linear-gradient(135deg, rgba(46, 123, 255, 0.11), transparent 38%),
    linear-gradient(315deg, rgba(106, 166, 255, 0.13), transparent 42%),
    var(--home-panel-strong);
}
body.page-home-dashboard .home-letter-panel {
  background:
    linear-gradient(135deg, rgba(46, 123, 255, 0.11), transparent 34%),
    linear-gradient(315deg, rgba(106, 166, 255, 0.10), transparent 44%),
    var(--home-panel);
}
body.page-home-dashboard .home-0dte-letter-panel {
  background:
    linear-gradient(135deg, rgba(106, 166, 255, 0.13), transparent 34%),
    linear-gradient(315deg, rgba(46, 123, 255, 0.10), transparent 44%),
    var(--home-panel);
}
body.page-home-dashboard .home-heatmap-legend {
  background: linear-gradient(90deg, rgba(255, 93, 93, 0.88), rgba(106, 166, 255, 0.6), rgba(46, 123, 255, 0.9));
}
body.page-home-dashboard .home-heat-tile.is-up::before {
  background: linear-gradient(145deg, rgba(61, 220, 132, 0.6), rgba(106, 166, 255, 0.22));
}
body.page-home-dashboard .home-tool-square::before {
  background:
    linear-gradient(135deg, rgba(46, 123, 255, 0.16), transparent 48%),
    linear-gradient(315deg, rgba(106, 166, 255, 0.12), transparent 52%);
}
body.page-home-dashboard .home-tool-v8::before {
  background:
    linear-gradient(135deg, rgba(106, 166, 255, 0.22), transparent 48%),
    linear-gradient(315deg, rgba(46, 123, 255, 0.14), transparent 52%);
}
body.page-home-dashboard .home-loading-tile {
  background:
    linear-gradient(135deg, rgba(46, 123, 255, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.035);
}
/* light variants */
html[data-theme="light"] body.page-home-dashboard .home-nav-item.is-active {
  border-color: #1e63e0 !important;
  background: rgba(124, 58, 237, 0.12) !important;
  color: var(--home-text) !important;
}
html[data-theme="light"] body.page-home-dashboard .home-user strong,
html[data-theme="light"] body.page-home-dashboard .home-user span { color: #1e63e0 !important; }
html[data-theme="light"] body.page-home-dashboard .home-primary-action {
  border-color: rgba(124, 58, 237, 0.5) !important;
  background: rgba(124, 58, 237, 0.12) !important;
}

/* ---- React islands (compiled css loads later -> use !important) ---- */
/* HomeCommandCenter primary CTA ("Open Surface") -> violet→cyan */
.dm-home-actions a:first-child {
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  border-color: transparent !important;
  color: #0a0814 !important;
}
/* StructureFlow brand select -> cyan→violet (was cyan→mint) */
.dm-structure-select { background: linear-gradient(135deg, #6aa6ff, #2e7bff) !important; }

/* ---- Semantic up/positive normalised to MINT #3ddc84 (kept green) ---- */
.flash-success, .status-banner[data-tone="success"] {
  border-color: rgba(61, 220, 132, 0.28);
  background: rgba(61, 220, 132, 0.07);
  color: #3ddc84;
}
body.page-market-analysis .market-analysis-status[data-tone="ready"] {
  color: #3ddc84; border-color: rgba(61, 220, 132, 0.22); background: rgba(61, 220, 132, 0.07);
}
@keyframes spotFlashUp {
  0%   { color: #3ddc84; text-shadow: 0 0 20px rgba(61, 220, 132, 0.65); }
  100% { color: var(--bright); text-shadow: none; }
}
.ladder-bar-fill.pos {
  background: linear-gradient(90deg, rgba(61, 220, 132, 0.42), rgba(61, 220, 132, 0.88));
  box-shadow: 0 0 8px rgba(61, 220, 132, 0.26);
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-replay-marker.is-session_high,
html body.page-dashboard-v5.page-dashboard-v5 .v5-replay-marker.is-bullish { background: #3ddc84 !important; }
html body.page-dashboard-v5.page-dashboard-v5 .v5-price-ohlc-strip.is-bullish {
  background: linear-gradient(90deg, rgba(61, 220, 132, 0.08), transparent 34%), rgba(3, 8, 10, 0.56) !important;
  border-color: rgba(61, 220, 132, 0.28) !important;
}

/* =====================================================================
   6. SURFACE PAGE RE-SKIN (body.page-dashboard-v5)
   Visual-only refinement of the existing .v5-* chrome — frosted panels,
   refined controls, violet/cyan accents, Manrope titles. NO DOM/JS change.
   ===================================================================== */
body.page-dashboard-v5 {
  --v5-skin-line: rgba(46, 123, 255, 0.18);
  --v5-skin-line-2: rgba(46, 123, 255, 0.30);
  --v5-skin-glass: linear-gradient(180deg, rgba(20, 26, 42, 0.94), rgba(12, 16, 28, 0.92));
}

/* ---- unified frosted panels ---- */
body.page-dashboard-v5 .v5-widget-panel,
body.page-dashboard-v5 .v5-stage-panel,
body.page-dashboard-v5 .v5-inspector-panel,
body.page-dashboard-v5 .v5-surface-tape,
body.page-dashboard-v5 .v5-market-card,
body.page-dashboard-v5 .v5-monthly-oi-panel,
body.page-dashboard-v5 .v5-swing-algo-alert,
body.page-dashboard-v5 .v5-widget-algo-levels-panel,
body.page-dashboard-v5 .v5-pro-scope-card,
body.page-dashboard-v5 .v5-surface-weight-card,
body.page-dashboard-v5 .v5-surface-mini-card {
  border: 1px solid var(--v5-skin-line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 38%),
    var(--v5-skin-glass);
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}

/* ---- left rail ---- */
body.page-dashboard-v5 .v5-pro-rail {
  border: 1px solid var(--v5-skin-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(12, 16, 28, 0.9));
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}
body.page-dashboard-v5 .v5-pro-nav-item.is-active {
  background: linear-gradient(90deg, rgba(46, 123, 255, 0.2), rgba(46, 123, 255, 0.02));
  border-color: var(--v5-skin-line-2);
  color: #fff;
}
body.page-dashboard-v5 .v5-pro-nav-item.is-active::before { background: #2e7bff !important; }
body.page-dashboard-v5 .v5-pro-brand-copy strong {
  background: linear-gradient(120deg, #fff, #d6e4ff 55%, #b9d3ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---- command band (top controls) ---- */
body.page-dashboard-v5 .v5-pro-command-band {
  border: 1px solid var(--v5-skin-line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 24, 40, 0.8), rgba(10, 14, 24, 0.7));
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

/* ---- inputs / selects ---- */
body.page-dashboard-v5 .vgex-input,
body.page-dashboard-v5 select.vgex-input,
body.page-dashboard-v5 .vgex-input-date {
  border: 1px solid rgba(46, 123, 255, 0.22);
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.82);
  color: #e7eefb;
}
body.page-dashboard-v5 .vgex-input:focus,
body.page-dashboard-v5 select.vgex-input:focus {
  outline: none;
  border-color: #2e7bff;
  box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.2);
}
body.page-dashboard-v5 .vgex-label { color: var(--accent-secondary); letter-spacing: 0.12em; }

/* ---- toggles / segments: active -> violet→cyan (replaces warm gold/blue) ---- */
body.page-dashboard-v5 .vgex-view-toggle.is-active,
body.page-dashboard-v5 .vgex-futures-toggle.is-active,
body.page-dashboard-v5 .vgex-risk-metric-toggle.is-active,
body.page-dashboard-v5 .vgex-gamma-metric-toggle.is-active,
body.page-dashboard-v5 .vgex-oi-sign-mode-toggle.is-active,
body.page-dashboard-v5 .v5-surface-mode-toggle.is-active,
body.page-dashboard-v5 .v5-strike-segment-button.is-active,
body.page-dashboard-v5 .v5-price-range-button.is-active,
body.page-dashboard-v5 .v5-split-mode-button.is-active,
body.page-dashboard-v5 .v5-surface-chart-view-toggle.is-active,
body.page-dashboard-v5 [aria-pressed="true"].vgex-view-toggle,
body.page-dashboard-v5 [data-active="true"].vgex-view-toggle {
  background: linear-gradient(135deg, rgba(46, 123, 255, 0.3), rgba(106, 166, 255, 0.16)) !important;
  border-color: rgba(46, 123, 255, 0.5) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* ---- primary/secondary action buttons (warm gold/green -> violet→cyan) ---- */
body.page-dashboard-v5 .vgex-load-button,
body.page-dashboard-v5 .vgex-live-mode-button,
body.page-dashboard-v5 .v5-save-setup-button {
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  border: none !important;
  color: #0a0814 !important;
  box-shadow: 0 10px 26px -12px rgba(46, 123, 255, 0.6) !important;
}

/* ---- metric tiles ---- */
body.page-dashboard-v5 .v5-pro-metric,
body.page-dashboard-v5 .v5-whatif-metric {
  border: 1px solid var(--v5-skin-line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(46, 123, 255, 0.06), rgba(255, 255, 255, 0.015));
}
body.page-dashboard-v5 .v5-pro-metric strong { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---- chart shells ---- */
body.page-dashboard-v5 .chart-shell,
body.page-dashboard-v5 .v5-tool-chart-shell,
body.page-dashboard-v5 .v5-monthly-oi-chart {
  border: 1px solid rgba(46, 123, 255, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(46, 123, 255, 0.07), transparent 46%),
    rgba(7, 10, 18, 0.66);
}

/* ---- level rows / lists ---- */
body.page-dashboard-v5 .v5-widget-market-level,
body.page-dashboard-v5 .v5-corridor-level,
body.page-dashboard-v5 .v5-pressure-row {
  border: 1px solid rgba(46, 123, 255, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

/* ---- market direction meter ---- */
body.page-dashboard-v5 .v5-direction-meter-fill {
  background: linear-gradient(90deg, #2e7bff, #6aa6ff) !important;
}

/* ---- IRIS signal status: violet "live/active" framing ---- */
body.page-dashboard-v5 .v5-iris-signal-dot {
  background: #2e7bff !important;
  box-shadow: 0 0 0 4px rgba(46, 123, 255, 0.12), 0 0 14px rgba(46, 123, 255, 0.5) !important;
}
body.page-dashboard-v5 .v5-iris-signal-status { border-color: rgba(46, 123, 255, 0.4) !important; }

/* ---- titles -> Manrope ---- */
body.page-dashboard-v5 .v5-pro-title,
body.page-dashboard-v5 .chart-title,
body.page-dashboard-v5 .v5-stage-head h2,
body.page-dashboard-v5 .v5-market-bias,
body.page-dashboard-v5 .v5-surface-tape-head .chart-title {
  font-family: "Manrope", "Inter", sans-serif;
  letter-spacing: -0.02em;
}
body.page-dashboard-v5 .chart-kicker,
body.page-dashboard-v5 .v5-market-kicker,
body.page-dashboard-v5 .v5-stage-tag { color: var(--accent-secondary); }

/* ---- 6b. high-specificity corrections (match app.css's own !important rules) ---- */
/* SAVE SETUP button: gold→mint  ->  violet→cyan */
html body.page-dashboard-v5.page-dashboard-v5 #v5-save-defaults-btn.v5-save-setup-button {
  border-color: rgba(46, 123, 255, 0.7) !important;
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  color: #0a0814 !important;
  box-shadow: 0 0 0 1px rgba(46, 123, 255, 0.3), 0 16px 34px -12px rgba(46, 123, 255, 0.4) !important;
}
html body.page-dashboard-v5.page-dashboard-v5 #v5-save-defaults-btn.v5-save-setup-button::before {
  background: rgba(10, 8, 20, 0.2) !important; color: #0a0814 !important;
}
/* gold focus ring -> violet */
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-controls :is(button, .vgex-input):focus-visible {
  outline: 2px solid rgba(46, 123, 255, 0.8) !important;
}
/* frosted panel framing (beat any high-spec panel rules) */
html body.page-dashboard-v5.page-dashboard-v5 :is(.v5-widget-panel,.v5-stage-panel,.v5-inspector-panel,.v5-surface-tape,.v5-market-card,.v5-monthly-oi-panel,.v5-swing-algo-alert,.v5-widget-algo-levels-panel,.v5-pro-scope-card,.v5-surface-weight-card,.v5-surface-mini-card) {
  border: 1px solid rgba(46, 123, 255, 0.18) !important;
  border-radius: 18px !important;
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}
html body.page-dashboard-v5.page-dashboard-v5 :is(.chart-shell,.v5-tool-chart-shell,.v5-monthly-oi-chart) {
  border: 1px solid rgba(46, 123, 255, 0.16) !important; border-radius: 16px !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-nav-item.is-active {
  border-color: rgba(46, 123, 255, 0.42) !important;
  background: linear-gradient(90deg, rgba(46, 123, 255, 0.2), rgba(46, 123, 255, 0.02)) !important;
  color: #fff !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-nav-item.is-active::before { background: #2e7bff !important; }
html body.page-dashboard-v5.page-dashboard-v5 .v5-iris-signal-dot {
  background: #2e7bff !important;
  box-shadow: 0 0 0 4px rgba(46, 123, 255, 0.12), 0 0 14px rgba(46, 123, 255, 0.5) !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-iris-signal-status { border-color: rgba(46, 123, 255, 0.4) !important; }
html body.page-dashboard-v5.page-dashboard-v5 .v5-direction-meter-fill { background: linear-gradient(90deg, #2e7bff, #6aa6ff) !important; }
html body.page-dashboard-v5.page-dashboard-v5 :is(.v5-pro-metric,.v5-whatif-metric) { border: 1px solid rgba(46, 123, 255, 0.16) !important; }
html body.page-dashboard-v5.page-dashboard-v5 :is(.v5-pro-title,.chart-title,.v5-market-bias) { font-family: "Manrope","Inter",sans-serif !important; letter-spacing: -0.02em; }

/* ---- 6c. bolder & more usable: force chart colours + elevate panels ---- */
/* chart palette -> cyan/violet on EVERY saved scheme (beats non-!important scheme blocks) */
html body.page-dashboard-v5.page-dashboard-v5 {
  --dm-chart-positive: #6aa6ff !important;     /* calls / +gamma -> cyan  */
  --dm-chart-negative: #2e7bff !important;     /* puts / -gamma  -> violet */
  --dm-chart-neutral: rgba(150, 166, 203, 0.5) !important;
  --dm-chart-grid: rgba(155, 168, 214, 0.09) !important;   /* soft, lets charts breathe */
  --dm-chart-axis: rgba(214, 224, 248, 0.55) !important;
  --dm-chart-text: #e7eefb !important;          /* crisp value labels */
  --dm-chart-subtext: rgba(154, 168, 205, 0.82) !important;
  --dm-chart-tooltip-bg: rgba(10, 14, 26, 0.96) !important;  /* frosted dark tooltip */
  --dm-chart-tooltip-border: rgba(46, 123, 255, 0.32) !important;
  --dm-terminal-accent: #2e7bff !important;
  --dm-terminal-secondary: #6aa6ff !important;
}
/* elevate panels so they read as distinct frosted cards (the "too subtle" fix) */
html body.page-dashboard-v5.page-dashboard-v5 :is(.v5-widget-panel,.v5-stage-panel,.v5-inspector-panel,.v5-surface-tape,.v5-market-card,.v5-monthly-oi-panel,.v5-swing-algo-alert,.v5-widget-algo-levels-panel,.v5-surface-weight-card,.v5-surface-mini-card) {
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.07), transparent 42%),
    linear-gradient(180deg, rgba(26, 32, 52, 0.84), rgba(16, 20, 34, 0.82)) !important;
  backdrop-filter: blur(14px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(135%) !important;
}
/* chart shells: faint framed surface so empty/loading reads as intentional */
html body.page-dashboard-v5.page-dashboard-v5 :is(.chart-shell,.v5-tool-chart-shell,.v5-monthly-oi-chart) {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(46, 123, 255, 0.09), transparent 46%),
    rgba(12, 16, 28, 0.72) !important;
}

/* ---- 6d. chart loading skeleton: subtle shimmer until a canvas/svg mounts ---- */
html body.page-dashboard-v5.page-dashboard-v5 :is(.chart-shell,.v5-tool-chart-shell,.v5-monthly-oi-chart):not(:has(canvas)):not(:has(svg)) {
  background-image:
    linear-gradient(90deg, rgba(46, 123, 255, 0.03) 0%, rgba(106, 166, 255, 0.08) 50%, rgba(46, 123, 255, 0.03) 100%) !important;
  background-size: 220% 100% !important;
  background-repeat: no-repeat !important;
  animation: dmChartShimmer 1.7s linear infinite !important;
}
@keyframes dmChartShimmer { from { background-position: 220% 0; } to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) {
  html body.page-dashboard-v5.page-dashboard-v5 :is(.chart-shell,.v5-tool-chart-shell,.v5-monthly-oi-chart):not(:has(canvas)):not(:has(svg)) { animation: none !important; }
}

/* =====================================================================
   7. MARKET DIRECTION INDEX gauge (.dm-mdi) — mounts at top of Surface
   Bull/bear composite: bear=pink, balanced=violet, bull=mint. Frosted card.
   ===================================================================== */
.dm-mdi {
  --bear: #ff5d5d; --bull: #3ddc84; --bal: #2e7bff;
  position: relative; border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(46, 123, 255, 0.22);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 93, 93, 0.07), transparent 42%),
    radial-gradient(120% 140% at 100% 0%, rgba(61, 220, 132, 0.07), transparent 42%),
    linear-gradient(180deg, rgba(22, 28, 46, 0.92), rgba(13, 17, 29, 0.92));
  box-shadow: 0 24px 54px -28px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px) saturate(135%); -webkit-backdrop-filter: blur(14px) saturate(135%);
  padding: clamp(16px, 2.2vw, 24px) clamp(18px, 2.6vw, 30px);
  margin-bottom: 14px;
}
.dm-mdi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dm-mdi-eyebrow { font-family: "Manrope","Inter",sans-serif; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-secondary); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.dm-mdi-eyebrow svg { width: 15px; height: 15px; }
.dm-mdi-status { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.dm-mdi-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bull); box-shadow: 0 0 9px var(--bull); }
.dm-mdi-status.is-stale .dot { background: var(--warn); box-shadow: 0 0 9px var(--warn); }
.dm-mdi-status.is-offline .dot { background: var(--bear); box-shadow: 0 0 9px var(--bear); }
.dm-mdi-status .dot { animation: dm-pulse 1.9s var(--ease, ease) infinite; }

.dm-mdi-grid { display: grid; grid-template-columns: minmax(240px, 320px) 1px 1fr; gap: clamp(16px, 2.4vw, 32px); align-items: center; }
.dm-mdi-sep { width: 1px; align-self: stretch; background: linear-gradient(180deg, transparent, rgba(46,123,255,0.22), transparent); }
@media (max-width: 880px) { .dm-mdi-grid { grid-template-columns: 1fr; } .dm-mdi-sep { display: none; } }

/* ---- gauge dial ---- */
.dm-mdi-dial { position: relative; }
.dm-mdi-dial svg { width: 100%; height: auto; display: block; overflow: visible; }
.dm-mdi-arc-track { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 14; stroke-linecap: round; }
.dm-mdi-arc { fill: none; stroke: url(#dmMdiArc); stroke-width: 14; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(46,123,255,0.35)); }
.dm-mdi-tick { stroke: rgba(255,255,255,0.18); stroke-width: 1.5; }
.dm-mdi-needle { transition: transform 900ms cubic-bezier(0.34,1.4,0.5,1); transform-box: fill-box; }
.dm-mdi-needle line { stroke: #fff; stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255,255,255,0.6)); }
.dm-mdi-needle circle { fill: #fff; }
.dm-mdi-hub { fill: var(--bg-2, #0b1116); stroke: rgba(255,255,255,0.25); stroke-width: 1.5; }
.dm-mdi-readout { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; }
.dm-mdi-score { font-family: "JetBrains Mono", monospace; font-size: clamp(38px, 5vw, 52px); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.dm-mdi-score.is-bull { color: var(--bull); } .dm-mdi-score.is-bear { color: var(--bear); } .dm-mdi-score.is-balanced { color: #a8c4f5; }
.dm-mdi-band { font-family: "Manrope","Inter",sans-serif; font-weight: 800; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 4px; }
.dm-mdi-band.is-bull { color: var(--bull); } .dm-mdi-band.is-bear { color: var(--bear); } .dm-mdi-band.is-balanced { color: #a8c4f5; }
.dm-mdi-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--faint); margin-top: 2px; padding: 0 6px; }

/* ---- confidence ---- */
.dm-mdi-conf { margin-top: 14px; }
.dm-mdi-conf-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.dm-mdi-conf-row .lbl { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.dm-mdi-conf-row .val { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text); }
.dm-mdi-conf-meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; }
.dm-mdi-conf-meter > span { display: block; height: 100%; border-radius: 99px; background: var(--grad-brand); transition: width 800ms var(--ease-out, ease); }

/* ---- layer breakdown (diverging bars) ---- */
.dm-mdi-layers { display: flex; flex-direction: column; gap: 12px; }
.dm-mdi-layers-head { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: 2px; }
.dm-mdi-layer { display: grid; grid-template-columns: 150px 1fr 64px; gap: 12px; align-items: center; }
@media (max-width: 560px) { .dm-mdi-layer { grid-template-columns: 110px 1fr 52px; gap: 8px; } }
.dm-mdi-layer-name { font-size: 12.5px; font-weight: 650; color: var(--text); }
.dm-mdi-layer-name small { display: block; font-size: 10px; color: var(--faint); font-weight: 600; }
.dm-mdi-layer-name .dim { color: var(--faint); font-weight: 700; }
.dm-mdi-bar { position: relative; height: 10px; border-radius: 99px; background: rgba(255,255,255,0.05); }
.dm-mdi-bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(255,255,255,0.18); }
.dm-mdi-bar > span { position: absolute; top: 0; bottom: 0; border-radius: 99px; transition: left 800ms var(--ease-out, ease), width 800ms var(--ease-out, ease); }
.dm-mdi-bar > span.is-bull { background: linear-gradient(90deg, rgba(61,220,132,0.45), var(--bull)); }
.dm-mdi-bar > span.is-bear { background: linear-gradient(270deg, rgba(255,93,93,0.45), var(--bear)); }
.dm-mdi-layer-val { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; text-align: right; }
.dm-mdi-layer-val.is-bull { color: var(--bull); } .dm-mdi-layer-val.is-bear { color: var(--bear); } .dm-mdi-layer-val.is-balanced { color: var(--muted); }
.dm-mdi-damp { font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 8px; margin-top: 2px; line-height: 1.4; }
.dm-mdi-damp svg { width: 14px; height: 14px; flex: none; color: #a8c4f5; }
.dm-mdi-damp b { color: #a8c4f5; font-family: var(--font-mono); }
.dm-mdi-foot { margin-top: 12px; font-size: 10.5px; color: var(--faint); line-height: 1.4; }

/* ---- skeleton + states ---- */
.dm-mdi-skeleton { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center; min-height: 150px; }
@media (max-width: 880px) { .dm-mdi-skeleton { grid-template-columns: 1fr; } }
.dm-mdi-sk { border-radius: 12px; background: linear-gradient(90deg, rgba(46,123,255,0.05), rgba(106,166,255,0.1), rgba(46,123,255,0.05)); background-size: 220% 100%; animation: dmChartShimmer 1.7s linear infinite; }
.dm-mdi-sk.dial { height: 150px; border-radius: 16px; }
.dm-mdi-sk.row { height: 12px; }
.dm-mdi-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .dm-mdi-needle, .dm-mdi-bar > span, .dm-mdi-conf-meter > span { transition: none; } .dm-mdi-sk { animation: none; } }
/* command band: clearly elevated control bar */
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-band {
  background: linear-gradient(180deg, rgba(24, 30, 50, 0.82), rgba(12, 16, 28, 0.78)) !important;
  border: 1px solid rgba(46, 123, 255, 0.2) !important;
  border-radius: 16px !important;
}

/* =====================================================================
   8. SURFACE PROFESSIONAL PASS (2026-06-09)
   Consistency + readability polish on the Surface page chrome: unified
   radii, real type hierarchy, calmer command band, refined node table.
   CSS-only — no markup/JS hooks touched. Roll back: delete this section.
   ===================================================================== */

/* ---- 8a. command band: kill the 3px radius outlier, even out controls ---- */
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-controls {
  gap: 9px !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-band {
  padding: 12px !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-controls :is(.vgex-load-button, .vgex-live-mode-button, .vgex-futures-toggle, .vgex-view-toggle, .vgex-volume-over-oi-toggle, .vgex-risk-metric-toggle, .vgex-gamma-metric-toggle, .vgex-oi-sign-mode-toggle, .v5-surface-mode-toggle, .v5-save-setup-button, .v5-home-link-button) {
  min-height: 38px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  transition: border-color 130ms ease, background-color 130ms ease, box-shadow 130ms ease, transform 130ms ease;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-controls .vgex-input {
  min-height: 38px !important;
  border-radius: 10px !important;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-controls .vgex-input:hover {
  border-color: rgba(46, 123, 255, 0.45);
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-controls :is(button):hover {
  border-color: rgba(46, 123, 255, 0.5) !important;
}
/* native form widgets (date picker, select arrows) follow the dark scheme */
html[data-theme="dark"] body.page-dashboard-v5 :is(.vgex-input, .vgex-input-date, select.vgex-input, .v5-price-interval-select, .v5-iris-range-input) {
  color-scheme: dark;
}

/* ---- 8b. hero: brand-gradient title + readable metric tiles ---- */
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-title {
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 60%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-metric {
  gap: 4px !important;
  padding: 9px 12px !important;
  border-radius: 12px !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-metric span {
  font-size: 0.62rem !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(168, 182, 218, 0.85) !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-metric strong {
  font-size: 0.95rem !important;
  color: #ffffff;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-metric small {
  font-size: 0.66rem !important;
  color: rgba(150, 166, 203, 0.85) !important;
}

/* ---- 8c. panel headers: consistent kicker/title/support hierarchy ---- */
body.page-dashboard-v5 .chart-kicker,
body.page-dashboard-v5 .v5-market-kicker {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
body.page-dashboard-v5 .chart-support {
  color: rgba(150, 166, 203, 0.9);
  line-height: 1.45;
}
body.page-dashboard-v5 .chart-meta-v5 {
  border-radius: 9px;
}

/* ---- 8d. surface node table: header + row readability ---- */
body.page-dashboard-v5 .v5-surface-ladder-header span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(168, 182, 218, 0.9);
}
body.page-dashboard-v5 .v5-surface-ladder-row {
  border-radius: 10px;
  transition: background-color 120ms ease, border-color 120ms ease;
}
body.page-dashboard-v5 .v5-surface-ladder-row:hover {
  background: rgba(46, 123, 255, 0.10);
  border-color: rgba(46, 123, 255, 0.36);
}
body.page-dashboard-v5 .v5-surface-ladder-row:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 123, 255, 0.55);
}
body.page-dashboard-v5 .v5-surface-ladder-row.is-spot {
  border-color: rgba(106, 166, 255, 0.45);
  background: linear-gradient(90deg, rgba(106, 166, 255, 0.10), rgba(106, 166, 255, 0.02));
}

/* ---- 8e. uniform small-control focus + hover affordance everywhere ---- */
body.page-dashboard-v5 :is(.v5-strike-segment-button, .v5-split-mode-button, .v5-price-range-button, .v5-iris-range-button, .v5-iris-pan-mode-button, .v5-iris-reset-zoom-button, .v5-surface-chart-view-toggle, .v5-price-gamma-source-toggle, .v5-price-level-button, .v5-price-reset-zoom, .v5-replay-button, .v5-replay-step-button) {
  border-radius: 9px;
  transition: border-color 130ms ease, background-color 130ms ease, color 130ms ease;
}
body.page-dashboard-v5 :is(.v5-strike-segment-button, .v5-split-mode-button, .v5-price-range-button, .v5-iris-range-button, .v5-surface-chart-view-toggle):hover {
  border-color: rgba(46, 123, 255, 0.5);
}
body.page-dashboard-v5 :is(.v5-strike-segment-button, .v5-split-mode-button, .v5-price-range-button, .v5-iris-range-button, .v5-iris-pan-mode-button, .v5-iris-reset-zoom-button, .v5-surface-chart-view-toggle, .vgex-input, button):focus-visible {
  outline: 2px solid rgba(46, 123, 255, 0.7);
  outline-offset: 1px;
}

/* ---- 8f. rail: calmer nav, clearer signed-in block ---- */
body.page-dashboard-v5 .v5-pro-nav-item {
  border-radius: 11px;
  transition: background-color 130ms ease, border-color 130ms ease;
}
body.page-dashboard-v5 .v5-pro-nav-item:hover:not(.is-active) {
  background: rgba(46, 123, 255, 0.07);
  border-color: rgba(46, 123, 255, 0.22);
}
body.page-dashboard-v5 .v5-pro-scope-card strong { color: #fff; }
body.page-dashboard-v5 .v5-pro-user small { overflow-wrap: anywhere; }

/* ---- 8g. status strips read as quiet system chrome, not alerts ---- */
body.page-dashboard-v5 .v5-surface-prewarm-status,
body.page-dashboard-v5 .v5-daily-algo-strip {
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-controls :is(button, .vgex-input),
  body.page-dashboard-v5 .v5-surface-ladder-row,
  body.page-dashboard-v5 .v5-pro-nav-item {
    transition: none !important;
  }
}


/* =====================================================================
   9.1. LOGIN / ACCOUNT RECOVERY (body.page-login-cinematic)
        PROFESSIONAL PASS (2026-06-09)
   Scope: templates/forgot_password.html — the ONLY template carrying
   page-login-cinematic. (login.html is standalone and loads
   dealermap-kit.css, not this file.) Aligns the recovery page with the
   kit landing it links from. Beats three legacy app.css passes, all
   !important at <= (0,3,2): "dm-terminal" teal (23400-23469),
   "IRIS landing" (35604-35936), "dm-" monochrome (36840-36988).
   Roll back: delete this section.
   ===================================================================== */

/* ---- 9.1a. page tokens: retune leftover --iris-landing-* to brand ---- */
html body.page-login-cinematic.page-login-cinematic {
  --iris-landing-line: rgba(46, 123, 255, 0.24);
  --iris-landing-line-strong: rgba(46, 123, 255, 0.44);
  --iris-landing-cyan: #6aa6ff;
  --iris-landing-violet: #2e7bff;
  --iris-landing-text: #e7eefb;
  --iris-landing-muted: #96a6cb;
  --iris-landing-soft: rgba(172, 186, 222, 0.55);
}
html[data-theme="light"] body.page-login-cinematic.page-login-cinematic {
  --iris-landing-line: rgba(30, 99, 224, 0.16);
  --iris-landing-line-strong: rgba(30, 99, 224, 0.30);
  --iris-landing-cyan: #1666cc;
  --iris-landing-violet: #1e63e0;
  --iris-landing-text: #1b1830;
  --iris-landing-muted: #5b5878;
  --iris-landing-soft: rgba(27, 24, 48, 0.55);
}

/* ---- 9.1b. backdrop: violet grid + the loginbackground.png canvas ---- */
html[data-theme="dark"] body.page-login-cinematic.page-login-cinematic {
  background:
    linear-gradient(180deg, rgba(9, 12, 24, 0.30), rgba(5, 8, 15, 0.96) 62%, #05080f 100%),
    linear-gradient(rgba(46, 123, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 166, 255, 0.035) 1px, transparent 1px),
    #05080f !important;
  background-size: auto, 52px 52px, 52px 52px, auto !important;
}
/* let the cinematic canvas (body::before, app.css:13037) read through —
   the "dm-" pass painted the shell opaque warm-black over it */
html body.page-login-cinematic.page-login-cinematic .site-shell {
  background: transparent !important;
}
html body.page-login-cinematic.page-login-cinematic::before {
  opacity: 0.5 !important;
}
html[data-theme="dark"] body.page-login-cinematic.page-login-cinematic .login-cinematic-stage {
  background:
    radial-gradient(ellipse 72% 48% at 50% 0%, rgba(46, 123, 255, 0.10), transparent 62%),
    linear-gradient(180deg, rgba(8, 11, 20, 0.34), rgba(5, 8, 15, 0.66) 58%, rgba(5, 8, 15, 0.88)) !important;
}

/* ---- 9.1c. composition: center the lone recovery card in the viewport.
        Auto margins (not justify-content) so overflowing content still
        scrolls correctly on short viewports / open keyboards. ---- */
html body.page-login-cinematic.page-login-cinematic .login-cinematic-topline {
  width: min(520px, 100%) !important;
  margin: auto auto 0 !important;
  justify-content: space-between !important;
}
html body.page-login-cinematic.page-login-cinematic .login-cinematic-dock {
  width: min(520px, 100%) !important;
  margin: 0 auto auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html body.page-login-cinematic.page-login-cinematic .login-cinematic-panelstack {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html body.page-login-cinematic.page-login-cinematic .login-cinematic-panel {
  width: 100% !important;
}
html body.page-login-cinematic.page-login-cinematic .login-cinematic-topitem {
  color: var(--muted) !important;
  font-size: 10.5px !important;
  letter-spacing: 0.16em !important;
}

/* ---- 9.1d. auth card: frosted glass, violet border, inset light edge ---- */
html body.page-login-cinematic.page-login-cinematic .login-cinematic-surface,
html body.page-login-cinematic.page-login-cinematic .auth-surface {
  border: 1px solid var(--line-s) !important;
  border-radius: 16px !important;
  padding: clamp(24px, 4.5vw, 32px) !important;
  gap: 15px !important;
  background:
    linear-gradient(180deg, rgba(var(--accent-primary-rgb), 0.07), transparent 44%),
    var(--bg-panel) !important;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(14px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(135%) !important;
  clip-path: none !important;
}
/* top light edge -> violet/cyan accent hairline */
html body.page-login-cinematic.page-login-cinematic .login-cinematic-surface::before {
  height: 2px !important;
  background: linear-gradient(90deg, rgba(46, 123, 255, 0.85), rgba(106, 166, 255, 0.45) 55%, transparent 85%) !important;
}

/* ---- 9.1e. card type hierarchy ---- */
html body.page-login-cinematic.page-login-cinematic .auth-surface-kicker,
html body.page-login-cinematic.page-login-cinematic .field-label {
  color: var(--accent-secondary) !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 0.66rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
}
html body.page-login-cinematic.page-login-cinematic .auth-surface-title {
  color: var(--bright) !important;
  font-size: 1.4rem !important;
  letter-spacing: -0.02em !important;
}
html body.page-login-cinematic.page-login-cinematic .auth-surface-badge {
  border: 1px solid rgba(var(--accent-primary-rgb), 0.38) !important;
  border-radius: 999px !important;
  background: rgba(var(--accent-primary-rgb), 0.13) !important;
  color: var(--accent-primary) !important;
  letter-spacing: 0.08em !important;
}
html body.page-login-cinematic.page-login-cinematic .field-help {
  color: var(--muted) !important;
  font-family: "Inter", system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}
html body.page-login-cinematic.page-login-cinematic .field-help a {
  color: var(--accent-secondary);
  border-bottom: 1px solid rgba(var(--accent-secondary-rgb), 0.35);
  transition: color 140ms ease, border-color 140ms ease;
}
html body.page-login-cinematic.page-login-cinematic .field-help a:hover,
html body.page-login-cinematic.page-login-cinematic .field-help a:focus-visible {
  color: var(--bright);
  border-bottom-color: var(--accent-secondary);
}

/* ---- 9.1f. inputs: unified 12px radius, violet focus ring ---- */
html body.page-login-cinematic.page-login-cinematic .field-input {
  min-height: 46px !important;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.28) !important;
  border-radius: 12px !important;
  color: var(--text) !important;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
html[data-theme="dark"] body.page-login-cinematic.page-login-cinematic .field-input {
  background: rgba(8, 12, 20, 0.82) !important;
  color-scheme: dark !important;
}
/* fixes the dark-input-on-light-card bug (app.css:23448 beat :13759) */
html[data-theme="light"] body.page-login-cinematic.page-login-cinematic .field-input {
  background: rgba(255, 255, 255, 0.88) !important;
  color-scheme: light !important;
}
html body.page-login-cinematic.page-login-cinematic .field-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.22) !important;
}
html[data-theme="dark"] body.page-login-cinematic.page-login-cinematic .field-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0b101c inset !important;
  -webkit-text-fill-color: #e7eefb !important;
  caret-color: #e7eefb;
}

/* ---- 9.1g. submit: brand-gradient CTA (Surface save-button precedent) ---- */
html body.page-login-cinematic.page-login-cinematic .auth-submit,
html body.page-login-cinematic.page-login-cinematic .btn-primary {
  min-height: 48px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  color: #0a0814 !important;
  font-family: "Manrope", "Inter", sans-serif !important;
  font-weight: 800 !important;
  font-size: 0.84rem !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
  box-shadow: 0 14px 30px -14px rgba(46, 123, 255, 0.55) !important;
}
html body.page-login-cinematic.page-login-cinematic .auth-submit:hover,
html body.page-login-cinematic.page-login-cinematic .btn-primary:hover {
  box-shadow: 0 18px 36px -14px rgba(46, 123, 255, 0.70) !important;
}
html body.page-login-cinematic.page-login-cinematic .auth-submit:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.35), 0 14px 30px -14px rgba(46, 123, 255, 0.55) !important;
}

/* ---- 9.1h. flash banners: semantic pink/mint, frosted ---- */
html body.page-login-cinematic.page-login-cinematic .flash-banner {
  border-radius: 12px !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
html body.page-login-cinematic.page-login-cinematic .flash-error {
  border-color: rgba(255, 93, 93, 0.34) !important;
  background: rgba(255, 93, 93, 0.08) !important;
  color: #ff5d5d !important;
}
html[data-theme="light"] body.page-login-cinematic.page-login-cinematic .flash-error {
  border-color: rgba(210, 59, 86, 0.34) !important;
  background: rgba(210, 59, 86, 0.07) !important;
  color: #d23b56 !important;
}
html body.page-login-cinematic.page-login-cinematic .flash-success {
  border-color: rgba(61, 220, 132, 0.30) !important;
  background: rgba(61, 220, 132, 0.07) !important;
  color: #3ddc84 !important;
}
html[data-theme="light"] body.page-login-cinematic.page-login-cinematic .flash-success {
  border-color: rgba(15, 157, 107, 0.30) !important;
  background: rgba(15, 157, 107, 0.07) !important;
  color: #0f9d6b !important;
}

@media (prefers-reduced-motion: reduce) {
  html body.page-login-cinematic.page-login-cinematic .field-input,
  html body.page-login-cinematic.page-login-cinematic .field-help a {
    transition: none !important;
  }
}


/* =====================================================================
   9.2. HOME CONSOLE PROFESSIONAL PASS (2026-06-09)
   Re-bases the legacy teal "emerald terminal" home console (app.css
   20691+, 22429 cross-page layer, 36916 institutional layer) onto the
   Refined Terminal language: violet/cyan tokens, frosted 16px glass
   panels, mint/pink semantics, shimmer skeletons for every async tile.
   NOTE: legacy token names are kept for cascade reasons —
   --home-cyan now carries the violet PRIMARY, --home-amber carries the
   cyan SECONDARY/flat tone. Scope: body.page-home-dashboard only.
   Roll back: delete this section.
   ===================================================================== */

/* ---- 9.2a. token re-base (dark + default) ---- */
html body.page-home-dashboard.page-home-dashboard {
  --home-bg: #05080f;
  --home-panel: rgba(13, 18, 31, 0.92);
  --home-panel-strong: rgba(17, 23, 38, 0.94);
  --home-panel-soft: rgba(9, 13, 24, 0.85);
  --home-line: rgba(46, 123, 255, 0.16);
  --home-line-strong: rgba(46, 123, 255, 0.32);
  --home-text: #e7eefb;
  --home-muted: #96a6cb;
  --home-faint: rgba(172, 186, 222, 0.45);
  --home-green: #3ddc84;
  --home-red: #ff5d5d;
  --home-amber: #6aa6ff;   /* flat/neutral + info accents -> cyan */
  --home-cyan: #2e7bff;    /* primary identity accents -> violet */
  --home-shadow: 0 24px 54px -28px rgba(0, 0, 0, 0.8);
}

/* dark canvas: beats app.css 22429 (teal grid + forced mono, !important) */
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard {
  background:
    linear-gradient(90deg, rgba(46, 123, 255, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(46, 123, 255, 0.04) 1px, transparent 1px),
    radial-gradient(ellipse 70% 45% at 10% 0%, rgba(46, 123, 255, 0.10), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 100%, rgba(106, 166, 255, 0.06), transparent 52%),
    #05080f !important;
  background-size: 46px 46px, 46px 46px, auto, auto, auto !important;
  color: #e7eefb !important;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
}

/* light tokens + canvas: beats app.css 23684/23757 */
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard {
  --home-bg: #eef0f8;
  --home-panel: rgba(255, 255, 255, 0.94);
  --home-panel-strong: rgba(255, 255, 255, 0.98);
  --home-panel-soft: rgba(247, 248, 253, 0.92);
  --home-line: rgba(30, 99, 224, 0.14);
  --home-line-strong: rgba(30, 99, 224, 0.26);
  --home-text: #1b1830;
  --home-muted: #5b5878;
  --home-faint: rgba(27, 24, 48, 0.45);
  --home-green: #0f9d6b;
  --home-red: #d23b56;
  --home-amber: #1666cc;
  --home-cyan: #1e63e0;
  --home-shadow: 0 18px 44px rgba(40, 26, 90, 0.14);
  background:
    linear-gradient(90deg, rgba(124, 58, 237, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(124, 58, 237, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 58% 0%, rgba(124, 58, 237, 0.07), transparent 36%),
    #eef0f8 !important;
  background-size: 46px 46px, 46px 46px, auto, auto !important;
  color: var(--home-text) !important;
}

/* ---- 9.2b. radius system (beats 36919's blanket 8px) ---- */
html body.page-home-dashboard.page-home-dashboard :is(.home-welcome-copy, .home-quote-card, .home-panel, .home-account-panel, .home-side-widget) {
  border-radius: 16px !important;
}
html body.page-home-dashboard.page-home-dashboard :is(.home-tool-square, .skew-board-panel, .skew-board-summary) {
  border-radius: 14px !important;
}
html body.page-home-dashboard.page-home-dashboard :is(.home-user, .home-monthly-letter-outlook, .market-analysis-status, .skew-ticker-card, .home-loading-tile) {
  border-radius: 12px !important;
}
html body.page-home-dashboard.page-home-dashboard .home-heat-tile {
  border-radius: 8px !important;
}
html body.page-home-dashboard.page-home-dashboard .home-rail {
  border-radius: 0 !important;
}
/* layout wrapper wrongly painted as a panel by app.css 36917 */
html body.page-home-dashboard.page-home-dashboard .home-terminal-top {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ---- 9.2c. frosted glass panels (dark) — beats 36916 ---- */
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard :is(.home-welcome-copy, .home-quote-card, .home-panel, .home-account-panel, .home-side-widget) {
  border-color: rgba(46, 123, 255, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 38%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(11, 15, 27, 0.92)) !important;
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(135%) !important;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-tool-square {
  border-color: rgba(46, 123, 255, 0.18) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 42%),
    linear-gradient(180deg, rgba(18, 24, 40, 0.96), rgba(9, 13, 24, 0.97)) !important;
  box-shadow: 0 16px 36px -22px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
/* welcome hero: violet/cyan flares back on top of the glass */
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-welcome-copy {
  background:
    linear-gradient(135deg, rgba(46, 123, 255, 0.12), transparent 40%),
    linear-gradient(315deg, rgba(106, 166, 255, 0.10), transparent 44%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.94), rgba(11, 15, 27, 0.94)) !important;
}
/* dealer letters: tone-tinted glass (fixes dead .home-letter-panel selector) */
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-monthly-letter-panel {
  background:
    linear-gradient(135deg, rgba(46, 123, 255, 0.11), transparent 36%),
    linear-gradient(315deg, rgba(106, 166, 255, 0.09), transparent 44%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(11, 15, 27, 0.92)) !important;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-0dte-letter-panel {
  background:
    linear-gradient(135deg, rgba(106, 166, 255, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(46, 123, 255, 0.09), transparent 44%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(11, 15, 27, 0.92)) !important;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard :is(.home-monthly-letter-panel.is-down, .home-0dte-letter-panel.is-down) {
  background:
    linear-gradient(135deg, rgba(255, 93, 93, 0.11), transparent 36%),
    linear-gradient(315deg, rgba(46, 123, 255, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(11, 15, 27, 0.92)) !important;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-monthly-letter-outlook {
  border-color: rgba(46, 123, 255, 0.18) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.07), transparent 52%),
    rgba(9, 13, 24, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* ---- 9.2d. rail, nav, user ---- */
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-rail {
  border-right: 1px solid rgba(46, 123, 255, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 30%),
    rgba(8, 11, 19, 0.92) !important;
  box-shadow: 14px 0 34px rgba(0, 0, 0, 0.34) !important;
  backdrop-filter: blur(14px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-user {
  border-color: rgba(46, 123, 255, 0.22) !important;
  background: rgba(12, 17, 29, 0.85) !important;
  border-radius: 10px !important;
}
body.page-home-dashboard .home-brand-plaque {
  border-color: rgba(46, 123, 255, 0.5);
  border-radius: 7px;
  background: rgba(46, 123, 255, 0.10);
}
body.page-home-dashboard .home-nav-item {
  border-radius: 0 10px 10px 0;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
}
body.page-home-dashboard .home-nav-item:hover,
body.page-home-dashboard .home-nav-item:focus-visible {
  border-color: rgba(46, 123, 255, 0.65);
  background: linear-gradient(90deg, rgba(46, 123, 255, 0.12), rgba(46, 123, 255, 0.02));
  color: #eef2ff;
}
body.page-home-dashboard .home-nav-icon {
  border-color: var(--home-line-strong);
}
body.page-home-dashboard .theme-switch-button {
  border-color: var(--home-line-strong);
  border-radius: 8px;
  background: rgba(12, 17, 29, 0.8);
  color: var(--home-muted);
}
body.page-home-dashboard .theme-switch-button:hover,
body.page-home-dashboard .theme-switch-button:focus-visible,
body.page-home-dashboard .theme-switch-button.is-active {
  border-color: rgba(46, 123, 255, 0.6);
  background: rgba(46, 123, 255, 0.12);
  color: #f3ecff;
}
body.page-home-dashboard .home-signout {
  border-color: var(--home-line);
  border-radius: 8px;
  color: var(--home-muted);
}
body.page-home-dashboard .home-signout:hover,
body.page-home-dashboard .home-signout:focus-visible {
  border-color: rgba(46, 123, 255, 0.5);
  color: var(--home-text);
}

/* ---- 9.2e. type hierarchy: micro-label kickers + bright titles ---- */
body.page-home-dashboard .home-widget-kicker,
body.page-home-dashboard .home-panel-head span,
body.page-home-dashboard .home-section-head span,
body.page-home-dashboard .home-side-widget header span,
body.page-home-dashboard .home-breadth-strip span,
body.page-home-dashboard .home-leaderboards section > span,
body.page-home-dashboard .home-account-panel span,
body.page-home-dashboard .home-skew-header span,
body.page-home-dashboard .home-skew-summary-row span,
body.page-home-dashboard .skew-board-panel-head span,
body.page-home-dashboard .home-monthly-letter-head span,
body.page-home-dashboard .home-alert-label {
  color: var(--accent-secondary);
  font-weight: 700;
  letter-spacing: 0.15em;
}
body.page-home-dashboard .home-panel-head h2,
body.page-home-dashboard .home-section-head h2,
body.page-home-dashboard .home-account-panel h2,
body.page-home-dashboard .home-skew-header h2,
body.page-home-dashboard .skew-board-panel-head strong,
body.page-home-dashboard .skew-board-summary strong,
body.page-home-dashboard .home-monthly-letter-head h2 {
  color: var(--bright);
  letter-spacing: -0.02em;
}
body.page-home-dashboard .home-welcome-copy h1 span {
  background: linear-gradient(120deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.page-home-dashboard .home-welcome-copy p,
body.page-home-dashboard .home-status-widget small,
body.page-home-dashboard .home-status-widget p {
  color: var(--home-muted);
}
body.page-home-dashboard .home-skew-header p {
  color: var(--home-muted);
  font-family: "Inter", system-ui, sans-serif;
}
body.page-home-dashboard .home-side-widget header strong,
body.page-home-dashboard .home-tool-square strong {
  color: var(--bright);
}
body.page-home-dashboard .home-tool-square small,
body.page-home-dashboard .home-side-row em {
  color: var(--home-muted);
}

/* ---- 9.2f. buttons + inputs (dark; beats 36926) ---- */
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard :is(.home-refresh-button, .home-secondary-action) {
  border-color: rgba(46, 123, 255, 0.34) !important;
  border-radius: 10px !important;
  background: rgba(46, 123, 255, 0.10) !important;
  color: #e7dcff !important;
  transition: border-color 130ms ease, background-color 130ms ease, transform 130ms ease;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard :is(.home-refresh-button, .home-secondary-action):hover,
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard :is(.home-refresh-button, .home-secondary-action):focus-visible {
  border-color: rgba(46, 123, 255, 0.62) !important;
  background: rgba(46, 123, 255, 0.18) !important;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .skew-board-expiration select {
  border-color: rgba(46, 123, 255, 0.26) !important;
  border-radius: 10px !important;
  background: rgba(8, 12, 22, 0.85) !important;
  color: var(--home-text) !important;
}
html body.page-home-dashboard.page-home-dashboard .skew-board-expiration select:focus {
  border-color: #2e7bff !important;
  box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.22) !important;
  outline: none !important;
}
body.page-home-dashboard :is(.home-refresh-button, .home-secondary-action, .home-heat-tile, .home-tool-square, .home-alert-actions button):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.30);
}

/* ---- 9.2g. quote card + sparkline ---- */
body.page-home-dashboard .home-quote-sparkline polyline {
  filter: drop-shadow(0 0 7px rgba(61, 220, 132, 0.4));
}
body.page-home-dashboard .home-quote-sparkline.is-down polyline {
  filter: drop-shadow(0 0 7px rgba(255, 93, 93, 0.4));
}
body.page-home-dashboard .home-quote-sparkline.is-flat polyline {
  stroke: var(--home-amber);
  filter: drop-shadow(0 0 7px rgba(106, 166, 255, 0.35));
}

/* ---- 9.2h. heatmap: legend fix + soft mint/pink tiles (mockup model) ---- */
body.page-home-dashboard .home-heatmap-legend {
  background: none; /* fixes section-5 bug: gradient belongs on the bar, not the row */
}
body.page-home-dashboard .home-heatmap-legend i {
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff5d5d, rgba(150, 166, 203, 0.55), #3ddc84);
}
body.page-home-dashboard .home-heatmap-legend .is-down { color: var(--home-red); }
body.page-home-dashboard .home-heatmap-legend .is-up { color: var(--home-green); }
body.page-home-dashboard .home-sector-block {
  border-color: var(--home-line);
  border-radius: 10px;
  background: var(--home-panel-soft);
}
body.page-home-dashboard .home-sector-block header { color: var(--home-muted); }
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-heat-tile {
  border-color: rgba(46, 123, 255, 0.10) !important;
  background: rgba(10, 14, 26, 0.6) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03) !important;
}
body.page-home-dashboard .home-heat-tile { color: var(--home-text); }
body.page-home-dashboard .home-heat-tile small { color: var(--home-muted); }
body.page-home-dashboard .home-heat-tile::before {
  background: rgba(150, 166, 203, calc(0.08 + (var(--heat-intensity, 0) * 0.12)));
}
body.page-home-dashboard .home-heat-tile.is-up::before {
  background: linear-gradient(160deg, rgba(61, 220, 132, calc(0.16 + (var(--heat-intensity, 0) * 0.36))), rgba(106, 166, 255, 0.08));
}
body.page-home-dashboard .home-heat-tile.is-down::before {
  background: linear-gradient(160deg, rgba(255, 93, 93, calc(0.16 + (var(--heat-intensity, 0) * 0.36))), rgba(46, 123, 255, 0.08));
}
html body.page-home-dashboard.page-home-dashboard .home-heat-tile:hover,
html body.page-home-dashboard.page-home-dashboard .home-heat-tile:focus-visible {
  border-color: rgba(46, 123, 255, 0.55) !important;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6), 0 0 14px rgba(46, 123, 255, 0.18) !important;
}
body.page-home-dashboard .home-breadth-strip > div {
  border-color: var(--home-line);
  border-radius: 10px;
  background: var(--home-panel-soft);
}

/* ---- 9.2i. tool squares ---- */
html body.page-home-dashboard.page-home-dashboard .home-tool-square:hover,
html body.page-home-dashboard.page-home-dashboard .home-tool-square:focus-visible {
  border-color: rgba(46, 123, 255, 0.6) !important;
  box-shadow: 0 16px 34px -16px rgba(0, 0, 0, 0.6), 0 0 22px rgba(46, 123, 255, 0.16) !important;
}
body.page-home-dashboard .home-tool-visual path,
body.page-home-dashboard .home-tool-visual circle {
  stroke: rgba(178, 134, 255, 0.8);
  filter: drop-shadow(0 0 7px rgba(46, 123, 255, 0.32));
}
body.page-home-dashboard .home-tool-visual .home-visual-grid {
  stroke: rgba(46, 123, 255, 0.32);
}
body.page-home-dashboard .home-tool-square:hover .home-tool-visual path,
body.page-home-dashboard .home-tool-square:hover .home-tool-visual circle,
body.page-home-dashboard .home-tool-square:focus-visible .home-tool-visual path,
body.page-home-dashboard .home-tool-square:focus-visible .home-tool-visual circle {
  stroke: rgba(205, 181, 255, 0.95);
}
body.page-home-dashboard .home-tool-visual.has-raster {
  border-color: rgba(46, 123, 255, 0.18);
  border-radius: 9px;
  background: #05080f;
}
body.page-home-dashboard .home-tool-status {
  border-color: rgba(106, 166, 255, 0.4);
  border-radius: 6px;
  background: rgba(106, 166, 255, 0.12);
  color: var(--home-amber);
}

/* ---- 9.2j. dealer letter cards ---- */
body.page-home-dashboard .home-monthly-letter-card,
body.page-home-dashboard .home-monthly-letter-loading {
  border-color: var(--home-line);
  border-radius: 12px;
}
body.page-home-dashboard .home-monthly-levels div {
  border-radius: 10px;
}
body.page-home-dashboard .home-monthly-letter-outlook p,
body.page-home-dashboard .home-monthly-letter-card p {
  color: var(--home-muted);
}

/* ---- 9.2k. skew board (dark; sub-panels beat 36916) ---- */
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard :is(.skew-board-summary, .skew-board-panel, .market-analysis-status) {
  border-color: rgba(46, 123, 255, 0.18) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 46%),
    rgba(9, 13, 24, 0.8) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .market-analysis-status[data-tone="ready"] {
  border-color: rgba(61, 220, 132, 0.34) !important;
  color: var(--home-green);
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .market-analysis-status[data-tone="error"] {
  border-color: rgba(255, 93, 93, 0.4) !important;
  color: var(--home-red);
}
body.page-home-dashboard .home-skew-header {
  border-bottom-color: var(--home-line);
}
body.page-home-dashboard .skew-board-panel-head {
  border-bottom-color: var(--home-line);
}
body.page-home-dashboard .algo-analysis-grid {
  border-radius: 12px;
  overflow: hidden;
  background: var(--home-line);
}
body.page-home-dashboard .algo-analysis-card {
  background: var(--home-panel-strong);
}
body.page-home-dashboard .algo-analysis-card i,
body.page-home-dashboard .skew-ticker-bars i {
  border-radius: 99px;
  background: rgba(46, 123, 255, 0.12);
}
body.page-home-dashboard .skew-ticker-card {
  border-color: var(--home-line);
  background: var(--home-panel-soft);
}
body.page-home-dashboard .skew-ticker-card.is-fear { border-color: rgba(255, 93, 93, 0.42); }
body.page-home-dashboard .skew-ticker-card.is-bullish { border-color: rgba(61, 220, 132, 0.4); }
body.page-home-dashboard .skew-ticker-algo { border-top-color: var(--home-line); }
body.page-home-dashboard .skew-ticker-algo strong { color: var(--bright); }

/* ---- 9.2l. intel: ticker rows, breadth score, regime bars ---- */
body.page-home-dashboard .home-ticker-row {
  border-color: var(--home-line);
  border-radius: 10px;
  background: var(--home-panel-soft);
}
body.page-home-dashboard .home-side-row {
  border-bottom-color: var(--home-line);
}
body.page-home-dashboard .home-breadth-score {
  border-color: var(--home-line-strong);
  border-radius: 12px;
  background: var(--home-panel-soft);
}
body.page-home-dashboard .home-breadth-score strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: -0.03em;
}
body.page-home-dashboard .home-regime-track {
  border-radius: 99px;
  background: rgba(46, 123, 255, 0.12);
}

/* ---- 9.2m. side rail: market status, online, alert composer ---- */
body.page-home-dashboard .home-status-line i {
  box-shadow: 0 0 10px rgba(106, 166, 255, 0.45);
  animation: dmHomePulse 2.2s ease-in-out infinite;
}
body.page-home-dashboard .home-status-line.is-up i {
  box-shadow: 0 0 10px rgba(61, 220, 132, 0.5);
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-online-widget {
  border-color: rgba(106, 166, 255, 0.32) !important;
  background:
    linear-gradient(180deg, rgba(106, 166, 255, 0.08), transparent 58%),
    rgba(12, 17, 29, 0.92) !important;
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-alert-widget {
  border-color: rgba(46, 123, 255, 0.36) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.09), transparent 58%),
    rgba(12, 17, 29, 0.92) !important;
}
body.page-home-dashboard .home-online-empty {
  border-color: var(--home-line-strong);
  border-radius: 10px;
  background: rgba(46, 123, 255, 0.05);
}
html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard .home-alert-form textarea {
  border-color: rgba(46, 123, 255, 0.22) !important;
  border-radius: 10px !important;
  background: rgba(8, 12, 22, 0.85) !important;
  color: var(--home-text) !important;
}
html body.page-home-dashboard.page-home-dashboard .home-alert-form textarea:focus {
  border-color: var(--home-cyan) !important;
  box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.22) !important;
  outline: none !important;
}
body.page-home-dashboard .home-alert-actions button {
  border-color: var(--home-line-strong);
  border-radius: 10px;
  background: rgba(46, 123, 255, 0.10);
  color: var(--home-text);
  transition: border-color 130ms ease, background-color 130ms ease;
}
body.page-home-dashboard .home-alert-actions button:hover,
body.page-home-dashboard .home-alert-actions button:focus-visible {
  border-color: rgba(46, 123, 255, 0.6);
  background: rgba(46, 123, 255, 0.18);
  color: var(--home-text);
}
body.page-home-dashboard .home-alert-actions button#home-alert-send {
  border-color: transparent;
  background: linear-gradient(135deg, #2e7bff, #6aa6ff);
  color: #0a0814;
}
body.page-home-dashboard .home-alert-actions button#home-alert-send:hover,
body.page-home-dashboard .home-alert-actions button#home-alert-send:focus-visible {
  background: linear-gradient(135deg, #a86fff, #7ce6ff);
  box-shadow: 0 8px 20px -10px rgba(46, 123, 255, 0.6);
  color: #0a0814;
}

/* ---- 9.2n. loading + empty states: shimmer skeletons, no layout jump ---- */
@keyframes dmHomePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
html body.page-home-dashboard.page-home-dashboard .home-loading-tile {
  border-color: rgba(46, 123, 255, 0.18) !important;
  background:
    linear-gradient(90deg, rgba(46, 123, 255, 0.04) 0%, rgba(106, 166, 255, 0.1) 50%, rgba(46, 123, 255, 0.04) 100%),
    rgba(10, 14, 26, 0.55) !important;
  background-size: 220% 100%, auto !important;
  background-repeat: no-repeat !important;
  animation: dmChartShimmer 1.8s linear infinite;
  color: var(--home-muted);
}
body.page-home-dashboard .home-monthly-letter-loading {
  background-image: linear-gradient(90deg, rgba(46, 123, 255, 0.04) 0%, rgba(106, 166, 255, 0.1) 50%, rgba(46, 123, 255, 0.04) 100%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: dmChartShimmer 1.8s linear infinite;
  color: var(--home-muted);
}
body.page-home-dashboard .home-quote-card.is-loading .home-quote-equity strong {
  color: var(--home-muted);
  animation: dmHomePulse 1.6s ease-in-out infinite;
}
/* async containers start as empty divs — hold space + shimmer until data */
body.page-home-dashboard :is(.home-side-list, .home-ticker-list, .home-regime-bars, .skew-board-chart, .algo-analysis-grid, .skew-ticker-grid):empty {
  min-height: 84px;
  border-radius: 10px;
  background-color: transparent;
  background-image: linear-gradient(90deg, rgba(46, 123, 255, 0.05) 0%, rgba(106, 166, 255, 0.10) 50%, rgba(46, 123, 255, 0.05) 100%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: dmChartShimmer 1.8s linear infinite;
}
body.page-home-dashboard .skew-ticker-grid:empty { min-height: 128px; }

/* ---- 9.2o. light theme corrections ---- */
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard :is(.home-welcome-copy, .home-quote-card, .home-panel, .home-account-panel, .home-side-widget, .home-tool-square, .skew-board-summary, .market-analysis-status, .skew-board-panel, .skew-ticker-card, .home-user) {
  border-color: rgba(30, 99, 224, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.04), transparent 46%),
    rgba(255, 255, 255, 0.94) !important;
}
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard .home-rail {
  border-color: rgba(30, 99, 224, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.05), transparent 30%),
    rgba(250, 250, 255, 0.97) !important;
}
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard .home-main {
  background:
    linear-gradient(rgba(124, 58, 237, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.035) 1px, transparent 1px),
    #f4f4fb !important;
}
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard :is(.home-refresh-button, .home-secondary-action, .skew-board-refresh) {
  border-color: rgba(124, 58, 237, 0.36) !important;
  background: #f3ecff !important;
  color: #5b21b6 !important;
}
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard .home-online-widget {
  background:
    linear-gradient(180deg, rgba(22, 102, 204, 0.06), transparent 58%),
    rgba(255, 255, 255, 0.95) !important;
}
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard .home-alert-widget {
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.06), transparent 58%),
    rgba(255, 255, 255, 0.95) !important;
}
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard .home-heat-tile:hover,
html[data-theme="light"] body.page-home-dashboard.page-home-dashboard .home-heat-tile:focus-visible {
  border-color: rgba(124, 58, 237, 0.45) !important;
}

/* ---- 9.2p. reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html body.page-home-dashboard.page-home-dashboard .home-loading-tile,
  body.page-home-dashboard .home-monthly-letter-loading,
  body.page-home-dashboard :is(.home-side-list, .home-ticker-list, .home-regime-bars, .skew-board-chart, .algo-analysis-grid, .skew-ticker-grid):empty,
  body.page-home-dashboard .home-quote-card.is-loading .home-quote-equity strong,
  body.page-home-dashboard .home-status-line i {
    animation: none !important;
  }
  body.page-home-dashboard .home-nav-item,
  body.page-home-dashboard .home-alert-actions button,
  html:not([data-theme="light"]) body.page-home-dashboard.page-home-dashboard :is(.home-refresh-button, .home-secondary-action) {
    transition: none !important;
  }
}


/* =====================================================================
   9.3. DEALERMAP ALGO PROFESSIONAL PASS (2026-06-09)
   Trained levels & replay (templates/dealer_map_algo.html; legacy
   static/dealer_map_algo.js card classes). Page also carries
   page-dashboard-v5, so sections 6+8 already skin the rail/command
   band/inputs/hero — this section upgrades the dm-algo-* components to
   the Surface bar: frosted violet panels, 14-18px radii, mint/pink
   up-down semantics (replacing legacy sage/salmon), brand-cyan arming,
   calm 130ms hovers. Dark glass stays scoped under html[data-theme=
   "dark"]; light mode uses tokens / deeper light-safe tints.
   Roll back: delete this section.
   ===================================================================== */

/* ---- 9.3a. section panels: 18px frame, layered shadow (both themes) ---- */
html body.page-dealer-map-algo .dm-algo-chart-panel,
html body.page-dealer-map-algo .dm-algo-explain-panel,
html body.page-dealer-map-algo .dm-algo-target-section,
html body.page-dealer-map-algo .dm-algo-perfect-section,
html body.page-dealer-map-algo .dm-algo-detail-section {
  border-radius: 18px;
  border-color: var(--line);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-chart-panel,
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-explain-panel,
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-target-section,
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-perfect-section,
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-detail-section {
  border-color: rgba(46, 123, 255, 0.18) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(12, 16, 28, 0.90)) !important;
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}

/* ---- 9.3b. chart shell: blue-black violet wash + loading shimmer ---- */
html body.page-dealer-map-algo .dm-algo-chart-shell {
  border-radius: 14px;
  border-color: var(--line);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-chart-shell {
  border-color: rgba(46, 123, 255, 0.16) !important;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(46, 123, 255, 0.09), transparent 46%),
    rgba(7, 10, 18, 0.66) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-chart-shell:not(:has(canvas)):not(:has(svg)) {
  background-image:
    linear-gradient(90deg, rgba(46, 123, 255, 0.03) 0%, rgba(106, 166, 255, 0.08) 50%, rgba(46, 123, 255, 0.03) 100%) !important;
  background-size: 220% 100% !important;
  background-repeat: no-repeat !important;
  animation: dmChartShimmer 1.7s linear infinite !important;
}

/* ---- 9.3c. replay bar: frosted strip, violet slider, ready glow ---- */
html body.page-dealer-map-algo .dm-algo-replay-bar {
  border-radius: 12px;
  border-color: var(--line);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-replay-bar {
  border-color: rgba(46, 123, 255, 0.20) !important;
  background: linear-gradient(180deg, rgba(24, 30, 50, 0.78), rgba(12, 16, 28, 0.74)) !important;
}
html body.page-dealer-map-algo .dm-algo-replay-bar[data-state="ready"] {
  border-color: rgba(106, 166, 255, 0.34);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-replay-bar[data-state="ready"] {
  border-color: rgba(106, 166, 255, 0.38) !important;
  box-shadow: 0 0 0 1px rgba(106, 166, 255, 0.10), 0 12px 30px -20px rgba(106, 166, 255, 0.35);
}
html body.page-dealer-map-algo .dm-algo-replay-copy span {
  color: var(--accent-secondary);
  letter-spacing: 0.14em;
}
html body.page-dealer-map-algo .dm-algo-replay-slider {
  accent-color: var(--accent-primary);
}
html body.page-dealer-map-algo .dm-algo-replay-slider:disabled {
  opacity: 0.45;
}
html body.page-dealer-map-algo .dm-algo-replay-button {
  min-height: 38px;
  border-radius: 10px;
  transition: border-color 130ms ease, background-color 130ms ease, box-shadow 130ms ease;
}
html body.page-dealer-map-algo .dm-algo-replay-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---- 9.3d. command controls: aligned row, consistent buttons,
        expiration picker joins the violet input skin ---- */
html body.page-dealer-map-algo .dm-algo-controls {
  align-items: end;
}
@media (min-width: 1180px) {
  html body.page-dealer-map-algo .dm-algo-controls {
    grid-template-columns: minmax(130px, 0.7fr) minmax(170px, 1fr) minmax(140px, 0.75fr) auto auto;
  }
}
html body.page-dealer-map-algo .dm-algo-live-mode-button {
  min-height: 38px;
  border-radius: 10px;
  font-weight: 700;
  transition: border-color 130ms ease, background-color 130ms ease, box-shadow 130ms ease;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-expiration-picker {
  border-color: rgba(46, 123, 255, 0.22) !important;
  background: rgba(8, 12, 20, 0.82) !important;
  color: #e7eefb !important;
}

/* ---- 9.3e. status strip tones: token mint/pink + missing loading state ---- */
html body.page-dealer-map-algo #dm-algo-status[data-tone="loading"] { color: var(--accent-secondary); }
html body.page-dealer-map-algo #dm-algo-status[data-tone="ready"] { color: var(--green); }
html body.page-dealer-map-algo #dm-algo-status[data-tone="warn"] { color: #ffd36d; }
html body.page-dealer-map-algo #dm-algo-status[data-tone="error"] { color: var(--red); }
html[data-theme="light"] body.page-dealer-map-algo #dm-algo-status[data-tone="warn"] { color: #a96f00; }

/* ---- 9.3f. daily target cards: mint up / pink down, 14px, pill chips ---- */
html body.page-dealer-map-algo .dm-algo-target-card {
  border-radius: 14px;
}
html body.page-dealer-map-algo .dm-algo-target-card.is-up {
  border-color: rgba(15, 157, 107, 0.32);
  box-shadow: inset 3px 0 0 rgba(15, 157, 107, 0.80);
}
html body.page-dealer-map-algo .dm-algo-target-card.is-down {
  border-color: rgba(210, 59, 86, 0.30);
  box-shadow: inset 3px 0 0 rgba(210, 59, 86, 0.80);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-target-card {
  border-color: rgba(46, 123, 255, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 46%),
    rgba(10, 14, 26, 0.62) !important;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-target-card.is-up {
  border-color: rgba(61, 220, 132, 0.30) !important;
  box-shadow: inset 3px 0 0 rgba(61, 220, 132, 0.78) !important;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-target-card.is-down {
  border-color: rgba(255, 93, 93, 0.30) !important;
  box-shadow: inset 3px 0 0 rgba(255, 93, 93, 0.78) !important;
}
html body.page-dealer-map-algo .dm-algo-target-stats span {
  border-radius: 10px;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-target-stats span {
  border-color: rgba(46, 123, 255, 0.16) !important;
  background: rgba(8, 12, 22, 0.55) !important;
}
html body.page-dealer-map-algo .dm-algo-target-criteria span {
  border-radius: 999px;
  padding: 0 11px;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-target-criteria span {
  border-color: rgba(46, 123, 255, 0.26) !important;
  background: rgba(46, 123, 255, 0.10) !important;
}

/* ---- 9.3g. perfect-touch cards: mint glass (replaces legacy sage) ---- */
html body.page-dealer-map-algo .dm-algo-perfect-card {
  border-radius: 14px;
  border-color: rgba(15, 157, 107, 0.30);
  background:
    linear-gradient(180deg, rgba(15, 157, 107, 0.07), rgba(15, 157, 107, 0.02)),
    var(--fin-panel-soft);
  box-shadow: inset 3px 0 0 rgba(15, 157, 107, 0.80), 0 0 24px rgba(15, 157, 107, 0.08);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-perfect-card {
  border-color: rgba(61, 220, 132, 0.30) !important;
  background:
    linear-gradient(180deg, rgba(61, 220, 132, 0.10), rgba(61, 220, 132, 0.02) 58%),
    rgba(10, 14, 26, 0.62) !important;
  box-shadow: inset 3px 0 0 rgba(61, 220, 132, 0.85), 0 0 30px rgba(61, 220, 132, 0.07) !important;
}
html body.page-dealer-map-algo .dm-algo-perfect-stats span {
  border-radius: 10px;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-perfect-stats span {
  border-color: rgba(46, 123, 255, 0.14) !important;
  background: rgba(8, 12, 22, 0.55) !important;
}
html body.page-dealer-map-algo .dm-algo-perfect-criteria span {
  border-radius: 999px;
  padding: 0 11px;
  border-color: rgba(15, 157, 107, 0.24);
  background: rgba(15, 157, 107, 0.08);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-perfect-criteria span {
  border-color: rgba(61, 220, 132, 0.26) !important;
  background: rgba(61, 220, 132, 0.09) !important;
}

/* ---- 9.3h. level sheet cards: mint/pink semantics, 14px ---- */
html body.page-dealer-map-algo .dm-algo-level-card {
  border-radius: 14px;
}
html body.page-dealer-map-algo .dm-algo-level-card.is-positive,
html body.page-dealer-map-algo .dm-algo-level-card.is-resistance {
  border-color: rgba(15, 157, 107, 0.26);
  background: rgba(15, 157, 107, 0.05);
  box-shadow: inset 3px 0 0 rgba(15, 157, 107, 0.72);
}
html body.page-dealer-map-algo .dm-algo-level-card.is-negative,
html body.page-dealer-map-algo .dm-algo-level-card.is-support {
  border-color: rgba(210, 59, 86, 0.24);
  background: rgba(210, 59, 86, 0.05);
  box-shadow: inset 3px 0 0 rgba(210, 59, 86, 0.72);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-card {
  border-color: rgba(46, 123, 255, 0.16) !important;
  background: rgba(10, 14, 26, 0.60) !important;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-card.is-positive,
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-card.is-resistance {
  border-color: rgba(61, 220, 132, 0.30) !important;
  background: linear-gradient(180deg, rgba(61, 220, 132, 0.10), rgba(61, 220, 132, 0.03) 60%), rgba(10, 14, 26, 0.60) !important;
  box-shadow: inset 3px 0 0 rgba(61, 220, 132, 0.78) !important;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-card.is-negative,
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-card.is-support {
  border-color: rgba(255, 93, 93, 0.28) !important;
  background: linear-gradient(180deg, rgba(255, 93, 93, 0.10), rgba(255, 93, 93, 0.03) 60%), rgba(10, 14, 26, 0.60) !important;
  box-shadow: inset 3px 0 0 rgba(255, 93, 93, 0.78) !important;
}

/* ---- 9.3i. activation chips: brand cyan arming, mint armed/trigger ---- */
html body.page-dealer-map-algo .dm-algo-level-activation {
  border-radius: 10px;
}
html body.page-dealer-map-algo .dm-algo-level-activation.is-arming {
  border-color: rgba(22, 102, 204, 0.36);
  background: rgba(22, 102, 204, 0.07);
}
html body.page-dealer-map-algo .dm-algo-level-activation.is-armed,
html body.page-dealer-map-algo .dm-algo-level-activation.is-trigger {
  border-color: rgba(15, 157, 107, 0.36);
  background: rgba(15, 157, 107, 0.08);
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-activation {
  border-color: rgba(46, 123, 255, 0.18) !important;
  background: rgba(8, 12, 22, 0.50) !important;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-activation.is-arming {
  border-color: rgba(106, 166, 255, 0.38) !important;
  background: rgba(106, 166, 255, 0.10) !important;
}
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-activation.is-armed,
html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-level-activation.is-trigger {
  border-color: rgba(61, 220, 132, 0.38) !important;
  background: rgba(61, 220, 132, 0.10) !important;
}
html body.page-dealer-map-algo .dm-algo-level-activation.is-trigger {
  box-shadow: 0 0 18px rgba(61, 220, 132, 0.22);
}

/* ---- 9.3j. shared finish: legend chips, empty states, calm hovers ---- */
html body.page-dealer-map-algo .dm-algo-legend span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(46, 123, 255, 0.04);
}
html body.page-dealer-map-algo .dm-algo-empty {
  padding: 26px 22px;
  border-radius: 12px;
  border-color: rgba(46, 123, 255, 0.28);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-align: center;
}
@media (hover: hover) {
  html body.page-dealer-map-algo :is(.dm-algo-target-card, .dm-algo-perfect-card, .dm-algo-level-card):hover {
    outline: 1px solid rgba(46, 123, 255, 0.35);
    outline-offset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] body.page-dealer-map-algo .dm-algo-chart-shell:not(:has(canvas)):not(:has(svg)) {
    animation: none !important;
  }
  html body.page-dealer-map-algo .dm-algo-replay-button,
  html body.page-dealer-map-algo .dm-algo-live-mode-button {
    transition: none !important;
  }
}


/* =====================================================================
   9.4. ACCOUNT UTILITY PAGES PROFESSIONAL PASS (2026-06-09)
   API Keys + Admin Users + Desktop Download (body.page-platform-utility:
   templates/api_keys.html, admin_users.html, dealermap_desktop.html).
   These pages were still rendered by app.css's legacy teal terminal
   layer (~22426) + monochrome institutional layer (~36783). This section
   re-points those layers' token sets to the Refined Terminal palette and
   rebuilds the chrome: frosted violet panels, gradient CTA, pro tables.
   NOTE: app.css already forces these pages dark in BOTH themes
   (color-scheme: dark !important at ~22507); this section keeps that
   behavior, matching the Surface-page precedent (section 6c).
   CSS-only — no markup/JS hooks touched. Roll back: delete this section.
   ===================================================================== */

/* ---- 9.4a. token re-point: every residual app.css rule on these pages
        consumes --dm-terminal-* / --dm-* / --fin-* (fin already aliases
        the terminal vars) — re-pointing them re-skins the long tail
        (responsive borders, code color, hover states) in one move ---- */
html body.page-platform-utility.page-platform-utility {
  /* legacy teal terminal palette -> violet/cyan */
  --dm-terminal-bg: #05080f;
  --dm-terminal-bg-2: #090e18;
  --dm-terminal-main: #070b14;
  --dm-terminal-panel: rgba(15, 21, 35, 0.94);
  --dm-terminal-panel-strong: rgba(20, 26, 42, 0.96);
  --dm-terminal-panel-soft: rgba(46, 123, 255, 0.08);
  --dm-terminal-rail: rgba(10, 14, 26, 0.96);
  --dm-terminal-line: rgba(46, 123, 255, 0.18);
  --dm-terminal-line-strong: rgba(46, 123, 255, 0.40);
  --dm-terminal-cyan: #2e7bff;
  --dm-terminal-cyan-bright: #6aa6ff;
  --dm-terminal-green: #3ddc84;
  --dm-terminal-red: #ff5d5d;
  --dm-terminal-text: #e7eefb;
  --dm-terminal-muted: #96a6cb;
  --dm-terminal-dim: #8b9cc7;
  --dm-terminal-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(46, 123, 255, 0.09);
  /* monochrome institutional palette -> violet/cyan */
  --dm-bg: #05080f;
  --dm-bg-2: #090e18;
  --dm-panel: rgba(15, 21, 35, 0.94);
  --dm-panel-2: rgba(20, 26, 42, 0.96);
  --dm-rail: rgba(10, 14, 26, 0.96);
  --dm-line: rgba(46, 123, 255, 0.16);
  --dm-line-soft: rgba(46, 123, 255, 0.10);
  --dm-line-strong: rgba(46, 123, 255, 0.40);
  --dm-ink: #e7eefb;
  --dm-ink-soft: #d6dffa;
  --dm-muted: #96a6cb;
  --dm-faint: rgba(172, 186, 222, 0.42);
  --dm-green: #3ddc84;
  --dm-green-soft: rgba(61, 220, 132, 0.13);
  --dm-red: #ff5d5d;
  --dm-red-soft: rgba(255, 93, 93, 0.13);
  /* restore brand accents hijacked at app.css ~36816 */
  --accent-primary: #2e7bff;
  --accent-primary-deep: #1e63e0;
  --accent-primary-rgb: 46, 123, 255;
  --accent-secondary: #6aa6ff;
  --accent-secondary-deep: #2e7bff;
  --accent-secondary-rgb: 106, 166, 255;
  --accent-success: #3ddc84;
  --accent-danger: #ff5d5d;
  /* page canvas: deep blue-black + ambient brand flares */
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(46, 123, 255, 0.10), transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 100%, rgba(106, 166, 255, 0.07), transparent 52%),
    #05080f !important;
  color: #e7eefb !important;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
}
/* fixed grid overlay: teal -> faint violet */
html body.page-platform-utility.page-platform-utility::before {
  background-image:
    linear-gradient(rgba(46, 123, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 123, 255, 0.035) 1px, transparent 1px) !important;
  opacity: 0.5 !important;
}
/* the shell wrapper paints its own grid over the body's — let it through */
html body.page-platform-utility.page-platform-utility .site-shell {
  background: transparent !important;
}

/* ---- 9.4b. window shell + left rail ---- */
html body.page-platform-utility.page-platform-utility .utility-pro-shell {
  border: 1px solid rgba(46, 123, 255, 0.20) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 30%),
    rgba(9, 13, 24, 0.88) !important;
  box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(46, 123, 255, 0.08) !important;
}
html body.page-platform-utility.page-platform-utility .v5-pro-rail {
  border-right: 1px solid rgba(46, 123, 255, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 36%),
    rgba(10, 14, 26, 0.92) !important;
  padding: 16px !important;
  gap: 16px !important;
}
html body.page-platform-utility.page-platform-utility .v5-pro-brand {
  border-bottom: 1px solid rgba(46, 123, 255, 0.16) !important;
}
html body.page-platform-utility.page-platform-utility :is(.v5-pro-plaque, .brand-plaque-header) {
  border: 1px solid rgba(46, 123, 255, 0.35) !important;
  border-radius: 10px !important;
  background: rgba(46, 123, 255, 0.12) !important;
}
html body.page-platform-utility.page-platform-utility .v5-pro-brand-copy strong {
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 55%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html body.page-platform-utility.page-platform-utility .v5-pro-nav-item {
  border-radius: 10px !important;
  transition: border-color 130ms ease, background-color 130ms ease, box-shadow 130ms ease;
}
html body.page-platform-utility.page-platform-utility .v5-pro-nav-item span {
  border: 1px solid rgba(46, 123, 255, 0.35) !important;
  border-radius: 7px !important;
  background: rgba(46, 123, 255, 0.10) !important;
  color: #a8c4f5 !important;
}
html body.page-platform-utility.page-platform-utility .v5-pro-nav-item strong {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 650 !important;
  color: #96a6cb !important;
}
html body.page-platform-utility.page-platform-utility :is(.v5-pro-nav-item:hover, .v5-pro-nav-item:focus-visible, .v5-pro-nav-item.is-active) {
  border-color: rgba(46, 123, 255, 0.45) !important;
  background: linear-gradient(90deg, rgba(46, 123, 255, 0.20), rgba(46, 123, 255, 0.03)) !important;
  box-shadow: inset 2px 0 0 #2e7bff !important;
  color: #ffffff !important;
}
html body.page-platform-utility.page-platform-utility .v5-pro-nav-item.is-active strong {
  color: #ffffff !important;
}
html body.page-platform-utility.page-platform-utility .v5-pro-nav-item.is-active span {
  border-color: transparent !important;
  background: #2e7bff !important;
  color: #0a0814 !important;
}
html body.page-platform-utility.page-platform-utility :is(.v5-pro-scope-card, .v5-pro-user) {
  border: 1px solid rgba(46, 123, 255, 0.18) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.07), transparent 50%),
    rgba(12, 17, 29, 0.85) !important;
  padding: 12px !important;
}

/* ---- 9.4c. micro-labels: cyan, real tracking (design spec 0.12-0.18em) ---- */
html body.page-platform-utility.page-platform-utility :is(.v5-pro-label, .field-label, .chart-kicker, .platform-brand-kicker) {
  color: var(--accent-secondary) !important;
  font-size: 10px !important;
  letter-spacing: 0.16em !important;
  line-height: 1.3 !important;
}
html body.page-platform-utility.page-platform-utility .platform-user .platform-user-label {
  color: var(--accent-secondary) !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
}

/* ---- 9.4d. main column + hero header ---- */
html body.page-platform-utility.page-platform-utility .utility-pro-main {
  gap: 14px !important;
  padding: 18px 20px 26px !important;
  background:
    linear-gradient(rgba(46, 123, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 123, 255, 0.025) 1px, transparent 1px),
    radial-gradient(120% 70% at 50% 0%, rgba(46, 123, 255, 0.05), transparent 55%),
    #070b14 !important;
  background-size: 28px 28px, 28px 28px, auto, auto !important;
}
html body.page-platform-utility.page-platform-utility .platform-header {
  border: 1px solid rgba(46, 123, 255, 0.22) !important;
  border-radius: 16px !important;
  padding: 20px 24px !important;
  background:
    radial-gradient(130% 160% at 0% 0%, rgba(46, 123, 255, 0.14), transparent 46%),
    radial-gradient(120% 150% at 100% 0%, rgba(106, 166, 255, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(22, 28, 46, 0.94), rgba(13, 17, 29, 0.94)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 54px -28px rgba(0, 0, 0, 0.8) !important;
}
html body.page-platform-utility.page-platform-utility .platform-title {
  font-family: "Manrope", "Inter", sans-serif !important;
  font-size: clamp(26px, 2.2vw, 34px) !important;
  letter-spacing: -0.02em !important;
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 60%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html body.page-platform-utility.page-platform-utility :is(.platform-subtitle, .field-help) {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: #96a6cb !important;
}
html body.page-platform-utility.page-platform-utility .field-help {
  font-size: 12.5px !important;
}
html body.page-platform-utility.page-platform-utility .platform-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html body.page-platform-utility.page-platform-utility .platform-pill {
  border: 1px solid rgba(46, 123, 255, 0.30) !important;
  border-radius: 999px !important;
  background: rgba(46, 123, 255, 0.10) !important;
  color: #b9ccf5 !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  min-height: 26px !important;
  padding: 4px 12px !important;
}
html body.page-platform-utility.page-platform-utility .platform-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
html body.page-platform-utility.page-platform-utility .platform-user {
  border: 1px solid rgba(46, 123, 255, 0.20) !important;
  border-radius: 12px !important;
  background: rgba(12, 17, 29, 0.85) !important;
  padding: 10px 14px !important;
  display: grid;
  gap: 2px;
}

/* ---- 9.4e. panels: frosted glass cards (replaces 2px teal boxes) ---- */
html body.page-platform-utility.page-platform-utility :is(.chart-panel, .panel, .status-banner) {
  border: 1px solid rgba(46, 123, 255, 0.18) !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(12, 16, 28, 0.92)) !important;
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(130%) !important;
  transition: border-color 140ms ease;
}
html body.page-platform-utility.page-platform-utility .chart-panel:hover {
  border-color: rgba(46, 123, 255, 0.34) !important;
}
html body.page-platform-utility.page-platform-utility .chart-panel {
  padding: 20px 20px 22px !important;
}
html body.page-platform-utility.page-platform-utility .chart-stack {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)) !important;
  gap: 14px !important;
}
html body.page-platform-utility.page-platform-utility .chart-title {
  font-family: "Manrope", "Inter", sans-serif !important;
  font-size: 18px !important;
  letter-spacing: -0.01em !important;
  color: #ffffff !important;
}
html body.page-platform-utility.page-platform-utility .chart-panel > form {
  gap: 12px !important;
}

/* ---- 9.4f. forms: comfortable inputs, key-display treatment ---- */
html body.page-platform-utility.page-platform-utility .field-input {
  min-height: 42px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(46, 123, 255, 0.26) !important;
  border-radius: 12px !important;
  background: rgba(8, 12, 20, 0.85) !important;
  color: #e7eefb !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 13px !important;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
html body.page-platform-utility.page-platform-utility .field-input:focus {
  border-color: #2e7bff !important;
  box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.22) !important;
}
html body.page-platform-utility.page-platform-utility .field-input::placeholder {
  color: rgba(150, 166, 203, 0.55) !important;
  -webkit-text-fill-color: rgba(150, 166, 203, 0.55) !important;
}
/* one-time secrets (recovery PIN / new API key) read as copy-once values */
html body.page-platform-utility.page-platform-utility .field-input[readonly] {
  border-color: rgba(106, 166, 255, 0.35) !important;
  background: rgba(106, 166, 255, 0.06) !important;
  color: #b9d3ff !important;
  -webkit-text-fill-color: #b9d3ff !important;
  font-size: 14px !important;
  letter-spacing: 0.04em !important;
  cursor: copy;
}

/* ---- 9.4g. buttons: gradient primary, violet ghost secondary/tertiary ---- */
html body.page-platform-utility.page-platform-utility .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px !important;
  padding: 0 18px !important;
  border: 1px solid rgba(46, 123, 255, 0.65) !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  color: #0a0814 !important;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  box-shadow: 0 12px 28px -14px rgba(46, 123, 255, 0.55) !important;
  justify-self: start;
}
html body.page-platform-utility.page-platform-utility .btn-primary:hover {
  border-color: rgba(46, 123, 255, 0.9) !important;
  background: linear-gradient(135deg, #a86eff, #7ee6ff) !important;
  color: #0a0814 !important;
  box-shadow: 0 16px 34px -14px rgba(46, 123, 255, 0.7) !important;
  transform: translateY(-1px) !important;
}
html body.page-platform-utility.page-platform-utility :is(.btn-secondary, .btn-tertiary, .v5-pro-signout) {
  min-height: 40px !important;
  padding: 0 15px !important;
  border: 1px solid rgba(46, 123, 255, 0.28) !important;
  border-radius: 12px !important;
  background: rgba(46, 123, 255, 0.07) !important;
  color: #d6dffa !important;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  transition: border-color 130ms ease, background-color 130ms ease, transform 130ms ease;
}
html body.page-platform-utility.page-platform-utility :is(.btn-secondary:hover, .btn-tertiary:hover, .v5-pro-signout:hover) {
  border-color: rgba(46, 123, 255, 0.50) !important;
  background: rgba(46, 123, 255, 0.14) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}
html body.page-platform-utility.page-platform-utility :is(.btn-primary, .btn-secondary, .btn-tertiary, .v5-pro-signout, .field-input):focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.35) !important;
}

/* ---- 9.4h. data tables: zebra, hover, cyan headers, compact row actions ---- */
html body.page-platform-utility.page-platform-utility .table-wrap {
  border: 1px solid rgba(46, 123, 255, 0.20) !important;
  border-radius: 12px !important;
  background: rgba(8, 12, 22, 0.60) !important;
}
html body.page-platform-utility.page-platform-utility .data-table {
  font-size: 12.5px !important;
}
html body.page-platform-utility.page-platform-utility .data-table th {
  padding: 10px 14px !important;
  border-color: rgba(46, 123, 255, 0.25) !important;
  background: linear-gradient(180deg, rgba(46, 123, 255, 0.12), rgba(46, 123, 255, 0.05)) !important;
  color: var(--accent-secondary) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  white-space: nowrap;
}
html body.page-platform-utility.page-platform-utility .data-table td {
  padding: 11px 14px !important;
  border-color: rgba(46, 123, 255, 0.10) !important;
  background: transparent !important;
  color: #c6d2ee !important;
}
html body.page-platform-utility.page-platform-utility .data-table tbody tr:nth-child(even) td {
  background: rgba(46, 123, 255, 0.04) !important;
}
html body.page-platform-utility.page-platform-utility .data-table tbody tr:hover td {
  background: rgba(46, 123, 255, 0.09) !important;
}
html body.page-platform-utility.page-platform-utility .data-table .btn-tertiary {
  min-height: 30px !important;
  padding: 0 12px !important;
  border-radius: 9px !important;
  font-size: 11px !important;
}

/* ---- 9.4i. code + quick-start block ---- */
html body.page-platform-utility.page-platform-utility pre {
  padding: 16px !important;
  border: 1px solid rgba(46, 123, 255, 0.22) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(135deg, rgba(46, 123, 255, 0.07), transparent 40%),
    rgba(7, 10, 18, 0.92) !important;
  color: #d6e4ff !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
}
html body.page-platform-utility.page-platform-utility :is(.field-help, td) code {
  padding: 2px 7px;
  border: 1px solid rgba(46, 123, 255, 0.30);
  border-radius: 6px;
  background: rgba(46, 123, 255, 0.12) !important;
  color: #b9ccf5 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  overflow-wrap: anywhere;
}

/* ---- 9.4j. desktop download: release cards + release notes ---- */
html body.page-platform-utility.page-platform-utility .desktop-release-grid {
  gap: 14px !important;
  margin-top: 16px;
}
html body.page-platform-utility.page-platform-utility .desktop-release-card {
  padding: 18px !important;
  border: 1px solid rgba(46, 123, 255, 0.22) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.08), transparent 46%),
    linear-gradient(180deg, rgba(22, 28, 46, 0.92), rgba(13, 17, 29, 0.92)) !important;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
html body.page-platform-utility.page-platform-utility .desktop-release-card:hover {
  border-color: rgba(46, 123, 255, 0.45) !important;
  transform: translateY(-2px);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.8), 0 0 24px rgba(46, 123, 255, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
html body.page-platform-utility.page-platform-utility .desktop-release-card-copy strong {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(18px, 1.6vw, 22px);
  letter-spacing: -0.01em;
  color: #ffffff;
}
html body.page-platform-utility.page-platform-utility .desktop-release-card-copy small {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #96a6cb !important;
}
html body.page-platform-utility.page-platform-utility .desktop-release-notes li {
  padding: 10px 14px;
  border: 1px solid rgba(46, 123, 255, 0.16);
  border-left: 3px solid rgba(46, 123, 255, 0.55);
  border-radius: 10px;
  background: rgba(46, 123, 255, 0.05);
  color: #d6e0f8;
  font-size: 13px;
  line-height: 1.5;
}

/* ---- 9.4k. motion guard ---- */
@media (prefers-reduced-motion: reduce) {
  html body.page-platform-utility.page-platform-utility :is(.v5-pro-nav-item, .chart-panel, .field-input, .btn-secondary, .btn-tertiary, .v5-pro-signout, .desktop-release-card) {
    transition: none !important;
  }
  html body.page-platform-utility.page-platform-utility :is(.btn-primary:hover, .btn-secondary:hover, .btn-tertiary:hover, .v5-pro-signout:hover, .desktop-release-card:hover) {
    transform: none !important;
  }
}


/* =====================================================================
   9.5. MARKET ANALYSIS + OI GAMMA MAP + STRUCTURE PROFESSIONAL PASS (2026-06-09)
   Brings page-market-analysis, page-oi-open-interest-map and page-structure
   to the Refined Terminal bar. The 2026-06-08 institutional pass at the end
   of app.css paints these pages with body-level --dm-* mono tokens plus
   !important component rules; we re-tint those tokens per page (so every
   mono rule resolves on-brand in BOTH themes) and re-assert frosted violet
   chrome at matching/higher specificity. The OI map template additionally
   ships a legacy emerald inline <style> (1-2 class selectors) which these
   body-scoped rules out-specify. CSS-only - roll back: delete this section.
   ===================================================================== */

/* ---- 9.5a. token re-tint: mono --dm-* -> Refined Terminal ---- */
html[data-theme="dark"] body.page-market-analysis,
html[data-theme="dark"] body.page-oi-open-interest-map,
html[data-theme="dark"] body.page-structure {
  --dm-bg: #05080f;
  --dm-bg-2: #0a101d;
  --dm-panel: rgba(15, 21, 35, 0.94);
  --dm-panel-2: rgba(12, 17, 29, 0.96);
  --dm-panel-3: rgba(20, 26, 42, 0.97);
  --dm-panel-strong: #0d1322;
  --dm-panel-soft: rgba(22, 29, 48, 0.82);
  --dm-rail: rgba(8, 12, 22, 0.97);
  --dm-line: rgba(46, 123, 255, 0.15);
  --dm-line-soft: rgba(46, 123, 255, 0.09);
  --dm-line-strong: rgba(46, 123, 255, 0.34);
  --dm-ink: #e7eefb;
  --dm-ink-soft: #c7d3ee;
  --dm-muted: #96a6cb;
  --dm-muted-2: #6c7ba1;
  --dm-faint: rgba(150, 166, 203, 0.55);
  --dm-white: #ffffff;
  --dm-green: #3ddc84;
  --dm-green-soft: rgba(61, 220, 132, 0.12);
  --dm-red: #ff5d5d;
  --dm-red-soft: rgba(255, 93, 93, 0.12);
  --dm-blue: #8fb8ff;
  --dm-blue-soft: rgba(143, 184, 255, 0.12);
  --accent-primary: #2e7bff;
  --accent-primary-deep: #1e63e0;
  --accent-primary-rgb: 46, 123, 255;
  --accent-secondary: #6aa6ff;
  --accent-secondary-deep: #2e7bff;
  --accent-secondary-rgb: 106, 166, 255;
  --accent-success: #3ddc84;
  --accent-danger: #ff5d5d;
}
html[data-theme="light"] body.page-market-analysis,
html[data-theme="light"] body.page-oi-open-interest-map,
html[data-theme="light"] body.page-structure {
  --dm-line: rgba(30, 99, 224, 0.13);
  --dm-line-soft: rgba(30, 99, 224, 0.08);
  --dm-line-strong: rgba(30, 99, 224, 0.30);
  --dm-green: #0f9d6b;
  --dm-green-soft: rgba(15, 157, 107, 0.10);
  --dm-red: #d23b56;
  --dm-red-soft: rgba(210, 59, 86, 0.10);
  --accent-primary: #1e63e0;
  --accent-primary-rgb: 124, 58, 237;
  --accent-secondary: #1666cc;
  --accent-secondary-rgb: 22, 102, 204;
  --accent-success: #0f9d6b;
  --accent-danger: #d23b56;
}

/* ---- 9.5b. MARKET ANALYSIS (body.page-market-analysis) ---- */
/* page canvas: ambient violet/cyan flares over deep blue-black */
html[data-theme="dark"] body.page-market-analysis .skew-board-page {
  background:
    radial-gradient(ellipse 70% 44% at 10% -6%, rgba(46, 123, 255, 0.11), transparent 60%),
    radial-gradient(ellipse 52% 38% at 96% 0%, rgba(106, 166, 255, 0.07), transparent 55%),
    var(--dm-bg) !important;
}

/* unified radii (mono pass pins 8px !important at (0,2,2)) */
html body.page-market-analysis :is(.skew-board-topbar, .skew-board-hero, .skew-board-panel, .skew-ticker-card, .skew-board-coming-soon) {
  border-radius: 16px !important;
}
html body.page-market-analysis :is(.skew-board-summary, .market-analysis-status) {
  border-radius: 13px !important;
}

/* frosted violet glass on every card (beats app.css mono panel rule) */
html[data-theme="dark"] body.page-market-analysis :is(.skew-board-topbar, .skew-board-hero, .skew-board-panel, .skew-ticker-card) {
  border: 1px solid rgba(46, 123, 255, 0.18) !important;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(12, 16, 28, 0.90)) !important;
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(130%) !important;
}

/* hero: brand-gradient display title + market-read accent card */
body.page-market-analysis .skew-board-hero h1 {
  font-weight: 800;
  letter-spacing: -0.02em !important;
}
html[data-theme="dark"] body.page-market-analysis .skew-board-hero h1 {
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 60%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] body.page-market-analysis .skew-board-summary {
  border-color: rgba(46, 123, 255, 0.30) !important;
  background:
    linear-gradient(135deg, rgba(46, 123, 255, 0.14), rgba(106, 166, 255, 0.05) 62%, transparent),
    rgba(12, 17, 29, 0.66) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

/* micro-labels: cyan kickers with real tracking (mono pass pins 0.08em) */
html body.page-market-analysis .v5-pro-label {
  color: var(--accent-secondary) !important;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em !important;
  text-transform: uppercase;
}

/* topbar: gradient wordmark, calm nav chips, brand CTA, refined select */
html[data-theme="dark"] body.page-market-analysis .skew-board-wordmark {
  background: linear-gradient(120deg, #ffffff, #d6e4ff 55%, #b9d3ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html body.page-market-analysis .skew-board-nav a {
  border-radius: 10px !important;
  color: var(--dm-muted) !important;
  transition: color 130ms ease, border-color 130ms ease, background-color 130ms ease;
}
html body.page-market-analysis .skew-board-nav a:hover,
html body.page-market-analysis .skew-board-nav a.is-active {
  color: var(--dm-ink) !important;
  border-color: var(--dm-line-strong) !important;
  background: rgba(46, 123, 255, 0.10) !important;
}
html body.page-market-analysis .skew-board-nav a:focus-visible {
  outline: 2px solid rgba(var(--accent-primary-rgb), 0.7);
  outline-offset: 1px;
}
html body.page-market-analysis .skew-board-refresh {
  border: none !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  color: #0a0814 !important;
  font-weight: 800;
  box-shadow: 0 10px 26px -12px rgba(46, 123, 255, 0.6) !important;
}
html body.page-market-analysis .skew-board-expiration select {
  border-color: var(--dm-line-strong) !important;
  border-radius: 10px !important;
  font-weight: 700;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
html body.page-market-analysis .skew-board-expiration select:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.22) !important;
}
html[data-theme="dark"] body.page-market-analysis .skew-board-expiration select {
  color-scheme: dark;
}

/* status strip: token-driven tones (tint layered over the mono panel fill) */
html body.page-market-analysis .market-analysis-status {
  font-size: 12px;
  letter-spacing: 0.02em;
}
body.page-market-analysis .market-analysis-status[data-tone="ready"] {
  color: var(--dm-green) !important;
  border-color: rgba(61, 220, 132, 0.30) !important;
  background-image: linear-gradient(90deg, rgba(61, 220, 132, 0.10), rgba(61, 220, 132, 0.03)) !important;
}
body.page-market-analysis .market-analysis-status[data-tone="error"] {
  color: var(--dm-red) !important;
  border-color: rgba(255, 93, 93, 0.32) !important;
  background-image: linear-gradient(90deg, rgba(255, 93, 93, 0.10), rgba(255, 93, 93, 0.03)) !important;
}
body.page-market-analysis .market-analysis-status[data-tone="loading"] {
  color: var(--accent-secondary) !important;
  border-color: rgba(106, 166, 255, 0.30) !important;
  background-image: linear-gradient(90deg, rgba(106, 166, 255, 0.04), rgba(106, 166, 255, 0.12) 50%, rgba(106, 166, 255, 0.04)) !important;
  background-size: 220% 100%;
  animation: dmChartShimmer 1.8s linear infinite;
}

/* panel heads + chart loading shimmer (echarts mounts a <canvas>) */
body.page-market-analysis .skew-board-panel-head strong {
  letter-spacing: -0.02em;
}
body.page-market-analysis .skew-board-chart:not(:has(canvas)) {
  border-radius: 12px;
  background-image: linear-gradient(90deg, rgba(46, 123, 255, 0.03), rgba(106, 166, 255, 0.08) 50%, rgba(46, 123, 255, 0.03));
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: dmChartShimmer 1.7s linear infinite;
}

/* 30m algo mosaic: kill the legacy emerald tile fill, add hover */
html[data-theme="dark"] body.page-market-analysis .algo-analysis-card {
  background: rgba(10, 14, 26, 0.96);
  transition: background-color 130ms ease;
}
html[data-theme="dark"] body.page-market-analysis .algo-analysis-card:hover {
  background: rgba(20, 26, 42, 0.96);
}
html[data-theme="light"] body.page-market-analysis .algo-analysis-card {
  background: rgba(255, 255, 255, 0.97);
}
body.page-market-analysis .algo-analysis-card b {
  background: var(--accent-primary);
}
body.page-market-analysis .algo-analysis-card.is-bullish b {
  background: linear-gradient(90deg, rgba(61, 220, 132, 0.55), var(--dm-green));
}
body.page-market-analysis .algo-analysis-card.is-bearish b {
  background: linear-gradient(90deg, rgba(255, 93, 93, 0.55), var(--dm-red));
}

/* ticker skew cards: hover lift + mint/pink tone borders and bars */
body.page-market-analysis .skew-ticker-card {
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
body.page-market-analysis .skew-ticker-card:hover {
  transform: translateY(-2px);
}
html body.page-market-analysis .skew-ticker-card:hover {
  border-color: rgba(46, 123, 255, 0.45) !important;
}
html body.page-market-analysis .skew-ticker-card.is-fear {
  border-color: rgba(255, 93, 93, 0.38) !important;
}
html body.page-market-analysis .skew-ticker-card.is-bullish {
  border-color: rgba(61, 220, 132, 0.36) !important;
}
body.page-market-analysis .skew-ticker-bars .put b {
  background: linear-gradient(90deg, rgba(255, 93, 93, 0.45), var(--dm-red));
}
body.page-market-analysis .skew-ticker-bars .call b {
  background: linear-gradient(90deg, rgba(61, 220, 132, 0.45), var(--dm-green));
}

/* roadmap placeholder reads as intentional, not as an empty panel */
html body.page-market-analysis .skew-board-coming-soon {
  min-height: 112px;
  border-style: dashed !important;
  border-color: var(--dm-line-strong) !important;
  background: linear-gradient(135deg, rgba(46, 123, 255, 0.07), transparent 52%) !important;
  box-shadow: none !important;
}
body.page-market-analysis .skew-board-coming-soon strong {
  color: var(--dm-muted);
  font-size: clamp(22px, 2.2vw, 30px);
}

/* ---- 9.5c. OI GAMMA OPEN INTEREST MAP (body.page-oi-open-interest-map) ----
   Out-specifies the legacy emerald inline <style> in the template and the
   app.css mono pass; token-driven so light mode works for the first time. */
body.page-oi-open-interest-map .oi-map-shell {
  background: transparent;
}
html[data-theme="dark"] body.page-oi-open-interest-map .oi-map-shell {
  background:
    radial-gradient(ellipse 70% 42% at 8% -6%, rgba(46, 123, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 50% 36% at 98% 0%, rgba(106, 166, 255, 0.06), transparent 55%);
}

/* header */
body.page-oi-open-interest-map .oi-map-title span {
  color: var(--accent-secondary);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
body.page-oi-open-interest-map .oi-map-title h1 {
  font-weight: 800;
  letter-spacing: -0.02em !important;
}
html[data-theme="dark"] body.page-oi-open-interest-map .oi-map-title h1 {
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 60%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html body.page-oi-open-interest-map .oi-map-header a {
  border: 1px solid var(--dm-line-strong) !important;
  border-radius: 10px !important;
  background: rgba(46, 123, 255, 0.10) !important;
  color: var(--dm-ink) !important;
  transition: border-color 130ms ease, background-color 130ms ease;
}
html body.page-oi-open-interest-map .oi-map-header a:hover {
  border-color: var(--accent-primary) !important;
  background: rgba(46, 123, 255, 0.18) !important;
}
html body.page-oi-open-interest-map .oi-map-header a:focus-visible {
  outline: 2px solid rgba(var(--accent-primary-rgb), 0.7);
  outline-offset: 1px;
}

/* filter band: frosted control bar with cyan micro-labels and brand CTA */
body.page-oi-open-interest-map .oi-map-controls {
  border: 1px solid var(--dm-line);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--dm-panel);
}
html[data-theme="dark"] body.page-oi-open-interest-map .oi-map-controls {
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 46%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(12, 16, 28, 0.90));
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}
body.page-oi-open-interest-map .oi-map-controls label {
  color: var(--accent-secondary);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}
html body.page-oi-open-interest-map .oi-map-controls select {
  min-height: 40px;
  border-color: var(--dm-line-strong) !important;
  border-radius: 10px !important;
  background: var(--dm-bg-2) !important;
  color: var(--dm-ink) !important;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
html body.page-oi-open-interest-map .oi-map-controls select:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.22) !important;
}
html[data-theme="dark"] body.page-oi-open-interest-map .oi-map-controls select {
  color-scheme: dark;
}
html body.page-oi-open-interest-map .oi-map-controls button {
  min-height: 40px;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 18px;
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  color: #0a0814 !important;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px -12px rgba(46, 123, 255, 0.55) !important;
  transition: transform 130ms ease, box-shadow 130ms ease;
}
html body.page-oi-open-interest-map .oi-map-controls button:hover {
  transform: translateY(-1px);
}
html body.page-oi-open-interest-map .oi-map-controls button:focus-visible {
  outline: 2px solid rgba(var(--accent-primary-rgb), 0.7);
  outline-offset: 2px;
}
body.page-oi-open-interest-map .oi-map-status {
  color: var(--dm-muted);
  letter-spacing: 0.10em;
}

/* wall summary cards: frosted, mono numerals, mint/pink semantics */
body.page-oi-open-interest-map .oi-map-card {
  border-color: var(--dm-line);
  border-radius: 14px;
  padding: 15px 16px;
  background: var(--dm-panel);
}
html[data-theme="dark"] body.page-oi-open-interest-map .oi-map-card {
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 44%),
    linear-gradient(180deg, rgba(18, 24, 40, 0.92), rgba(12, 16, 28, 0.92));
  box-shadow: 0 16px 36px -22px rgba(0, 0, 0, 0.66), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
body.page-oi-open-interest-map .oi-map-card span {
  color: var(--dm-muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}
body.page-oi-open-interest-map .oi-map-card strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--dm-ink);
}
body.page-oi-open-interest-map .oi-map-card small {
  color: var(--dm-muted);
}
body.page-oi-open-interest-map .oi-map-card.is-put strong {
  color: var(--dm-red);
}
body.page-oi-open-interest-map .oi-map-card.is-call strong {
  color: var(--dm-green);
}

/* ladder panel */
html body.page-oi-open-interest-map .oi-map-panel {
  border-color: var(--dm-line) !important;
  border-radius: 16px !important;
  background: var(--dm-panel) !important;
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.6) !important;
}
html[data-theme="dark"] body.page-oi-open-interest-map .oi-map-panel {
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 38%),
    linear-gradient(180deg, rgba(15, 21, 35, 0.95), rgba(10, 14, 24, 0.94)) !important;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}
body.page-oi-open-interest-map .oi-map-chart-title {
  border-bottom-color: var(--dm-line);
  padding: 15px 18px;
}
body.page-oi-open-interest-map .oi-map-chart-title span {
  color: var(--dm-muted);
  letter-spacing: 0.08em;
}
body.page-oi-open-interest-map .oi-map-chart-title strong {
  color: var(--dm-ink);
  letter-spacing: -0.01em;
}

/* strike rows: violet hairlines, hover affordance, cyan spot marker */
body.page-oi-open-interest-map .oi-map-row-head {
  background: var(--dm-bg-2);
  color: var(--dm-muted);
  letter-spacing: 0.10em;
  border-bottom: 1px solid var(--dm-line-strong);
}
body.page-oi-open-interest-map .oi-map-row {
  border-bottom-color: var(--dm-line-soft);
  transition: background-color 120ms ease;
}
body.page-oi-open-interest-map .oi-map-row:hover {
  background: rgba(46, 123, 255, 0.07);
}
body.page-oi-open-interest-map .oi-map-row.is-spot {
  background: rgba(106, 166, 255, 0.08);
  box-shadow: inset 2px 0 0 var(--accent-secondary);
}
body.page-oi-open-interest-map .oi-strike {
  color: var(--dm-ink);
}
body.page-oi-open-interest-map .oi-map-row:is(.is-put-oi-wall, .is-put-gamma-wall) .oi-strike {
  color: var(--dm-red);
}
body.page-oi-open-interest-map .oi-map-row:is(.is-call-oi-wall, .is-call-gamma-wall) .oi-strike {
  color: var(--dm-green);
}

/* OI bars: mint/pink fills replacing legacy red/green */
body.page-oi-open-interest-map .oi-bar {
  border-color: var(--dm-line-soft);
  border-radius: 8px;
  background: rgba(46, 123, 255, 0.045);
}
body.page-oi-open-interest-map .oi-bar > i {
  background: rgba(61, 220, 132, 0.30);
}
body.page-oi-open-interest-map .oi-bar.is-put > i {
  background: rgba(255, 93, 93, 0.30);
}
body.page-oi-open-interest-map .oi-bar > em {
  color: var(--dm-ink-soft);
}

/* wall badges */
body.page-oi-open-interest-map .oi-badges b {
  border-color: var(--dm-line-strong);
  background: rgba(46, 123, 255, 0.08);
  color: var(--dm-muted);
}
body.page-oi-open-interest-map .oi-badges .put {
  color: var(--dm-red);
  border-color: rgba(255, 93, 93, 0.36);
}
body.page-oi-open-interest-map .oi-badges .call {
  color: var(--dm-green);
  border-color: rgba(61, 220, 132, 0.34);
}
body.page-oi-open-interest-map .oi-map-empty {
  color: var(--dm-muted);
}

/* ---- 9.5d. STRUCTURE (body.page-dashboard-v5.page-structure) ----
   React island already ships the violet/cyan terminal and the rail is
   themed by sections 6/8. Align the page canvas; give light mode a dark
   stage so the island's dark-only palette stays readable. */
html[data-theme="dark"] body.page-structure .site-shell-v5-pro {
  background:
    radial-gradient(ellipse 64% 40% at 8% -4%, rgba(46, 123, 255, 0.09), transparent 58%),
    radial-gradient(ellipse 48% 34% at 98% 0%, rgba(106, 166, 255, 0.06), transparent 54%),
    var(--dm-bg) !important;
}
html[data-theme="light"] body.page-structure .v5-pro-main.dm-structure-main {
  border: 1px solid rgba(30, 99, 224, 0.20);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 70% 50% at 10% -8%, rgba(46, 123, 255, 0.12), transparent 60%),
    #070a16;
}

/* ---- 9.5e. motion guards ---- */
@media (prefers-reduced-motion: reduce) {
  body.page-market-analysis .market-analysis-status[data-tone="loading"],
  body.page-market-analysis .skew-board-chart:not(:has(canvas)) {
    animation: none !important;
  }
  body.page-market-analysis .skew-ticker-card:hover,
  html body.page-oi-open-interest-map .oi-map-controls button:hover {
    transform: none !important;
  }
  body.page-market-analysis .skew-ticker-card,
  html body.page-market-analysis .skew-board-nav a,
  body.page-oi-open-interest-map .oi-map-row,
  html body.page-oi-open-interest-map .oi-map-controls :is(select, button),
  html body.page-oi-open-interest-map .oi-map-header a {
    transition: none !important;
  }
}

/* =====================================================================
   9.6. IRIS LEARNING MONITOR (body.page-iris-learning)
        PROFESSIONAL PASS (2026-06-09)
   The page shares page-dashboard-v5 (rail/chrome themed by sections 6+8)
   but every iris-* component still wears a legacy sky-teal/green skin
   (panel borders rgba(117,210,236,0.24), kicker #9edff5, green #3ddc97
   active tabs, 6-8px radii — app.css 33557+). Re-bases it on the Refined
   Terminal: frosted violet glass, 12-18px radii, cyan kickers, gradient
   display title, violet→cyan tabs. Same-or-higher specificity than
   app.css (non-!important there); this file loads later and wins.
   Roll back: delete this section.
   ===================================================================== */

/* ---- 9.6a. panels: frosted violet glass (replaces teal 8px slabs) ---- */
body.page-iris-learning .iris-learning-hero,
body.page-iris-learning .iris-learning-command-band,
body.page-iris-learning .iris-learning-panel,
body.page-iris-learning .iris-learning-model-card {
  border: 1px solid rgba(46, 123, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(12, 16, 28, 0.90));
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}
body.page-iris-learning .iris-learning-hero { border-radius: 18px; }

/* ---- 9.6b. hero: gradient display title + violet metric tiles ---- */
body.page-iris-learning .iris-learning-hero h1 {
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 60%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
body.page-iris-learning .iris-learning-hero p {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: #96a6cb;
}
body.page-iris-learning .iris-learning-hero-metrics > div {
  border: 1px solid rgba(46, 123, 255, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(46, 123, 255, 0.07), rgba(255, 255, 255, 0.015));
  transition: border-color 130ms ease;
}
body.page-iris-learning .iris-learning-hero-metrics > div:hover {
  border-color: rgba(46, 123, 255, 0.4);
}

/* ---- 9.6c. kickers + micro-labels: cyan with real tracking ---- */
body.page-iris-learning .iris-learning-kicker {
  color: var(--accent-secondary);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}
body.page-iris-learning .iris-learning-hero-metrics span,
body.page-iris-learning .iris-learning-card-top span,
body.page-iris-learning .iris-learning-panel-head span,
body.page-iris-learning .iris-learning-table-row span,
body.page-iris-learning .iris-learning-feature-row span {
  color: rgba(168, 182, 218, 0.85);
  letter-spacing: 0.12em;
}

/* ---- 9.6d. monitor tabs: violet segment control (replaces green) ---- */
body.page-iris-learning .iris-monitor-tabs {
  border: 1px solid rgba(46, 123, 255, 0.20);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(18, 24, 40, 0.80), rgba(10, 14, 24, 0.70));
}
body.page-iris-learning .iris-monitor-tab {
  border-radius: 9px;
  color: rgba(231, 238, 251, 0.62);
}
body.page-iris-learning .iris-monitor-tab:is(:hover, :focus-visible) {
  color: #e7eefb;
  border-color: rgba(46, 123, 255, 0.45);
}
body.page-iris-learning .iris-monitor-tab:focus-visible {
  outline: 2px solid rgba(46, 123, 255, 0.7);
  outline-offset: 1px;
}
body.page-iris-learning .iris-monitor-tab.is-active {
  color: #0a0814;
  border-color: rgba(46, 123, 255, 0.7);
  background: linear-gradient(135deg, #2e7bff, #6aa6ff);
  box-shadow: 0 6px 20px rgba(46, 123, 255, 0.28);
}

/* ---- 9.6e. chips: violet pills ---- */
body.page-iris-learning .iris-learning-chip {
  border: 1px solid rgba(46, 123, 255, 0.30);
  border-radius: 999px;
  background: rgba(46, 123, 255, 0.10);
  color: #b9ccf5;
}

/* ---- 9.6f. health metric tiles ---- */
body.page-iris-learning .iris-health-metric {
  border: 1px solid rgba(46, 123, 255, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(46, 123, 255, 0.06), rgba(255, 255, 255, 0.015));
}
body.page-iris-learning .iris-health-metric strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: #ffffff;
}

/* ---- 9.6g. async containers: shimmer while empty so panels never
        sit as bare boxes during the first monitor poll ---- */
body.page-iris-learning :is(.iris-clue-list, .iris-experiment-arena, .iris-model-pulse-timeline, .iris-learning-change-bars, .iris-knowledge-funnel, .iris-pulse-chart, .iris-model-guard-chart, .iris-brain-map, .iris-training-web, .iris-learning-pipeline, .iris-learning-feature-list, .iris-learning-table-list, .iris-learning-timeline, .iris-learning-insight-list, .iris-health-upgrade-list, .iris-health-model-list):empty {
  min-height: 72px;
  border-radius: 12px;
  background-image: linear-gradient(90deg, rgba(46, 123, 255, 0.03), rgba(106, 166, 255, 0.08) 50%, rgba(46, 123, 255, 0.03));
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: dmChartShimmer 1.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  body.page-iris-learning .iris-learning-hero-metrics > div,
  body.page-iris-learning .iris-monitor-tab { transition: none; }
  body.page-iris-learning :is(.iris-clue-list, .iris-experiment-arena, .iris-model-pulse-timeline, .iris-learning-change-bars, .iris-knowledge-funnel, .iris-pulse-chart, .iris-model-guard-chart, .iris-brain-map, .iris-training-web, .iris-learning-pipeline, .iris-learning-feature-list, .iris-learning-table-list, .iris-learning-timeline, .iris-learning-insight-list, .iris-health-upgrade-list, .iris-health-model-list):empty { animation: none; }
}

/* =====================================================================
   9.7. EDUCATION (body.page-educational) PROFESSIONAL PASS (2026-06-09)
   Inherits the platform-utility chrome pass (section 9.4) for rail and
   shell; this tops up the education-* content components, which still
   use --fin-* tokens and 8px radii. Roll back: delete this section.
   ===================================================================== */
body.page-educational :is(.education-hero, .education-copy-panel, .education-panel, .education-image-panel, .education-pressure-panel, .education-method-panel) {
  border: 1px solid rgba(46, 123, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(20, 26, 42, 0.92), rgba(12, 16, 28, 0.90));
  box-shadow: 0 22px 48px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
html[data-theme="light"] body.page-educational :is(.education-hero, .education-copy-panel, .education-panel, .education-image-panel, .education-pressure-panel, .education-method-panel) {
  border: 1px solid rgba(30, 99, 224, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px -22px rgba(40, 26, 90, 0.18);
}
body.page-educational .education-hero h1 {
  font-family: "Manrope", "Inter", sans-serif;
  letter-spacing: -0.02em;
}
html[data-theme="dark"] body.page-educational .education-hero h1 {
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 60%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.page-educational .education-callout {
  border: 1px solid rgba(46, 123, 255, 0.26);
  border-left: 3px solid var(--accent-primary);
  border-radius: 12px;
  background: rgba(46, 123, 255, 0.07);
}
body.page-educational .education-screenshot {
  border: 1px solid rgba(46, 123, 255, 0.24);
  border-radius: 14px;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.6);
}
/* gamma direction visuals: re-point the page's good/bad tokens to the
   design language (mint up / pink down) — recolors the gamma bars and
   hedge-flow animations, which paint with var(--fin-good)/var(--fin-bad) */
body.page-educational {
  --fin-good: #3ddc84;
  --fin-bad: #ff5d5d;
}
html[data-theme="light"] body.page-educational {
  --fin-good: #0f9d6b;
  --fin-bad: #d23b56;
}

/* =====================================================================
   10. SURFACE COMMAND DECK REVAMP (2026-06-09, structural)
   Pairs with dashboard.html markup: compact pro header (eyebrow +
   "Surface" + context line) and the command band regrouped into
   labeled Scope / Session clusters (.v5-cmd-revamp wrappers).
   The app.css "simplified" layer hid Greek/Source/Replay fields with
   `> label[for=...]` direct-child selectors; the wrappers break those
   matches, so the same controls are re-hidden here (descendant form)
   to keep behavior identical. Roll back: revert dashboard.html hunks
   + delete this section.
   ===================================================================== */

/* ---- 10a. hero: compact professional header ---- */
html body.page-dashboard-v5.page-dashboard-v5 .v5-hero-revamp {
  min-height: 0 !important;
  padding: 14px 18px !important;
  align-items: center !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-hero-revamp .v5-pro-hero-copy {
  gap: 3px !important;
}
body.page-dashboard-v5 .v5-hero-eyebrow {
  color: var(--accent-secondary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-hero-revamp .v5-pro-title {
  font-size: clamp(1.6rem, 1vw + 1.1rem, 2.1rem) !important;
  line-height: 1.04 !important;
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 60%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.page-dashboard-v5 .v5-hero-context {
  margin: 2px 0 0;
  color: #96a6cb;
  font-size: 12.5px;
  line-height: 1.4;
}

/* ---- 10b. command band: labeled control clusters ---- */
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-command-controls.v5-cmd-revamp {
  display: flex !important;
  flex-wrap: wrap;
  gap: 14px 28px !important;
  align-items: stretch !important;
}
body.page-dashboard-v5 .v5-cmd-group {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}
body.page-dashboard-v5 .v5-cmd-group-scope { flex: 1 1 380px; }
body.page-dashboard-v5 .v5-cmd-group-session { flex: 1 1 420px; }
body.page-dashboard-v5 .v5-cmd-group-label {
  color: rgba(168, 182, 218, 0.85);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-left: 2px;
}
body.page-dashboard-v5 .v5-cmd-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: flex-end;
  min-width: 0;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp .vgex-field {
  flex: 1 1 150px;
  max-width: 230px;
  min-width: 130px !important;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp .v5-cmd-group-row :is(button, a.btn-tertiary) {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0 !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}
/* spot readout reads as a live chip beside the actions */
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp .v5-pro-command-spot {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid rgba(106, 166, 255, 0.30);
  border-radius: 10px;
  background: rgba(106, 166, 255, 0.07);
  color: #b9d3ff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp .v5-pro-command-spot:empty {
  display: none;
}
/* preserve the simplified layout: these stay hidden exactly as before
   (the originals used `>` and stopped matching inside the wrappers) */
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp label[for="v5-replay-enabled-input"],
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp label[for="vgex-trade-date-input"],
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp label[for="v5-widget-greek-input"],
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp label[for="v5-widget-source-input"] {
  display: none !important;
}
@media (max-width: 900px) {
  body.page-dashboard-v5 .v5-cmd-group { flex: 1 1 100%; }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp .vgex-field { max-width: none; }
}

/* ---- 10c. workspace depth: ambient flares + structured panel heads ---- */
html[data-theme="dark"] body.page-dashboard-v5 .site-shell-v5-pro {
  background:
    radial-gradient(ellipse 64% 38% at 6% -4%, rgba(46, 123, 255, 0.10), transparent 58%),
    radial-gradient(ellipse 46% 32% at 98% 2%, rgba(106, 166, 255, 0.07), transparent 54%);
}
body.page-dashboard-v5 .v5-stage-head,
body.page-dashboard-v5 .v5-surface-tape-head {
  border-bottom: 1px solid rgba(46, 123, 255, 0.12);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

/* =====================================================================
   11. REACT ISLAND REVAMP — HOME + ALGO WORKBENCH (2026-06-09)
   The Home console and Algo page are the compiled React UIs
   (dm-home-* / dm-algo-react-*). dealermap-theme.css now loads AFTER
   dealermap-react.css (base.html), so these single-class overrides win
   by source order. Visual only. Roll back: delete this section +
   restore the link order in base.html.
   ===================================================================== */

/* ---- 11a. home hero: tighter display type + ambient glass stage ---- */
.dm-home-hero {
  border: 1px solid rgba(46, 123, 255, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 70% 60% at 8% 0%, rgba(46, 123, 255, 0.14), transparent 58%),
    radial-gradient(ellipse 52% 44% at 96% 8%, rgba(106, 166, 255, 0.10), transparent 55%),
    linear-gradient(180deg, rgba(16, 21, 38, 0.94), rgba(9, 13, 24, 0.96));
  box-shadow: 0 30px 64px -32px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  min-height: 0;
}
.dm-home-hero h1, .dm-algo-react-hero h1 {
  font-size: clamp(2.1rem, 3.4vw, 3.4rem);
  letter-spacing: -0.025em;
  background: linear-gradient(120deg, #ffffff 0%, #d6e4ff 58%, #b9d3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- 11b. home cards: defined frosted tiles with hover affordance ---- */
.dm-home-letter-card,
.dm-home-leader-card,
.dm-home-cot-card,
.dm-home-stat {
  border: 1px solid rgba(46, 123, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 44%),
    rgba(13, 18, 32, 0.72);
  transition: border-color 130ms ease;
}
.dm-home-letter-card:hover,
.dm-home-leader-card:hover,
.dm-home-cot-card:hover {
  border-color: rgba(46, 123, 255, 0.38);
}
.dm-home-tool {
  border: 1px solid rgba(46, 123, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(46, 123, 255, 0.10), transparent 46%),
    linear-gradient(180deg, rgba(16, 21, 38, 0.92), rgba(10, 14, 25, 0.94));
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.dm-home-tool:hover {
  transform: translateY(-2px);
  border-color: rgba(46, 123, 255, 0.5);
  box-shadow: 0 18px 40px -20px rgba(46, 123, 255, 0.35);
}
.dm-home-heat-tile {
  border-radius: 12px;
}
.dm-home-heat-tile:hover {
  border-color: rgba(46, 123, 255, 0.5);
}
.dm-home-heatmap-panel,
.dm-home-cot-panel,
.dm-home-letter {
  border-radius: 18px;
}

/* ---- 11c. algo workbench: glass stages + violet tab affordances ---- */
.dm-algo-react-stage,
.dm-algo-react-inspector,
.dm-algo-react-ladder {
  border: 1px solid rgba(46, 123, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.05), transparent 42%),
    linear-gradient(180deg, rgba(17, 22, 40, 0.93), rgba(10, 14, 26, 0.94));
  box-shadow: 0 24px 52px -28px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dm-algo-view-tabs button {
  border-radius: 10px;
  transition: border-color 130ms ease, background-color 130ms ease, color 130ms ease;
}
.dm-algo-view-tabs button:hover {
  border-color: rgba(46, 123, 255, 0.45);
}
.dm-algo-table-row {
  transition: background-color 120ms ease;
}
.dm-algo-table-row:hover {
  background: rgba(46, 123, 255, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .dm-home-tool, .dm-home-tool:hover { transform: none; transition: none; }
  .dm-home-letter-card, .dm-home-leader-card, .dm-home-cot-card,
  .dm-home-heat-tile, .dm-algo-view-tabs button, .dm-algo-table-row { transition: none; }
}

/* ---- 11d. kill remaining off-palette greens in the React bundles ---- */
/* the bundle's mint-teal brand green -> design-language mint (semantic
   up/positive stays green, just the right green) */
html[data-theme=dark] { --simple-green: #3ddc84; --simple-green-soft: rgba(61, 220, 132, 0.10); }
html[data-theme=light] { --simple-green: #0f9d6b; --simple-green-soft: rgba(15, 157, 107, 0.10); }
/* gold->green Save buttons -> brand violet->cyan (theirs are !important) */
.dm-algo-react-controls button.is-save,
.dm-structure-controls button.is-save {
  color: #0a0814 !important;
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  border-color: rgba(46, 123, 255, 0.7) !important;
  box-shadow: 0 14px 32px rgba(46, 123, 255, 0.25) !important;
}
.dm-algo-react-controls button.is-save:before,
.dm-structure-controls button.is-save:before {
  color: #0a0814;
  background: rgba(10, 8, 20, 0.18);
}
.dm-algo-save-status, .dm-structure-save-status {
  color: #3ddc84;
  background: rgba(61, 220, 132, 0.10);
  border-color: rgba(61, 220, 132, 0.30);
}
/* home quick-action hover was solid green */
.dm-home-react .dm-home-actions button:hover {
  border-color: #2e7bff;
  background: #2e7bff;
}

/* =====================================================================
   12. SURFACE WORKSPACE NAVIGATION + CLEAN CANVAS (2026-06-09, bold)
   Pairs with dashboard.html: sticky "Workspace" jump-nav chips that
   anchor to every major tool panel, a clean violet grid canvas that
   replaces the dimmed photo backdrop, a sticky node-table header, and
   rail/legibility polish. Roll back: delete section + revert template.
   ===================================================================== */

/* ---- 12a. smooth anchor scrolling with safe offsets ---- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body.page-dashboard-v5 :is(#surface-node-table, #surface-monthly-outlook, #v5-swing-algo-alert, #surface-gamma-bar, #surface-candles, #surface-iris-chart-anchor, #surface-strike-engine) {
  scroll-margin-top: 76px;
}

/* ---- 12b. sticky workspace jump nav ---- */
body.page-dashboard-v5 .v5-jump-nav {
  position: sticky;
  top: 8px;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(46, 123, 255, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.07), transparent 50%),
    rgba(10, 14, 26, 0.88);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}
body.page-dashboard-v5 .v5-jump-nav-label {
  color: rgba(168, 182, 218, 0.85);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-right: 4px;
}
body.page-dashboard-v5 .v5-jump-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid rgba(46, 123, 255, 0.22);
  border-radius: 999px;
  background: rgba(46, 123, 255, 0.07);
  color: #cfd9f3;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 130ms ease, background-color 130ms ease, color 130ms ease;
}
body.page-dashboard-v5 .v5-jump-chip:hover {
  border-color: rgba(46, 123, 255, 0.55);
  background: rgba(46, 123, 255, 0.16);
  color: #ffffff;
}
body.page-dashboard-v5 .v5-jump-chip:focus-visible {
  outline: 2px solid rgba(46, 123, 255, 0.7);
  outline-offset: 1px;
}

/* ---- 12c. clean professional canvas: violet grid replaces the photo ---- */
html[data-theme="dark"] body.page-dashboard-v5::before {
  background-image:
    radial-gradient(ellipse 70% 44% at 12% -6%, rgba(46, 123, 255, 0.13), transparent 60%),
    radial-gradient(ellipse 50% 36% at 96% 0%, rgba(106, 166, 255, 0.08), transparent 55%),
    linear-gradient(rgba(46, 123, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 166, 255, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #070a14, #05080f) !important;
  background-size: auto, auto, 52px 52px, 52px 52px, auto !important;
  opacity: 1 !important;
}

/* ---- 12d. node table: sticky header + stronger data legibility ---- */
body.page-dashboard-v5 .v5-surface-ladder-header {
  position: sticky;
  top: 56px;
  z-index: 4;
  background: rgba(10, 14, 26, 0.97);
  border-radius: 9px;
}
body.page-dashboard-v5 .v5-surface-strike-cell strong {
  font-size: 0.95rem;
}

/* ---- 12e. rail: clearer hierarchy ---- */
body.page-dashboard-v5 .v5-pro-brand {
  border-bottom: 1px solid rgba(46, 123, 255, 0.14);
  padding-bottom: 12px;
  margin-bottom: 4px;
}
body.page-dashboard-v5 .v5-pro-nav-item span {
  color: rgba(140, 156, 196, 0.8);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
body.page-dashboard-v5 .v5-pro-nav-item strong {
  font-size: 13px;
  letter-spacing: -0.01em;
}
body.page-dashboard-v5 .v5-pro-nav-item.is-active strong {
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  body.page-dashboard-v5 .v5-jump-chip { transition: none; }
}

/* =====================================================================
   13. SURFACE "TERMINAL 2.0" ARCHITECTURE (2026-06-09, structural)
   The sidebar is gone: dashboard.html now renders a sticky top command
   bar (.v5-topbar) and the shell is single-column, giving the charts
   the full viewport width. On wide screens the workspace becomes a
   zoned 12-column grid instead of one long monotonous stack.
   Roll back: revert dashboard.html rail hunk + delete this section.
   ===================================================================== */

/* ---- 13a. single-column shell (was 240px rail + content) ---- */
html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-shell.v5-shell-top {
  display: block !important;
}

/* ---- 13b. sticky top command bar ---- */
body.page-dashboard-v5 .v5-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  margin: 0 0 10px;
  padding: 7px 16px;
  border: 1px solid rgba(46, 123, 255, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.07), transparent 55%),
    rgba(8, 12, 22, 0.92);
  box-shadow: 0 20px 44px -24px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}
html[data-theme="light"] body.page-dashboard-v5 .v5-topbar {
  border-color: rgba(30, 99, 224, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px -20px rgba(40, 26, 90, 0.25);
}
body.page-dashboard-v5 .v5-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
}
body.page-dashboard-v5 .v5-topbar-plaque {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(46, 123, 255, 0.35);
  border-radius: 9px;
  background: rgba(46, 123, 255, 0.12);
  overflow: hidden;
}
body.page-dashboard-v5 .v5-topbar-plaque-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.page-dashboard-v5 .v5-topbar-brand > strong {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #ffffff, #d6e4ff 55%, #b9d3ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] body.page-dashboard-v5 .v5-topbar-brand > strong {
  background: linear-gradient(120deg, #1b1830, #1e63e0 70%, #1666cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* nav */
body.page-dashboard-v5 .v5-topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
body.page-dashboard-v5 .v5-topbar-nav::-webkit-scrollbar { display: none; }
body.page-dashboard-v5 .v5-topbar-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 130ms ease, background-color 130ms ease, border-color 130ms ease;
}
body.page-dashboard-v5 .v5-topbar-nav a:hover {
  color: var(--bright);
  background: rgba(46, 123, 255, 0.10);
  border-color: rgba(46, 123, 255, 0.25);
}
body.page-dashboard-v5 .v5-topbar-nav a.is-active {
  color: #0a0814;
  background: linear-gradient(135deg, #2e7bff, #6aa6ff);
  border-color: transparent;
  box-shadow: 0 8px 20px -8px rgba(46, 123, 255, 0.55);
}
body.page-dashboard-v5 .v5-topbar-nav a:focus-visible {
  outline: 2px solid rgba(46, 123, 255, 0.7);
  outline-offset: 1px;
}

/* right side: scope chip, theme, user */
body.page-dashboard-v5 .v5-topbar-side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
body.page-dashboard-v5 .v5-topbar-scope {
  display: grid;
  gap: 0;
  padding: 4px 12px;
  border: 1px solid rgba(106, 166, 255, 0.30);
  border-radius: 10px;
  background: rgba(106, 166, 255, 0.07);
  text-align: center;
}
body.page-dashboard-v5 .v5-topbar-scope strong {
  color: #b9d3ff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}
body.page-dashboard-v5 .v5-topbar-scope small {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
body.page-dashboard-v5 .v5-topbar-theme {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 3px;
  border: 1px solid rgba(46, 123, 255, 0.20);
  border-radius: 10px;
  background: rgba(8, 12, 22, 0.55);
}
html[data-theme="light"] body.page-dashboard-v5 .v5-topbar-theme {
  background: rgba(124, 58, 237, 0.06);
}
body.page-dashboard-v5 .v5-topbar-theme .theme-switch-button {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 10.5px;
}
body.page-dashboard-v5 .v5-topbar-user {
  display: grid;
  text-align: right;
  gap: 0;
}
body.page-dashboard-v5 .v5-topbar-user strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}
body.page-dashboard-v5 .v5-topbar-signout {
  color: var(--accent-secondary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
body.page-dashboard-v5 .v5-topbar-signout:hover { text-decoration: underline; }

@media (max-width: 760px) {
  body.page-dashboard-v5 .v5-topbar { flex-wrap: wrap; }
  body.page-dashboard-v5 .v5-topbar-scope { display: none; }
}

/* ---- 13c. sticky offsets now account for the top bar ---- */
body.page-dashboard-v5 .v5-jump-nav { top: 64px; }
body.page-dashboard-v5 :is(#surface-node-table, #surface-monthly-outlook, #v5-swing-algo-alert, #surface-gamma-bar, #surface-candles, #surface-iris-chart-anchor, #surface-strike-engine) {
  scroll-margin-top: 130px;
}
body.page-dashboard-v5 .v5-surface-ladder-header { top: 118px; }

/* ---- 13d. zoned workspace: 12-column grid on wide screens ---- */
@media (min-width: 1460px) {
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > * {
    grid-column: 1 / -1;
    min-width: 0;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > [data-v5-widget="market-direction"] {
    grid-column: span 4;
    order: 3 !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > .v5-daily-algo-strip {
    grid-column: span 8;
    order: 3 !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > [data-v5-widget="monthly-gamma"] {
    grid-column: span 5;
    order: 4 !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > .v5-swing-algo-alert {
    grid-column: span 7;
    order: 4 !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > [data-v5-widget="strike-pressure"] {
    order: 5 !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > [data-v5-widget="split-watch"] {
    order: 6 !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > [data-v5-widget="appearance"] {
    order: 7 !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-canvas > #status-banner {
    order: 0 !important;
  }
}
/* charts zone: candle chart beside the intraday map, IRIS beside nothing */
@media (min-width: 1500px) {
  html body.page-dashboard-v5.page-dashboard-v5 .v5-widget-workspace[data-v5-widget-layout="command"] .v5-workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-workspace-grid > #surface-gamma-bar,
  html body.page-dashboard-v5.page-dashboard-v5 .v5-workspace-grid > #surface-candles,
  html body.page-dashboard-v5.page-dashboard-v5 .v5-workspace-grid > #surface-iris-chart-anchor {
    grid-column: 1 / -1;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-workspace-grid > .v5-intraday-pressure-panel {
    grid-column: 1 / -1;
  }
}

/* ---- 13e. CANDLES RESTORED (2026-06-09) ----
   The 2026-06-08 simplified layer hid the Candles/Heatmap main toggle
   (#vgex-view-toggle-btn, app.css ~32024), stranding users whose stored
   view mode was heatmap with no way back to the price candlestick chart.
   Re-show the toggle in the Session cluster; v5.js also bumped
   PRICE_CHART_DEFAULTS_VERSION so stored view modes reset to candles. */
html body.page-dashboard-v5.page-dashboard-v5 .v5-cmd-revamp #vgex-view-toggle-btn.vgex-view-toggle {
  display: inline-flex !important;
}

/* =====================================================================
   14. ARCTIC MONO — global palette + typography (2026-06-10)
   A complete re-base off the violet/cyan scheme: near-neutral black,
   ice-white text, a single electric-blue accent, green/red signals.
   Loads last; redefines the neutral tokens the earlier sections left
   navy, the chart engine variables (read by ECharts at render), the
   React-island token namespace, and the display font.
   Roll back: delete this section + restore base.html font/rev.
   ===================================================================== */

/* ---- 14a. neutral base tokens (the brand colors are already blue via
        the section-1/2 remap; here we neutralize the navy + glows) ---- */
:root,
html[data-theme="dark"],
html[data-theme="dark"][data-color-scheme="emerald"],
html[data-theme="dark"][data-color-scheme="classic"],
html[data-theme="dark"][data-color-scheme="mono"] {
  --bg:          #08090c;
  --bg-up:       #0c0e12;
  --bg-panel:    rgba(16, 18, 24, 0.94);
  --bg-card:     rgba(13, 15, 20, 0.96);
  --line:        rgba(46, 123, 255, 0.14);
  --line-s:      rgba(46, 123, 255, 0.28);
  --text:        #eef2f7;
  --bright:      #ffffff;
  --muted:       #9aa4b6;
  --faint:       rgba(168, 178, 198, 0.42);
  --shadow:      0 30px 70px -28px rgba(0, 0, 0, 0.86), 0 0 0 1px rgba(46, 123, 255, 0.08);
  --shadow-sm:   0 10px 28px -14px rgba(0, 0, 0, 0.66);
  --ambient-flares:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(46, 123, 255, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 100%, rgba(46, 123, 255, 0.05) 0%, transparent 52%);
}
html[data-theme="light"],
html[data-theme="light"][data-color-scheme="emerald"],
html[data-theme="light"][data-color-scheme="classic"],
html[data-theme="light"][data-color-scheme="mono"] {
  --bg:          #eef1f6;
  --bg-up:       #e6eaf2;
  --bg-panel:    rgba(255, 255, 255, 0.94);
  --bg-card:     rgba(255, 255, 255, 0.98);
  --line:        rgba(30, 99, 224, 0.14);
  --line-s:      rgba(30, 99, 224, 0.26);
  --text:        #0f1622;
  --bright:      #060a12;
  --muted:       #5a6172;
}

/* ---- 14b. chart engine palette (read live by v5.js via CSS vars) ---- */
html body.page-dashboard-v5.page-dashboard-v5,
html body {
  --dm-chart-positive: #2e7bff !important;   /* calls / +gamma -> electric blue */
  --dm-chart-negative: #ff5d5d !important;   /* puts / -gamma  -> red */
  --dm-chart-neutral: rgba(154, 164, 182, 0.5) !important;
  --dm-chart-grid: rgba(140, 160, 200, 0.08) !important;
  --dm-chart-axis: rgba(222, 230, 242, 0.55) !important;
  --dm-chart-text: #eef2f7 !important;
  --dm-chart-subtext: rgba(154, 164, 182, 0.82) !important;
  --dm-chart-tooltip-bg: rgba(12, 14, 20, 0.96) !important;
  --dm-chart-tooltip-border: rgba(46, 123, 255, 0.32) !important;
  --dm-terminal-accent: #2e7bff !important;
  --dm-terminal-secondary: #6aa6ff !important;
}

/* ---- 14c. React island token namespace (Home / Algo / Structure) ---- */
:root {
  --dm-cyan: #6aa6ff;
  --dm-cyan-strong: #2e7bff;
  --dm-purple: #2e7bff;
  --dm-purple-strong: #1e63e0;
  --dm-pink: #ff5d5d;
  --dm-green: #3ddc84;
  --dm-red: #ff5d5d;
  --dm-line: rgba(46, 123, 255, 0.22);
}
html[data-theme="dark"] { --simple-green: #3ddc84; --simple-green-soft: rgba(61, 220, 132, 0.10); }
/* compiled island gradients are hardcoded ice/violet -> unify to blue */
.dm-home-actions a:first-child,
.dm-home-actions button,
.dm-algo-react-controls button.is-primary {
  background: linear-gradient(135deg, #2e7bff, #6aa6ff) !important;
  box-shadow: 0 0 30px rgba(46, 123, 255, 0.22) !important;
}
.dm-algo-view-tabs button.is-active,
.dm-algo-table-tools button.is-active,
.dm-structure-window-tabs button.is-active,
.dm-structure-mode-toggle button.is-active {
  background: linear-gradient(135deg, rgba(46, 123, 255, 0.30), rgba(106, 166, 255, 0.22)) !important;
  border-color: rgba(46, 123, 255, 0.62) !important;
  color: #fff !important;
}

/* ---- 14d. typography: Space Grotesk display, Inter UI, JetBrains data --- */
h1, h2, h3,
.v5-pro-title,
.v5-hero-eyebrow,
.v5-topbar-brand > strong,
.chart-title,
.v5-stage-head h2,
.v5-surface-tape-head .chart-title,
.dm-home-hero h1, .dm-algo-react-hero h1,
.dm-home-hero h2, .dm-structure-hero h1,
.iris-learning-hero h1,
.education-hero h1,
.skew-board-hero h1,
.oi-map-title h1,
.home-welcome-copy h1,
.login-cinematic-headline {
  font-family: "Space Grotesk", "Manrope", "Inter", "Segoe UI", sans-serif !important;
  letter-spacing: -0.02em;
}

/* ---- 14e. accent-blue scrollbars + selection (global) ---- */
::selection { background: rgba(46, 123, 255, 0.32); color: #fff; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(46, 123, 255, 0.24);
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(46, 123, 255, 0.42);
}

/* =====================================================================
   15. SURFACE COCKPIT LAYOUT (2026-06-10, structural)
   Replaces the "endless wall of identical giant panels" with a real
   trading-terminal hierarchy: the price candlestick chart is the hero,
   secondary charts pair side-by-side, and the canvas children follow a
   deliberate read order (chart -> read -> table -> models). CSS-only,
   scoped to the default (non-widget-edit) workspace so custom layouts
   are untouched. Every selector targets existing DOM. Roll back: delete.
   ===================================================================== */

/* ---- 15a. deliberate canvas read-order (chart-first cockpit) ---- */
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > #status-banner { order: 0 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-workspace-grid { order: 1 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-market-deck { order: 2 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-daily-algo-strip { order: 3 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-surface-tape { order: 4 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-swing-algo-alert { order: 5 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-dm-strike-bar-panel { order: 6 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-inspector-panel { order: 7 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-split-board { order: 8 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .v5-widget-algo-levels-panel { order: 9 !important; }
body.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas > .vgex-style-panel { order: 10 !important; }

/* ---- 15b. the charts zone: candle chart is the hero ---- */
@media (min-width: 1280px) {
  html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-workspace[data-v5-widget-layout="command"] .v5-workspace-grid,
  html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-workspace[data-v5-widget-layout="focus"] .v5-workspace-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  /* price candles = full-width hero, first */
  html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) .v5-workspace-grid > #surface-candles {
    display: grid !important;
    grid-column: 1 / -1 !important;
    order: 1 !important;
  }
  /* gamma bar + IRIS chart pair side-by-side underneath */
  html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) .v5-workspace-grid > #surface-gamma-bar {
    grid-column: 1 !important;
    order: 2 !important;
  }
  html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) .v5-workspace-grid > #surface-iris-chart-anchor {
    grid-column: 2 !important;
    order: 3 !important;
  }
  /* timestamp pressure is no longer a default Surface chart */
  html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) .v5-workspace-grid > .v5-intraday-pressure-panel {
    display: none !important;
    grid-column: 1 / -1 !important;
    order: 4 !important;
  }
}

html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) #surface-candles {
  display: grid !important;
}

html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) .v5-intraday-pressure-panel {
  display: none !important;
}

/* ---- 15c. professional chart sizing: hero tall, secondaries calmer
        (replaces the uniform 640-780px wall) ---- */
body.page-dashboard-v5 #surface-candles .chart-shell-heatmap {
  min-height: 600px !important;
}
body.page-dashboard-v5 #surface-gamma-bar .chart-shell-vgex-bar {
  min-height: 460px !important;
}
body.page-dashboard-v5 .v5-iris-price-chart {
  min-height: 460px !important;
}
body.page-dashboard-v5 .chart-shell-vgex-intraday {
  min-height: 420px !important;
}
@media (max-width: 1100px) {
  body.page-dashboard-v5 #surface-candles .chart-shell-heatmap { min-height: 460px !important; }
  body.page-dashboard-v5 #surface-gamma-bar .chart-shell-vgex-bar,
  body.page-dashboard-v5 .v5-iris-price-chart { min-height: 400px !important; }
}

/* ---- 15d. a "hero chart" treatment so the candle panel reads as primary ---- */
body.page-dashboard-v5 #surface-candles {
  border-color: rgba(46, 123, 255, 0.30) !important;
  box-shadow: 0 30px 64px -30px rgba(0, 0, 0, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(46, 123, 255, 0.10) !important;
}
body.page-dashboard-v5 #surface-candles .chart-kicker {
  color: #2e7bff !important;
}
body.page-dashboard-v5 #surface-candles .chart-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: #2e7bff;
  box-shadow: 0 0 10px rgba(46, 123, 255, 0.8);
  vertical-align: middle;
}

/* ---- 15e. denser, more deliberate panel rhythm ---- */
html body.page-dashboard-v5.page-dashboard-v5:not(.is-v5-widget-mode) .v5-widget-canvas {
  gap: 12px !important;
}
body.page-dashboard-v5 .v5-stage-panel,
body.page-dashboard-v5 .v5-widget-panel,
body.page-dashboard-v5 .v5-surface-tape {
  padding: 16px 18px !important;
}
body.page-dashboard-v5 .chart-shell {
  border-radius: 14px !important;
}

/* =====================================================================
   16. SURFACE PERFORMANCE GUARDRAIL + LIVE-FEEL PASS (rev 20260611)
   Mirrors the shipped v8 "performance guardrails": backdrop-filter on ~15
   stacked panels (several nested) plus two sticky bars forced a full-width
   GPU re-blur on every scroll frame. Identity is preserved by raising the
   panel background alpha instead. Also: load feedback (spinner, dimming,
   pending shimmer), status toast, pulsing live dots, value flashes, and a
   reduced-motion-safe page-enter stagger.
   ===================================================================== */

/* ---- 16a. compositing guardrail: no backdrop blur on Surface ---- */
html body.page-dashboard-v5.page-dashboard-v5 :is(.v5-widget-panel,.v5-stage-panel,.v5-inspector-panel,.v5-surface-tape,.v5-market-card,.v5-monthly-oi-panel,.v5-swing-algo-alert,.v5-widget-algo-levels-panel,.v5-surface-weight-card,.v5-surface-mini-card,.dm-mdi,.v5-pro-command-band,.v5-topbar,.v5-jump-nav) {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* compensate with near-opaque surfaces so the frost loss is invisible */
html body.page-dashboard-v5.page-dashboard-v5 :is(.v5-widget-panel,.v5-stage-panel,.v5-inspector-panel,.v5-surface-tape,.v5-market-card,.v5-monthly-oi-panel,.v5-swing-algo-alert,.v5-widget-algo-levels-panel,.v5-surface-weight-card,.v5-surface-mini-card) {
  background:
    linear-gradient(180deg, rgba(46, 123, 255, 0.07), transparent 42%),
    linear-gradient(180deg, rgba(24, 29, 46, 0.97), rgba(15, 19, 31, 0.96)) !important;
}
body.page-dashboard-v5 .v5-topbar {
  background: rgba(8, 11, 19, 0.97);
}
body.page-dashboard-v5 .v5-jump-nav {
  background: rgba(10, 13, 22, 0.97);
}
body.page-dashboard-v5 .v5-pro-command-band {
  background: rgba(13, 17, 28, 0.96);
}
/* cheaper shadows: 48px blur stacks inflate every panel repaint */
html body.page-dashboard-v5.page-dashboard-v5 :is(.v5-widget-panel,.v5-stage-panel,.v5-inspector-panel,.v5-surface-tape,.v5-market-card,.v5-monthly-oi-panel,.v5-swing-algo-alert,.v5-widget-algo-levels-panel,.v5-surface-weight-card,.v5-surface-mini-card) {
  box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}
/* render containment: panels never bleed layout/paint into the 8000px page */
body.page-dashboard-v5 :is(.v5-widget-panel, .v5-stage-panel, .v5-inspector-panel) {
  contain: layout;
}
body.page-dashboard-v5 :is(.chart-shell, .v5-tool-chart-shell, .v5-monthly-oi-chart) {
  contain: layout paint;
}
/* the decorative logo sheen kept the sticky topbar compositing forever */
body.page-dashboard-v5 .brand-plaque::after {
  animation: none;
}

/* ---- 16b. smooth-scroll only for users who want motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
}

/* ---- 16c. status banner becomes a toast (no more mid-page layout jolt) ---- */
body.page-dashboard-v5 .status-banner {
  position: fixed;
  left: 18px;
  bottom: 18px;
  right: auto;
  z-index: 1200;
  max-width: 380px;
  margin: 0;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85) !important;
}
body.page-dashboard-v5 .status-banner[data-tone="error"] {
  border-color: rgba(255, 93, 93, 0.55);
}
body.page-dashboard-v5 .status-banner[data-tone="success"] {
  border-color: rgba(61, 220, 132, 0.45);
}

/* ---- 16d. load feedback: refresh spinner + workspace dim + pending shimmer ---- */
@keyframes dm-spin-slow { to { transform: rotate(360deg); } }
body.page-dashboard-v5 .vgex-load-button.is-loading {
  opacity: 0.82;
  pointer-events: none;
}
body.page-dashboard-v5 .vgex-load-button.is-loading::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 8px;
  vertical-align: -1px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dm-spin-slow 0.7s linear infinite;
}
body.page-dashboard-v5 .v5-workspace-grid[aria-busy="true"] .chart-shell {
  opacity: 0.55;
  filter: saturate(0.7);
  transition: opacity 180ms ease, filter 180ms ease;
}
body.page-dashboard-v5 .chart-shell.is-pending {
  position: relative;
}
body.page-dashboard-v5 .chart-shell.is-pending::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(46, 123, 255, 0.03), rgba(106, 166, 255, 0.10), rgba(46, 123, 255, 0.03));
  background-size: 220% 100%;
  animation: dmChartShimmer 1.7s linear infinite;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  body.page-dashboard-v5 .vgex-load-button.is-loading::after { animation: none; }
  body.page-dashboard-v5 .chart-shell.is-pending::after { animation: none; }
}

/* ---- 16e. live dots actually breathe ---- */
@keyframes dm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.72); }
}
@media (prefers-reduced-motion: no-preference) {
  body.page-dashboard-v5 .v5-stream-status[data-state="streaming"] .v5-stream-dot,
  body.page-dashboard-v5 .v5-iris-signal-status[data-state="active"] .v5-iris-signal-dot,
  body.page-dashboard-v5 .dm-mdi-status .dot {
    animation: dm-pulse 1.9s ease infinite;
  }
  body.page-dashboard-v5 .v5-stream-status[data-state="reconnecting"] .v5-stream-dot,
  body.page-dashboard-v5 .v5-stream-status[data-state="starting"] .v5-stream-dot {
    animation: dm-pulse 0.95s ease infinite;
  }
}
#v5-surface-prewarm-status i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #2e7bff;
  box-shadow: 0 0 8px rgba(46, 123, 255, 0.5);
  vertical-align: 1px;
}
#v5-surface-prewarm-status[data-state="warming"] i {
  background: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55);
}
#v5-surface-prewarm-status[data-state="ready"] i {
  background: #3ddc84;
  box-shadow: 0 0 10px rgba(61, 220, 132, 0.55);
}
@media (prefers-reduced-motion: no-preference) {
  #v5-surface-prewarm-status[data-state="warming"] i { animation: dm-pulse 1.2s ease infinite; }
}
#v5-surface-prewarm-title { transition: color 200ms ease; }

/* ---- 16f. spot tick flash (app.css pins color with !important; restore it
        while the flash class is live — class is removed on animationend) ---- */
@media (prefers-reduced-motion: no-preference) {
  html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-metric strong.summary-value--flash-up,
  html body.page-dashboard-v5.page-dashboard-v5 #vgex-spot-display.summary-value--flash-up {
    color: #3ddc84 !important;
    text-shadow: 0 0 14px rgba(61, 220, 132, 0.45);
    transition: color 120ms ease;
  }
  html body.page-dashboard-v5.page-dashboard-v5 .v5-pro-metric strong.summary-value--flash-down,
  html body.page-dashboard-v5.page-dashboard-v5 #vgex-spot-display.summary-value--flash-down {
    color: #ff5d5d !important;
    text-shadow: 0 0 14px rgba(255, 93, 93, 0.45);
    transition: color 120ms ease;
  }
}

/* ---- 16g. page-enter: deliberate top-down reveal instead of random pop-in ---- */
@keyframes dmPanelEnter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  body.page-dashboard-v5 :is(.v5-pro-hero, .dm-mdi, .v5-pro-command-band, .v5-jump-nav) {
    animation: dmPanelEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  body.page-dashboard-v5 .dm-mdi { animation-delay: 0.06s; }
  body.page-dashboard-v5 .v5-pro-command-band { animation-delay: 0.12s; }
  body.page-dashboard-v5 .v5-jump-nav { animation-delay: 0.18s; }
  body.page-dashboard-v5 .v5-widget-canvas > * {
    animation: dmPanelEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.22s;
  }
  body.page-dashboard-v5 .v5-widget-canvas > :nth-child(-n+2) { animation-delay: 0.16s; }
  /* MDI skeleton -> content crossfade */
  body.page-dashboard-v5 .dm-mdi-body:not([hidden]) {
    animation: dmPanelEnter 0.3s ease both;
  }
}

/* ---- 16h. micro-interactions: controls acknowledge the hand ---- */
body.page-dashboard-v5 :is(.btn-primary, .btn-tertiary, .v5-strike-segment-button, .v5-jump-chip, .theme-switch-button) {
  transition: transform 120ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
body.page-dashboard-v5 :is(.btn-primary, .btn-tertiary, .v5-strike-segment-button, .v5-jump-chip, .theme-switch-button):active {
  transform: translateY(1px) scale(0.985);
}
body.page-dashboard-v5 .v5-surface-ladder-row {
  transition: background-color 120ms ease, border-color 120ms ease;
}

/* ---- 16i. live-tilt ladder bars ease between spot ticks ---- */
@media (prefers-reduced-motion: no-preference) {
  body.page-dashboard-v5 .v5-surface-exposure-bar {
    transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
  }
}
