:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel: rgba(15, 19, 31, 0.88);
  --panel-2: rgba(22, 27, 43, 0.92);
  --panel-3: rgba(8, 12, 21, 0.94);
  --line: rgba(118, 145, 190, 0.24);
  --line-hot: rgba(62, 217, 255, 0.62);
  --text: #f3f8ff;
  --muted: #a8b4c9;
  --subtle: #717b91;
  --cyan: #3ed9ff;
  --green: #35e27b;
  --red: #ff536f;
  --magenta: #d65cff;
  --amber: #f0c44e;
  --violet: #8f7bff;
  --axis: #dce7ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --glow: 0 0 34px rgba(62, 217, 255, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 1120px;
  background:
    linear-gradient(90deg, rgba(62, 217, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(62, 217, 255, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 16% 0%, rgba(62, 217, 255, 0.18), transparent 29%),
    radial-gradient(circle at 88% 12%, rgba(214, 92, 255, 0.14), transparent 32%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
  color: var(--text);
}

button, input, select { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(780px, 1fr);
  min-height: 100vh;
}

.strategy-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(6, 8, 14, 0.86);
  backdrop-filter: blur(16px);
}

.rail-header, .topbar, .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rail-header h1, .topbar h2, .panel h3 { margin: 0; }
.rail-header h1 { font-size: 23px; }
.topbar h2 { font-size: 34px; line-height: 1.1; }
.panel h3 { font-size: 18px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strategy-heading {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.info-button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-hot);
  border-radius: 999px;
  background: rgba(62, 217, 255, 0.13);
  color: var(--cyan);
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.strategy-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 10;
  display: none;
  width: min(390px, calc(100vw - 48px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(62, 217, 255, 0.42);
  border-radius: 8px;
  background: rgba(5, 7, 13, 0.97);
  box-shadow: var(--shadow), var(--glow);
}

.strategy-heading:hover .strategy-popover,
.strategy-heading:focus-within .strategy-popover,
.strategy-heading.is-open .strategy-popover { display: block; }

.strategy-popover strong { display: block; margin-bottom: 8px; }
.strategy-popover p { margin: 0 0 8px; color: var(--axis); font-size: 13px; line-height: 1.45; }
.strategy-popover dl { display: grid; gap: 7px; margin: 10px 0 0; }
.strategy-popover dl div { display: grid; grid-template-columns: 58px 1fr; gap: 8px; }
.strategy-popover dt, .strategy-popover dd { margin: 0; font-size: 12px; line-height: 1.35; }
.strategy-popover dt { color: var(--cyan); font-weight: 850; }
.strategy-popover dd { color: var(--muted); }

.primary-button, .link-button, .filter-pill, .collapse-toggle, .strategy-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

.primary-button, .link-button, .filter-pill, .collapse-toggle {
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #159fc0, #315adc);
  box-shadow: 0 0 24px rgba(62, 217, 255, 0.16);
  font-weight: 750;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.link-button.is-active {
  border-color: rgba(62, 217, 255, 0.7);
  background: rgba(62, 217, 255, 0.18);
}

.search-box {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.search-box input, .control-field input, .control-field select, .leg-field input, .leg-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 8, 15, 0.96);
  color: var(--text);
  padding: 0 10px;
}

.control-field select, .leg-field select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.control-field select option, .leg-field select option {
  background: #080c15;
  color: var(--text);
}

.search-box input:focus, .control-field input:focus, .control-field select:focus, .leg-field input:focus, .leg-field select:focus {
  outline: none;
  border-color: rgba(62, 217, 255, 0.9);
  background: rgba(62, 217, 255, 0.10);
  box-shadow: 0 0 0 3px rgba(62, 217, 255, 0.18);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

.filter-pill { color: var(--muted); }
.filter-pill.is-active { border-color: rgba(62, 217, 255, 0.8); color: var(--text); background: rgba(62, 217, 255, 0.16); }
.collapse-toggle { display: none; margin-left: auto; color: var(--muted); }
.category-info-panel {
  display: none;
  margin: -2px 0 14px;
  padding: 12px;
  border: 1px solid rgba(62, 217, 255, 0.38);
  border-radius: 8px;
  background: rgba(62, 217, 255, 0.09);
  box-shadow: var(--glow);
}
.category-info-panel.is-open { display: block; }
.category-info-panel strong { display: block; margin-bottom: 6px; font-size: 13px; }
.category-info-panel p { margin: 0; color: var(--axis); font-size: 12px; line-height: 1.45; }

.strategy-list { display: grid; gap: 8px; padding-bottom: 24px; }

.strategy-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.strategy-item > span:first-child { display: grid; gap: 4px; min-width: 0; }
.strategy-item:hover, .strategy-item.is-selected { border-color: rgba(62, 217, 255, 0.72); background: rgba(62, 217, 255, 0.12); }
.strategy-name { display: block; font-weight: 780; }
.strategy-tags, .strategy-description { display: block; color: var(--muted); font-size: 12px; }
.strategy-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.workspace { padding: 26px; }
.topbar { margin-bottom: 20px; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.layout-grid {
  display: grid;
  grid-template-columns: minmax(660px, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.analysis-column, .control-column { display: grid; gap: 18px; }

.panel, .guide-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 26, 42, 0.9), rgba(10, 14, 24, 0.9));
  box-shadow: var(--shadow), var(--glow);
  padding: 18px;
}

.panel-heading { margin-bottom: 14px; }
.panel-heading.compact { margin-bottom: 12px; }
.chart-panel { position: relative; }

.legend, .curve-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-line { width: 28px; height: 3px; border-radius: 999px; background: currentColor; }
.legend-line.dashed { background: repeating-linear-gradient(90deg, currentColor 0 7px, transparent 7px 12px); }
.legend-line.dotted { background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 8px); }

.main-chart { width: 100%; height: 430px; }
.main-chart-wrap { position: relative; }
.chart-legend { margin: 10px 0 0; }
.main-chart svg, .mini-chart svg { display: block; width: 100%; height: 100%; }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  display: none;
  min-width: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 7, 13, 0.94);
  color: var(--text);
  font-size: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
}

.chart-tooltip.is-docked {
  left: var(--chart-axis-left, 48px);
  right: var(--chart-axis-right, 48px);
  top: 12px;
  width: auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  border-color: rgba(62, 217, 255, 0.45);
  backdrop-filter: blur(10px);
}

.chart-tooltip.is-docked span { white-space: nowrap; }
.pnl-up { color: var(--green); font-weight: 850; }
.pnl-down { color: var(--red); font-weight: 850; }
.pnl-flat { color: var(--text); font-weight: 850; }
.chart-crosshair line { stroke: rgba(62, 217, 255, 0.78); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart-crosshair circle { fill: var(--bg); stroke: var(--cyan); stroke-width: 2.4; }

.range-control { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.range-label-row { display: flex; align-items: baseline; justify-content: flex-start; gap: 10px; }
.range-control.wide { margin-bottom: 12px; }
input[type="range"] { accent-color: var(--cyan); }
.readout { color: var(--text); font-weight: 750; }

.greek-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mini-chart { min-width: 0; }
.mini-chart h4 { margin: 0 0 8px; text-align: center; font-size: 17px; }
.mini-svg { height: 190px; border: 1px solid rgba(220, 231, 255, 0.48); background: rgba(3, 6, 12, 0.62); }
.mini-copy { margin: 10px 0 0; color: var(--axis); line-height: 1.26; font-size: 13px; }

.control-grid, .leg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.control-field, .leg-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }

.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-3); padding: 10px; }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 6px; font-size: 18px; }

