/* ===========================================================
   M² RobotCLUB — Portfolio Analytics
   Visual layer only. IDs, classes referenced by bundle.js/app.js
   are preserved; only appearance is redesigned.
   =========================================================== */

/* ---- tokens: dark (default) ---- */
:root,
:root[data-theme="dark"] {
  --bg: #07090d;
  --bg-grid: radial-gradient(circle at 12% 0%, rgba(62, 166, 255, 0.10), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(34, 211, 163, 0.07), transparent 40%);
  --surface: #10141b;
  --surface-2: #141924;
  --surface-soft: #171d29;
  --surface-raised: #1a212e;
  --text: #eef2f8;
  --muted: #8993a4;
  --slate: #aab3c4;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --accent: #4fb2ff;
  --accent-2: #7c9bff;
  --accent-soft: rgba(79, 178, 255, 0.14);
  --accent-text: #bfe2ff;

  --green: #2fe3ab;
  --green-soft: rgba(47, 227, 171, 0.12);
  --green-text: #8bf2d3;

  --red: #ff5d76;
  --red-soft: rgba(255, 93, 118, 0.13);
  --red-text: #ffb3c0;

  --orange: #ffb648;
  --orange-soft: rgba(255, 182, 72, 0.13);
  --orange-text: #ffdca8;

  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.38);
  --ring: 0 0 0 1px rgba(79, 178, 255, 0.4);

  --font-ui: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-num: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* canvas chart tokens (read by bundle.js via getComputedStyle) */
  --chart-grid: rgba(255, 255, 255, 0.055);
  --chart-muted: #8993a4;
  --chart-accent: #4fb2ff;
  --chart-accent-rgb: 79, 178, 255;
  --chart-benchmark: #5b6577;
  --chart-warning: #ffb648;
  --chart-warning-rgb: 255, 182, 72;
  --chart-warning-text: #2c1c02;
  --chart-negative: #ff5d76;
  --chart-negative-rgb: 255, 93, 118;
  --chart-panel-bg: rgba(255, 182, 72, 0.92);
}

:root[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-grid: radial-gradient(circle at 12% 0%, rgba(47, 111, 237, 0.06), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(22, 163, 106, 0.05), transparent 40%);
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-soft: #f6f8fb;
  --surface-raised: #ffffff;
  --text: #10151d;
  --muted: #667085;
  --slate: #475467;
  --border: #e3e7f0;
  --border-strong: #d3d9e6;

  --accent: #2f6fed;
  --accent-2: #4f6bff;
  --accent-soft: rgba(47, 111, 237, 0.08);
  --accent-text: #1c4fbd;

  --green: #16a36a;
  --green-soft: #ecfdf3;
  --green-text: #0d7a4d;

  --red: #d92d20;
  --red-soft: #fef1f0;
  --red-text: #b5271b;

  --orange: #f79009;
  --orange-soft: #fff7ed;
  --orange-text: #8a4b05;

  --shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.05);
  --ring: 0 0 0 1px rgba(47, 111, 237, 0.35);

  --font-ui: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-num: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --chart-grid: #eaeef4;
  --chart-muted: #667085;
  --chart-accent: #2f6fed;
  --chart-accent-rgb: 47, 111, 237;
  --chart-benchmark: #98a2b3;
  --chart-warning: #f79009;
  --chart-warning-rgb: 247, 144, 9;
  --chart-warning-text: #7a3f00;
  --chart-negative: #d92d20;
  --chart-negative-rgb: 217, 45, 32;
  --chart-panel-bg: rgba(255, 255, 255, 0.98);
}

/* ---- base ---- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--bg-grid);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-ui);
  letter-spacing: 0;
  transition: background-color 200ms ease, color 200ms ease;
}

button,
select,
input {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

/* tabular / numeric emphasis */
.kpi-card strong,
.risk-metric strong,
.risk-switch button span:first-child,
.strategy-summary-card strong,
.strategy-detail-card strong,
.strategy-recent-card strong,
.strategy-recent-card em,
.trade-card-meta span,
th,
td,
.heat-cell,
.version-date,
.data-package-card dd,
.data-source-card dd {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* ---- layout ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 250px;
}

.brand-mark {
  display: flex;
  align-items: center;
  width: 168px;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: filter 200ms ease;
}

:root[data-theme="dark"] .brand-mark img {
  filter: invert(1) brightness(1.28) contrast(0.92) saturate(0.9);
}

.brand-caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.main-nav {
  display: flex;
  gap: 22px;
  justify-content: center;
  min-width: 0;
  color: var(--slate);
  font-size: 14px;
  font-weight: 600;
}

.main-nav a {
  position: relative;
  padding: 4px 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: right 180ms ease;
}

.main-nav a:hover {
  color: var(--text);
}

.main-nav a:hover::after {
  right: 0;
}

.header-status {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
  white-space: nowrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--slate);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
}

.theme-toggle-track {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background-color 200ms ease;
}

