/* SPYLab Quant: dark working surfaces, stable strategy identities and readable data.
   Dark overrides apply on screen only, keeping printed research reports on white. */
:root {
  --strategy-buy-hold: #916500;
  --strategy-ma200: #7055c5;
  --strategy-dca12: #237bbb;
  --strategy-custom: #087d59;
  --data-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 33px; padding: 6px 10px; border: 1px solid #c9d7eb; border-radius: 99px;
  background: rgba(255,255,255,.72); color: #405c86; font: inherit; font-size: 11px;
  font-weight: 500; white-space: nowrap; box-shadow: inset 0 1px 0 #fff;
}
.theme-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.theme-toggle:hover { background: #fff; border-color: #9eb6e1; }
.theme-toggle:focus-visible { outline: 3px solid #5474e4; outline-offset: 3px; }
.metric-card strong, .metric-card:last-child strong, .lab-stat,
.tooltip-row b, .tooltip-date, .result-period, .chart-label,
.results-table td:not(:first-child), .formula-note {
  font-family: var(--data-font); font-variant-numeric: tabular-nums lining-nums;
}
.metric-card:last-child strong { font-size: 26px; }
.strategy-name, .best-mark, .annual-cell { font-family: inherit; }
.results-table .strategy-name { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.strategy-color.green { background: var(--strategy-buy-hold); }
.strategy-color.amber { background: var(--strategy-ma200); }
.strategy-color.blue { background: var(--strategy-dca12); }
.strategy-color.rose { background: var(--strategy-custom); }
.chart-vertical-grid { stroke: #e6edf6; stroke-width: 1; stroke-dasharray: 2 5; }
.chart-hover-horizontal { stroke: #6e83a6; stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.chart-point { pointer-events: none; }
.chart-tooltip { max-width: calc(100% - 16px); }
.legend-item.off { opacity: .5; }
.rule-accordion { margin: 0 0 9px; border: 1px solid #dce5f2; border-radius: 10px; overflow: hidden; }
.rule-accordion summary { padding: 13px 15px; color: #2f496c; background: #f5f8fd; font-size: 13px; font-weight: 600; cursor: pointer; }
.rule-accordion[open] summary { border-bottom: 1px solid #dce5f2; }
.rule-number { display: inline-block; margin-right: 10px; color: #5b7da9; font-family: var(--data-font); font-size: 11px; }
.tooltip-reference { margin-top: 8px; padding-top: 7px; border-top: 1px solid #dce6f3; color: #596d86; font-size: 10px; }
.rule-accordion > :not(summary) { margin: 0; padding: 13px 15px; }
.run-flow { display: none; align-items: center; justify-content: center; gap: 3px; height: 17px; width: 19px; flex: 0 0 19px; }
.run-flow i { width: 3px; height: 7px; border-radius: 3px; background: currentColor; }
.run-button[data-busy="true"] .run-flow { display: inline-flex; }
.run-button[data-busy="true"] .play-icon { display: none; }
.run-button[data-busy="true"] { cursor: progress; }

@media screen {
  html[data-theme="dark"] {
    color-scheme:dark;
    --bg:#101a2b; --paper:#1a2b43; --ink:#e3eaf5; --muted:#b2c2d6;
    --line:#344c68; --accent:#6bdfec; --lab-soft:#1a2b43; --lab-blue-soft:#20344d;
    --lab-success:#b4ebca; --glass-border:#344c68;
    --shadow:0 8px 22px rgba(0,0,0,.10),inset 0 1px 0 rgba(255,255,255,.035);
    --surface-raised:#20344d; --surface-input:#132238; --control-line:#6486a8;
    --strategy-buy-hold:#f0cd79; --strategy-ma200:#b8a1f4;
    --strategy-dca12:#88c5ef; --strategy-custom:#8ce0b3;
  }
  html[data-theme="dark"] body { background:var(--bg); color:var(--ink); }
  html[data-theme="dark"] body::before { background:var(--bg); }
  html[data-theme="dark"] .ambient-scene { display:none; }
  html[data-theme="dark"] .skip { background:#20344d; color:#e3eaf5; border:1px solid #6486a8; }
  html[data-theme="dark"] .results:has(#dirtyNote:not([hidden])) #resultContent { opacity:.8; }
  html[data-theme="dark"] ::selection { background:#235c73; color:#fff; }
  html[data-theme="dark"] :is(button,a,input,select,textarea,svg,summary):focus-visible,
  html[data-theme="dark"] :is(.upload-link,.upload-button):focus-within { outline-color:#8ceaf2; }

  /* Navy framing. Cyan marks an action or a selected location. */
  html[data-theme="dark"] .sidebar { background:#101d30; border-color:#344c68; box-shadow:none; backdrop-filter:none; }
  html[data-theme="dark"] .sidebar::after { background:none; }
  html[data-theme="dark"] .brand-mark { background:linear-gradient(145deg,#294c65,#1a2b43); border-color:#6486a8; box-shadow:inset 0 1px 0 #ffffff22; }
  html[data-theme="dark"] .brand-mark svg { stroke:#b4f1f6; }
  html[data-theme="dark"] :is(.brand-en,.sidebar-label,.sidebar-footer,.sidebar-footer>div,.sidebar-tools button) { color:#b2c2d6; }
  html[data-theme="dark"] .sidebar .nav-item { color:#b2c2d6; }
  html[data-theme="dark"] .sidebar .nav-item:hover { background:#20344d; border-color:#344c68; color:#e3eaf5; }
  html[data-theme="dark"] .sidebar .nav-item.active,
  html[data-theme="dark"] .sidebar .nav-item.active:hover { background:#213b50; color:#b4f1f6; border-color:#6486a8; box-shadow:none; }
  html[data-theme="dark"] .sidebar .nav-item.active::before { background:#6bdfec; box-shadow:none; }
  html[data-theme="dark"] .sidebar .nav-dot { background:#6bdfec; box-shadow:none; }
  html[data-theme="dark"] .sidebar-tools button:hover { color:#b4f1f6; }
  html[data-theme="dark"] .status-dot { background:#a8e1bc; box-shadow:none; }
  html[data-theme="dark"] .topbar { border-color:#344c68; }
  html[data-theme="dark"] :is(.breadcrumb,.breadcrumb span,.breadcrumb #routeLabel,.text-button) { color:#b2c2d6; }
  html[data-theme="dark"] .text-button:hover { color:#b4f1f6; }
  html[data-theme="dark"] .theme-toggle { background:#1a2b43; color:#b2c2d6; border-color:#6486a8; box-shadow:none; }
  html[data-theme="dark"] .theme-toggle[aria-pressed="true"] { background:#213b50; color:#b4f1f6; border-color:#6486a8; }
  html[data-theme="dark"] .theme-toggle:hover { background:#294c65; border-color:#83b4ce; }

  /* Light lives around the sculpture; the reading surface stays still. */
  html[data-theme="dark"] .page-heading.lab-hero { min-height:192px; padding:23px 28px; margin:20px 0 24px; background:linear-gradient(110deg,#14253a,#17374b 60%,#15414b); border-color:#344c68; border-radius:20px; box-shadow:inset 0 1px 0 #ffffff0c; animation:none; }
  html[data-theme="dark"] .lab-hero::before { background:radial-gradient(ellipse at 88% 14%,rgba(81,174,223,.25),transparent 48%),radial-gradient(ellipse at 97% 100%,rgba(83,207,217,.12),transparent 35%); }
  html[data-theme="dark"] .lab-hero::after { background-image:linear-gradient(rgba(172,220,243,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(172,220,243,.06) 1px,transparent 1px); mask-image:linear-gradient(90deg,transparent 50%,#0009); -webkit-mask-image:linear-gradient(90deg,transparent 50%,#0009); }
  html[data-theme="dark"] .hero-kicker { color:#c9d9e9; }
  html[data-theme="dark"] .hero-kicker>span:empty { background:#6bdfec; box-shadow:0 0 9px #6bdfec44; }
  html[data-theme="dark"] .page-heading.lab-hero h1 { font-size:29px; color:#e3eaf5; letter-spacing:.2px; }
  html[data-theme="dark"] .page-heading.lab-hero .brand-subtitle { color:#b2c2d6; }
  html[data-theme="dark"] .page-heading.lab-hero .hero-description { color:#e3eaf5; }
  html[data-theme="dark"] .lab-hero .research-workflow { color:#b2c2d6; }
  html[data-theme="dark"] .lab-hero .research-workflow button { background:#ffffff08; border-color:#6486a8; color:#c9d9e9; }
  html[data-theme="dark"] .lab-hero .research-workflow button:hover { background:#ffffff12; border-color:#83b4ce; color:#fff; }
  html[data-theme="dark"] .hero-art { height:160px; --art-scale:.94; }
  html[data-theme="dark"] .hero-floor { background:radial-gradient(ellipse,#08172955,transparent 70%); }
  html[data-theme="dark"] .orbit-ring { border-color:#a8dcea44; }
  html[data-theme="dark"] .orbit-ring.ring-two { border-color:#91d7e82e; }
  html[data-theme="dark"] .glass-sheet { border-color:#c0e8f599; background:linear-gradient(140deg,#c8e9fa2e,#7bb9d610 60%,#8bdde71a); box-shadow:inset 0 1px 1px #ffffff66,10px 15px 26px #07152522; }
  html[data-theme="dark"] .sheet-mid { background:linear-gradient(135deg,#8ec7e726,#a2deed12); }
  html[data-theme="dark"] .sheet-front { background:linear-gradient(135deg,#e1f5ff45,#aad8e912 65%,#a0e4eb28); }
  html[data-theme="dark"] .sheet-front>svg { stroke:#e3eaf5; filter:none; }
  html[data-theme="dark"] .glass-lines i { background:#e1f5fc8c; }
  html[data-theme="dark"] .orbital-dot { background:radial-gradient(circle at 30% 25%,#fff,#b5e8f4 40%,#317b98); box-shadow:0 0 16px #6bdfec22; }

  /* Solid, distinct levels make dense research text comfortable to scan. */
  html[data-theme="dark"] :is(.panel,.lab-card,.lab-history-card,.experiment-bar,.metric-card,.lab-empty) { background:var(--paper); border-color:var(--line); box-shadow:var(--shadow); backdrop-filter:none; -webkit-backdrop-filter:none; }
  html[data-theme="dark"] .experiment-bar { background:#132238; margin-bottom:24px; }
  html[data-theme="dark"] .experiment-bar .experiment-helper { color:var(--muted); }
  html[data-theme="dark"] :is(.lab-field>label,.lab-field>.lab-label,.experiment-bar .lab-field>label,.field-label,.date-row label) { color:#c9d9e9; }
  html[data-theme="dark"] .panel-heading { background:#20344d; border-color:var(--line); }
  html[data-theme="dark"] :is(.panel-heading h2,.setup-section h3,.chart-top h2,.lab-page-intro h1,.lab-page-intro h2,.lab-card h2,.lab-card h3,.lab-card-head h2,.lab-history-card h3,.lab-empty h2,.lab-empty h3,.guide-step h3,.rules-list dt) { color:var(--ink); }
  html[data-theme="dark"] .tiny-pill { background:#20344d; color:#c9d9e9; border-color:#344c68; }
  html[data-theme="dark"] .setup-section { border-color:var(--line); }
  html[data-theme="dark"] .step-num { color:#6bdfec; font-family:var(--data-font); }
  html[data-theme="dark"] .data-card { background:#213b50; border-color:#6486a8; }
  html[data-theme="dark"] .data-card strong { color:#e3eaf5; }
  html[data-theme="dark"] .data-card span:not(.data-check) { color:#c9d9e9; }
  html[data-theme="dark"] :is(.data-icon,.data-check,.locked-rule span) { color:#6bdfec; }
  html[data-theme="dark"] :is(.hint-label,.field-note,.run-area p,.strategy-option small,.locked-rule,.metric-sub,.focus-row,.focus-tip,.result-period,.chart-top p,.chart-foot,.research-tag,.table-toolbar p,.table-bottom-note,.pagination,.workspace-footer,.workspace-footer a,.muted,.lab-muted,.lab-label) { color:var(--muted); }
  html[data-theme="dark"] .strategy-card { background:#1a2b43; border-color:#344c68; box-shadow:none; }
  html[data-theme="dark"] .strategy-card.is-selected { background:#213b50; border-color:#6486a8; box-shadow:inset 0 1px 0 #ffffff06; }
  html[data-theme="dark"] .strategy-card .strategy-option strong { color:#e3eaf5; }
  html[data-theme="dark"] .strategy-card .strategy-option:has(input:checked) { background:transparent; }
  html[data-theme="dark"] .strategy-card .strategy-option:hover { background:#ffffff06; }
  html[data-theme="dark"] .strategy-card :is(.strategy-settings,.strategy-definition) { background:transparent; border-color:#344c68; }
  html[data-theme="dark"] .settings-caption { color:#6bdfec; }
  html[data-theme="dark"] .dca-presets button { background:#1a2b43; color:#c9d9e9; border-color:#6486a8; }
  html[data-theme="dark"] .dca-presets button:hover { background:#294c65; border-color:#8ceaf2; }
  html[data-theme="dark"] .dca-presets button[aria-pressed="true"] { background:#73dce9; border-color:#a5eff5; color:#102b37; }
  html[data-theme="dark"] :is(.link-button,.upload-link,.small-actions .link-button) { color:#6bdfec; }
  html[data-theme="dark"] .setup input:not([type="checkbox"]),html[data-theme="dark"] .setup select,
  html[data-theme="dark"] .lab-field input:not([type="checkbox"]):not([type="radio"]),html[data-theme="dark"] .lab-field select,html[data-theme="dark"] .lab-field textarea,
  html[data-theme="dark"] .trade-tools input,html[data-theme="dark"] .trade-tools select,html[data-theme="dark"] .focus-row select { background:var(--surface-input); color:#e3eaf5; border-color:var(--control-line); box-shadow:none; }
  html[data-theme="dark"] :is(input,textarea)::placeholder { color:#b2c2d6; }
  html[data-theme="dark"] .setup input:not([type="checkbox"]):focus,html[data-theme="dark"] .setup select:focus,
  html[data-theme="dark"] .lab-field input:focus,html[data-theme="dark"] .lab-field select:focus,html[data-theme="dark"] .lab-field textarea:focus,
  html[data-theme="dark"] .trade-tools input:focus { border-color:#8ceaf2; box-shadow:0 0 0 3px #6bdfec21; }
  html[data-theme="dark"] select option { background:#132238; color:#e3eaf5; }
  html[data-theme="dark"] :is(.lab-upload,.upload-button) { background:#1a2b43; color:#c9d9e9; border-color:#6486a8; }
  html[data-theme="dark"] :is(.lab-upload,.upload-button):hover { background:#294c65; border-color:#8ceaf2; }
  html[data-theme="dark"] .lab-upload input[type="file"] { color:#c9d9e9; }
  html[data-theme="dark"] :is(.lab-upload,.lab-field) input[type="file"]::file-selector-button { background:#294c65; color:#e3eaf5; border:1px solid #6486a8; }
  html[data-theme="dark"] :is(.lab-button,.lab-download,.download-button) { background:#20344d; color:#c9d9e9; border-color:#6486a8; box-shadow:none; }
  html[data-theme="dark"] :is(.lab-button,.lab-download,.download-button):hover:not(:disabled) { background:#294c65; color:#e3eaf5; border-color:#83b4ce; box-shadow:none; }
  html[data-theme="dark"] .lab-button.danger { color:#f6b8be; border-color:#a7777b; }
  html[data-theme="dark"] .run-area { background:#1a2b43; border-color:var(--line); }
  html[data-theme="dark"] :is(.run-button,.primary-button,.lab-button.primary,.lab-download.primary) { background:linear-gradient(110deg,#73dce9,#69d5d4); color:#102b37; border-color:#a5eff5; box-shadow:0 4px 16px #6bdfec0a; font-weight:650; }
  html[data-theme="dark"] :is(.run-button,.primary-button,.lab-button.primary,.lab-download.primary):hover:not(:disabled) { background:linear-gradient(110deg,#91e8f1,#83e2df); color:#102b37; border-color:#c2f7fa; box-shadow:0 4px 18px #6bdfec16; }
  html[data-theme="dark"] .run-button[data-busy="true"] { opacity:.8; }
  html[data-theme="dark"] .results-toolbar strong { color:#c9d9e9; }
  html[data-theme="dark"] .results-dot { background:#b4e2c4; }
  html[data-theme="dark"] .metric-card { background:linear-gradient(145deg,#20344d,#1a2b43); padding:21px 17px 18px; }
  html[data-theme="dark"] .metric-card::before { background:#6bdfec; opacity:.8; }
  html[data-theme="dark"] .metric-card:nth-child(2)::before { background:#eeb4b7; }
  html[data-theme="dark"] .metric-card:nth-child(3)::before { background:#6bdfec; }
  html[data-theme="dark"] .metric-card:nth-child(4)::before { background:#91b5db; }
  html[data-theme="dark"] .metric-label { color:#c9d9e9; }
  html[data-theme="dark"] .metric-card strong,html[data-theme="dark"] .metric-card:last-child strong { font-size:clamp(26px,2.15vw,35px); color:#e3eaf5; letter-spacing:-1.2px; font-weight:600; }
  html[data-theme="dark"] .metric-card:nth-child(2) strong { color:#f4b6bc; }
  html[data-theme="dark"] .metric-card:last-child strong { font-size:clamp(24px,1.85vw,32px); }
  html[data-theme="dark"] .info-button { border-color:#6486a8; color:#c9d9e9; }
  html[data-theme="dark"] .info-button:hover { background:#294c65; border-color:#8ceaf2; color:#e3eaf5; }

  /* Strategy colors remain distinct on a blue chart canvas. */
  html[data-theme="dark"] .chart-panel { background:#132238; }
  html[data-theme="dark"] .chart-grid { stroke:#344c68; }
  html[data-theme="dark"] .chart-vertical-grid { stroke:#263e58; }
  html[data-theme="dark"] .chart-label { fill:#b2c2d6; }
  html[data-theme="dark"] .chart-line { stroke-width:2.2; filter:none; }
  html[data-theme="dark"] :is(.chart-hover-line,.chart-hover-horizontal) { stroke:#8eb9d2; }
  html[data-theme="dark"] .chart-tooltip { background:#294c65; border-color:#83b4ce; color:#c9d9e9; box-shadow:0 10px 30px #0005; }
  html[data-theme="dark"] :is(.tooltip-date,.tooltip-row b) { color:#e3eaf5; }
  html[data-theme="dark"] .tooltip-reference { border-color:#344c68; color:#c9d9e9; }
  html[data-theme="dark"] .legend-item { color:#c9d9e9; }
  html[data-theme="dark"] .chart-foot { border-color:#344c68; }
  html[data-theme="dark"] .segmented { background:#132238; border-color:#6486a8; }
  html[data-theme="dark"] .segmented button { color:#b2c2d6; }
  html[data-theme="dark"] .segmented .selected { background:#294c65; color:#b4f1f6; box-shadow:none; }
  html[data-theme="dark"] .detail-tabs { background:#1a2b43; border-color:#344c68; }
  html[data-theme="dark"] .detail-tabs button { color:#b2c2d6; }
  html[data-theme="dark"] .detail-tabs .selected { color:#b4f1f6; border-bottom-color:#6bdfec; }
  html[data-theme="dark"] :is(.results-table th,.lab-table th) { background:#20344d; color:#c9d9e9; border-bottom-color:#344c68; }
  html[data-theme="dark"] :is(.results-table td,.lab-table td) { color:#c9d9e9; border-bottom-color:#344c68; }
  html[data-theme="dark"] :is(.results-table tbody tr,.lab-table tbody tr):hover { background:#20344d; }
  html[data-theme="dark"] .strategy-name { color:#e3eaf5; }
  html[data-theme="dark"] .best-mark { background:#294c65; color:#b4f1f6; }
  html[data-theme="dark"] .lab-table-wrap { border-color:#344c68; background:#132238; }
  html[data-theme="dark"] .lab-table caption { background:#20344d; color:#c9d9e9; border-color:#344c68; }
  html[data-theme="dark"] :is(.table-bottom-note,.pagination) { border-color:#344c68; }
  html[data-theme="dark"] .pagination button { background:#20344d; color:#c9d9e9; border-color:#6486a8; }
  html[data-theme="dark"] .pagination button:hover:not(:disabled) { background:#294c65; border-color:#8ceaf2; }
  html[data-theme="dark"] .positive { color:#b4e6c8!important; }
  html[data-theme="dark"] .negative { color:#f2b5bf!important; }
  html[data-theme="dark"] .annual-positive { background:#293e35; color:#c2ebd1; }
  html[data-theme="dark"] .annual-negative { background:#47313b; color:#f5c4cc; }
  html[data-theme="dark"] .result-explainer { background:#20344d; border-color:#344c68; color:#c9d9e9; }
  html[data-theme="dark"] .explain-symbol { border-color:#83b4ce; }
  html[data-theme="dark"] .run-context { background:#1a2b43; border-color:#6bdfec; }
  html[data-theme="dark"] .diagnostic-grid>div { background:#20344d; border-color:#344c68; }
  html[data-theme="dark"] .plan-progress { background:#20344d; border-color:#6bdfec; }

  html[data-theme="dark"] .lab-page-intro .lab-label { color:#6bdfec; }
  html[data-theme="dark"] :is(.lab-card ul,.lab-card ol) { color:#b2c2d6; }
  html[data-theme="dark"] .lab-role-number { background:#20344d; color:#b4f1f6; border-color:#6486a8; }
  html[data-theme="dark"] .lab-summary-grid>* { background:#1a2b43; border-color:#344c68; }
  html[data-theme="dark"] .lab-stat { color:#e3eaf5; }
  html[data-theme="dark"] .lab-feature-code { background:#20344d; color:#b4f1f6; }
  html[data-theme="dark"] .lab-timeline>*,html[data-theme="dark"] .lab-timeline>:nth-child(2),html[data-theme="dark"] .lab-timeline>:nth-child(3) { background:#1a2b43; border-top-color:#91b5db; }
  html[data-theme="dark"] .lab-timeline>:nth-child(2) { border-top-color:#6bdfec; }
  html[data-theme="dark"] .lab-timeline>:nth-child(3) { border-top-color:#a5d9bd; }
  html[data-theme="dark"] :is(.lab-note,.plain-note,.rule-intro,.formula-note) { background:#20344d; color:#c9d9e9; }
  html[data-theme="dark"] .lab-note { border-left-color:#6bdfec; }
  html[data-theme="dark"] .lab-note.warning { background:#3c352b; color:#ecd1a5; border-left-color:#d5b87f; }
  html[data-theme="dark"] .lab-details summary { color:#6bdfec; }
  html[data-theme="dark"] :is(.lab-status,.lab-badge) { background:#20344d; border-color:#6486a8; color:#c9d9e9; }
  html[data-theme="dark"] :is(.lab-status.success,.lab-badge.success) { background:#2b3c33; border-color:#779581; color:#bfe8cd; }
  html[data-theme="dark"] :is(.lab-status.warning,.lab-badge.warning,.warning-box,.dirty-note) { background:#3d3428; border-color:#9d875e; color:#efdab0; }
  html[data-theme="dark"] .lab-empty { background:#132238; border-color:#344c68; }
  html[data-theme="dark"] :is(.lab-inline-error,.error-box) { background:#412e36; border-color:#b68692; color:#f5c7d0; }
  html[data-theme="dark"] .empty-state h2 { color:#c9d9e9; }
  html[data-theme="dark"] .empty-state p { color:#b2c2d6; }
  html[data-theme="dark"] .empty-chart svg { stroke:#344c68; }
  html[data-theme="dark"] .empty-chart .empty-line { stroke:#6bdfec; }
  html[data-theme="dark"] .lab-prob-chart line { stroke:#344c68; }
  html[data-theme="dark"] .lab-prob-chart text { fill:#b2c2d6; }
  html[data-theme="dark"] .lab-prob-chart path { stroke:#6bdfec; }
  html[data-theme="dark"] .lab-prob-chart circle { fill:#6bdfec; }

  html[data-theme="dark"] .execution-dock { background:rgba(26,43,67,.97); border-color:#6486a8; box-shadow:0 8px 30px #0003,inset 0 1px 0 #ffffff0c; backdrop-filter:blur(14px); }
  html[data-theme="dark"] .dock-copy strong { color:#e3eaf5; }
  html[data-theme="dark"] :is(.dock-copy span,.dock-results) { color:#b2c2d6; }
  html[data-theme="dark"] .dock-results:hover:not(:disabled) { background:#294c65; border-color:#83b4ce; }
  html[data-theme="dark"] .execution-dock[data-state="dirty"] { border-color:#d5b87c; }
  html[data-theme="dark"] .execution-dock[data-state="dirty"] .dock-copy strong { color:#f5dca6; }
  html[data-theme="dark"] .execution-dock[data-state="busy"] .dock-copy strong { color:#6bdfec; }
  html[data-theme="dark"] .toast { background:#294c65; border-color:#6bdfec; color:#e3eaf5; }
  html[data-theme="dark"] dialog { background:#1a2b43; color:#e3eaf5; border-color:#6486a8; box-shadow:0 25px 80px #0006; }
  html[data-theme="dark"] dialog::backdrop { background:#0b152599; }
  html[data-theme="dark"] :is(.dialog-head,.dialog-foot) { background:#20344d; border-color:#344c68; }
  html[data-theme="dark"] .dialog-head h2 { color:#e3eaf5; }
  html[data-theme="dark"] .dialog-head .close-dialog { color:#b2c2d6; }
  html[data-theme="dark"] .dialog-body { color:#c9d9e9; }
  html[data-theme="dark"] .guide-step>b { background:#294c65; color:#b4f1f6; }
  html[data-theme="dark"] .rules-list>div { border-color:#344c68; }
  html[data-theme="dark"] .rule-accordion { border-color:#6486a8; }
  html[data-theme="dark"] .rule-number { color:#6bdfec; }
  html[data-theme="dark"] .rule-accordion summary { background:#20344d; color:#c9d9e9; }
  html[data-theme="dark"] .rule-accordion[open] summary { border-color:#6486a8; }
}
@media screen and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html[data-theme="dark"] .metric-card:hover,
  html[data-theme="dark"] .lab-history-card:hover,
  html[data-theme="dark"] .lab-grid > .lab-download:hover { border-color:#6486a8; box-shadow:0 10px 25px #0002,inset 0 1px 0 #ffffff09; }
}
@media screen and (max-width: 1250px) {
  html[data-theme="dark"] .metric-card strong,
  html[data-theme="dark"] .metric-card:last-child strong { font-size: 32px; }
}
@media screen and (max-width: 820px) {
  html[data-theme="dark"] .page-heading.lab-hero { padding: 20px 22px; min-height: 174px; }
  html[data-theme="dark"] .hero-art { --art-scale: .78; }
  html[data-theme="dark"] .lab-timeline > * { border-left-color: #91b5db; }
  html[data-theme="dark"] .lab-timeline > :nth-child(2) { border-left-color: #6bdfec; }
  html[data-theme="dark"] .lab-timeline > :nth-child(3) { border-left-color: #a5d9bd; }
}
@media (max-width: 600px) {
  .topbar { height: auto; min-height: 80px; padding: 11px 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .topbar .breadcrumb { width: 100%; flex-basis: 100%; }
  .topbar-actions { gap: 8px; width: 100%; justify-content: flex-end; }
  .theme-toggle { font-size: 11px; min-height: 34px; padding: 6px 9px; }
  .theme-toggle svg { width: 13px; height: 13px; }
  .topbar .text-button { font-size: 11px; margin-left: auto; }
  .metric-card:last-child strong { font-size: 24px; }
  .chart-tooltip { font-size: 10px; }
  .tooltip-row b { padding-left: 10px; }
}
@media screen and (max-width: 600px) {
  html[data-theme="dark"] .page-heading.lab-hero { min-height: 0; padding: 20px; margin-top: 16px; }
  html[data-theme="dark"] .page-heading.lab-hero h1 { font-size: 25px; }
  html[data-theme="dark"] .metric-card { padding: 19px 14px 15px; }
  html[data-theme="dark"] .metric-card strong,
  html[data-theme="dark"] .metric-card:last-child strong { font-size: 28px; letter-spacing: -1.2px; }
  html[data-theme="dark"] .metric-card:last-child strong { font-size: 24px; }
}
@media screen and (max-width: 380px) {
  html[data-theme="dark"] .metric-card { padding-left: 12px; padding-right: 12px; }
  html[data-theme="dark"] .metric-card strong,
  html[data-theme="dark"] .metric-card:last-child strong { font-size: 26px; }
  html[data-theme="dark"] .metric-card:last-child strong { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { .run-flow i { animation: none; } }
@media print { .theme-toggle { display: none !important; } .run-flow { display: none; } }