.legs-editor { display: grid; gap: 12px; }
.leg-row { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-3); padding: 12px; }
.leg-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.leg-title strong { font-size: 14px; }
.leg-summary { margin: 0 0 10px; color: var(--axis); font-size: 13px; line-height: 1.35; }

.education-panel, .disclaimer-panel, .pro-panel { margin-top: 18px; }
.education-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.education-item { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-3); padding: 12px; }
.education-item h4 { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.education-item p { margin: 0; line-height: 1.45; }

.disclaimer-panel { border-color: rgba(240, 196, 78, 0.48); background: rgba(31, 24, 12, 0.74); }
.disclaimer-panel p, .pro-panel p { margin: 0; color: var(--axis); font-size: 13px; line-height: 1.55; }
.disclaimer-panel strong { color: var(--amber); }
.disclaimer-panel p + p { margin-top: 10px; }

.guide-panel { margin-bottom: 18px; border-color: rgba(240, 196, 78, 0.54); background: rgba(48, 37, 14, 0.45); }
.guide-panel.is-hidden, .is-hidden { display: none; }
.guide-panel h3 { margin: 0 0 10px; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.guide-actions button { min-height: 34px; border: 1px solid rgba(240, 196, 78, 0.62); border-radius: 8px; background: rgba(240, 196, 78, 0.14); color: var(--text); cursor: pointer; }

.pro-phase {
  padding: 14px 0 0;
}
.pro-phase + .pro-phase {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.pro-phase h4 {
  margin: 0;
  font-size: 17px;
}
.pro-control-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}
.pro-discretization-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.param-help {
  position: relative;
  display: inline-flex;
  width: fit-content;
  color: var(--cyan);
  border-bottom: 1px dotted rgba(62, 217, 255, 0.82);
  cursor: help;
}
.param-help:focus {
  outline: none;
  color: var(--text);
}
.param-card {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: none;
  width: min(320px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgba(62, 217, 255, 0.46);
  border-radius: 8px;
  background: rgba(5, 7, 13, 0.98);
  color: var(--axis);
  box-shadow: var(--shadow), var(--glow);
  line-height: 1.45;
}
.param-card strong,
.param-card span,
.param-card em {
  display: block;
}
.param-card strong {
  margin-bottom: 6px;
  color: var(--text);
}
.param-card em {
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
}
.param-help:hover .param-card,
.param-help:focus .param-card {
  display: block;
}
.pro-metrics {
  margin-top: 12px;
}
.diagnostics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.diagnostic-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--axis);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.diagnostic-badge.ok {
  border-color: rgba(53, 226, 123, 0.55);
  color: var(--green);
  background: rgba(53, 226, 123, 0.09);
}
.diagnostic-badge.warn {
  border-color: rgba(240, 196, 78, 0.68);
  color: var(--amber);
  background: rgba(240, 196, 78, 0.10);
}
.diagnostic-badge.bad {
  border-color: rgba(255, 83, 111, 0.68);
  color: var(--red);
  background: rgba(255, 83, 111, 0.10);
}
.diagnostic-info-panel {
  display: none;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(62, 217, 255, 0.38);
  border-radius: 8px;
  background: rgba(62, 217, 255, 0.08);
}
.diagnostic-info-panel.is-open { display: block; }
.diagnostic-info-panel strong { display: block; margin-bottom: 6px; }
.diagnostic-info-panel p { margin: 0; color: var(--axis); font-size: 13px; line-height: 1.45; }
.pricing-surface {
  margin-top: 12px;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 0%, rgba(62, 217, 255, 0.12), transparent 44%), var(--panel-3);
  cursor: grab;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.pricing-surface:active { cursor: grabbing; }
.pricing-surface svg {
  display: block;
  width: 100%;
  height: 600px;
  user-select: none;
  -webkit-user-select: none;
}
.pricing-surface text {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.surface-label {
  fill: var(--muted);
  font-size: 12px;
}
.surface-title {
  fill: var(--text);
  font-size: 14px;
  font-weight: 800;
}
.surface-grid {
  stroke: rgba(220, 231, 255, 0.18);
  stroke-width: 0.8;
}
.surface-axis {
  stroke: rgba(243, 248, 255, 0.82);
  stroke-width: 1.35;
}
.surface-tick {
  fill: var(--muted);
  font-size: 11px;
}
.surface-axis-label {
  fill: var(--axis);
  font-size: 12px;
  font-weight: 800;
}
.model-table { margin-top: 14px; overflow-x: auto; }
.model-table table { width: 100%; border-collapse: collapse; }
.model-table th, .model-table td { border: 1px solid var(--line); padding: 9px; text-align: left; font-size: 13px; }
.model-table th { color: var(--muted); background: rgba(62, 217, 255, 0.08); }
.recommend-box { margin-top: 12px; border: 1px solid var(--line-hot); border-radius: 8px; background: rgba(62, 217, 255, 0.10); padding: 12px; line-height: 1.45; }
.is-muted { color: var(--muted); }

.axis-label, .chart-note { fill: var(--muted); font-size: 12px; }
.tick-label { fill: var(--muted); font-size: 11px; }
.zero-line, .axis-line { stroke: rgba(220, 231, 255, 0.72); stroke-width: 1; }
.grid-line { stroke: rgba(220, 231, 255, 0.12); stroke-width: 1; }
.spot-line { stroke: rgba(243, 248, 255, 0.92); stroke-width: 1.5; stroke-dasharray: 3 4; }
.breakeven-line { stroke: rgba(240, 196, 78, 0.9); stroke-width: 1; stroke-dasharray: 5 5; }
.profit-fill { fill: url(#profitGradient); opacity: 0.58; }
.loss-fill { fill: url(#lossGradient); opacity: 0.55; }

@media (max-width: 1180px) {
  body { min-width: 0; }
  .app-shell { grid-template-columns: 1fr; }
  .strategy-rail { position: static; height: auto; max-height: none; overflow: visible; }
  .collapse-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .layout-grid { grid-template-columns: 1fr; }
  .greek-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); overflow-x: auto; }
}

@media (max-width: 760px) {
  .workspace, .strategy-rail { padding: 16px; }
  .topbar, .panel-heading { align-items: flex-start; flex-direction: column; }
  .topbar h2 { font-size: 26px; }
  .strategy-popover { left: 0; top: calc(100% + 8px); width: min(420px, calc(100vw - 32px)); }
  .control-grid, .metrics-grid, .leg-grid, .education-grid, .pro-control-grid { grid-template-columns: 1fr; }
  .main-chart { height: 340px; }
  .greek-grid { grid-template-columns: 1fr; }
}

/* Premium research UI refresh. These rules intentionally preserve the app's DOM and behavior. */
:root {
  --bg: #07111d;
  --panel: #0b1320;
  --panel-2: #0e1826;
  --panel-3: #101c2b;
  --field: #08111a;
  --line: rgba(148, 163, 184, 0.18);
  --line-hot: rgba(34, 211, 238, 0.58);
  --text: #e5eef9;
  --muted: #94a3b8;
  --subtle: #64748b;
  --cyan: #22d3ee;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --axis: #cbd5e1;
  --shadow: 0 16px 46px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body {
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, #07111d 0%, #08111a 42%, #050a12 100%);
  background-size: 56px 56px, 56px 56px, auto;
  color: var(--text);
  font-size: 14px;
}

button, input, select { letter-spacing: 0; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.75);
  outline-offset: 2px;
}

.app-shell { grid-template-columns: 318px minmax(0, 1fr); }

.app-shell > * {
  min-width: 0;
}

.strategy-rail {
  padding: 22px 16px;
  background: rgba(7, 17, 29, 0.96);
  box-shadow: inset -1px 0 0 rgba(148, 163, 184, 0.08);
}

.rail-header h1 {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

.rail-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.workspace {
  max-width: min(1520px, 100%);
  width: 100%;
  padding: 24px;
}

.topbar {
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.topbar h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

.panel h3 {
  font-size: 17px;
  line-height: 1.2;
}

.pro-phase h4 {
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.eyebrow {
  color: #8fb3c7;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.section-subtitle {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.strategy-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.metadata-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 28, 43, 0.82);
  color: var(--axis);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.metadata-badge span {
  color: var(--muted);
}

.metadata-badge.positive { border-color: rgba(34, 197, 94, 0.35); }
.metadata-badge.negative { border-color: rgba(239, 68, 68, 0.38); }
.metadata-badge.warning { border-color: rgba(245, 158, 11, 0.42); }
.metadata-badge.accent { border-color: rgba(34, 211, 238, 0.4); }

.status-badge {
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(34, 211, 238, 0.1);
  color: #a5f3fc;
  font-weight: 700;
}

.primary-button, .link-button, .filter-pill, .collapse-toggle, .strategy-item {
  background: rgba(14, 24, 38, 0.88);
  border-color: var(--line);
}

.primary-button {
  background: #0e7490;
  box-shadow: none;
  color: #ecfeff;
}

.primary-button:hover,
.link-button:hover,
.filter-pill:hover,
.strategy-item:hover {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(16, 44, 62, 0.72);
}

.link-button.is-active,
.filter-pill.is-active,
.strategy-item.is-selected {
  border-color: rgba(34, 211, 238, 0.62);
  background: rgba(34, 211, 238, 0.11);
}

.search-box {
  margin-top: 18px;
}

.search-box input, .control-field input, .control-field select, .leg-field input, .leg-field select {
  min-height: 34px;
  border-radius: 6px;
  background: var(--field);
  font-family: var(--mono);
  font-size: 12px;
}

.control-field span,
.leg-field span,
.search-box span {
  color: var(--muted);
  font-size: 11px;
}

.category-info-panel {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(16, 28, 43, 0.64);
  box-shadow: none;
}

.strategy-list {
  gap: 7px;
}

.strategy-item {
  padding: 10px;
}

.strategy-name {
  color: var(--text);
  font-size: 13px;
}

.strategy-tags {
  align-self: start;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(148, 163, 184, 0.06);
  font-size: 11px;
}

.layout-grid {
  grid-template-columns: minmax(620px, 1fr) minmax(330px, 390px);
  gap: 16px;
}

.analysis-column, .control-column {
  gap: 16px;
}

.panel, .guide-panel {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(14, 24, 38, 0.96), rgba(11, 19, 32, 0.96));
  box-shadow: var(--soft-shadow);
  padding: 16px;
}

.panel-heading {
  gap: 12px;
  margin-bottom: 12px;
}

.chart-panel {
  padding: 18px;
}

.chart-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(8, 17, 26, 0.58);
}

.range-control.wide {
  margin: 0;
}

.readout,
.metric strong,
.model-table .num,
.score-cell {
  font-family: var(--mono);
}

.main-chart {
  height: 460px;
}

.main-chart-wrap {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 8px;
  background: rgba(5, 10, 18, 0.55);
  overflow: hidden;
}

.chart-legend {
  margin: 10px 0;
}

.mini-svg {
  height: 172px;
  border-color: rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  background: rgba(5, 10, 18, 0.58);
}

.mini-chart h4 {
  color: var(--axis);
  font-size: 14px;
  letter-spacing: 0;
}

.mini-copy {
  color: var(--muted);
  font-size: 12px;
}

.control-grid, .leg-grid {
  gap: 10px;
}

.metrics-grid {
  gap: 9px;
}

.metric {
  min-width: 0;
  border-color: rgba(148, 163, 184, 0.15);
  background: rgba(8, 17, 26, 0.78);
  padding: 10px;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.pro-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pro-metrics .metric {
  padding: 12px;
}

.pro-metrics .metric strong {
  font-size: clamp(16px, 1.5vw, 22px);
}

.muted-value {
  color: var(--subtle) !important;
  font-size: 14px !important;
  font-family: inherit !important;
  font-weight: 650;
}

.model-value {
  color: #a5f3fc !important;
  font-size: 15px !important;
  font-family: inherit !important;
}

.positive-value { color: var(--green) !important; }
.negative-value { color: var(--red) !important; }

.leg-row,
.education-item {
  border-color: rgba(148, 163, 184, 0.15);
  background: rgba(8, 17, 26, 0.74);
}

.education-panel, .disclaimer-panel, .pro-panel {
  margin-top: 16px;
}

.education-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.disclaimer-panel {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(41, 28, 9, 0.42);
  box-shadow: none;
}

.pro-panel {
  border-color: rgba(34, 211, 238, 0.24);
  background:
    linear-gradient(180deg, rgba(11, 24, 39, 0.98), rgba(8, 17, 26, 0.98));
}

.pro-module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.pro-module-header h3 {
  margin: 0;
  font-size: 22px;
}

.pro-phase {
  padding-top: 10px;
}

.pro-phase + .pro-phase {
  margin-top: 18px;
  padding-top: 18px;
}

.pro-control-grid {
  display: grid;
  grid-template-columns: 1.1fr 2.4fr 1.6fr;
  gap: 12px;
}

.pro-control-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  background: rgba(8, 17, 26, 0.64);
}

.model-group {
  grid-template-columns: 1fr;
}

.stability-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-group-title {
  grid-column: 1 / -1;
  color: #a5f3fc;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pro-discretization-note {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.06);
}

.param-help {
  color: var(--muted);
  border-bottom-color: rgba(34, 211, 238, 0.5);
}

.diagnostics-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(8, 17, 26, 0.58);
}

.diagnostics-title {
  flex: 0 0 auto;
  color: var(--axis);
  font-size: 12px;
  font-weight: 750;
}

.diagnostics-row {
  margin: 0;
}

.diagnostic-badge {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 750;
}

.pricing-surface {
  min-height: 580px;
  margin-top: 14px;
  border-color: rgba(34, 211, 238, 0.22);
  background: #07111d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pricing-surface svg {
  height: 580px;
}

.surface-label {
  fill: var(--muted);
  font-size: 11px;
}

.surface-title {
  fill: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.surface-hint {
  fill: #7dd3fc;
}

.surface-grid {
  stroke: rgba(148, 163, 184, 0.16);
}

.surface-axis {
  stroke: rgba(203, 213, 225, 0.7);
}

.surface-tick {
  fill: rgba(203, 213, 225, 0.74);
  font-size: 10px;
  font-family: var(--mono);
}

.surface-axis-label {
  fill: var(--axis);
  font-size: 11px;
  font-weight: 750;
}

.surface-meta rect {
  fill: rgba(16, 28, 43, 0.78);
  stroke: rgba(34, 211, 238, 0.24);
}

.surface-meta text {
  fill: #cbd5e1;
  font-family: var(--mono);
  font-size: 8px;
}

.model-table {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  overflow: auto;
}

.model-table table {
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
}

.model-table th, .model-table td {
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 10px 12px;
  font-size: 12px;
}

.model-table th {
  background: rgba(8, 17, 26, 0.96);
  color: var(--muted);
  font-weight: 750;
  text-align: left;
}

.model-table th:not(:first-child),
.model-table td:not(:first-child) {
  text-align: right;
}

.model-table tbody tr:hover {
  background: rgba(34, 211, 238, 0.06);
}

.model-table tr.is-recommended {
  background: rgba(34, 211, 238, 0.09);
  box-shadow: inset 3px 0 0 rgba(34, 211, 238, 0.7);
}

.score-cell {
  color: #a5f3fc;
}

.recommend-box {
  margin-top: 12px;
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.07);
  box-shadow: none;
}

.recommend-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.recommend-header div {
  display: grid;
  gap: 3px;
}

.recommend-header span:not(.status-badge),
.recommend-body h5 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recommend-header strong {
  color: var(--text);
  font-size: 16px;
  font-family: var(--mono);
}

.recommend-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.recommend-body h5 {
  margin: 0 0 7px;
}

.recommend-body ul {
  margin: 0;
  padding-left: 18px;
  color: var(--axis);
  font-size: 13px;
  line-height: 1.45;
}

.axis-label, .chart-note { fill: var(--muted); }
.zero-line, .axis-line { stroke: rgba(203, 213, 225, 0.62); }
.grid-line { stroke: rgba(148, 163, 184, 0.12); }
.profit-fill { opacity: 0.5; }
.loss-fill { opacity: 0.5; }

@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 292px minmax(0, 1fr); }
  .layout-grid { grid-template-columns: 1fr; }
  .control-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .control-column .panel { min-width: 0; }
  .pro-control-grid { grid-template-columns: 1fr 1fr; }
  .grid-group { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .strategy-rail { position: static; height: auto; }
  .control-column { grid-template-columns: 1fr; }
  .education-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  html, body {
    overflow-x: hidden;
  }
  .app-shell,
  .strategy-rail,
  .workspace {
    max-width: 100%;
    width: 100%;
  }
  .workspace, .strategy-rail { padding: 16px; }
  .topbar,
  .pro-module-header,
  .recommend-header {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .top-actions,
  .chart-controls,
  .recommend-body,
  .education-grid,
  .pro-metrics {
    grid-template-columns: 1fr;
  }
  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .chart-panel { padding: 14px; }
  .main-chart { height: 360px; }
  .pro-control-grid,
  .pro-control-group,
  .stability-group {
    grid-template-columns: 1fr;
  }
  .diagnostics-block {
    align-items: flex-start;
    flex-direction: column;
  }
  .pricing-surface,
  .pricing-surface svg {
    min-height: 520px;
    height: 520px;
  }
}

/* FUI contrast pass: brighter secondary text, stronger legends, subtle technical framing. */
:root {
  --muted: #b8c7d9;
  --subtle: #91a3b8;
  --axis: #d8e5f2;
}

body {
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, transparent 0 72%, rgba(34, 211, 238, 0.035) 72% 72.15%, transparent 72.15%),
    linear-gradient(180deg, #07111d 0%, #08111a 42%, #050a12 100%);
  background-size: 56px 56px, 56px 56px, 100% 100%, auto;
}

.panel,
.guide-panel,
.pro-panel {
  position: relative;
}

.strategy-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.55) rgba(8, 17, 26, 0.85);
}

.strategy-rail::-webkit-scrollbar {
  width: 10px;
}

.strategy-rail::-webkit-scrollbar-track {
  background: rgba(8, 17, 26, 0.85);
}

.strategy-rail::-webkit-scrollbar-thumb {
  border: 2px solid rgba(8, 17, 26, 0.85);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.85), rgba(34, 197, 94, 0.55));
}

.strategy-rail::after,
.panel::after,
.guide-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.12), transparent 28%) top left / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(34, 211, 238, 0.08), transparent 22%) top left / 1px 100% no-repeat;
  opacity: 0.8;
}