:root[data-theme="light"] .theme-toggle-track {
  background: var(--accent-soft);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 200ms ease;
}

:root[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(12px);
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.dashboard-shell {
  padding: 26px 26px 0;
  border-radius: 20px;
}

.dashboard-shell,
.content-section,
.info-grid {
  scroll-margin-top: 92px;
}

.page-intro {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 6px 0 4px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  max-width: 860px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.06;
}

h2 {
  margin-bottom: 5px;
  font-size: 21px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 700;
}

.intro-copy,
.panel-heading p,
.section-heading p:not(.eyebrow),
.info-block p {
  color: var(--muted);
}

.intro-copy {
  max-width: 790px;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.6;
}

.intro-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.intro-highlights span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--slate);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.dashboard-grid > *,
.lower-grid > *,
.info-grid > * {
  min-width: 0;
}

.panel,
.content-section,
.info-block {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 22px;
}

.chart-panel {
  min-width: 0;
}

.panel-heading,
.section-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-heading p,
.section-heading p {
  margin-bottom: 0;
  font-size: 13px;
}

.content-section {
  margin-top: 22px;
  padding: 26px;
}

.section-heading.split {
  align-items: center;
}

.section-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

.info-block {
  position: relative;
  padding: 26px;
  overflow: hidden;
}

.info-block::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.info-block:nth-child(2)::before {
  background: var(--orange);
}

.info-block p,
.info-block li {
  line-height: 1.6;
}

.info-block ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--slate);
}

/* ---- components ---- */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--slate);
  font-size: 12px;
  font-weight: 700;
}

.badge.live {
  position: relative;
  padding-left: 22px;
  border-color: rgba(47, 227, 171, 0.3);
  background: var(--green-soft);
  color: var(--green-text);
}

.badge.live::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(47, 227, 171, 0.55);
  animation: liveDotPulse 2.2s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .badge.live::before {
    animation: none;
  }
}

@keyframes liveDotPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 227, 171, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(47, 227, 171, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 227, 171, 0);
  }
}

.badge.backtest {
  border-color: rgba(79, 178, 255, 0.3);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.intro-actions {
  display: flex;
  gap: 10px;
  min-width: 0;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease,
    box-shadow 160ms ease;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121f;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(79, 178, 255, 0.25);
}

:root[data-theme="light"] .button.primary {
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(47, 111, 237, 0.28);
}

.button.secondary {
  background: var(--surface-soft);
  color: var(--text);
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary:hover {
  box-shadow: 0 16px 34px rgba(79, 178, 255, 0.34);
}

.button.secondary:hover {
  border-color: var(--border-strong);
}

.chart-controls,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

label {
  color: var(--muted);
  font-size: 12px;
}

select {
  min-height: 36px;
  margin-left: 6px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
}

select:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.check-control {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--slate);
  font-weight: 650;
}

.risk-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.risk-switch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.risk-switch button,
.filter {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.risk-switch button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-weight: 800;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.risk-switch button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.risk-switch button.active {
  border-color: rgba(79, 178, 255, 0.4);
  background: linear-gradient(135deg, var(--accent-soft), transparent 120%);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

.risk-summary {
  display: grid;
  gap: 10px;
  padding: 8px 0 2px;
}

.risk-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.risk-metric span {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-ui);
}

.risk-metric strong {
  font-size: 19px;
}

.risk-note {
  margin: 16px 0 0;
  padding: 13px;
  border: 1px solid rgba(255, 182, 72, 0.28);
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange-text);
  font-size: 13px;
  line-height: 1.5;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 22px;
}

.methodology-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.methodology-strip article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.methodology-strip article:nth-child(1) {
  border-color: rgba(79, 178, 255, 0.22);
}

.methodology-strip article:nth-child(2) {
  border-color: rgba(47, 227, 171, 0.24);
}

.methodology-strip article:nth-child(3) {
  border-color: rgba(255, 182, 72, 0.26);
}

.methodology-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.methodology-strip strong {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  font-family: var(--font-ui);
}

.methodology-strip p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.kpi-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.kpi-card:nth-child(1),
.kpi-card:nth-child(2) {
  border-color: rgba(47, 227, 171, 0.22);
  background: linear-gradient(180deg, var(--surface) 0%, var(--green-soft) 220%);
}

.kpi-card:nth-child(3),
.kpi-card:nth-child(4) {
  border-color: rgba(255, 93, 118, 0.2);
}

.kpi-card span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-ui);
}

.kpi-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  word-break: break-word;
}

.kpi-card small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}

.data-quality {
  margin: 0 0 22px;
  padding: 22px;
  border-color: rgba(79, 178, 255, 0.2);
}

.data-quality .section-heading {
  margin-bottom: 12px;
}

.data-status-line {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(79, 178, 255, 0.18);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--slate);
  font-size: 12px;
  line-height: 1.5;
  font-family: var(--font-ui);
}