body.pro-mode-enabled {
  background:
    radial-gradient(circle at 78% 8%, rgba(34, 211, 238, 0.2), transparent 24%),
    radial-gradient(circle at 18% 84%, rgba(34, 197, 94, 0.11), transparent 28%),
    linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, transparent 0 72%, rgba(34, 211, 238, 0.055) 72% 72.15%, transparent 72.15%),
    linear-gradient(180deg, #07111d 0%, #08111a 42%, #050a12 100%);
  background-size: auto, auto, 56px 56px, 56px 56px, 100% 100%, auto;
}

body.pro-mode-enabled::before {
  content: "PRO SIGNAL ACTIVE  /  FD SOLVER ONLINE  /  STABILITY SCAN";
  position: fixed;
  top: auto;
  bottom: 0;
  right: 24px;
  z-index: 30;
  max-width: calc(100vw - 48px);
  padding: 5px 10px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(5, 10, 18, 0.86);
  color: #a5f3fc;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.18);
  pointer-events: none;
}

body.pro-mode-enabled::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 64%, rgba(34, 211, 238, 0.055) 64.15% 64.35%, transparent 64.5%),
    linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.028) 50%, transparent);
}

body.pro-mode-enabled .app-shell {
  position: relative;
  z-index: 1;
}