.data-quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.data-package-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.28fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(79, 178, 255, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), var(--green-soft) 160%);
}

.data-package-card h3 {
  margin: 4px 0 6px;
  font-size: 16px;
}

.data-package-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-ui);
}

.data-package-card dl {
  display: grid;
  gap: 8px;
  align-content: center;
  margin: 0;
}

.data-package-card dl div {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.data-package-card dt {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}

.data-package-card dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.data-source-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.data-source-card:hover,
.version-card:hover {
  border-color: rgba(79, 178, 255, 0.3);
}

.data-source-card header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.data-source-card h3 {
  margin: 0;
  font-size: 15px;
}

.data-source-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}

.data-source-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.data-source-card div {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.data-source-card dt {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}

.data-source-card dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
  word-break: break-word;
}

.portfolio-versions {
  margin: 0 0 22px;
  padding: 22px;
}

.portfolio-versions .section-heading {
  margin-bottom: 14px;
}

.version-timeline {
  display: grid;
  gap: 12px;
  position: relative;
}

.version-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.18fr) minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.version-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.version-card > div:first-child {
  display: grid;
  gap: 8px;
  align-content: start;
}

.version-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.version-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-ui);
}

.version-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.version-card li {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.process-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.process-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-num);
}

.process-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.process-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-ui);
}

.process-card.accent {
  border-color: rgba(255, 182, 72, 0.3);
  background: linear-gradient(180deg, var(--surface) 0%, var(--orange-soft) 200%);
}

.process-card.accent span {
  background: var(--orange-soft);
  color: var(--orange-text);
}

.strategy-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.strategy-summary-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.strategy-summary-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  font-family: var(--font-ui);
}

.strategy-summary-card strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.strategy-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
}

.strategy-tools label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.strategy-tools select {
  min-width: 190px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.segmented button.active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.strategy-detail {
  margin-bottom: 16px;
}

.strategy-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  align-items: start;
  gap: 16px;
}

.strategy-table-panel {
  min-width: 0;
}

.strategy-table-panel .table-wrap {
  max-height: 740px;
  overflow: auto;
}

.strategy-detail {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.strategy-detail-card,
.strategy-detail-empty {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 220%);
}

.strategy-detail-card h3 {
  margin: 0 0 6px;
  font-size: 24px;
  font-family: var(--font-ui);
}

.strategy-detail-card p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-family: var(--font-ui);
}

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

.strategy-passport-meta span {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-ui);
}

.strategy-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.strategy-detail-grid div,
.strategy-trade-strip div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.strategy-detail-grid span,
.strategy-trade-strip span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-ui);
}

.strategy-detail-grid strong {
  color: var(--text);
  font-size: 18px;
}

.strategy-detail-chart {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.strategy-mini-chart {
  display: block;
  width: 100%;
  height: 140px;
}

.strategy-mini-chart line {
  stroke: var(--border);
  stroke-width: 1;
}

.strategy-mini-chart path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.strategy-empty-chart {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.strategy-trade-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.strategy-recent {
  margin-bottom: 16px;
}

.strategy-recent-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.strategy-recent-heading h3 {
  margin: 2px 0 0;
  font-size: 20px;
}

.strategy-recent-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-ui);
}

.strategy-recent-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.strategy-recent-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.strategy-recent-card:hover {
  border-color: rgba(79, 178, 255, 0.4);
  transform: translateY(-1px);
}

.strategy-recent-card span,
.strategy-recent-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  font-family: var(--font-ui);
}

.strategy-recent-card strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 20px;
}

.strategy-recent-card em {
  display: block;
  margin: 3px 0 7px;
  font-style: normal;
  font-size: 16px;
  font-weight: 800;
}

#strategyRows tr {
  cursor: pointer;
}

#strategyRows tr.selected {
  background: var(--accent-soft);
  outline: 1px solid rgba(79, 178, 255, 0.4);
  outline-offset: -1px;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

/* ---- charts ---- */
.canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.clickable-chart {
  cursor: zoom-in;
}

.clickable-chart:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.chart-expand-button {
  white-space: nowrap;
}

.equity-wrap {
  min-height: 430px;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-tooltip {
  position: absolute;
  min-width: 190px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font-num);
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-ui);
}

.drawdown-insight {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 14px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 182, 72, 0.26);
  border-radius: 12px;
  background: var(--orange-soft);
}

.drawdown-insight strong,
.drawdown-insight span {
  display: block;
}

.drawdown-insight strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-ui);
}

.drawdown-insight span,
.drawdown-insight dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-family: var(--font-ui);
}

.drawdown-insight dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.drawdown-insight div {
  min-width: 0;
}

.drawdown-insight dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.drawdown-duration {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 182, 72, 0.22);
}

.duration-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.duration-heading span,
.duration-heading strong { display: block; }
.duration-heading strong { margin-top: 2px; font-size: 15px; }
.duration-status { text-align: right; }
.duration-status strong { font-size: 12px; }

.duration-track {
  position: relative;
  height: 8px;
  margin-top: 16px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(22, 163, 106, 0.4), rgba(247, 144, 9, 0.4) 72%, rgba(217, 45, 32, 0.42));
}

.duration-threshold {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 14px;
  background: var(--muted);
  opacity: 0.65;
}

.duration-current {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
}

.duration-current.warning { background: var(--orange); }
.duration-current.negative { background: var(--red); }

.duration-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.duration-values span { color: var(--text); font-size: 11px; }
.duration-values b { display: block; margin-bottom: 2px; color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.drawdown-duration p { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.duration-reading {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 182, 72, 0.18);
}

.duration-reading > div + div {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 182, 72, 0.18);
}

.duration-reading span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.duration-reading strong { display: block; margin-top: 4px; font-size: 12px; }
.duration-reading p { margin-top: 4px; }

.duration-guide { margin-top: 10px; color: var(--muted); font-size: 10px; }
.duration-guide summary { width: max-content; cursor: pointer; color: var(--accent); font-weight: 700; }
.duration-guide-rows { margin-top: 8px; border-top: 1px solid var(--border); }
.duration-guide-rows > div { display: grid; grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.duration-guide-rows b { color: var(--text); }

.warning {
  color: var(--orange-text) !important;
}

body.modal-open {
  overflow: hidden;
}

.chart-modal[hidden] {
  display: none;
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.chart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(10px);
}

.chart-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.chart-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.chart-modal-header h2 {
  margin: 0;
  font-size: 26px;
}

.chart-modal-header p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
}

.modal-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.drawdown-modal-canvas-wrap {
  height: min(66vh, 620px);
  min-height: 460px;
}

.drawdown-modal-info {
  margin-top: 14px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-ui);
}

.legend-row span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
}