body.pro-mode-enabled #proToggle.is-active {
  border-color: rgba(34, 211, 238, 0.86);
  background: rgba(34, 211, 238, 0.18);
  color: #ecfeff;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.16), 0 0 26px rgba(34, 211, 238, 0.22);
}

body.pro-mode-enabled .pro-panel {
  border-color: rgba(34, 211, 238, 0.52);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.36),
    0 0 44px rgba(34, 211, 238, 0.14),
    inset 0 1px 0 rgba(165, 243, 252, 0.08);
}

body.pro-mode-enabled .pro-panel::before {
  content: "SUPERIOR QUANT SIGNAL  /  ADVANCED NUMERICS  /  CONFIDENCE LAYER";
  position: absolute;
  top: -1px;
  right: 14px;
  z-index: 2;
  max-width: calc(100% - 28px);
  padding: 5px 10px;
  border: 1px solid rgba(34, 211, 238, 0.48);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(8, 17, 26, 0.94);
  color: #a5f3fc;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.18);
}

body.pro-mode-enabled .status-badge {
  border-color: rgba(34, 211, 238, 0.68);
  background: rgba(34, 211, 238, 0.15);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.16);
}

body.pro-mode-enabled .pricing-surface {
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(165, 243, 252, 0.08),
    0 0 30px rgba(34, 211, 238, 0.1);
}

.panel-heading::before,
.pro-module-header::before {
  content: "";
  width: 3px;
  align-self: stretch;
  min-height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.95), rgba(34, 197, 94, 0.38));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.18);
}

.panel-heading {
  justify-content: flex-start;
}

.pro-module-header::before {
  flex: 0 0 auto;
}

.section-subtitle,
.strategy-description,
.rail-subtitle,
.category-info-panel p,
.leg-summary,
.mini-copy,
.disclaimer-panel p,
.pro-panel p,
.recommend-body ul {
  color: var(--muted);
}

.eyebrow,
.control-field span,
.leg-field span,
.search-box span,
.metric span,
.recommend-header span:not(.status-badge),
.recommend-body h5,
.model-table th {
  color: #a9c5d7;
}

.muted-value {
  color: #9fb2c6 !important;
}

.legend,
.curve-legend {
  gap: 12px;
  color: var(--axis);
  font-size: 14px;
  font-weight: 750;
}

.legend-item {
  gap: 8px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
}

.legend-line {
  width: 38px;
  height: 4px;
}

.chart-legend {
  margin: 12px 0;
}

.axis-label,
.chart-note {
  fill: #c8d8e8;
  font-size: 14px;
  font-weight: 750;
}

.tick-label {
  fill: #afc1d3;
  font-size: 13px;
  font-family: var(--mono);
}