.legend-line,
.legend-dash {
  display: inline-block;
  width: 24px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.legend-line.equity {
  background: var(--accent);
}

.legend-line.benchmark {
  background: var(--chart-benchmark);
}

.legend-dash {
  border-top: 2px dashed var(--orange);
}

.heatmap {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.heat-row {
  display: grid;
  grid-template-columns: 52px repeat(12, minmax(34px, 1fr)) 58px;
  gap: 4px;
  align-items: center;
  min-width: 640px;
}

.heat-cell,
.heat-label {
  display: grid;
  min-height: 32px;
  place-items: center;
  border-radius: 8px;
  font-size: 11px;
}

.heat-label {
  color: var(--muted);
  font-weight: 750;
  font-family: var(--font-ui);
}

/* ---- tables ---- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 13px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-soft);
}

td:first-child,
th:first-child {
  padding-left: 16px;
  font-family: var(--font-ui);
}

td:last-child,
th:last-child {
  padding-right: 16px;
}

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

.empty-state {
  color: var(--muted);
  text-align: left;
  white-space: normal;
  font-family: var(--font-ui);
}

.trade-journal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trade-card {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.trade-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.trade-card-header h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  font-family: var(--font-ui);
}

.trade-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.trade-card-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.trade-card-meta > span {
  min-height: 36px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--slate);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.trade-card .trade-links {
  margin-top: auto;
}

.trade-empty {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-family: var(--font-ui);
}

.trade-review {
  display: block;
  min-width: 220px;
  white-space: normal;
  font-family: var(--font-ui);
}

.trade-result-neutral {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--slate);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.trade-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.trade-links a {
  padding: 5px 9px;
  border: 1px solid rgba(79, 178, 255, 0.28);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  font-family: var(--font-ui);
}

.trade-links a:hover {
  border-color: rgba(79, 178, 255, 0.5);
  color: var(--accent);
}

.trade-warning {
  margin: 0 0 12px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 182, 72, 0.34);
  border-radius: 12px;
  background: var(--orange-soft);
  color: var(--orange-text);
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-ui);
}

.trade-link-placeholder {
  padding: 5px 9px;
  border: 1px solid rgba(255, 182, 72, 0.34);
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--orange-text);
  font-size: 12px;
  font-weight: 750;
  font-family: var(--font-ui);
}

.filter {
  min-height: 36px;
  padding: 0 13px;
  color: var(--slate);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-ui);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.filter.active {
  border-color: rgba(79, 178, 255, 0.5);
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---- entrance / reveal motion ---- */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpi-card,
.strategy-summary-card,
.strategy-recent-card,
.data-source-card,
.version-card,
.methodology-strip article,
.process-card,
.trade-card {
  animation: riseIn 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.kpi-grid > *:nth-child(1) { animation-delay: 0ms; }
.kpi-grid > *:nth-child(2) { animation-delay: 30ms; }
.kpi-grid > *:nth-child(3) { animation-delay: 60ms; }
.kpi-grid > *:nth-child(4) { animation-delay: 90ms; }
.kpi-grid > *:nth-child(5) { animation-delay: 120ms; }
.kpi-grid > *:nth-child(6) { animation-delay: 150ms; }

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 620ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .kpi-card,
  .strategy-summary-card,
  .strategy-recent-card,
  .data-source-card,
  .version-card,
  .methodology-strip article,
  .process-card,
  .trade-card {
    animation: none;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- responsive ---- */
@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 1fr;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .header-status {
    justify-content: flex-start;
  }

  .dashboard-grid,
  .lower-grid,
  .info-grid,
  .process-grid {
    grid-template-columns: 1fr;
  }

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

  .data-quality-grid {
    grid-template-columns: 1fr;
  }

  .data-package-card {
    grid-template-columns: 1fr;
  }

  .methodology-strip {
    grid-template-columns: 1fr;
  }

  .trade-journal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  main {
    padding: 18px;
  }

  .app-header {
    padding: 12px 18px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 140px;
    height: 32px;
  }

  .brand-caption {
    display: none;
  }

  .page-intro,
  .panel-heading,
  .section-heading.split {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 30px;
  }

  .intro-highlights {
    gap: 6px;
  }

  .intro-highlights span {
    width: 100%;
    justify-content: center;
  }

  .intro-actions,
  .chart-controls,
  .filter-row {
    width: 100%;
  }

  .intro-actions {
    flex-direction: column;
  }

  .button,
  .chart-controls label,
  .chart-controls select,
  .check-control,
  .filter {
    width: 100%;
  }

  .chart-controls label {
    display: grid;
    gap: 6px;
  }

  .chart-controls select {
    margin-left: 0;
  }

  .header-status {
    flex-wrap: wrap;
  }

  .risk-panel {
    grid-row: 1;
  }

  .chart-panel {
    grid-row: 2;
  }

  .equity-wrap {
    min-height: 340px;
  }

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

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

  .strategy-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .strategy-tools label {
    align-items: stretch;
    flex-direction: column;
  }

  .strategy-tools select {
    width: 100%;
  }

  .strategy-detail-grid,
  .strategy-trade-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-workspace {
    grid-template-columns: 1fr;
  }

  .strategy-detail {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .strategy-table-panel .table-wrap {
    max-height: 620px;
  }

  .strategy-recent-heading {
    align-items: start;
    flex-direction: column;
  }

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

  .data-quality {
    padding: 16px;
  }

  .portfolio-versions {
    padding: 16px;
  }

  .data-package-card,
  .data-source-card,
  .version-card {
    padding: 14px;
  }

  .version-card {
    grid-template-columns: 1fr;
  }

  .kpi-card strong {
    font-size: 20px;
  }

  .content-section,
  .info-block,
  .panel {
    padding: 16px;
  }

  .section-heading {
    gap: 10px;
  }

  .trade-card-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawdown-insight {
    grid-template-columns: 1fr;
  }

  .duration-heading { align-items: flex-start; flex-direction: column; }
  .duration-status { text-align: left; }
  .duration-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duration-reading { grid-template-columns: 1fr; }
  .duration-reading > div + div { padding: 10px 0 0; border-top: 1px solid rgba(255, 182, 72, 0.18); border-left: 0; }
  .duration-guide summary { width: auto; }
  .duration-guide-rows > div { grid-template-columns: 1fr; gap: 3px; }

  .chart-modal {
    padding: 12px;
  }

  .chart-modal-panel {
    width: calc(100vw - 24px);
    padding: 14px;
    border-radius: 14px;
  }

  .chart-modal-header {
    align-items: flex-start;
  }

  .drawdown-modal-canvas-wrap {
    height: 58vh;
    min-height: 360px;
  }
}

/* Compact drawdown context: intentionally lives inside the drawdown panel. */
.portfolio-state-section {
  margin-top: 18px;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.portfolio-state-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.portfolio-state-heading .eyebrow {
  margin-bottom: 3px;
}

.portfolio-state-heading h3 {
  margin: 0;
  font-size: 18px;
}

.portfolio-state-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: var(--surface-soft);
}

.portfolio-state-hero > div > strong {
  margin-top: 2px;
  font-size: 19px;
}

.state-confirmation {
  min-width: 105px;
  padding-left: 14px;
  text-align: right;
}

.state-confirmation strong {
  margin: 2px 0 0;
  font-size: 22px;
}

.consensus-scale-card {
  margin-top: 10px;
  padding: 12px 2px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.state-card-heading strong {
  font-size: 14px;
}

.consensus-scale {
  margin-top: 24px;
}

.consensus-scale-track {
  height: 10px;
}

.consensus-scale-labels {
  font-size: 9px;
}

.model-state-row {
  gap: 8px;
  margin-top: 12px;
}

.model-state-row > div {
  position: relative;
  padding: 9px 10px 9px 28px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
}

.state-dot {
  position: absolute;
  top: 12px;
  left: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.state-dot.fixed { background: var(--accent); }
.state-dot.dynamic { background: var(--green); }

.model-state-row strong {
  font-size: 12px;
}

.portfolio-state-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.portfolio-state-card {
  min-height: 0;
  padding: 11px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
}

.portfolio-state-card strong {
  margin-top: 4px;
  font-size: 13px;
}

.portfolio-state-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.portfolio-state-details {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.portfolio-state-details summary {
  width: max-content;
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.portfolio-state-details p {
  margin: 8px 0 0;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .portfolio-state-section {
    padding: 16px 0 0;
  }

  .portfolio-state-heading,
  .portfolio-state-hero {
    align-items: flex-start;
  }

  .portfolio-state-hero {
    flex-direction: column;
  }

  .state-confirmation {
    width: 100%;
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    text-align: left;
  }

  .portfolio-state-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .kpi-grid {
    grid-template-columns: 1fr;
}


/* ---- portfolio state lab ---- */
.portfolio-state-section {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 94%, #2a87ff 6%), var(--surface));
  box-shadow: var(--shadow-soft);
}

.portfolio-state-heading {
  align-items: flex-start;
  margin-bottom: 18px;
}

.lab-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 12px;
  font-weight: 700;
}

.portfolio-state-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-raised);
}

.portfolio-state-hero.state-positive { border-left-color: var(--green); }
.portfolio-state-hero.state-warning { border-left-color: var(--orange); }
.portfolio-state-hero.state-watch { border-left-color: var(--accent); }
.portfolio-state-hero.state-negative { border-left-color: var(--red); }

.portfolio-state-hero span,
.portfolio-state-card > span,
.state-card-heading span,
.model-state-row span,
.state-confirmation span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.portfolio-state-hero > div > strong {
  display: block;
  margin-top: 5px;
  font-size: 25px;
  line-height: 1.15;
}

.portfolio-state-hero p,
.portfolio-state-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.state-confirmation {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.state-confirmation strong {
  display: block;
  margin: 3px 0;
  font-size: 30px;
  color: var(--text);
}

.state-confirmation small {
  color: var(--muted);
  line-height: 1.35;
}

.consensus-scale-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
}

.state-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.state-card-heading strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.state-card-heading small {
  color: var(--muted);
  text-align: right;
}

.consensus-scale {
  margin-top: 28px;
}

.consensus-scale-track {
  position: relative;
  height: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--green) 22%, transparent), color-mix(in srgb, var(--red) 18%, transparent));
}

.consensus-zone {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 33.333%;
  width: 33.333%;
  border: 1px solid color-mix(in srgb, var(--orange) 65%, transparent);
  background: color-mix(in srgb, var(--orange) 23%, transparent);
}

.model-marker {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.model-marker.fixed { background: var(--accent); }
.model-marker.dynamic { background: var(--green); }

.model-marker b {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: var(--text);
  font-size: 10px;
  white-space: nowrap;
}

.consensus-scale-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.consensus-scale-labels span:nth-child(2),
.consensus-scale-labels span:nth-child(3) { text-align: center; }
.consensus-scale-labels span:last-child { text-align: right; }

.model-state-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.model-state-row > div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.model-state-row strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.portfolio-state-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.portfolio-state-card {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
}

.portfolio-state-card strong {
  display: block;
  margin-top: 7px;
  font-size: 17px;
  line-height: 1.25;
}

.portfolio-state-disclaimer {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--border));
  border-radius: 6px;
  color: var(--muted);
  background: color-mix(in srgb, var(--orange) 8%, transparent);
  font-size: 12px;
  line-height: 1.5;
}

.watch { color: var(--accent); }
.warning { color: var(--orange); }
.muted { color: var(--muted); }


@media (max-width: 1100px) {
  .portfolio-state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .portfolio-state-section {
    padding: 16px;
  }

  .portfolio-state-heading,
  .state-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .state-card-heading small {
    text-align: left;
  }

  .portfolio-state-hero {
    grid-template-columns: 1fr;
  }

  .state-confirmation {
    padding: 14px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .model-state-row,
  .portfolio-state-grid {
    grid-template-columns: 1fr;
  }

  .consensus-scale-labels {
    font-size: 9px;
  }
}
  .strategy-summary-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .strategy-detail-grid,
  .strategy-trade-strip {
    grid-template-columns: 1fr;
  }

  .strategy-recent-grid {
    grid-template-columns: 1fr;
  }

  .trade-card-meta {
    grid-template-columns: 1fr;
  }
}

/* Confirmed drawdown and cycle analytics. */
.drawdown-marker-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

.drawdown-marker-legend span { display: inline-flex; align-items: center; gap: 5px; }
.drawdown-marker-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--chart-muted); }
.drawdown-marker-legend i.gain { background: var(--green); }
.drawdown-marker-legend i.loss { background: var(--red); }
.drawdown-marker-legend i.pending { background: var(--chart-muted); }

.portfolio-state-section {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.portfolio-state-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.portfolio-state-heading .eyebrow { margin-bottom: 3px; }
.portfolio-state-heading h3 { margin: 0; font-size: 18px; }

#portfolioStateLab {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px 18px;
  align-items: start;
}

.portfolio-state-hero {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: var(--surface-soft);
  grid-column: 1;
  grid-row: 1;
}

.portfolio-state-hero > div > strong { margin-top: 2px; font-size: 19px; }

.portfolio-state-hero p {
  max-width: 610px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.state-action {
  max-width: 230px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  text-align: right;
}

.state-action span { display: block; color: var(--muted); font-size: 9px; }
.state-action strong { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; }

.action-map {
  grid-column: 1;
  grid-row: 2;
  margin-top: 0;
  padding: 10px 2px 0;
}

.action-map-track {
  position: relative;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(217, 45, 32, 0.42) 0 20%, rgba(247, 144, 9, 0.4) 20% 55%, rgba(22, 163, 106, 0.4) 55% 100%);
}

.action-map-marker {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
}

.action-map-marker.state-positive { background: var(--green); }
.action-map-marker.state-warning { background: var(--orange); }
.action-map-marker.state-watch { background: var(--accent); }
.action-map-marker.state-negative { background: var(--red); }