.surface-label {
  fill: #b9cadd;
  font-size: 13px;
}

.surface-title {
  font-size: 16px;
}

.surface-tick {
  fill: #b8c7d9;
  font-size: 12px;
}

.surface-axis-label {
  fill: #dbeafe;
  font-size: 13px;
}

.surface-meta text {
  fill: #d8e5f2;
  font-size: 9px;
}

.main-chart-wrap,
.mini-svg,
.pricing-surface {
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.032) 1px, transparent 1px),
    rgba(5, 10, 18, 0.72);
  background-size: 34px 34px, 34px 34px, auto;
}

.pricing-surface {
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.036) 1px, transparent 1px),
    #07111d;
  background-size: 38px 38px, 38px 38px, auto;
}

.grid-line {
  stroke: rgba(148, 163, 184, 0.18);
}

.surface-grid {
  stroke: rgba(148, 163, 184, 0.22);
}

@media (max-width: 820px) {
  .legend,
  .curve-legend {
    font-size: 13px;
  }
  .legend-line {
    width: 32px;
  }
  body.pro-mode-enabled::before,
  body.pro-mode-enabled .pro-panel::before {
    display: none;
  }
}

@media (max-width: 1180px) {
  .strategy-rail {
    position: static;
    height: auto;
    overflow: visible;
  }
}