.action-map-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.action-map-labels span:nth-child(2) { text-align: center; }
.action-map-labels span:last-child { text-align: right; }
.action-map-labels strong,
.action-map-labels small { display: block; }
.action-map-labels strong { font-size: 10px; }
.action-map-labels small { margin-top: 2px; color: var(--muted); font-size: 9px; }

.action-next {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 10px;
}

.action-next span { color: var(--muted); }
.action-next strong { max-width: 72%; text-align: right; }

.zone-evidence {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 0;
}

.zone-evidence article {
  padding: 11px 12px;
  border-left: 3px solid var(--green);
  border-radius: 5px;
  background: var(--surface-soft);
}

.zone-evidence article + article { border-left-color: var(--orange); }
.zone-evidence .recovery-evidence.state-positive { border-left-color: var(--green); }
.zone-evidence .recovery-evidence.state-watch { border-left-color: var(--accent); }
.zone-evidence .recovery-evidence.state-warning { border-left-color: var(--orange); }
.zone-evidence .recovery-evidence.state-negative { border-left-color: var(--red); }
.zone-evidence span,
.zone-evidence strong,
.zone-evidence small { display: block; }
.zone-evidence span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.zone-evidence strong { margin: 3px 0 5px; font-size: 14px; }
.zone-evidence small { margin-top: 2px; color: var(--muted); font-size: 10px; }


.method-steps {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.method-steps > div { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; }
.method-steps b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface-soft);
  font-size: 10px;
}
.method-steps p { margin: 0; }
.method-steps strong,
.method-steps span { display: block; }
.method-steps strong { color: var(--text); font-size: 11px; }
.method-steps span { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.state-confirmation {
  min-width: 105px;
  padding-left: 14px;
  text-align: right;
}

.state-confirmation strong { margin: 2px 0 0; font-size: 22px; }

.consensus-scale-card {
  margin-top: 10px;
  padding: 12px 2px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.state-card-heading strong { font-size: 14px; }
.consensus-scale { margin-top: 24px; }
.consensus-scale-track { height: 10px; }
.consensus-scale-labels { font-size: 9px; }

.model-state-row { gap: 8px; margin-top: 12px; }

.model-state-row > div {
  position: relative;
  padding: 9px 10px 9px 28px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
}

.state-dot {
  position: absolute;
  top: 12px;
  left: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.state-dot.fixed { background: var(--accent); }
.state-dot.dynamic { background: var(--green); }
.model-state-row strong { font-size: 12px; }

.portfolio-state-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.portfolio-state-card {
  min-height: 0;
  padding: 11px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
}

.portfolio-state-card strong { margin-top: 4px; font-size: 13px; }

.portfolio-state-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.portfolio-state-details {
  grid-column: 1 / -1;
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
}
.portfolio-state-details summary { width: max-content; cursor: pointer; color: var(--accent); font-weight: 700; }
.portfolio-state-details p { margin: 8px 0 0; line-height: 1.5; }
.portfolio-state-details[open] { padding-bottom: 4px; }

.closing-health {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.closing-health-heading,
.closing-health-verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.closing-health-heading span,
.closing-health-verdict span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.closing-health-heading strong { display: block; margin-top: 3px; font-size: 15px; }

.health-windows {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.health-windows button {
  min-width: 34px;
  min-height: 28px;
  padding: 4px 7px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.health-windows button.active { color: var(--text); background: var(--surface-raised); box-shadow: 0 0 0 1px var(--border); }

.closing-health-verdict {
  margin-top: 9px;
  padding: 11px 12px;
  border-left: 3px solid var(--green);
  background: var(--surface-soft);
}

.closing-health-verdict.state-warning { border-left-color: var(--orange); }
.closing-health-verdict.state-watch { border-left-color: var(--accent); }
.closing-health-verdict.state-negative { border-left-color: var(--red); }
.closing-health-verdict strong { display: block; margin-top: 3px; font-size: 14px; }
.closing-health-verdict p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.closing-health-verdict small { max-width: 220px; color: var(--muted); font-size: 9px; text-align: right; }

.closing-health-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 9px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.closing-health-metrics > div { padding: 9px 11px; }
.closing-health-metrics > div + div { border-left: 1px solid var(--border); }
.closing-health-metrics span,
.closing-health-metrics strong,
.closing-health-metrics small { display: block; }
.closing-health-metrics span { color: var(--muted); font-size: 9px; }
.closing-health-metrics strong { margin-top: 3px; font-size: 14px; }
.closing-health-metrics small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.closing-health-details { margin-top: 8px; color: var(--muted); font-size: 10px; }
.closing-health-details summary { width: max-content; cursor: pointer; color: var(--accent); font-weight: 700; }
.closing-health-details p { margin: 7px 0 0; line-height: 1.45; }

.outcome-study {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.outcome-study-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.outcome-study-heading span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.outcome-study-heading strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}

.outcome-horizons {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.outcome-horizons button {
  min-width: 38px;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.outcome-horizons button.active {
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
}

.outcome-verdict {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
}

.outcome-verdict span,
.outcome-verdict small { display: block; color: var(--muted); font-size: 10px; }
.outcome-verdict > div > strong { display: block; margin: 3px 0; font-size: 17px; }

.outcome-compare {
  display: flex;
  align-items: center;
  gap: 10px;
}

.outcome-compare > div { min-width: 82px; text-align: right; }
.outcome-compare strong { display: block; margin-top: 2px; font-family: var(--font-num); font-size: 17px; }
.outcome-compare i { color: var(--muted); font-size: 10px; font-style: normal; }

.outcome-confidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 9px 2px 0;
  color: var(--muted);
  font-size: 10px;
}

.outcome-confidence strong { color: var(--text); }
.outcome-confidence strong.positive { color: var(--green); }
.outcome-confidence strong.negative { color: var(--red); }

.outcome-details { margin-top: 9px; color: var(--muted); font-size: 10px; }
.outcome-details summary { width: max-content; cursor: pointer; color: var(--accent); font-weight: 700; }

.outcome-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.outcome-metrics > div {
  padding: 10px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.outcome-metrics span {
  display: block;
  min-height: 26px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.outcome-metrics strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-num);
  font-size: 17px;
}

.outcome-episodes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.outcome-episode {
  position: relative;
  padding: 9px 9px 9px 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.outcome-episode::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
  content: "";
}

.outcome-episode.loss::before { background: var(--red); }
.outcome-episode span,
.outcome-episode small { display: block; color: var(--muted); font-size: 9px; }
.outcome-episode strong { display: block; margin: 2px 0; font-family: var(--font-num); font-size: 13px; }
.outcome-episode.gain strong { color: var(--green); }
.outcome-episode.loss strong { color: var(--red); }

.outcome-baseline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.outcome-baseline > div + div {
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.outcome-baseline span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.outcome-baseline strong {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.outcome-note,
.outcome-empty {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .portfolio-state-section { padding: 16px; }
  #portfolioStateLab { grid-template-columns: 1fr; }
  .portfolio-state-heading,
  .portfolio-state-hero { align-items: flex-start; }
  .portfolio-state-hero { flex-direction: column; }
  .state-action { max-width: none; padding: 10px 0 0; border-top: 1px solid var(--border); border-left: 0; text-align: left; }
  .action-next { align-items: flex-start; flex-direction: column; }
  .action-next strong { max-width: none; text-align: left; }
  .portfolio-state-hero,
  .action-map,
  .zone-evidence,
  .portfolio-state-details,
  .outcome-study { grid-column: 1; grid-row: auto; }
  .zone-evidence { grid-template-columns: 1fr; }
  .state-confirmation {
    width: 100%;
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    text-align: left;
  }
  .portfolio-state-grid { grid-template-columns: 1fr; }
  .closing-health-heading,
  .closing-health-verdict { align-items: flex-start; flex-direction: column; }
  .closing-health-verdict small { max-width: none; text-align: left; }
  .closing-health-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .closing-health-metrics > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--border); }
  .closing-health-metrics > div:nth-child(4) { border-top: 1px solid var(--border); }
  .closing-health-details summary { width: auto; }
  .outcome-study-heading { align-items: flex-start; flex-direction: column; }
  .outcome-verdict { grid-template-columns: 1fr; }
  .outcome-compare { justify-content: space-between; }
  .outcome-compare > div { text-align: left; }
  .outcome-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outcome-episodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outcome-baseline { grid-template-columns: 1fr; }
  .outcome-baseline > div + div { padding: 8px 0 0; border-top: 1px solid var(--border); border-left: 0; }
}
