:root {
  /* THEME CONTROL - ändra främst dessa vid nytt färgtema */
  --bg: #f8fbf9;
  --bg-top: #fbfefd;
  --surface: #ffffff;
  --text: #24483f;
  --text-muted: #658178;
  --primary: #355f54;
  --primary-2: #53796d;
  --accent: #7fa796;
  --accent-soft: #e7f3ee;
  --success-bg: #e7f3ee;
  --success-text: #355f54;
  --warning-bg: #fff7df;
  --warning-text: #745c12;
  --danger-bg: #fff1ee;
  --danger-text: #9b3d32;
  --info-bg: #e0f0f2;
  --info-text: #285f70;

  /* Brand logo */
  --logo-bg: #e7f3ee;
  --logo-ring: #355f54;
  --logo-ring-soft: #8fb9aa;
  --logo-sweep: #7fa796;
  --logo-dot: #355f54;
  --logo-highlight: #e7bd61;

  /* Surfaces and lines */
  --surface-soft: #f7fbf8;
  --surface-tint: #f4faf7;
  --surface-muted: #eef7f2;
  --surface-warm: #fffdf9;
  --surface-warm-soft: #fff4ec;
  --surface-2: #f1f7f4;
  --line: #dce8e2;
  --line-soft: #edf3f0;
  --line-tint: #dceae4;
  --line-strong: #c9ded5;
  --line-success: #b9d8cc;
  --line-neutral: #d3e6de;
  --line-warning: #eadcae;
  --text-soft: #58706a;
  --on-primary: #ffffff;
  --warm-surface: #f0e0c4;
  --warm-line: #eadfce;

  /* Status variants */
  --success-bg-strong: #d9efe4;
  --success-text-strong: #1f5d4b;
  --info-teal-bg: #dcefeb;
  --info-teal-text: #24665e;
  --neutral-bg: #eef5f2;
  --neutral-bg-soft: #edf6f2;
  --neutral-track: #e9eee6;
  --success-toast-bg: #f4fbf7;
  --warning-toast-bg: #fffaf0;
  --danger-toast-bg: #fff6f4;
  --warning-line: #eadfba;
  --danger-line: #eed0cb;

  /* Tables */
  --table-head-bg: #e4f1ec;
  --table-head-text: #31584d;
  --table-row-alt: #f7fbf8;

  /* MOS meter */
  --mos-negative: #c77265;
  --mos-neutral: #d6bd5b;
  --mos-positive: #53796d;

  /* Hero illustration */
  --warm-accent: #e7bd61;

  --theme-score-missing: #69736f;
  --theme-final-strong: #24584a;
  --theme-final-good: #547044;
  --theme-final-neutral: #766326;
  --theme-final-warning: #87503e;
  --theme-final-danger: #8f302d;
  --theme-rr-strong: #315f54;
  --theme-rr-good: #4e756a;
  --theme-rr-positive: #39756f;
  --theme-rr-neutral: #7b622d;
  --theme-rr-warning: #815043;
  --theme-gk-strong: #315d52;
  --theme-gk-good: #4f7167;
  --theme-gk-neutral: #61736b;
  --theme-gk-warning: #805746;
  --hero-sky-top: #f6fbf8;
  --hero-sky-mid: #dceee8;
  --hero-sky-bottom: #c9dfd6;
  --hero-mist: #d9eee7;
  --hero-hill: #cfe3d9;
  --hero-tree-soft: #5e8f82;
  --hero-water-mid: #8fb9aa;
  --hero-water-deep: #3f8176;
  --hero-forest: #2d665c;
  --hero-forest-soft: #5e9f95;
  --hero-water-line: #eaf5f0;
  --hero-water-line-soft: #d6e9e2;
  --hero-art-top: #eff8f4;
  --hero-art-mid: #d6e9e3;
  --hero-card-bottom: #e5f0ec;

  /* Translucent effects and shadows */
  --header-bg: rgba(248, 251, 249, .84);
  --header-line: rgba(220, 232, 226, .82);
  --surface-74: rgba(255, 255, 255, .74);
  --surface-78: rgba(255, 255, 255, .78);
  --surface-82: rgba(255, 255, 255, .82);
  --surface-88: rgba(255, 255, 255, .88);
  --surface-92: rgba(255, 255, 255, .92);
  --surface-94: rgba(255, 255, 255, .94);
  --surface-96: rgba(255, 255, 255, .96);
  --surface-glow: rgba(255, 255, 255, .18);
  --surface-ring: rgba(255, 255, 255, .12);
  --surface-line: rgba(255, 255, 255, .68);
  --line-translucent: rgba(210, 226, 218, .82);
  --line-card: rgba(216, 230, 224, .94);
  --line-glass: rgba(230, 238, 233, .86);
  --primary-12: rgba(65, 135, 123, .12);
  --primary-13: rgba(65, 135, 123, .13);
  --primary-18: rgba(65, 135, 123, .18);
  --primary-dark-16: rgba(53, 95, 84, .16);
  --primary-dark-18: rgba(53, 95, 84, .18);
  --primary-dark-20: rgba(53, 95, 84, .20);
  --primary-dark-22: rgba(53, 95, 84, .22);
  --accent-focus: rgba(127, 167, 150, .16);
  --accent-14: rgba(127, 167, 150, .14);
  --warm-18: rgba(229, 185, 91, .18);
  --warm-20: rgba(229, 185, 91, .20);
  --risk-10: rgba(196, 123, 82, .10);
  --risk-18: rgba(196, 123, 82, .18);
  --risk-26: rgba(196, 123, 82, .26);
  --info-22: rgba(146, 178, 195, .22);
  --info-24: rgba(76, 128, 145, .24);
  --hero-gold-glow: rgba(226, 184, 95, .20);
  --hero-green-glow: rgba(73, 140, 128, .20);
  --kpi-green-soft: rgba(237, 248, 243, .90);
  --kpi-blue-soft: rgba(236, 244, 246, .92);
  --kpi-warm-soft: rgba(252, 244, 233, .92);
  --kpi-green-mark: rgba(56, 116, 104, .20);
  --kpi-accent-mark: rgba(131, 178, 160, .18);
  --shadow-soft: rgba(32, 70, 59, .045);
  --shadow-card: rgba(31, 69, 58, .055);
  --shadow-12: rgba(32, 70, 59, .12);
  --shadow-13: rgba(40, 83, 70, .13);
  --shadow-14: rgba(40, 83, 70, .14);
  --shadow: 0 20px 60px rgba(40, 83, 70, .08);

  /* Layout */
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: 1180px;
}

html[data-theme="nordic"] .badge.action-badge.watch {
  background: var(--info-teal-bg);
  color: var(--info-teal-text);
  border: 1px solid var(--line-success);
  box-shadow: none;
}

html[data-theme="nordic"] .badge.risk-high-badge,
html[data-theme="nordic"] .portfolio-risk-badge.risk-high {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-line);
  box-shadow: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) {
  color-scheme: dark;

  --bg: #070b1c;
  --bg-top: #0b1230;
  --surface: #111936;
  --text: #f4f2ff;
  --text-muted: #b9b6d9;
  --primary: #7c3aed;
  --primary-2: #9b5cff;
  --accent: #23d3c5;
  --accent-soft: #1a2c4f;
  --success-bg: #122f4b;
  --success-text: #5ee7e0;
  --warning-bg: #2b2057;
  --warning-text: #ded2ff;
  --danger-bg: #3e182b;
  --danger-text: #ff7ba3;
  --info-bg: #123246;
  --info-text: #6fe7ff;

  --logo-bg: #111936;
  --logo-ring: #9b5cff;
  --logo-ring-soft: #4852a3;
  --logo-sweep: #23d3c5;
  --logo-dot: #ffffff;
  --logo-highlight: #ff9f1c;

  --surface-soft: #151d3f;
  --surface-tint: #192250;
  --surface-muted: #1c264f;
  --surface-warm: #21172f;
  --surface-warm-soft: #291b3d;
  --surface-2: #151d3f;
  --line: #26305f;
  --line-soft: #1f2850;
  --line-tint: #313a71;
  --line-strong: #4852a3;
  --line-success: #286b83;
  --line-neutral: #30385f;
  --line-warning: rgba(155, 92, 255, .68);
  --text-soft: #9ca1c8;
  --on-primary: #ffffff;
  --warm-surface: #2f2035;
  --warm-line: #704060;

  --success-bg-strong: #173b59;
  --success-text-strong: #7ff7ea;
  --info-teal-bg: #132f4b;
  --info-teal-text: #65e8db;
  --neutral-bg: #20284c;
  --neutral-bg-soft: #1a2244;
  --neutral-track: #293056;
  --success-toast-bg: #102944;
  --warning-toast-bg: #2b2057;
  --danger-toast-bg: #321727;
  --warning-line: rgba(155, 92, 255, .56);
  --danger-line: #7a3652;

  --table-head-bg: #241747;
  --table-head-text: #ebe7ff;
  --table-row-alt: #101936;

  --mos-negative: #ff6b6b;
  --mos-neutral: #ffc44d;
  --mos-positive: #23d3c5;

  --warm-accent: #ff9f1c;

  --theme-score-missing: #4f5678;
  --theme-final-strong: #5b21b6;
  --theme-final-good: #6b2fc2;
  --theme-final-neutral: #6d4c1d;
  --theme-final-warning: #9b4d17;
  --theme-final-danger: #a82b62;
  --theme-rr-strong: #0f6b66;
  --theme-rr-good: #2b6675;
  --theme-rr-positive: #6050a5;
  --theme-rr-neutral: #6b5a25;
  --theme-rr-warning: #8d365f;
  --theme-gk-strong: #375d78;
  --theme-gk-good: #4a5c78;
  --theme-gk-neutral: #5a5875;
  --theme-gk-warning: #70465f;
  --hero-sky-top: #11123a;
  --hero-sky-mid: #2a1b5f;
  --hero-sky-bottom: #3b185f;
  --hero-mist: #51306f;
  --hero-hill: #241a55;
  --hero-tree-soft: #3d2d78;
  --hero-water-mid: #244d82;
  --hero-water-deep: #0f2f5f;
  --hero-forest: #101f4a;
  --hero-forest-soft: #30377e;
  --hero-water-line: #ff6b9a;
  --hero-water-line-soft: #23d3c5;
  --hero-art-top: #17133c;
  --hero-art-mid: #251b58;
  --hero-card-bottom: #101936;

  --header-bg: rgba(7, 11, 28, .88);
  --header-line: rgba(70, 82, 150, .35);
  --surface-74: rgba(17, 25, 54, .74);
  --surface-78: rgba(17, 25, 54, .78);
  --surface-82: rgba(17, 25, 54, .82);
  --surface-88: rgba(17, 25, 54, .88);
  --surface-92: rgba(17, 25, 54, .92);
  --surface-94: rgba(17, 25, 54, .94);
  --surface-96: rgba(17, 25, 54, .96);
  --surface-glow: rgba(155, 92, 255, .12);
  --surface-ring: rgba(35, 211, 197, .08);
  --surface-line: rgba(185, 182, 217, .24);
  --line-translucent: rgba(72, 82, 163, .55);
  --line-card: rgba(49, 58, 113, .82);
  --line-glass: rgba(72, 82, 163, .65);
  --primary-12: rgba(124, 58, 237, .12);
  --primary-13: rgba(124, 58, 237, .13);
  --primary-18: rgba(124, 58, 237, .18);
  --primary-dark-16: rgba(0, 0, 0, .16);
  --primary-dark-18: rgba(0, 0, 0, .18);
  --primary-dark-20: rgba(0, 0, 0, .20);
  --primary-dark-22: rgba(0, 0, 0, .22);
  --accent-focus: rgba(35, 211, 197, .20);
  --accent-14: rgba(35, 211, 197, .14);
  --warm-18: rgba(255, 159, 28, .18);
  --warm-20: rgba(255, 159, 28, .20);
  --risk-10: rgba(217, 54, 130, .10);
  --risk-18: rgba(217, 54, 130, .18);
  --risk-26: rgba(217, 54, 130, .26);
  --info-22: rgba(53, 199, 214, .22);
  --info-24: rgba(53, 199, 214, .24);
  --hero-gold-glow: rgba(255, 159, 28, .20);
  --hero-green-glow: rgba(217, 54, 130, .16);
  --kpi-green-soft: rgba(18, 45, 75, .90);
  --kpi-blue-soft: rgba(24, 35, 79, .92);
  --kpi-warm-soft: rgba(42, 26, 66, .92);
  --kpi-green-mark: rgba(35, 211, 197, .20);
  --kpi-accent-mark: rgba(155, 92, 255, .20);
  --shadow-soft: rgba(0, 0, 0, .18);
  --shadow-card: rgba(0, 0, 0, .22);
  --shadow-12: rgba(0, 0, 0, .28);
  --shadow-13: rgba(0, 0, 0, .32);
  --shadow-14: rgba(0, 0, 0, .36);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .soft-pill,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .badge,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-extreme,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-strong,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-positive,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-light,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-neutral,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-warning {
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .badge.strong,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .badge.strong-value-zone {
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .badge.value-zone {
  background: var(--warm-accent);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .badge.below-base {
  background: var(--surface-tint);
  color: var(--text-soft);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-extreme,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-strong {
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-positive {
  background: var(--warm-accent);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-light {
  background: var(--neutral-bg-soft);
  color: var(--text-soft);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-neutral {
  background: var(--neutral-bg);
  color: var(--text-muted);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.rr-warning {
  background: var(--danger-bg);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .portfolio-risk-badge.risk-low,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .portfolio-risk-badge.risk-low-medium,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .portfolio-risk-badge.risk-medium,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .portfolio-risk-badge.risk-unknown {
  background: var(--neutral-bg);
  color: var(--text);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .portfolio-risk-badge.risk-medium-high,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .portfolio-risk-badge.risk-high {
  background: var(--warm-accent);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.low {
  background: var(--warm-accent);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .score-pill.badscore {
  background: #d93682;
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .gatekeeper-detail .badge.good {
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .gatekeeper-detail .badge.bad {
  background: #d93682;
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .gatekeeper-detail .badge.neutral {
  background: var(--neutral-bg);
  color: var(--text-muted);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .mos-zone-detail .badge.bluegreen,
:is(html[data-theme="dark"], html[data-theme="midnight"]) .mos-zone-detail .badge.teal {
  background: var(--warm-accent);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .mos-zone-detail .badge.strong {
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .mos-zone-detail .badge.neutral {
  background: var(--neutral-bg);
  color: var(--text-muted);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .badge.action-badge.watch {
  background: var(--warm-accent);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .badge.risk-high-badge {
  background: #d93682;
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .estimate-interpretation.estimate-scenario {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

:is(html[data-theme="dark"], html[data-theme="midnight"]) .estimate-interpretation.estimate-scenario span {
  color: var(--text-soft);
}

html[data-theme="tropic"] {
  color-scheme: light;

  --bg: #fffaf3;
  --bg-top: #fbfff7;
  --surface: #ffffff;
  --text: #173b2b;
  --text-muted: #587064;
  --primary: #12904f;
  --primary-2: #6acc39;
  --accent: #6acc39;
  --accent-soft: #e9f8df;
  --success-bg: #e4f7de;
  --success-text: #0d713d;
  --warning-bg: #fff4c8;
  --warning-text: #655317;
  --danger-bg: #ffe3e9;
  --danger-text: #a52f57;
  --info-bg: #e2f7ee;
  --info-text: #126c4a;

  --logo-bg: #f1fae9;
  --logo-ring: #12904f;
  --logo-ring-soft: #9cda78;
  --logo-sweep: #6acc39;
  --logo-dot: #d4b54e;
  --logo-highlight: #ec604d;

  --surface-soft: #fbfdf6;
  --surface-tint: #f1fae9;
  --surface-muted: #ecf7e5;
  --surface-warm: #fff6e3;
  --surface-warm-soft: #fff0e9;
  --surface-2: #f5faef;
  --line: #dce9d3;
  --line-soft: #edf3e8;
  --line-tint: #cfe4c2;
  --line-strong: #afd395;
  --line-success: #8fcf78;
  --line-neutral: #d9dfce;
  --line-warning: #dac369;
  --text-soft: #466456;
  --on-primary: #ffffff;
  --warm-surface: #f8edc9;
  --warm-line: #d4b54e;

  --success-bg-strong: #d4efca;
  --success-text-strong: #0b6436;
  --info-teal-bg: #dcf4e8;
  --info-teal-text: #116c4a;
  --neutral-bg: #f1eee0;
  --neutral-bg-soft: #f6f3e9;
  --neutral-track: #e9e8d9;
  --success-toast-bg: #f2fbec;
  --warning-toast-bg: #fff9e8;
  --danger-toast-bg: #fff0f3;
  --warning-line: #dfca78;
  --danger-line: #ef9aad;

  --table-head-bg: #e2f4d7;
  --table-head-text: #155c36;
  --table-row-alt: #fbfdf7;

  --mos-negative: #f4728c;
  --mos-neutral: #d4b54e;
  --mos-positive: #12904f;

  --warm-accent: #d4b54e;

  --theme-score-missing: #5b7267;
  --theme-final-strong: #0c6939;
  --theme-final-good: #14733f;
  --theme-final-neutral: #746018;
  --theme-final-warning: #8c5520;
  --theme-final-danger: #992b50;
  --theme-rr-strong: #12613a;
  --theme-rr-good: #287046;
  --theme-rr-positive: #476b31;
  --theme-rr-neutral: #735f20;
  --theme-rr-warning: #84404f;
  --theme-gk-strong: #36674b;
  --theme-gk-good: #4d6c50;
  --theme-gk-neutral: #5e6c49;
  --theme-gk-warning: #745149;
  --value-solid: #ec604d;
  --risk-solid: #f4728c;
  --gold-solid: #d4b54e;
  --value-below-solid: #b89a37;
  --value-outside-solid: #6f7e5c;
  --rr-low-solid: #b07836;
  --rr-neutral-solid: #6f7e5c;
  --upside-good-solid: #b88e2f;
  --action-watch-solid: #2d7a43;
  --discipline-bg: #f8fbf5;
  --discipline-line: #cbbe8a;
  --hero-sky-top: #f8fff0;
  --hero-sky-mid: #e1f5c9;
  --hero-sky-bottom: #c9eba9;
  --hero-mist: #ecf8da;
  --hero-hill: #b7df92;
  --hero-tree-soft: #6acc39;
  --hero-water-mid: #7fd7b1;
  --hero-water-deep: #12904f;
  --hero-forest: #0d713d;
  --hero-forest-soft: #45aa54;
  --hero-water-line: #fff6d8;
  --hero-water-line-soft: #d4b54e;
  --hero-art-top: #f2fde9;
  --hero-art-mid: #dff3c8;
  --hero-card-bottom: #eef8e4;

  --header-bg: rgba(255, 250, 243, .88);
  --header-line: rgba(220, 233, 211, .82);
  --surface-74: rgba(255, 255, 255, .74);
  --surface-78: rgba(255, 255, 255, .78);
  --surface-82: rgba(255, 255, 255, .82);
  --surface-88: rgba(255, 255, 255, .88);
  --surface-92: rgba(255, 255, 255, .92);
  --surface-94: rgba(255, 255, 255, .94);
  --surface-96: rgba(255, 255, 255, .96);
  --surface-glow: rgba(106, 204, 57, .14);
  --surface-ring: rgba(18, 144, 79, .10);
  --surface-line: rgba(255, 255, 255, .72);
  --line-translucent: rgba(175, 211, 149, .78);
  --line-card: rgba(207, 228, 194, .92);
  --line-glass: rgba(220, 233, 211, .86);
  --primary-12: rgba(18, 144, 79, .12);
  --primary-13: rgba(18, 144, 79, .13);
  --primary-18: rgba(18, 144, 79, .18);
  --primary-dark-16: rgba(12, 105, 57, .16);
  --primary-dark-18: rgba(12, 105, 57, .18);
  --primary-dark-20: rgba(12, 105, 57, .20);
  --primary-dark-22: rgba(12, 105, 57, .22);
  --accent-focus: rgba(106, 204, 57, .20);
  --accent-14: rgba(106, 204, 57, .14);
  --warm-18: rgba(212, 181, 78, .18);
  --warm-20: rgba(212, 181, 78, .20);
  --risk-10: rgba(244, 114, 140, .10);
  --risk-18: rgba(244, 114, 140, .18);
  --risk-26: rgba(244, 114, 140, .26);
  --info-22: rgba(18, 144, 79, .18);
  --info-24: rgba(106, 204, 57, .22);
  --hero-gold-glow: rgba(212, 181, 78, .24);
  --hero-green-glow: rgba(106, 204, 57, .22);
  --kpi-green-soft: rgba(233, 248, 223, .92);
  --kpi-blue-soft: rgba(226, 247, 238, .92);
  --kpi-warm-soft: rgba(255, 240, 233, .92);
  --kpi-green-mark: rgba(18, 144, 79, .20);
  --kpi-accent-mark: rgba(106, 204, 57, .22);
  --shadow-soft: rgba(23, 59, 43, .05);
  --shadow-card: rgba(23, 59, 43, .07);
  --shadow-12: rgba(23, 59, 43, .12);
  --shadow-13: rgba(23, 59, 43, .13);
  --shadow-14: rgba(23, 59, 43, .14);
  --shadow: 0 20px 60px rgba(23, 59, 43, .10);
}

html[data-theme="tropic"] .soft-pill,
html[data-theme="tropic"] .badge,
html[data-theme="tropic"] .score-pill {
  background-image: none;
}

html[data-theme="tropic"] .badge.strong,
html[data-theme="tropic"] .badge.strong-value-zone,
html[data-theme="tropic"] .score-pill.rr-extreme,
html[data-theme="tropic"] .score-pill.rr-strong,
html[data-theme="tropic"] .gatekeeper-detail .badge.good,
html[data-theme="tropic"] .mos-zone-detail .badge.strong {
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="tropic"] .badge.value-zone,
html[data-theme="tropic"] .score-pill.rr-positive,
html[data-theme="tropic"] .mos-zone-detail .badge.bluegreen,
html[data-theme="tropic"] .mos-zone-detail .badge.teal {
  background: var(--value-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="tropic"] .badge.below-base {
  background: var(--value-below-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="tropic"] .badge.outside-value-zone {
  background: var(--value-outside-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="tropic"] .score-pill.low,
html[data-theme="tropic"] .portfolio-risk-badge.risk-medium-high,
html[data-theme="tropic"] .portfolio-risk-badge.risk-high {
  background: var(--gold-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="tropic"] .badge.upside-strong {
  background: var(--value-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="tropic"] .badge.upside-good {
  background: var(--upside-good-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="tropic"] .badge.upside-near {
  background: var(--value-outside-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="tropic"] .badge.action-badge.watch {
  background: var(--action-watch-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="tropic"] .score-pill.badscore,
html[data-theme="tropic"] .badge.risk-high-badge,
html[data-theme="tropic"] .gatekeeper-detail .badge.bad,
html[data-theme="tropic"] .score-pill.rr-warning {
  background: var(--risk-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="tropic"] .portfolio-risk-badge.risk-low,
html[data-theme="tropic"] .portfolio-risk-badge.risk-low-medium,
html[data-theme="tropic"] .portfolio-risk-badge.risk-medium,
html[data-theme="tropic"] .portfolio-risk-badge.risk-unknown,
html[data-theme="tropic"] .gatekeeper-detail .badge.neutral,
html[data-theme="tropic"] .mos-zone-detail .badge.neutral:not(.strong-value-zone):not(.outside-value-zone) {
  background: var(--neutral-bg-soft);
  color: var(--text-muted);
  border: 0;
  box-shadow: none;
}

html[data-theme="tropic"] .score-pill.rr-light {
  background: var(--rr-low-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="tropic"] .score-pill.rr-neutral {
  background: var(--rr-neutral-solid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="tropic"] .discipline-row {
  border-color: var(--discipline-line);
  background: var(--discipline-bg);
}

html[data-theme="tropic"] .estimate-interpretation.estimate-scenario {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="tropic"] .estimate-interpretation.estimate-scenario span {
  color: var(--text-soft);
}

html[data-theme="slate"] {
  color-scheme: light;

  --bg: #f8f9fa;
  --bg-top: #e9ecef;
  --surface: #ffffff;
  --text: #212529;
  --text-muted: #495057;
  --primary: #212529;
  --primary-2: #343a40;
  --accent: #495057;
  --accent-soft: #e9ecef;
  --success-bg: #e9ecef;
  --success-text: #343a40;
  --warning-bg: #dee2e6;
  --warning-text: #495057;
  --danger-bg: #dee2e6;
  --danger-text: #212529;
  --info-bg: #e9ecef;
  --info-text: #343a40;

  --logo-bg: #e9ecef;
  --logo-ring: #212529;
  --logo-ring-soft: #adb5bd;
  --logo-sweep: #495057;
  --logo-dot: #343a40;
  --logo-highlight: #6c757d;

  --surface-soft: #f8f9fa;
  --surface-tint: #e9ecef;
  --surface-muted: #dee2e6;
  --surface-warm: #e9ecef;
  --surface-warm-soft: #dee2e6;
  --surface-2: #dee2e6;
  --line: #ced4da;
  --line-soft: #dee2e6;
  --line-tint: #adb5bd;
  --line-strong: #6c757d;
  --line-success: #adb5bd;
  --line-neutral: #ced4da;
  --line-warning: #adb5bd;
  --text-soft: #6c757d;
  --on-primary: #ffffff;
  --warm-surface: #dee2e6;
  --warm-line: #adb5bd;

  --success-bg-strong: #dee2e6;
  --success-text-strong: #343a40;
  --info-teal-bg: #e9ecef;
  --info-teal-text: #495057;
  --neutral-bg: #dee2e6;
  --neutral-bg-soft: #e9ecef;
  --neutral-track: #ced4da;
  --success-toast-bg: #f8f9fa;
  --warning-toast-bg: #f8f9fa;
  --danger-toast-bg: #e9ecef;
  --warning-line: #adb5bd;
  --danger-line: #6c757d;

  --table-head-bg: #dee2e6;
  --table-head-text: #212529;
  --table-row-alt: #f8f9fa;

  --mos-negative: #6c757d;
  --mos-neutral: #495057;
  --mos-positive: #212529;

  --warm-accent: #495057;
  --hero-sky-top: #f8f9fa;
  --hero-sky-mid: #e9ecef;
  --hero-sky-bottom: #dee2e6;
  --hero-mist: #e9ecef;
  --hero-hill: #ced4da;
  --hero-tree-soft: #6c757d;
  --hero-water-mid: #adb5bd;
  --hero-water-deep: #495057;
  --hero-forest: #343a40;
  --hero-forest-soft: #6c757d;
  --hero-water-line: #f8f9fa;
  --hero-water-line-soft: #dee2e6;
  --hero-art-top: #f8f9fa;
  --hero-art-mid: #e9ecef;
  --hero-card-bottom: #dee2e6;

  --header-bg: rgba(248, 249, 250, .88);
  --header-line: rgba(206, 212, 218, .82);
  --surface-74: rgba(255, 255, 255, .74);
  --surface-78: rgba(255, 255, 255, .78);
  --surface-82: rgba(255, 255, 255, .82);
  --surface-88: rgba(255, 255, 255, .88);
  --surface-92: rgba(255, 255, 255, .92);
  --surface-94: rgba(255, 255, 255, .94);
  --surface-96: rgba(255, 255, 255, .96);
  --surface-glow: rgba(173, 181, 189, .16);
  --surface-ring: rgba(73, 80, 87, .10);
  --surface-line: rgba(255, 255, 255, .72);
  --line-translucent: rgba(173, 181, 189, .78);
  --line-card: rgba(206, 212, 218, .92);
  --line-glass: rgba(222, 226, 230, .86);
  --primary-12: rgba(33, 37, 41, .12);
  --primary-13: rgba(33, 37, 41, .13);
  --primary-18: rgba(33, 37, 41, .18);
  --primary-dark-16: rgba(33, 37, 41, .16);
  --primary-dark-18: rgba(33, 37, 41, .18);
  --primary-dark-20: rgba(33, 37, 41, .20);
  --primary-dark-22: rgba(33, 37, 41, .22);
  --accent-focus: rgba(73, 80, 87, .18);
  --accent-14: rgba(73, 80, 87, .14);
  --warm-18: rgba(108, 117, 125, .18);
  --warm-20: rgba(108, 117, 125, .20);
  --risk-10: rgba(52, 58, 64, .10);
  --risk-18: rgba(52, 58, 64, .18);
  --risk-26: rgba(52, 58, 64, .26);
  --info-22: rgba(73, 80, 87, .22);
  --info-24: rgba(73, 80, 87, .24);
  --hero-gold-glow: rgba(108, 117, 125, .18);
  --hero-green-glow: rgba(73, 80, 87, .16);
  --kpi-green-soft: rgba(233, 236, 239, .92);
  --kpi-blue-soft: rgba(222, 226, 230, .92);
  --kpi-warm-soft: rgba(206, 212, 218, .90);
  --kpi-green-mark: rgba(73, 80, 87, .18);
  --kpi-accent-mark: rgba(108, 117, 125, .18);
  --shadow-soft: rgba(33, 37, 41, .05);
  --shadow-card: rgba(33, 37, 41, .07);
  --shadow-12: rgba(33, 37, 41, .12);
  --shadow-13: rgba(33, 37, 41, .13);
  --shadow-14: rgba(33, 37, 41, .14);
  --shadow: 0 20px 60px rgba(33, 37, 41, .12);

  --slate-top: #212529;
  --slate-strong: #343a40;
  --slate-mid: #495057;
  --slate-muted: #6c757d;
  --slate-soft: #adb5bd;
  --slate-discipline-bg: #e9ecef;
  --slate-discipline-line: #adb5bd;
  --theme-score-missing: #6c757d;
  --theme-final-strong: #212529;
  --theme-final-good: #343a40;
  --theme-final-neutral: #495057;
  --theme-final-warning: #6c757d;
  --theme-final-danger: #574d49;
  --theme-rr-strong: #343a40;
  --theme-rr-good: #495057;
  --theme-rr-positive: #56616b;
  --theme-rr-neutral: #6c757d;
  --theme-rr-warning: #625852;
  --theme-gk-strong: #495057;
  --theme-gk-good: #59636c;
  --theme-gk-neutral: #6c757d;
  --theme-gk-warning: #73645d;
}

html[data-theme="slate"] .soft-pill,
html[data-theme="slate"] .badge,
html[data-theme="slate"] .score-pill {
  background-image: none;
}

html[data-theme="slate"] .badge.good,
html[data-theme="slate"] .badge.strong {
  background: var(--slate-strong);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .badge.bluegreen,
html[data-theme="slate"] .badge.teal,
html[data-theme="slate"] .badge.watch {
  background: var(--slate-mid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .badge.bad {
  background: var(--slate-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .badge.neutral {
  background: var(--slate-soft);
  color: var(--text);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .badge.strong-value-zone {
  background: var(--slate-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .badge.value-zone {
  background: var(--slate-strong);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .badge.below-base {
  background: var(--slate-mid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .badge.outside-value-zone {
  background: var(--slate-muted);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .score-pill {
  background: var(--slate-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="slate"] .score-pill.rr-strong {
  background: var(--slate-strong);
}

html[data-theme="slate"] .score-pill.rr-positive,
html[data-theme="slate"] .score-pill.low {
  background: var(--slate-mid);
}

html[data-theme="slate"] .score-pill.rr-light,
html[data-theme="slate"] .score-pill.rr-neutral,
html[data-theme="slate"] .score-pill.rr-warning,
html[data-theme="slate"] .score-pill.badscore {
  background: var(--slate-muted);
  color: var(--on-primary);
}

html[data-theme="slate"] .badge.action-badge.watch {
  background: var(--slate-mid);
  color: var(--on-primary);
}

html[data-theme="slate"] .badge.risk-high-badge,
html[data-theme="slate"] .portfolio-risk-badge.risk-high {
  background: var(--slate-strong);
  color: var(--on-primary);
}

html[data-theme="slate"] .portfolio-risk-badge.risk-medium-high {
  background: var(--slate-mid);
  color: var(--on-primary);
}

html[data-theme="slate"] .portfolio-risk-badge.risk-low,
html[data-theme="slate"] .portfolio-risk-badge.risk-low-medium,
html[data-theme="slate"] .portfolio-risk-badge.risk-medium,
html[data-theme="slate"] .portfolio-risk-badge.risk-unknown {
  background: var(--slate-muted);
  color: var(--on-primary);
}

html[data-theme="slate"] .gatekeeper-detail .badge.good {
  background: var(--slate-strong);
  color: var(--on-primary);
}

html[data-theme="slate"] .gatekeeper-detail .badge.bad {
  background: var(--slate-top);
  color: var(--on-primary);
}

html[data-theme="slate"] .mos-zone-detail .badge.bluegreen,
html[data-theme="slate"] .mos-zone-detail .badge.teal {
  background: var(--slate-strong);
  color: var(--on-primary);
}

html[data-theme="slate"] .mos-zone-detail .badge.strong {
  background: var(--slate-top);
  color: var(--on-primary);
}

html[data-theme="slate"] .mos-zone-detail .badge.neutral:not(.strong-value-zone):not(.outside-value-zone) {
  background: var(--slate-soft);
  color: var(--text);
}

html[data-theme="slate"] .badge.upside-strong {
  background: var(--slate-top);
  color: var(--on-primary);
}

html[data-theme="slate"] .badge.upside-good {
  background: var(--slate-strong);
  color: var(--on-primary);
}

html[data-theme="slate"] .badge.upside-near {
  background: var(--slate-muted);
  color: var(--on-primary);
}

html[data-theme="slate"] .discipline-row {
  border-color: var(--slate-discipline-line);
  background: var(--slate-discipline-bg);
}

html[data-theme="slate"] .estimate-interpretation.estimate-scenario {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="slate"] .estimate-interpretation.estimate-scenario span {
  color: var(--text-soft);
}

html[data-theme="abyss"] {
  color-scheme: dark;

  --bg: #0f2c38;
  --bg-top: #123946;
  --surface: #212f45;
  --text: #f8fafc;
  --text-muted: #e2e7ed;
  --primary: #006466;
  --primary-2: #065a60;
  --accent: #0b525b;
  --accent-soft: rgba(11, 82, 91, .24);
  --success-bg: #0b525b;
  --success-text: #f5f7fa;
  --warning-bg: #212f45;
  --warning-text: #d8dee6;
  --danger-bg: #4d194d;
  --danger-text: #f5f7fa;
  --info-bg: #144552;
  --info-text: #f5f7fa;

  --logo-bg: #212f45;
  --logo-ring: #006466;
  --logo-ring-soft: #144552;
  --logo-sweep: #0b525b;
  --logo-dot: #f5f7fa;
  --logo-highlight: #4d194d;

  --surface-soft: #26354b;
  --surface-tint: #312244;
  --surface-muted: #1b3a4b;
  --surface-warm: #3e1f47;
  --surface-warm-soft: #4d194d;
  --surface-2: #24364b;
  --line: rgba(255, 255, 255, .18);
  --line-soft: rgba(255, 255, 255, .12);
  --line-tint: rgba(255, 255, 255, .22);
  --line-strong: rgba(255, 255, 255, .30);
  --line-success: rgba(0, 100, 102, .72);
  --line-neutral: rgba(255, 255, 255, .12);
  --line-warning: rgba(62, 31, 71, .78);
  --text-soft: #bdc7d2;
  --on-primary: #ffffff;
  --warm-surface: #312244;
  --warm-line: #3e1f47;

  --success-bg-strong: #065a60;
  --success-text-strong: #f5f7fa;
  --info-teal-bg: #0b525b;
  --info-teal-text: #f5f7fa;
  --neutral-bg: #312244;
  --neutral-bg-soft: #272640;
  --neutral-track: #312244;
  --success-toast-bg: #0b525b;
  --warning-toast-bg: #212f45;
  --danger-toast-bg: #3e1f47;
  --warning-line: rgba(255, 255, 255, .14);
  --danger-line: rgba(77, 25, 77, .82);

  --table-head-bg: #065a60;
  --table-head-text: #f8fafc;
  --table-row-alt: #1b3a4b;

  --mos-negative: #4d194d;
  --mos-neutral: #272640;
  --mos-positive: #006466;

  --warm-accent: #144552;

  --theme-score-missing: #445267;
  --theme-final-strong: #004f51;
  --theme-final-good: #07535a;
  --theme-final-neutral: #3e1f47;
  --theme-final-warning: #572448;
  --theme-final-danger: #681f50;
  --theme-rr-strong: #08565e;
  --theme-rr-good: #155861;
  --theme-rr-positive: #294b63;
  --theme-rr-neutral: #45364f;
  --theme-rr-warning: #56264d;
  --theme-gk-strong: #1c5260;
  --theme-gk-good: #2b5260;
  --theme-gk-neutral: #3b5361;
  --theme-gk-warning: #4c3c50;
  --hero-sky-top: #212f45;
  --hero-sky-mid: #272640;
  --hero-sky-bottom: #312244;
  --hero-mist: #144552;
  --hero-hill: #1b3a4b;
  --hero-tree-soft: #0b525b;
  --hero-water-mid: #065a60;
  --hero-water-deep: #0b525b;
  --hero-forest: #144552;
  --hero-forest-soft: #006466;
  --hero-water-line: #aeb9c6;
  --hero-water-line-soft: #4d194d;
  --hero-art-top: #212f45;
  --hero-art-mid: #272640;
  --hero-card-bottom: #1b3a4b;

  --header-bg: rgba(15, 44, 56, .92);
  --header-line: rgba(255, 255, 255, .16);
  --surface-74: rgba(33, 47, 69, .74);
  --surface-78: rgba(33, 47, 69, .78);
  --surface-82: rgba(33, 47, 69, .82);
  --surface-88: rgba(33, 47, 69, .88);
  --surface-92: rgba(33, 47, 69, .92);
  --surface-94: rgba(33, 47, 69, .94);
  --surface-96: rgba(33, 47, 69, .96);
  --surface-glow: rgba(0, 100, 102, .12);
  --surface-ring: rgba(11, 82, 91, .12);
  --surface-line: rgba(255, 255, 255, .18);
  --line-translucent: rgba(255, 255, 255, .12);
  --line-card: rgba(255, 255, 255, .14);
  --line-glass: rgba(255, 255, 255, .16);
  --primary-12: rgba(0, 100, 102, .12);
  --primary-13: rgba(0, 100, 102, .13);
  --primary-18: rgba(0, 100, 102, .18);
  --primary-dark-16: rgba(0, 0, 0, .16);
  --primary-dark-18: rgba(0, 0, 0, .18);
  --primary-dark-20: rgba(0, 0, 0, .20);
  --primary-dark-22: rgba(0, 0, 0, .22);
  --accent-focus: rgba(11, 82, 91, .22);
  --accent-14: rgba(11, 82, 91, .14);
  --warm-18: rgba(49, 34, 68, .18);
  --warm-20: rgba(49, 34, 68, .20);
  --risk-10: rgba(77, 25, 77, .10);
  --risk-18: rgba(77, 25, 77, .18);
  --risk-26: rgba(77, 25, 77, .26);
  --info-22: rgba(6, 90, 96, .22);
  --info-24: rgba(6, 90, 96, .24);
  --hero-gold-glow: rgba(77, 25, 77, .16);
  --hero-green-glow: rgba(0, 100, 102, .18);
  --kpi-green-soft: rgba(11, 82, 91, .88);
  --kpi-blue-soft: rgba(33, 47, 69, .92);
  --kpi-warm-soft: rgba(49, 34, 68, .92);
  --kpi-green-mark: rgba(0, 100, 102, .20);
  --kpi-accent-mark: rgba(11, 82, 91, .20);
  --shadow-soft: rgba(0, 0, 0, .18);
  --shadow-card: rgba(0, 0, 0, .22);
  --shadow-12: rgba(0, 0, 0, .28);
  --shadow-13: rgba(0, 0, 0, .32);
  --shadow-14: rgba(0, 0, 0, .36);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);

  --abyss-top: #006466;
  --abyss-strong: #065a60;
  --abyss-mid: #144552;
  --abyss-neutral: #272640;
  --abyss-muted: #312244;
  --abyss-risk: #4d194d;
  --abyss-risk-surface: #312244;
  --abyss-risk-line: #4d194d;
}

html[data-theme="abyss"] .soft-pill,
html[data-theme="abyss"] .badge,
html[data-theme="abyss"] .score-pill {
  background-image: none;
}

html[data-theme="abyss"] .soft-pill {
  background: var(--abyss-mid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.good,
html[data-theme="abyss"] .badge.strong {
  background: var(--abyss-strong);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.bluegreen,
html[data-theme="abyss"] .badge.teal {
  background: var(--abyss-strong);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.watch {
  background: var(--abyss-mid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.bad {
  background: var(--abyss-risk);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.neutral {
  background: var(--abyss-muted);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.strong-value-zone {
  background: var(--abyss-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.value-zone {
  background: var(--abyss-strong);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.below-base {
  background: var(--surface-2);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .badge.outside-value-zone {
  background: var(--abyss-muted);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .score-pill {
  background: var(--abyss-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="abyss"] .score-pill.rr-strong {
  background: var(--abyss-strong);
}

html[data-theme="abyss"] .score-pill.rr-positive,
html[data-theme="abyss"] .score-pill.low {
  background: var(--abyss-mid);
}

html[data-theme="abyss"] .score-pill.rr-light,
html[data-theme="abyss"] .score-pill.rr-neutral {
  background: var(--abyss-neutral);
  color: var(--on-primary);
}

html[data-theme="abyss"] .score-pill.rr-warning,
html[data-theme="abyss"] .score-pill.badscore {
  background: var(--abyss-risk);
  color: var(--on-primary);
}

html[data-theme="abyss"] .badge.action-badge.watch {
  background: var(--abyss-mid);
  color: var(--on-primary);
}

html[data-theme="abyss"] .badge.risk-high-badge,
html[data-theme="abyss"] .portfolio-risk-badge.risk-high {
  background: var(--abyss-risk);
  color: var(--on-primary);
}

html[data-theme="abyss"] .portfolio-risk-badge.risk-medium-high {
  background: var(--abyss-muted);
  color: var(--on-primary);
}

html[data-theme="abyss"] .portfolio-risk-badge.risk-low,
html[data-theme="abyss"] .portfolio-risk-badge.risk-low-medium,
html[data-theme="abyss"] .portfolio-risk-badge.risk-medium,
html[data-theme="abyss"] .portfolio-risk-badge.risk-unknown {
  background: var(--abyss-neutral);
  color: var(--on-primary);
}

html[data-theme="abyss"] .gatekeeper-detail .badge.good {
  background: var(--abyss-top);
  color: var(--on-primary);
}

html[data-theme="abyss"] .gatekeeper-detail .badge.bad {
  background: var(--abyss-risk);
  color: var(--on-primary);
}

html[data-theme="abyss"] .mos-zone-detail .badge.bluegreen,
html[data-theme="abyss"] .mos-zone-detail .badge.teal {
  background: var(--abyss-strong);
  color: var(--on-primary);
}

html[data-theme="abyss"] .mos-zone-detail .badge.strong {
  background: var(--abyss-top);
  color: var(--on-primary);
}

html[data-theme="abyss"] .mos-zone-detail .badge.neutral:not(.strong-value-zone):not(.outside-value-zone) {
  background: var(--abyss-neutral);
  color: var(--on-primary);
}

html[data-theme="abyss"] .badge.upside-strong {
  background: var(--abyss-top);
  color: var(--on-primary);
}

html[data-theme="abyss"] .badge.upside-good {
  background: var(--abyss-mid);
  color: var(--on-primary);
}

html[data-theme="abyss"] .badge.upside-near {
  background: var(--abyss-neutral);
  color: var(--on-primary);
}

html[data-theme="abyss"] .discipline-row {
  border-color: var(--abyss-risk-line);
  background: var(--abyss-risk-surface);
}

html[data-theme="abyss"] .estimate-interpretation.estimate-scenario {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="abyss"] .estimate-interpretation.estimate-scenario span {
  color: var(--text-soft);
}

html[data-theme="abyss"] .eyebrow,
html[data-theme="abyss"] .kicker,
html[data-theme="abyss"] .details-grid section > span {
  color: var(--text-muted);
}

html[data-theme="abyss"] .radar-row small span:not(.badge),
html[data-theme="abyss"] .composite-meta span {
  background: var(--abyss-mid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="abyss"] .estimate-diff,
html[data-theme="abyss"] .estimate-diff.positive {
  background: var(--abyss-strong);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="abyss"] .estimate-diff.negative {
  background: var(--abyss-risk);
  color: var(--on-primary);
}

html[data-theme="abyss"] .table-toolbar {
  background: var(--surface-soft);
  border-bottom-color: var(--line-tint);
}

html[data-theme="abyss"] .sortable-head button:hover {
  color: #b8e6e2;
}

html[data-theme="abyss"] .sortable-head button.is-active {
  color: #e0fff9;
}

html[data-theme="abyss"] .sort-arrow {
  color: #91d8d2;
}

html[data-theme="abyss"] .sortable-head button.is-active .sort-arrow {
  color: #7fe8dc;
}

html[data-theme="abyss"] .data-table td {
  border-top-color: var(--line);
}

html[data-theme="abyss"] .data-table tbody tr.details-row td {
  background: var(--bg);
}

html[data-theme="abyss"] .toolbar-controls input,
html[data-theme="abyss"] .price-input {
  background: var(--surface-soft);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="abyss"] .details-toggle {
  background: var(--surface-soft);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="abyss"] .details-grid {
  border-top-color: var(--line);
}

html[data-theme="abyss"] .details-grid section {
  background: var(--surface-soft);
  border-color: var(--line-tint);
}

html[data-theme="abyss"] .details-grid section.details-wide {
  background:
    radial-gradient(circle at 92% 10%, var(--primary-12), transparent 7rem),
    var(--surface-muted);
}

html[data-theme="abyss"] .gatekeeper-item {
  background: var(--surface-2);
  border-color: var(--line);
}

html[data-theme="abyss"] .estimate-interpretation {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="abyss"] .estimate-interpretation span {
  color: var(--text-muted);
}

html[data-theme="abyss"] .panel-conclusion {
  background: var(--surface-muted);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="solstice"] {
  color-scheme: light;

  --bg: #ffffff;
  --bg-top: rgba(38, 70, 83, .04);
  --surface: #ffffff;
  --text: #264653;
  --text-muted: rgba(38, 70, 83, .78);
  --primary: #2a9d8f;
  --primary-2: #287271;
  --accent: #efb366;
  --accent-soft: rgba(239, 179, 102, .16);
  --success-bg: rgba(42, 157, 143, .12);
  --success-text: #287271;
  --warning-bg: rgba(233, 196, 106, .18);
  --warning-text: #264653;
  --danger-bg: rgba(231, 111, 81, .16);
  --danger-text: #c94f36;
  --info-bg: rgba(42, 157, 143, .10);
  --info-text: #287271;

  --logo-bg: #ffffff;
  --logo-ring: #2a9d8f;
  --logo-ring-soft: #8ab17d;
  --logo-sweep: #287271;
  --logo-dot: #e76f51;
  --logo-highlight: #f4a261;

  --surface-soft: rgba(38, 70, 83, .035);
  --surface-tint: rgba(42, 157, 143, .08);
  --surface-muted: rgba(138, 177, 125, .10);
  --surface-warm: rgba(244, 162, 97, .10);
  --surface-warm-soft: rgba(239, 137, 89, .10);
  --surface-2: rgba(38, 70, 83, .03);
  --line: rgba(38, 70, 83, .16);
  --line-soft: rgba(38, 70, 83, .08);
  --line-tint: rgba(38, 70, 83, .22);
  --line-strong: rgba(38, 70, 83, .30);
  --line-success: rgba(42, 157, 143, .34);
  --line-neutral: rgba(38, 70, 83, .16);
  --line-warning: rgba(239, 179, 102, .44);
  --text-soft: rgba(38, 70, 83, .62);
  --on-primary: #ffffff;
  --warm-surface: rgba(244, 162, 97, .12);
  --warm-line: rgba(239, 179, 102, .42);

  --success-bg-strong: #287271;
  --success-text-strong: #ffffff;
  --info-teal-bg: rgba(42, 157, 143, .12);
  --info-teal-text: #287271;
  --neutral-bg: rgba(38, 70, 83, .10);
  --neutral-bg-soft: rgba(38, 70, 83, .07);
  --neutral-track: rgba(38, 70, 83, .12);
  --success-toast-bg: rgba(42, 157, 143, .08);
  --warning-toast-bg: rgba(239, 179, 102, .10);
  --danger-toast-bg: rgba(231, 111, 81, .10);
  --warning-line: rgba(239, 179, 102, .45);
  --danger-line: rgba(231, 111, 81, .38);

  --table-head-bg: #264653;
  --table-head-text: #ffffff;
  --table-row-alt: rgba(42, 157, 143, .035);

  --mos-negative: #e76f51;
  --mos-neutral: #e9c46a;
  --mos-positive: #2a9d8f;

  --warm-accent: #f4a261;

  --theme-score-missing: #5d6f76;
  --theme-final-strong: #1f756b;
  --theme-final-good: #276a68;
  --theme-final-neutral: #85621f;
  --theme-final-warning: #9a531f;
  --theme-final-danger: #a93f32;
  --theme-rr-strong: #286761;
  --theme-rr-good: #3a6c68;
  --theme-rr-positive: #716127;
  --theme-rr-neutral: #89542e;
  --theme-rr-warning: #93463b;
  --theme-gk-strong: #3f6668;
  --theme-gk-good: #52696b;
  --theme-gk-neutral: #606d6e;
  --theme-gk-warning: #7f5545;
  --hero-sky-top: #ffffff;
  --hero-sky-mid: #f8f3e8;
  --hero-sky-bottom: #f3dfbd;
  --hero-mist: #edf5ed;
  --hero-hill: #dce8d3;
  --hero-tree-soft: #8ab17d;
  --hero-water-mid: #75bcb2;
  --hero-water-deep: #287271;
  --hero-forest: #264653;
  --hero-forest-soft: #2a9d8f;
  --hero-water-line: #fff7e8;
  --hero-water-line-soft: #efb366;
  --hero-art-top: #ffffff;
  --hero-art-mid: #eef7f5;
  --hero-card-bottom: #fbf3e5;

  --header-bg: rgba(255, 255, 255, .90);
  --header-line: rgba(38, 70, 83, .12);
  --surface-74: rgba(255, 255, 255, .74);
  --surface-78: rgba(255, 255, 255, .78);
  --surface-82: rgba(255, 255, 255, .82);
  --surface-88: rgba(255, 255, 255, .88);
  --surface-92: rgba(255, 255, 255, .92);
  --surface-94: rgba(255, 255, 255, .94);
  --surface-96: rgba(255, 255, 255, .96);
  --surface-glow: rgba(239, 179, 102, .14);
  --surface-ring: rgba(42, 157, 143, .10);
  --surface-line: rgba(255, 255, 255, .72);
  --line-translucent: rgba(38, 70, 83, .14);
  --line-card: rgba(38, 70, 83, .16);
  --line-glass: rgba(38, 70, 83, .12);
  --primary-12: rgba(42, 157, 143, .12);
  --primary-13: rgba(42, 157, 143, .13);
  --primary-18: rgba(42, 157, 143, .18);
  --primary-dark-16: rgba(38, 70, 83, .16);
  --primary-dark-18: rgba(38, 70, 83, .18);
  --primary-dark-20: rgba(38, 70, 83, .20);
  --primary-dark-22: rgba(38, 70, 83, .22);
  --accent-focus: rgba(42, 157, 143, .18);
  --accent-14: rgba(239, 179, 102, .14);
  --warm-18: rgba(244, 162, 97, .18);
  --warm-20: rgba(244, 162, 97, .20);
  --risk-10: rgba(231, 111, 81, .10);
  --risk-18: rgba(231, 111, 81, .18);
  --risk-26: rgba(231, 111, 81, .26);
  --info-22: rgba(42, 157, 143, .22);
  --info-24: rgba(40, 114, 113, .24);
  --hero-gold-glow: rgba(233, 196, 106, .24);
  --hero-green-glow: rgba(42, 157, 143, .18);
  --kpi-green-soft: rgba(42, 157, 143, .10);
  --kpi-blue-soft: rgba(38, 70, 83, .08);
  --kpi-warm-soft: rgba(244, 162, 97, .11);
  --kpi-green-mark: rgba(42, 157, 143, .20);
  --kpi-accent-mark: rgba(239, 179, 102, .22);
  --shadow-soft: rgba(38, 70, 83, .05);
  --shadow-card: rgba(38, 70, 83, .07);
  --shadow-12: rgba(38, 70, 83, .12);
  --shadow-13: rgba(38, 70, 83, .13);
  --shadow-14: rgba(38, 70, 83, .14);
  --shadow: 0 20px 60px rgba(38, 70, 83, .10);

  --solstice-top: #237f76;
  --solstice-deep: #264653;
  --solstice-value: #bd593c;
  --solstice-balanced: #7d7333;
  --solstice-watch: #a86120;
  --solstice-low: #a86120;
  --solstice-near: #687044;
  --solstice-risk: #c94f36;
  --solstice-neutral: rgba(38, 70, 83, .10);
  --solstice-risk-surface: rgba(239, 137, 89, .08);
  --solstice-risk-line: rgba(231, 111, 81, .38);
}

html[data-theme="solstice"] .soft-pill,
html[data-theme="solstice"] .badge,
html[data-theme="solstice"] .score-pill {
  background-image: none;
}

html[data-theme="solstice"] .soft-pill {
  background: var(--accent-soft);
  color: var(--text);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.good {
  background: var(--solstice-deep);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.strong {
  background: var(--solstice-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.bluegreen,
html[data-theme="solstice"] .badge.teal {
  background: var(--solstice-value);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.watch {
  background: var(--solstice-watch);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.bad {
  background: var(--solstice-risk);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.neutral {
  background: var(--solstice-neutral);
  color: var(--text);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.strong-value-zone {
  background: var(--solstice-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.value-zone {
  background: var(--solstice-value);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.below-base {
  background: var(--solstice-balanced);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .badge.outside-value-zone {
  background: var(--solstice-near);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .score-pill {
  background: var(--solstice-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="solstice"] .score-pill.rr-strong {
  background: var(--solstice-deep);
}

html[data-theme="solstice"] .score-pill.rr-positive {
  background: var(--solstice-value);
  color: var(--on-primary);
}

html[data-theme="solstice"] .score-pill.rr-light,
html[data-theme="solstice"] .score-pill.low {
  background: var(--solstice-low);
  color: var(--on-primary);
}

html[data-theme="solstice"] .score-pill.rr-neutral {
  background: var(--solstice-balanced);
  color: var(--on-primary);
}

html[data-theme="solstice"] .score-pill.rr-warning,
html[data-theme="solstice"] .score-pill.badscore {
  background: var(--solstice-risk);
  color: var(--on-primary);
}

html[data-theme="solstice"] .badge.action-badge.watch {
  background: var(--solstice-watch);
  color: var(--on-primary);
}

html[data-theme="solstice"] .badge.risk-high-badge,
html[data-theme="solstice"] .portfolio-risk-badge.risk-high {
  background: var(--solstice-risk);
  color: var(--on-primary);
}

html[data-theme="solstice"] .portfolio-risk-badge.risk-medium-high {
  background: var(--solstice-watch);
  color: var(--on-primary);
}

html[data-theme="solstice"] .portfolio-risk-badge.risk-low,
html[data-theme="solstice"] .portfolio-risk-badge.risk-low-medium,
html[data-theme="solstice"] .portfolio-risk-badge.risk-medium,
html[data-theme="solstice"] .portfolio-risk-badge.risk-unknown {
  background: var(--solstice-neutral);
  color: var(--text);
}

html[data-theme="solstice"] .gatekeeper-detail .badge.good {
  background: var(--solstice-top);
  color: var(--on-primary);
}

html[data-theme="solstice"] .gatekeeper-detail .badge.bad {
  background: var(--solstice-risk);
  color: var(--on-primary);
}

html[data-theme="solstice"] .mos-zone-detail .badge.bluegreen,
html[data-theme="solstice"] .mos-zone-detail .badge.teal {
  background: var(--solstice-value);
  color: var(--on-primary);
}

html[data-theme="solstice"] .mos-zone-detail .badge.strong {
  background: var(--solstice-top);
  color: var(--on-primary);
}

html[data-theme="solstice"] .mos-zone-detail .badge.neutral:not(.strong-value-zone):not(.outside-value-zone) {
  background: var(--solstice-neutral);
  color: var(--text);
}

html[data-theme="solstice"] .badge.upside-strong {
  background: var(--solstice-top);
  color: var(--on-primary);
}

html[data-theme="solstice"] .badge.upside-good {
  background: var(--solstice-value);
  color: var(--on-primary);
}

html[data-theme="solstice"] .badge.upside-near {
  background: var(--solstice-near);
  color: var(--on-primary);
}

html[data-theme="solstice"] .discipline-row {
  border-color: var(--solstice-risk-line);
  background: var(--solstice-risk-surface);
}

html[data-theme="solstice"] .estimate-diff,
html[data-theme="solstice"] .estimate-diff.positive {
  background: var(--solstice-value);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="solstice"] .estimate-diff.negative {
  background: var(--solstice-risk);
  color: var(--on-primary);
}

html[data-theme="solstice"] .estimate-interpretation,
html[data-theme="solstice"] .estimate-interpretation.estimate-scenario {
  background: var(--surface-tint);
  border-color: rgba(42, 157, 143, .28);
  color: var(--text);
}

html[data-theme="solstice"] .estimate-interpretation span,
html[data-theme="solstice"] .estimate-interpretation.estimate-scenario span {
  color: var(--text-muted);
}

html[data-theme="solstice"] .table-toolbar {
  background: var(--surface-soft);
  border-bottom-color: var(--line);
}

html[data-theme="solstice"] .toolbar-controls input,
html[data-theme="solstice"] .price-input {
  background: var(--surface);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="solstice"] .details-toggle {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="solstice"] .gatekeeper-item {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="solstice"] .theme-toggle button.active,
html[data-theme="solstice"] .btn-primary {
  background: var(--solstice-top);
  color: var(--on-primary);
}

html[data-theme="velvet"] {
  color-scheme: light;

  --bg: #211423;
  --bg-top: #2b1830;
  --surface: #f8f1ea;
  --text: #2a1b20;
  --text-muted: #6b5660;
  --primary: #43244a;
  --primary-2: #5b8c84;
  --accent: #c97b63;
  --accent-soft: rgba(201, 123, 99, .16);
  --success-bg: rgba(127, 174, 158, .18);
  --success-text: #3f746b;
  --warning-bg: rgba(200, 164, 93, .22);
  --warning-text: #73551a;
  --danger-bg: rgba(184, 92, 138, .18);
  --danger-text: #8a315f;
  --info-bg: rgba(91, 140, 132, .18);
  --info-text: #3f746b;

  --logo-bg: #2b1830;
  --logo-ring: #c97b63;
  --logo-ring-soft: #7fae9e;
  --logo-sweep: #5b8c84;
  --logo-dot: #fff8f1;
  --logo-highlight: #c8a45d;

  --surface-soft: #f1e4da;
  --surface-tint: #e8d3c4;
  --surface-muted: #f1e4da;
  --surface-warm: #341c3a;
  --surface-warm-soft: #43244a;
  --surface-2: #f1e4da;
  --line: rgba(67, 36, 74, .20);
  --line-soft: rgba(67, 36, 74, .10);
  --line-tint: rgba(67, 36, 74, .26);
  --line-strong: rgba(67, 36, 74, .34);
  --line-success: rgba(91, 140, 132, .42);
  --line-neutral: rgba(107, 86, 96, .24);
  --line-warning: rgba(200, 164, 93, .48);
  --text-soft: #7a6670;
  --on-primary: #fff8f1;
  --warm-surface: rgba(201, 123, 99, .14);
  --warm-line: rgba(201, 123, 99, .42);

  --success-bg-strong: #49766f;
  --success-text-strong: #fff8f1;
  --info-teal-bg: rgba(91, 140, 132, .16);
  --info-teal-text: #3f746b;
  --neutral-bg: #e8d3c4;
  --neutral-bg-soft: #f1e4da;
  --neutral-track: #d8bfae;
  --success-toast-bg: rgba(127, 174, 158, .12);
  --warning-toast-bg: rgba(200, 164, 93, .14);
  --danger-toast-bg: rgba(184, 92, 138, .12);
  --warning-line: rgba(200, 164, 93, .46);
  --danger-line: rgba(184, 92, 138, .40);

  --table-head-bg: #53305a;
  --table-head-text: #fff8f1;
  --table-row-alt: #f1e4da;

  --mos-negative: #b85c8a;
  --mos-neutral: #c8a45d;
  --mos-positive: #5b8c84;

  --warm-accent: #d99a6c;

  --theme-score-missing: #74636b;
  --theme-final-strong: #43244a;
  --theme-final-good: #5f315c;
  --theme-final-neutral: #73551a;
  --theme-final-warning: #8a4a2d;
  --theme-final-danger: #8a315f;
  --theme-rr-strong: #3f655f;
  --theme-rr-good: #506a66;
  --theme-rr-positive: #6c4c60;
  --theme-rr-neutral: #73551a;
  --theme-rr-warning: #7b3d55;
  --theme-gk-strong: #4d5f5c;
  --theme-gk-good: #5d6562;
  --theme-gk-neutral: #6b6668;
  --theme-gk-warning: #73515e;
  --hero-sky-top: #f8f1ea;
  --hero-sky-mid: #e8d3c4;
  --hero-sky-bottom: #d8bfae;
  --hero-mist: #f1e4da;
  --hero-hill: #cfae9f;
  --hero-tree-soft: #7fae9e;
  --hero-water-mid: #789f96;
  --hero-water-deep: #5b8c84;
  --hero-forest: #43244a;
  --hero-forest-soft: #6d496f;
  --hero-water-line: #fff8f1;
  --hero-water-line-soft: #d99a6c;
  --hero-art-top: #f8f1ea;
  --hero-art-mid: #e8d3c4;
  --hero-card-bottom: #f1e4da;

  --header-bg: rgba(43, 24, 48, .92);
  --header-line: rgba(232, 211, 196, .18);
  --surface-74: rgba(248, 241, 234, .74);
  --surface-78: rgba(248, 241, 234, .78);
  --surface-82: rgba(248, 241, 234, .82);
  --surface-88: rgba(248, 241, 234, .88);
  --surface-92: rgba(248, 241, 234, .92);
  --surface-94: rgba(248, 241, 234, .94);
  --surface-96: rgba(248, 241, 234, .96);
  --surface-glow: rgba(217, 154, 108, .16);
  --surface-ring: rgba(127, 174, 158, .12);
  --surface-line: rgba(255, 248, 241, .58);
  --line-translucent: rgba(67, 36, 74, .18);
  --line-card: rgba(67, 36, 74, .20);
  --line-glass: rgba(67, 36, 74, .14);
  --primary-12: rgba(67, 36, 74, .12);
  --primary-13: rgba(67, 36, 74, .13);
  --primary-18: rgba(67, 36, 74, .18);
  --primary-dark-16: rgba(43, 24, 48, .16);
  --primary-dark-18: rgba(43, 24, 48, .18);
  --primary-dark-20: rgba(43, 24, 48, .20);
  --primary-dark-22: rgba(43, 24, 48, .22);
  --accent-focus: rgba(201, 123, 99, .20);
  --accent-14: rgba(201, 123, 99, .14);
  --warm-18: rgba(217, 154, 108, .18);
  --warm-20: rgba(217, 154, 108, .20);
  --risk-10: rgba(184, 92, 138, .10);
  --risk-18: rgba(184, 92, 138, .18);
  --risk-26: rgba(184, 92, 138, .26);
  --info-22: rgba(91, 140, 132, .22);
  --info-24: rgba(91, 140, 132, .24);
  --hero-gold-glow: rgba(200, 164, 93, .22);
  --hero-green-glow: rgba(91, 140, 132, .20);
  --kpi-green-soft: rgba(127, 174, 158, .16);
  --kpi-blue-soft: rgba(67, 36, 74, .10);
  --kpi-warm-soft: rgba(184, 92, 138, .12);
  --kpi-green-mark: rgba(91, 140, 132, .22);
  --kpi-accent-mark: rgba(201, 123, 99, .22);
  --shadow-soft: rgba(33, 20, 35, .08);
  --shadow-card: rgba(33, 20, 35, .10);
  --shadow-12: rgba(33, 20, 35, .12);
  --shadow-13: rgba(33, 20, 35, .13);
  --shadow-14: rgba(33, 20, 35, .14);
  --shadow: 0 24px 70px rgba(20, 10, 22, .22);

  /* Contrast-safe Velvet status colors. */
  --velvet-top: #49766f;
  --velvet-deep: #43244a;
  --velvet-value: #a95f49;
  --velvet-gold: #826329;
  --velvet-risk: #98436f;
  --velvet-neutral: #d8bfae;
  --velvet-risk-surface: #341c3a;
  --velvet-risk-line: rgba(184, 92, 138, .58);
}

html[data-theme="velvet"] .soft-pill,
html[data-theme="velvet"] .badge,
html[data-theme="velvet"] .score-pill {
  background-image: none;
}

html[data-theme="velvet"] .soft-pill {
  background: var(--velvet-neutral);
  color: var(--text);
  border: 0;
  box-shadow: none;
}

html[data-theme="velvet"] .badge.good,
html[data-theme="velvet"] .badge.strong,
html[data-theme="velvet"] .badge.strong-value-zone {
  background: var(--velvet-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="velvet"] .badge.bluegreen,
html[data-theme="velvet"] .badge.teal,
html[data-theme="velvet"] .badge.value-zone {
  background: var(--velvet-value);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="velvet"] .badge.watch,
html[data-theme="velvet"] .badge.below-base {
  background: var(--velvet-gold);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="velvet"] .badge.bad {
  background: var(--velvet-risk);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="velvet"] .badge.neutral,
html[data-theme="velvet"] .badge.outside-value-zone {
  background: var(--velvet-neutral);
  color: var(--text);
  border: 0;
  box-shadow: none;
}

html[data-theme="velvet"] .badge.strong-value-zone {
  background: var(--velvet-deep);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="velvet"] .score-pill {
  background: var(--velvet-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="velvet"] .score-pill.rr-strong {
  background: var(--velvet-top);
}

html[data-theme="velvet"] .score-pill.rr-positive {
  background: var(--velvet-value);
}

html[data-theme="velvet"] .score-pill.rr-light,
html[data-theme="velvet"] .score-pill.low,
html[data-theme="velvet"] .score-pill.rr-neutral {
  background: var(--velvet-gold);
  color: var(--on-primary);
}

html[data-theme="velvet"] .score-pill.rr-warning,
html[data-theme="velvet"] .score-pill.badscore {
  background: var(--velvet-risk);
  color: var(--on-primary);
}

html[data-theme="velvet"] .badge.action-badge.watch {
  background: var(--velvet-value);
  color: var(--on-primary);
}

html[data-theme="velvet"] .badge.risk-high-badge,
html[data-theme="velvet"] .portfolio-risk-badge.risk-high {
  background: var(--velvet-risk);
  color: var(--on-primary);
}

html[data-theme="velvet"] .portfolio-risk-badge.risk-medium-high {
  background: var(--velvet-gold);
  color: var(--on-primary);
}

html[data-theme="velvet"] .portfolio-risk-badge.risk-low,
html[data-theme="velvet"] .portfolio-risk-badge.risk-low-medium,
html[data-theme="velvet"] .portfolio-risk-badge.risk-medium,
html[data-theme="velvet"] .portfolio-risk-badge.risk-unknown {
  background: var(--velvet-neutral);
  color: var(--text);
}

html[data-theme="velvet"] .gatekeeper-detail .badge.good {
  background: var(--velvet-top);
  color: var(--on-primary);
}

html[data-theme="velvet"] .gatekeeper-detail .badge.bad {
  background: var(--velvet-risk);
  color: var(--on-primary);
}

html[data-theme="velvet"] .mos-zone-detail .badge.bluegreen,
html[data-theme="velvet"] .mos-zone-detail .badge.teal {
  background: var(--velvet-value);
  color: var(--on-primary);
}

html[data-theme="velvet"] .mos-zone-detail .badge.strong {
  background: var(--velvet-top);
  color: var(--on-primary);
}

html[data-theme="velvet"] .mos-zone-detail .badge.neutral:not(.strong-value-zone):not(.outside-value-zone) {
  background: var(--velvet-neutral);
  color: var(--text);
}

html[data-theme="velvet"] .badge.upside-strong {
  background: var(--velvet-top);
  color: var(--on-primary);
}

html[data-theme="velvet"] .badge.upside-good {
  background: var(--velvet-value);
  color: var(--on-primary);
}

html[data-theme="velvet"] .badge.upside-near {
  background: var(--velvet-gold);
  color: var(--on-primary);
}

html[data-theme="velvet"] .discipline-row {
  background: var(--velvet-risk-surface);
  border-color: var(--velvet-risk-line);
  color: var(--on-primary);
}

html[data-theme="velvet"] .discipline-row strong,
html[data-theme="velvet"] .discipline-row em,
html[data-theme="velvet"] .discipline-row small {
  color: var(--on-primary);
}

html[data-theme="velvet"] .estimate-diff,
html[data-theme="velvet"] .estimate-diff.positive {
  background: var(--velvet-value);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="velvet"] .estimate-diff.negative {
  background: var(--velvet-risk);
  color: var(--on-primary);
}

html[data-theme="velvet"] .estimate-interpretation,
html[data-theme="velvet"] .estimate-interpretation.estimate-scenario {
  background: rgba(91, 140, 132, .12);
  border-color: rgba(67, 36, 74, .24);
  color: var(--text);
}

html[data-theme="velvet"] .estimate-interpretation span,
html[data-theme="velvet"] .estimate-interpretation.estimate-scenario span {
  color: var(--text-muted);
}

html[data-theme="velvet"] .table-toolbar {
  background: var(--surface-soft);
  border-bottom-color: var(--line);
}

html[data-theme="velvet"] .table-panel {
  border-color: var(--table-head-bg);
}

html[data-theme="velvet"] .data-table th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  box-shadow: none;
}

html[data-theme="velvet"] .data-table th:last-child {
  box-shadow: 1px 0 0 var(--table-head-bg);
}

html[data-theme="velvet"] .sortable-head button:hover,
html[data-theme="velvet"] .sortable-head button.is-active {
  color: #f1e4da;
}

html[data-theme="velvet"] .sort-arrow,
html[data-theme="velvet"] .sortable-head button.is-active .sort-arrow {
  color: #d99a6c;
}

html[data-theme="velvet"] .data-table td {
  border-top-color: rgba(67, 36, 74, .16);
}

html[data-theme="velvet"] .data-table tbody tr.holding-row:nth-of-type(4n + 1) td,
html[data-theme="velvet"] .investment-logic-table tbody tr:nth-child(odd) td {
  background: var(--surface);
}

html[data-theme="velvet"] .data-table tbody tr.holding-row:nth-of-type(4n + 3) td,
html[data-theme="velvet"] .investment-logic-table tbody tr:nth-child(even) td {
  background: var(--surface-soft);
}

html[data-theme="velvet"] .data-table tbody tr.holding-row:hover td,
html[data-theme="velvet"] .investment-logic-table tbody tr:hover td {
  background: #ead9cf;
}

html[data-theme="velvet"] .data-table tbody tr.details-row td {
  background: var(--surface-warm);
}

html[data-theme="velvet"] .kpi-card {
  background: var(--surface);
  border-color: var(--line-tint);
}

html[data-theme="velvet"] .kpi-mos,
html[data-theme="velvet"] .kpi-quality {
  background: #edf0e9;
}

html[data-theme="velvet"] .kpi-rr,
html[data-theme="velvet"] .kpi-bear,
html[data-theme="velvet"] .kpi-rank {
  background: var(--surface-soft);
}

html[data-theme="velvet"] .kpi-risk {
  background: #f2e2e6;
}

html[data-theme="velvet"] .kpi-card::before {
  opacity: .28;
}

html[data-theme="velvet"] .kpi-card span,
html[data-theme="velvet"] .kpi-card small {
  color: var(--text-muted);
}

html[data-theme="velvet"] .kpi-card strong {
  color: var(--text);
}

html[data-theme="velvet"] .composite-mini-metric {
  background: var(--surface-soft);
  border-color: var(--line-tint);
}

html[data-theme="velvet"] .composite-mini-metric span {
  color: var(--text-muted);
}

html[data-theme="velvet"] .composite-mini-metric strong {
  color: var(--text);
}

html[data-theme="velvet"] .toolbar-controls input,
html[data-theme="velvet"] .price-input {
  background: var(--surface);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="velvet"] .details-toggle {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="velvet"] .gatekeeper-item,
html[data-theme="velvet"] .details-grid section {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="velvet"] .gatekeeper-summary > div,
html[data-theme="velvet"] .detail-summary-strip > div {
  background: var(--velvet-deep);
  border-color: rgba(255, 248, 241, .16);
}

html[data-theme="velvet"] .gatekeeper-summary span,
html[data-theme="velvet"] .detail-summary-strip span {
  color: rgba(255, 248, 241, .72);
}

html[data-theme="velvet"] .gatekeeper-summary strong,
html[data-theme="velvet"] .detail-summary-strip strong {
  color: var(--on-primary);
}

html[data-theme="velvet"] .details-grid section.details-wide {
  background: var(--surface-soft);
}

html[data-theme="velvet"] .guide-card,
html[data-theme="velvet"] .formula-box,
html[data-theme="velvet"] .fact-list div,
html[data-theme="velvet"] .glossary-grid article,
html[data-theme="velvet"] .tools-panel {
  background: var(--surface-soft);
  border-color: var(--line-tint);
}

html[data-theme="velvet"] .guide-card strong,
html[data-theme="velvet"] .fact-list dd,
html[data-theme="velvet"] .glossary-grid h3 {
  color: var(--text);
}

html[data-theme="velvet"] .guide-card p,
html[data-theme="velvet"] .guide-steps li,
html[data-theme="velvet"] .formula-box p,
html[data-theme="velvet"] .fact-list dt,
html[data-theme="velvet"] .glossary-grid p {
  color: var(--text-muted);
}

html[data-theme="velvet"] .site-header .brand strong,
html[data-theme="velvet"] .site-header .top-nav a,
html[data-theme="velvet"] .site-header .nav-dropdown-button {
  color: var(--on-primary);
}

html[data-theme="velvet"] .site-header .brand small {
  color: #d8bfae;
}

html[data-theme="velvet"] .footer,
html[data-theme="velvet"] .footer a {
  color: #e8d3c4;
}

html[data-theme="velvet"] .theme-toggle button.active,
html[data-theme="velvet"] .btn-primary {
  background: var(--velvet-deep);
  color: var(--on-primary);
}

html[data-theme="arctic"] {
  color-scheme: light;

  --bg: #f8fcff;
  --bg-top: #eaf6fb;
  --surface: #ffffff;
  --text: #012a4a;
  --text-muted: #2a526c;
  --primary: #014f86;
  --primary-2: #2a6f97;
  --accent: #2c7da0;
  --accent-soft: rgba(169, 214, 229, .42);
  --success-bg: rgba(44, 125, 160, .14);
  --success-text: #014f86;
  --warning-bg: rgba(97, 165, 194, .20);
  --warning-text: #013a63;
  --danger-bg: rgba(1, 42, 74, .12);
  --danger-text: #012a4a;
  --info-bg: rgba(137, 194, 217, .30);
  --info-text: #01497c;

  --logo-bg: #eaf6fb;
  --logo-ring: #014f86;
  --logo-ring-soft: #89c2d9;
  --logo-sweep: #2c7da0;
  --logo-dot: #012a4a;
  --logo-highlight: #61a5c2;

  --surface-soft: #f3fafd;
  --surface-tint: #eaf6fb;
  --surface-muted: #ddf0f8;
  --surface-warm: #eaf6fb;
  --surface-warm-soft: #ddf0f8;
  --surface-2: #f3fafd;
  --line: rgba(1, 42, 74, .16);
  --line-soft: rgba(1, 42, 74, .08);
  --line-tint: rgba(1, 42, 74, .22);
  --line-strong: rgba(1, 42, 74, .32);
  --line-success: rgba(44, 125, 160, .34);
  --line-neutral: rgba(1, 42, 74, .16);
  --line-warning: rgba(70, 143, 175, .38);
  --text-soft: #4e758b;
  --on-primary: #ffffff;
  --warm-surface: rgba(137, 194, 217, .20);
  --warm-line: rgba(42, 111, 151, .34);

  --success-bg-strong: #2c7da0;
  --success-text-strong: #ffffff;
  --info-teal-bg: rgba(97, 165, 194, .20);
  --info-teal-text: #014f86;
  --neutral-bg: rgba(169, 214, 229, .32);
  --neutral-bg-soft: rgba(169, 214, 229, .20);
  --neutral-track: rgba(1, 42, 74, .12);
  --success-toast-bg: rgba(44, 125, 160, .08);
  --warning-toast-bg: rgba(97, 165, 194, .10);
  --danger-toast-bg: rgba(1, 42, 74, .08);
  --warning-line: rgba(70, 143, 175, .38);
  --danger-line: rgba(1, 42, 74, .30);

  --table-head-bg: #013a63;
  --table-head-text: #ffffff;
  --table-row-alt: #f3fafd;

  --mos-negative: #012a4a;
  --mos-neutral: #61a5c2;
  --mos-positive: #2c7da0;

  --warm-accent: #61a5c2;
  --hero-sky-top: #f8fcff;
  --hero-sky-mid: #eaf6fb;
  --hero-sky-bottom: #cfe8f2;
  --hero-mist: #f3fafd;
  --hero-hill: #c6e1ec;
  --hero-tree-soft: #89c2d9;
  --hero-water-mid: #61a5c2;
  --hero-water-deep: #2a6f97;
  --hero-forest: #013a63;
  --hero-forest-soft: #2c7da0;
  --hero-water-line: #ffffff;
  --hero-water-line-soft: #a9d6e5;
  --hero-art-top: #f8fcff;
  --hero-art-mid: #eaf6fb;
  --hero-card-bottom: #ddf0f8;

  --header-bg: rgba(248, 252, 255, .90);
  --header-line: rgba(1, 42, 74, .12);
  --surface-74: rgba(255, 255, 255, .74);
  --surface-78: rgba(255, 255, 255, .78);
  --surface-82: rgba(255, 255, 255, .82);
  --surface-88: rgba(255, 255, 255, .88);
  --surface-92: rgba(255, 255, 255, .92);
  --surface-94: rgba(255, 255, 255, .94);
  --surface-96: rgba(255, 255, 255, .96);
  --surface-glow: rgba(169, 214, 229, .20);
  --surface-ring: rgba(44, 125, 160, .10);
  --surface-line: rgba(255, 255, 255, .76);
  --line-translucent: rgba(1, 42, 74, .14);
  --line-card: rgba(1, 42, 74, .16);
  --line-glass: rgba(1, 42, 74, .12);
  --primary-12: rgba(1, 79, 134, .12);
  --primary-13: rgba(1, 79, 134, .13);
  --primary-18: rgba(1, 79, 134, .18);
  --primary-dark-16: rgba(1, 42, 74, .16);
  --primary-dark-18: rgba(1, 42, 74, .18);
  --primary-dark-20: rgba(1, 42, 74, .20);
  --primary-dark-22: rgba(1, 42, 74, .22);
  --accent-focus: rgba(44, 125, 160, .18);
  --accent-14: rgba(44, 125, 160, .14);
  --warm-18: rgba(97, 165, 194, .18);
  --warm-20: rgba(97, 165, 194, .20);
  --risk-10: rgba(1, 42, 74, .10);
  --risk-18: rgba(1, 42, 74, .18);
  --risk-26: rgba(1, 42, 74, .26);
  --info-22: rgba(97, 165, 194, .22);
  --info-24: rgba(44, 125, 160, .24);
  --hero-gold-glow: rgba(169, 214, 229, .26);
  --hero-green-glow: rgba(44, 125, 160, .18);
  --kpi-green-soft: rgba(137, 194, 217, .16);
  --kpi-blue-soft: rgba(97, 165, 194, .13);
  --kpi-warm-soft: rgba(1, 42, 74, .09);
  --kpi-green-mark: rgba(44, 125, 160, .22);
  --kpi-accent-mark: rgba(97, 165, 194, .22);
  --shadow-soft: rgba(1, 42, 74, .05);
  --shadow-card: rgba(1, 42, 74, .07);
  --shadow-12: rgba(1, 42, 74, .12);
  --shadow-13: rgba(1, 42, 74, .13);
  --shadow-14: rgba(1, 42, 74, .14);
  --shadow: 0 20px 60px rgba(1, 42, 74, .10);

  --arctic-top: #014f86;
  --arctic-strong: #2a6f97;
  --arctic-value: #2c7da0;
  --arctic-mid: #347795;
  --arctic-risk: #012a4a;
  --arctic-neutral: #a9d6e5;
  --arctic-hover: #ddf0f8;
  --arctic-risk-surface: #eaf6fb;
  --arctic-risk-line: rgba(1, 73, 124, .30);
  --theme-score-missing: #526f80;
  --theme-final-strong: #014f86;
  --theme-final-good: #2a6f97;
  --theme-final-neutral: #2c7da0;
  --theme-final-warning: #607582;
  --theme-final-danger: #012a4a;
  --theme-rr-strong: #2a6f97;
  --theme-rr-good: #347795;
  --theme-rr-positive: #2c7da0;
  --theme-rr-neutral: #4f7184;
  --theme-rr-warning: #536775;
  --theme-gk-strong: #347795;
  --theme-gk-good: #41758e;
  --theme-gk-neutral: #526f80;
  --theme-gk-warning: #5b7180;
}

html[data-theme="arctic"] .soft-pill,
html[data-theme="arctic"] .badge,
html[data-theme="arctic"] .score-pill {
  background-image: none;
}

html[data-theme="arctic"] .soft-pill {
  background: var(--accent-soft);
  color: var(--text);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .badge.good,
html[data-theme="arctic"] .badge.strong {
  background: var(--arctic-strong);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .badge.bluegreen,
html[data-theme="arctic"] .badge.teal,
html[data-theme="arctic"] .badge.value-zone {
  background: var(--arctic-value);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .badge.watch,
html[data-theme="arctic"] .badge.below-base {
  background: var(--arctic-mid);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .badge.bad {
  background: var(--arctic-risk);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .badge.neutral,
html[data-theme="arctic"] .badge.outside-value-zone {
  background: var(--arctic-neutral);
  color: var(--text);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .badge.strong-value-zone {
  background: var(--arctic-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .badge.below-base {
  background: #3f7893;
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .badge.outside-value-zone {
  background: #607582;
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .score-pill {
  background: var(--arctic-top);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
}

html[data-theme="arctic"] .score-pill.rr-strong {
  background: var(--arctic-strong);
}

html[data-theme="arctic"] .score-pill.rr-positive {
  background: var(--arctic-value);
}

html[data-theme="arctic"] .score-pill.rr-light,
html[data-theme="arctic"] .score-pill.low,
html[data-theme="arctic"] .score-pill.rr-neutral {
  background: var(--arctic-mid);
  color: var(--on-primary);
}

html[data-theme="arctic"] .score-pill.rr-warning,
html[data-theme="arctic"] .score-pill.badscore {
  background: var(--arctic-risk);
  color: var(--on-primary);
}

html[data-theme="arctic"] .badge.action-badge.watch {
  background: var(--arctic-strong);
  color: var(--on-primary);
}

html[data-theme="arctic"] .badge.risk-high-badge,
html[data-theme="arctic"] .portfolio-risk-badge.risk-high {
  background: var(--arctic-risk);
  color: var(--on-primary);
}

html[data-theme="arctic"] .portfolio-risk-badge.risk-medium-high {
  background: var(--arctic-strong);
  color: var(--on-primary);
}

html[data-theme="arctic"] .portfolio-risk-badge.risk-low,
html[data-theme="arctic"] .portfolio-risk-badge.risk-low-medium,
html[data-theme="arctic"] .portfolio-risk-badge.risk-medium,
html[data-theme="arctic"] .portfolio-risk-badge.risk-unknown {
  background: var(--arctic-neutral);
  color: var(--text);
}

html[data-theme="arctic"] .gatekeeper-detail .badge.good {
  background: var(--arctic-strong);
  color: var(--on-primary);
}

html[data-theme="arctic"] .gatekeeper-detail .badge.bad {
  background: var(--arctic-risk);
  color: var(--on-primary);
}

html[data-theme="arctic"] .mos-zone-detail .badge.bluegreen,
html[data-theme="arctic"] .mos-zone-detail .badge.teal {
  background: var(--arctic-value);
  color: var(--on-primary);
}

html[data-theme="arctic"] .mos-zone-detail .badge.strong {
  background: var(--arctic-top);
  color: var(--on-primary);
}

html[data-theme="arctic"] .mos-zone-detail .badge.neutral:not(.strong-value-zone):not(.outside-value-zone) {
  background: var(--arctic-neutral);
  color: var(--text);
}

html[data-theme="arctic"] .badge.upside-strong {
  background: var(--arctic-top);
  color: var(--on-primary);
}

html[data-theme="arctic"] .badge.upside-good {
  background: var(--arctic-value);
  color: var(--on-primary);
}

html[data-theme="arctic"] .badge.upside-near {
  background: var(--arctic-mid);
  color: var(--on-primary);
}

html[data-theme="arctic"] .discipline-row {
  background: var(--arctic-risk-surface);
  border-color: var(--arctic-risk-line);
}

html[data-theme="arctic"] .estimate-diff,
html[data-theme="arctic"] .estimate-diff.positive {
  background: var(--arctic-strong);
  color: var(--on-primary);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="arctic"] .estimate-diff.negative {
  background: var(--arctic-risk);
  color: var(--on-primary);
}

html[data-theme="arctic"] .estimate-interpretation,
html[data-theme="arctic"] .estimate-interpretation.estimate-scenario {
  background: rgba(169, 214, 229, .22);
  border-color: rgba(1, 42, 74, .20);
  color: var(--text);
}

html[data-theme="arctic"] .estimate-interpretation span,
html[data-theme="arctic"] .estimate-interpretation.estimate-scenario span {
  color: var(--text-muted);
}

html[data-theme="arctic"] .table-toolbar {
  background: var(--surface-soft);
  border-bottom-color: var(--line);
}

html[data-theme="arctic"] .data-table th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  box-shadow: none;
}

html[data-theme="arctic"] .sortable-head button:hover,
html[data-theme="arctic"] .sortable-head button.is-active,
html[data-theme="arctic"] .sort-arrow,
html[data-theme="arctic"] .sortable-head button.is-active .sort-arrow {
  color: #a9d6e5;
}

html[data-theme="arctic"] .data-table td {
  border-top-color: var(--line-soft);
}

html[data-theme="arctic"] .data-table tbody tr.holding-row:nth-of-type(4n + 1) td,
html[data-theme="arctic"] .investment-logic-table tbody tr:nth-child(odd) td {
  background: var(--surface);
}

html[data-theme="arctic"] .data-table tbody tr.holding-row:nth-of-type(4n + 3) td,
html[data-theme="arctic"] .investment-logic-table tbody tr:nth-child(even) td {
  background: var(--table-row-alt);
}

html[data-theme="arctic"] .data-table tbody tr.holding-row:hover td,
html[data-theme="arctic"] .investment-logic-table tbody tr:hover td {
  background: var(--arctic-hover);
}

html[data-theme="arctic"] .data-table tbody tr.details-row td {
  background: var(--surface-muted);
}

html[data-theme="arctic"] .toolbar-controls input,
html[data-theme="arctic"] .price-input {
  background: var(--surface);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="arctic"] .details-toggle {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="arctic"] .kpi-card {
  background: var(--surface);
  border-color: var(--line-tint);
}

html[data-theme="arctic"] .kpi-mos,
html[data-theme="arctic"] .kpi-quality {
  background: #eef8fc;
}

html[data-theme="arctic"] .kpi-rr,
html[data-theme="arctic"] .kpi-bear,
html[data-theme="arctic"] .kpi-rank {
  background: var(--surface-tint);
}

html[data-theme="arctic"] .kpi-risk {
  background: #dceef6;
}

html[data-theme="arctic"] .kpi-card::before {
  opacity: .30;
}

html[data-theme="arctic"] .composite-mini-metric {
  background: var(--surface-tint);
  border-color: var(--line-tint);
}

html[data-theme="arctic"] .gatekeeper-item,
html[data-theme="arctic"] .details-grid section {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="arctic"] .details-grid section.details-wide {
  background: var(--surface-soft);
}

html[data-theme="arctic"] .guide-card,
html[data-theme="arctic"] .formula-box,
html[data-theme="arctic"] .fact-list div,
html[data-theme="arctic"] .glossary-grid article,
html[data-theme="arctic"] .tools-panel {
  background: var(--surface-tint);
  border-color: var(--line);
}

html[data-theme="arctic"] .theme-toggle button.active,
html[data-theme="arctic"] .btn-primary {
  background: var(--arctic-top);
  color: var(--on-primary);
}

html[data-theme="nordic-dark"] {
  color-scheme: dark;

  --bg: #10221d;
  --bg-top: #0b1714;
  --surface: #172b25;
  --text: #f1f7f3;
  --text-muted: #bfd0c8;
  --primary: #7fa796;
  --primary-2: #9bbfaf;
  --accent: #b9d5c8;
  --accent-soft: rgba(127, 167, 150, .18);
  --success-bg: #29483f;
  --success-text: #d9eee5;
  --warning-bg: #433f2a;
  --warning-text: #e7d99f;
  --danger-bg: #482e2a;
  --danger-text: #ecc4bb;
  --info-bg: #263f39;
  --info-text: #c8ded5;

  --logo-bg: #10221d;
  --logo-ring: #9bbfaf;
  --logo-ring-soft: #53796d;
  --logo-sweep: #7fa796;
  --logo-dot: #f1f7f3;
  --logo-highlight: #b9a56d;

  --surface-soft: #1d352e;
  --surface-tint: #223d35;
  --surface-muted: #1a302a;
  --surface-warm: #2a2a1f;
  --surface-warm-soft: #302f22;
  --surface-2: #1a302a;
  --line: rgba(211, 230, 222, .16);
  --line-soft: rgba(211, 230, 222, .08);
  --line-tint: rgba(211, 230, 222, .22);
  --line-strong: rgba(211, 230, 222, .32);
  --line-success: rgba(127, 167, 150, .42);
  --line-neutral: rgba(211, 230, 222, .16);
  --line-warning: rgba(185, 165, 109, .42);
  --text-soft: #91aaa0;
  --on-primary: #10221d;
  --warm-surface: #2a2a1f;
  --warm-line: rgba(185, 165, 109, .38);

  --success-bg-strong: #3f7767;
  --success-text-strong: #f1f7f3;
  --info-teal-bg: #29483f;
  --info-teal-text: #d9eee5;
  --neutral-bg: #2c3d37;
  --neutral-bg-soft: #23342e;
  --neutral-track: #31443d;
  --success-toast-bg: #1d352e;
  --warning-toast-bg: #302f22;
  --danger-toast-bg: #382824;
  --warning-line: rgba(185, 165, 109, .42);
  --danger-line: rgba(153, 88, 74, .44);

  --table-head-bg: #0b1714;
  --table-head-text: #f1f7f3;
  --table-row-alt: #1a302a;

  --mos-negative: #9a6258;
  --mos-neutral: #a99a62;
  --mos-positive: #7fa796;

  --warm-accent: #b9a56d;

  --theme-score-missing: #52655d;
  --theme-final-strong: #315f54;
  --theme-final-good: #3f685d;
  --theme-final-neutral: #71612f;
  --theme-final-warning: #7b5435;
  --theme-final-danger: #7d3f3b;
  --theme-rr-strong: #37665a;
  --theme-rr-good: #496b62;
  --theme-rr-positive: #526d65;
  --theme-rr-neutral: #706238;
  --theme-rr-warning: #754b40;
  --theme-gk-strong: #4b655d;
  --theme-gk-good: #586b65;
  --theme-gk-neutral: #626d68;
  --theme-gk-warning: #6d574f;
  --hero-sky-top: #0b1714;
  --hero-sky-mid: #18302a;
  --hero-sky-bottom: #28463d;
  --hero-mist: #3a554c;
  --hero-hill: #1d352e;
  --hero-tree-soft: #53796d;
  --hero-water-mid: #3f6c61;
  --hero-water-deep: #234c43;
  --hero-forest: #0d251f;
  --hero-forest-soft: #31594e;
  --hero-water-line: #9bbfaf;
  --hero-water-line-soft: #6f9686;
  --hero-art-top: #10221d;
  --hero-art-mid: #1d352e;
  --hero-card-bottom: #172b25;

  --header-bg: rgba(11, 23, 20, .90);
  --header-line: rgba(211, 230, 222, .14);
  --surface-74: rgba(23, 43, 37, .74);
  --surface-78: rgba(23, 43, 37, .78);
  --surface-82: rgba(23, 43, 37, .82);
  --surface-88: rgba(23, 43, 37, .88);
  --surface-92: rgba(23, 43, 37, .92);
  --surface-94: rgba(23, 43, 37, .94);
  --surface-96: rgba(23, 43, 37, .96);
  --surface-glow: rgba(155, 191, 175, .12);
  --surface-ring: rgba(127, 167, 150, .10);
  --surface-line: rgba(211, 230, 222, .24);
  --line-translucent: rgba(211, 230, 222, .14);
  --line-card: rgba(211, 230, 222, .16);
  --line-glass: rgba(211, 230, 222, .12);
  --primary-12: rgba(127, 167, 150, .12);
  --primary-13: rgba(127, 167, 150, .13);
  --primary-18: rgba(127, 167, 150, .18);
  --primary-dark-16: rgba(11, 23, 20, .16);
  --primary-dark-18: rgba(11, 23, 20, .18);
  --primary-dark-20: rgba(11, 23, 20, .20);
  --primary-dark-22: rgba(11, 23, 20, .22);
  --accent-focus: rgba(185, 213, 200, .18);
  --accent-14: rgba(185, 213, 200, .14);
  --warm-18: rgba(185, 165, 109, .18);
  --warm-20: rgba(185, 165, 109, .20);
  --risk-10: rgba(129, 75, 66, .10);
  --risk-18: rgba(129, 75, 66, .18);
  --risk-26: rgba(129, 75, 66, .26);
  --info-22: rgba(127, 167, 150, .22);
  --info-24: rgba(83, 121, 109, .24);
  --hero-gold-glow: rgba(185, 165, 109, .18);
  --hero-green-glow: rgba(127, 167, 150, .18);
  --kpi-green-soft: rgba(34, 61, 53, .90);
  --kpi-blue-soft: rgba(29, 53, 46, .92);
  --kpi-warm-soft: rgba(48, 47, 34, .92);
  --kpi-green-mark: rgba(127, 167, 150, .20);
  --kpi-accent-mark: rgba(155, 191, 175, .18);
  --shadow-soft: rgba(0, 0, 0, .16);
  --shadow-card: rgba(0, 0, 0, .20);
  --shadow-12: rgba(0, 0, 0, .24);
  --shadow-13: rgba(0, 0, 0, .28);
  --shadow-14: rgba(0, 0, 0, .32);
  --shadow: 0 24px 70px rgba(0, 0, 0, .30);

  --nd-top: #3f7767;
  --nd-strong: #4b6f63;
  --nd-value: #507367;
  --nd-below: #3f554e;
  --nd-neutral: #2c3d37;
  --nd-watch: #6c633d;
  --nd-risk: #814b42;
  --nd-pill-text: #f1f7f3;
  --nd-hover: #28463d;
  --nd-risk-surface: #292b22;
  --nd-risk-line: rgba(185, 165, 109, .34);
}

html[data-theme="nordic-dark"] .soft-pill,
html[data-theme="nordic-dark"] .badge,
html[data-theme="nordic-dark"] .score-pill {
  background-image: none;
}

html[data-theme="nordic-dark"] .soft-pill {
  background: var(--accent-soft);
  color: var(--text);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.good,
html[data-theme="nordic-dark"] .badge.strong {
  background: var(--nd-strong);
  color: var(--nd-pill-text);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.bluegreen,
html[data-theme="nordic-dark"] .badge.teal,
html[data-theme="nordic-dark"] .badge.value-zone {
  background: var(--nd-value);
  color: var(--nd-pill-text);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.watch {
  background: var(--nd-watch);
  color: var(--nd-pill-text);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.bad {
  background: var(--nd-risk);
  color: var(--nd-pill-text);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.neutral {
  background: var(--nd-neutral);
  color: var(--text-muted);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.strong-value-zone {
  background: var(--nd-top);
  color: var(--nd-pill-text);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.below-base {
  background: var(--nd-below);
  color: var(--nd-pill-text);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.outside-value-zone {
  background: var(--nd-neutral);
  color: var(--text-muted);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .score-pill {
  background: var(--nd-top);
  color: var(--nd-pill-text);
  border: 0;
  box-shadow: none;
}

html[data-theme="nordic-dark"] .score-pill.rr-strong {
  background: var(--nd-strong);
}

html[data-theme="nordic-dark"] .score-pill.rr-positive {
  background: var(--nd-value);
}

html[data-theme="nordic-dark"] .score-pill.rr-light,
html[data-theme="nordic-dark"] .score-pill.low {
  background: var(--nd-watch);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .score-pill.rr-neutral {
  background: var(--nd-below);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .score-pill.rr-warning,
html[data-theme="nordic-dark"] .score-pill.badscore {
  background: var(--nd-risk);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .badge.action-badge.watch {
  background: var(--info-teal-bg);
  color: var(--info-teal-text);
  border: 1px solid var(--line-success);
  box-shadow: none;
}

html[data-theme="nordic-dark"] .badge.risk-high-badge,
html[data-theme="nordic-dark"] .portfolio-risk-badge.risk-high {
  background: var(--nd-risk);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .portfolio-risk-badge.risk-medium-high {
  background: var(--nd-watch);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .portfolio-risk-badge.risk-low,
html[data-theme="nordic-dark"] .portfolio-risk-badge.risk-low-medium,
html[data-theme="nordic-dark"] .portfolio-risk-badge.risk-medium,
html[data-theme="nordic-dark"] .portfolio-risk-badge.risk-unknown {
  background: var(--nd-neutral);
  color: var(--text-muted);
}

html[data-theme="nordic-dark"] .gatekeeper-detail .badge.good {
  background: var(--nd-top);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .gatekeeper-detail .badge.bad {
  background: var(--nd-risk);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .mos-zone-detail .badge.bluegreen,
html[data-theme="nordic-dark"] .mos-zone-detail .badge.teal {
  background: var(--nd-value);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .mos-zone-detail .badge.strong {
  background: var(--nd-top);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .mos-zone-detail .badge.neutral:not(.strong-value-zone):not(.outside-value-zone) {
  background: var(--nd-neutral);
  color: var(--text-muted);
}

html[data-theme="nordic-dark"] .badge.upside-strong {
  background: var(--nd-top);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .badge.upside-good {
  background: var(--nd-value);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .badge.upside-near {
  background: var(--nd-watch);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .discipline-row {
  background: var(--nd-risk-surface);
  border-color: var(--nd-risk-line);
}

html[data-theme="nordic-dark"] .estimate-diff,
html[data-theme="nordic-dark"] .estimate-diff.positive {
  background: var(--nd-value);
  color: var(--nd-pill-text);
  border: 0;
  box-shadow: none;
  background-image: none;
}

html[data-theme="nordic-dark"] .estimate-diff.negative {
  background: var(--nd-risk);
  color: var(--nd-pill-text);
}

html[data-theme="nordic-dark"] .estimate-interpretation,
html[data-theme="nordic-dark"] .estimate-interpretation.estimate-scenario {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="nordic-dark"] .estimate-interpretation span,
html[data-theme="nordic-dark"] .estimate-interpretation.estimate-scenario span {
  color: var(--text-soft);
}

html[data-theme="nordic-dark"] .table-toolbar {
  background: var(--surface-soft);
  border-bottom-color: var(--line);
}

html[data-theme="nordic-dark"] .data-table th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  box-shadow: none;
}

html[data-theme="nordic-dark"] .sortable-head button:hover,
html[data-theme="nordic-dark"] .sortable-head button.is-active,
html[data-theme="nordic-dark"] .sort-arrow,
html[data-theme="nordic-dark"] .sortable-head button.is-active .sort-arrow {
  color: var(--primary-2);
}

html[data-theme="nordic-dark"] .data-table td {
  border-top-color: var(--line-soft);
}

html[data-theme="nordic-dark"] .data-table tbody tr.holding-row:nth-of-type(4n + 1) td,
html[data-theme="nordic-dark"] .investment-logic-table tbody tr:nth-child(odd) td {
  background: var(--surface);
}

html[data-theme="nordic-dark"] .data-table tbody tr.holding-row:nth-of-type(4n + 3) td,
html[data-theme="nordic-dark"] .investment-logic-table tbody tr:nth-child(even) td {
  background: var(--table-row-alt);
}

html[data-theme="nordic-dark"] .data-table tbody tr.holding-row:hover td,
html[data-theme="nordic-dark"] .investment-logic-table tbody tr:hover td {
  background: var(--nd-hover);
}

html[data-theme="nordic-dark"] .data-table tbody tr.details-row td {
  background: var(--surface-muted);
}

html[data-theme="nordic-dark"] .toolbar-controls input,
html[data-theme="nordic-dark"] .price-input {
  background: var(--surface);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="nordic-dark"] .details-toggle {
  background: var(--surface-tint);
  border-color: var(--line-tint);
  color: var(--text);
}

html[data-theme="nordic-dark"] .kpi-card {
  border-color: var(--line-card);
}

html[data-theme="nordic-dark"] .kpi-card span,
html[data-theme="nordic-dark"] .kpi-card small {
  color: var(--text-muted);
}

html[data-theme="nordic-dark"] .kpi-card strong {
  color: var(--text);
}

html[data-theme="nordic-dark"] .composite-mini-metric {
  background: var(--surface-tint);
  border-color: var(--line-tint);
}

html[data-theme="nordic-dark"] .gatekeeper-item,
html[data-theme="nordic-dark"] .details-grid section {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="nordic-dark"] .details-grid section.details-wide {
  background: var(--surface-soft);
}

html[data-theme="nordic-dark"] .guide-card,
html[data-theme="nordic-dark"] .formula-box,
html[data-theme="nordic-dark"] .fact-list div,
html[data-theme="nordic-dark"] .glossary-grid article,
html[data-theme="nordic-dark"] .tools-panel {
  background: var(--surface-soft);
  border-color: var(--line);
}

html[data-theme="nordic-dark"] .theme-toggle button.active,
html[data-theme="nordic-dark"] .btn-primary {
  background: var(--nd-top);
  color: var(--nd-pill-text);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-top: 76px;
  max-width: 100%;
  overflow-x: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button { cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.brand,
.brand > span:last-child,
.hero-inner > *,
.panel,
.kpi-card,
.table-panel {
  min-width: 0;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--on-primary);
  font-weight: 900;
  box-shadow: 0 12px 26px var(--primary-dark-22);
}

.brand-logo-svg {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  flex: 0 0 48px;
}

.brand-mark-image {
  background: transparent;
  box-shadow: none;
}

.brand strong {
  display: block;
  font-size: .98rem;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
}

.top-nav {
  display: flex;
  gap: 22px;
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-78);
}

.theme-toggle button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}

.theme-toggle button:hover {
  color: var(--text);
}

.theme-toggle button.active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 12px var(--primary-dark-16);
}

.theme-controls {
  position: relative;
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.mode-toggle {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 82px;
  height: 38px;
  flex: 0 0 82px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border-radius: 999px;
}

.mode-toggle-track {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 1px solid var(--line);
  border-radius: inherit;
  background: var(--surface-78);
  box-shadow: 0 8px 20px var(--shadow-soft);
}

.mode-toggle-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  z-index: 1;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 3px 10px var(--shadow-12), inset 0 0 0 1px var(--line-soft);
  transform: translateX(0);
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease, opacity .18s ease;
}

.mode-toggle[data-mode="dark"] .mode-toggle-thumb {
  background: var(--surface-tint);
  box-shadow: 0 3px 10px var(--shadow-12), inset 0 0 0 1px var(--line-tint);
  transform: translateX(100%);
}

.mode-toggle[data-mode="preset"] .mode-toggle-thumb {
  opacity: 0;
  transform: translateX(50%) scale(.84);
}

.mode-toggle-option,
.theme-picker-button,
.theme-picker-option,
.theme-picker-random {
  font: inherit;
  cursor: pointer;
}

.mode-toggle-option {
  position: relative;
  z-index: 2;
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.mode-toggle-option:hover {
  color: var(--text);
}

.mode-toggle[data-mode="light"] .mode-toggle-option-light {
  color: var(--text);
}

.mode-toggle[data-mode="dark"] .mode-toggle-option-dark {
  color: var(--text);
}

.mode-toggle[data-mode="preset"] .mode-toggle-option {
  color: var(--text-soft);
}

.mode-toggle-icon {
  font-size: .9rem;
  font-weight: 700;
  line-height: 1;
}

.theme-picker {
  position: relative;
}

.theme-picker-button {
  display: inline-flex;
  min-height: 38px;
  min-width: 94px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-78);
  color: var(--text-muted);
  box-shadow: 0 8px 20px var(--shadow-soft);
  font-size: .76rem;
  font-weight: 850;
  white-space: nowrap;
}

.theme-picker-button:hover,
.theme-picker-button.has-active-theme,
.theme-picker-button[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface-92);
  color: var(--text);
}

.theme-picker-chevron {
  transition: transform .16s ease;
}

.theme-picker-button[aria-expanded="true"] .theme-picker-chevron {
  transform: rotate(180deg);
}

.theme-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  width: min(310px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 140px));
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line-tint);
  border-radius: 17px;
  background: var(--surface-96);
  box-shadow: var(--shadow);
}

.theme-picker-menu[hidden] {
  display: none;
}

.theme-picker-group + .theme-picker-group {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}

.theme-picker-group-label {
  display: block;
  padding: 2px 7px 6px;
  color: var(--text-soft);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.theme-picker-option {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font-size: .8rem;
  font-weight: 800;
}

.theme-picker-option:hover {
  background: var(--surface-tint);
  color: var(--text);
}

.theme-picker-option.active {
  background: var(--accent-soft);
  color: var(--text);
}

.theme-picker-option.active::before {
  content: "✓";
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 950;
}

.theme-picker-option.active > span:first-of-type {
  margin-right: auto;
}

.theme-picker-swatches {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
}

.theme-picker-swatch {
  width: 11px;
  height: 11px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line-soft);
}

.theme-picker-random {
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 800;
}

.theme-picker-random:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.mode-toggle-option:focus-visible,
.theme-picker-button:focus-visible,
.theme-picker-option:focus-visible,
.theme-picker-random:focus-visible {
  outline: 3px solid var(--accent-focus);
  outline-offset: 2px;
}

.top-nav a {
  color: var(--text-muted);
  font-size: .94rem;
  font-weight: 650;
}

.top-nav a:hover,
.top-nav a.active {
  color: var(--text);
}

.hero {
  padding: 24px 0 22px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 16px;
}

.page-actions-left,
.page-actions-right {
  display: flex;
  align-items: center;
}

.page-actions-right {
  margin-left: auto;
}

.company-page-actions {
  padding-top: 24px;
  margin-bottom: -24px;
}

.page-actions .btn {
  min-height: 34px;
  padding: 0 13px;
  font-size: .88rem;
  font-weight: 800;
  box-shadow: none;
}

.page-actions .btn-primary {
  box-shadow: 0 10px 22px var(--primary-dark-16);
}

.icon-refresh-btn {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.18rem;
  line-height: 1;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% 15%, var(--hero-gold-glow), transparent 25rem),
    radial-gradient(circle at 63% 85%, var(--hero-green-glow), transparent 28rem),
    linear-gradient(135deg, var(--surface) 0%, var(--surface-tint) 54%, var(--hero-card-bottom) 100%);
  box-shadow: var(--shadow);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 28px;
  align-items: stretch;
  padding: 36px;
}

.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  font-weight: 850;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -.045em;
}

h1 {
  max-width: 12ch;
  margin: 12px 0 14px;
  font-size: clamp(2.05rem, 4.1vw, 4rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero-screener-word {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.08em;
  font-style: italic;
  font-weight: 300;
  letter-spacing: -.025em;
}

h2 {
  margin-top: 8px;
  font-size: clamp(1.55rem, 2.5vw, 2.22rem);
}

.hero-lead,
.hero p {
  max-width: 64ch;
  margin: 0;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.68;
}

.hero-disclaimer { margin-top: 12px !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.btn {
  min-height: 44px;
  padding: 0 16px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--on-primary);
  box-shadow: 0 16px 30px var(--primary-dark-20);
}

.btn-secondary {
  background: var(--surface-78);
  border-color: var(--line);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--line-strong);
}

.hero-art {
  position: relative;
  align-self: stretch;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--line-translucent);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 16%, var(--surface-82), transparent 17rem),
    linear-gradient(145deg, var(--hero-art-top), var(--hero-art-mid) 54%, var(--warm-surface));
  box-shadow: 0 26px 76px var(--shadow-14);
}

.hero-art::before,
.hero-art::after {
  content: "";
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  pointer-events: none;
}

.hero-art::before {
  inset: 22px auto auto 24px;
  width: 106px;
  height: 106px;
  border: 1px solid var(--surface-line);
  background: var(--surface-glow);
}

.hero-art::after {
  right: 26px;
  bottom: 30px;
  width: 88px;
  height: 88px;
  background: var(--warm-18);
  box-shadow: 0 0 0 18px var(--surface-ring);
}

.hero-art svg {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
}

.hero-mos-card {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(72%, 340px);
  padding: 18px;
  border: 1px solid var(--line-glass);
  border-radius: 20px;
  background: var(--surface-74);
  box-shadow: 0 18px 42px var(--shadow-13);
}

.hero-mos-card > span {
  display: block;
  color: var(--primary);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-mos-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.hero-mos-row {
  display: grid;
  gap: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}

.hero-mos-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.hero-mos-row strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

.hero-mos-row small {
  display: block;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.45;
}

.toast {
  position: fixed;
  top: 92px;
  right: max(18px, calc((100vw - var(--container)) / 2));
  z-index: 80;
  max-width: min(440px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-96);
  box-shadow: 0 18px 44px var(--shadow-12);
  color: var(--text);
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.45;
}

.toast.ok {
  border-color: var(--line-strong);
  background: var(--success-toast-bg);
  color: var(--primary);
}

.toast.warn {
  border-color: var(--warning-line);
  background: var(--warning-toast-bg);
  color: var(--warning-text);
}

.toast.error {
  border-color: var(--danger-line);
  background: var(--danger-toast-bg);
  color: var(--danger-text);
}

html[data-theme="velvet"] .toast.ok {
  border-color: var(--line-success);
  background: var(--primary-2);
  color: var(--on-primary);
}

html[data-theme="velvet"] .toast.warn {
  border-color: var(--line-warning);
  background: var(--mos-neutral);
  color: var(--text);
}

html[data-theme="velvet"] .toast.error {
  border-color: var(--danger-line);
  background: var(--mos-negative);
  color: var(--on-primary);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px var(--accent-focus);
}

code {
  padding: 2px 6px;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--primary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 13px;
  margin-top: 16px;
}

.kpi-card {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 17px 16px 16px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 90% 12%, var(--surface-88), transparent 4.8rem),
    var(--surface-88);
  box-shadow: 0 14px 34px var(--shadow-card);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: auto 15px 14px auto;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  opacity: .5;
  transform: rotate(8deg);
}

.kpi-card::after {
  content: "";
  position: absolute;
  left: 16px;
  bottom: 15px;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--primary-dark-18);
}

.kpi-card span {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .01em;
}

.kpi-card strong {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.kpi-card small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-weight: 650;
  line-height: 1.35;
}

.kpi-card small {
  overflow-wrap: anywhere;
}

.kpi-mos,
.kpi-quality {
  background:
    radial-gradient(circle at 92% 14%, var(--primary-18), transparent 5.2rem),
    linear-gradient(145deg, var(--surface-92), var(--kpi-green-soft));
}

.kpi-mos::before,
.kpi-quality::before {
  background: linear-gradient(135deg, var(--kpi-green-mark), var(--kpi-accent-mark));
}

.kpi-rr,
.kpi-bear,
.kpi-rank {
  background:
    radial-gradient(circle at 88% 12%, var(--info-22), transparent 5.5rem),
    linear-gradient(145deg, var(--surface-92), var(--kpi-blue-soft));
}

.kpi-rr::before,
.kpi-bear::before,
.kpi-rank::before {
  background: linear-gradient(135deg, var(--info-24), var(--accent-14));
}

.kpi-risk {
  background:
    radial-gradient(circle at 90% 12%, var(--risk-18), transparent 5.2rem),
    linear-gradient(145deg, var(--surface-94), var(--kpi-warm-soft));
}

.kpi-risk::before {
  background: linear-gradient(135deg, var(--risk-26), var(--warm-20));
}

.section {
  padding: 31px 0;
  scroll-margin-top: 96px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 14px 38px var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.soft-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.badge.good,
.tone-good { background: var(--success-bg); color: var(--success-text); }
.badge.strong { background: var(--success-bg-strong); color: var(--success-text-strong); }
.badge.teal { background: var(--info-teal-bg); color: var(--info-teal-text); }
.badge.bluegreen { background: var(--info-bg); color: var(--info-text); }
.badge.strong-value-zone { background: var(--success-bg-strong); color: var(--success-text-strong); }
.badge.value-zone { background: var(--info-bg); color: var(--info-text); }
.badge.below-base { background: var(--success-bg); color: var(--success-text); }
.badge.outside-value-zone { background: var(--neutral-bg); color: var(--text-muted); }
.badge.neutral,
.tone-neutral { background: var(--neutral-bg); color: var(--text-muted); }
.badge.watch,
.tone-watch { background: var(--warning-bg); color: var(--warning-text); }
.badge.bad,
.tone-bad { background: var(--danger-bg); color: var(--danger-text); }

.bucket-list,
.spotlight-list,
.warning-list {
  display: grid;
  gap: 10px;
}

.compass-metric {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-top);
}

.compass-metric span {
  display: block;
  color: var(--text-muted);
  font-size: .73rem;
  font-weight: 850;
}

.compass-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.composite-panel {
  display: grid;
  gap: 12px;
}

.composite-summary {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line-tint);
  border-radius: 16px;
  background:
    radial-gradient(circle at 95% 12%, var(--primary-13), transparent 4.8rem),
    linear-gradient(135deg, var(--surface-soft), var(--surface-muted));
}

.composite-summary span {
  color: var(--primary-2);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.composite-score-main {
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: 0;
}

.composite-summary small {
  color: var(--text-muted);
  font-size: .84rem;
  line-height: 1.45;
}

.composite-list {
  display: grid;
  gap: 8px;
}

.composite-row {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.composite-row-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.composite-rank {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 900;
}

.composite-company {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: .98rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composite-score-pill {
  min-width: 44px;
  justify-content: center;
}

.composite-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 32px;
}

.composite-meta span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
}

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

.composite-mini-metric {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-top);
}

.composite-mini-metric span {
  display: block;
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 850;
}

.composite-mini-metric strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: .98rem;
  line-height: 1.15;
}

.panel-conclusion,
.panel-note {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.panel-conclusion {
  padding: 12px 13px;
  border: 1px solid var(--line-tint);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--surface-soft), var(--surface-muted));
  color: var(--primary);
  font-weight: 750;
}

.radar-row,
.discipline-row {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.radar-row {
  background:
    radial-gradient(circle at 95% 8%, var(--primary-12), transparent 4.5rem),
    var(--surface);
}

.discipline-row {
  border-color: var(--warm-line);
  background:
    radial-gradient(circle at 95% 8%, var(--risk-10), transparent 4.5rem),
    var(--surface-warm);
}

.radar-row strong,
.discipline-row strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  letter-spacing: -.02em;
}

.radar-row small {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--text-muted);
  font-size: .84rem;
  line-height: 1.45;
}

.radar-row small span:not(.badge) {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--primary);
  font-weight: 800;
}

.radar-row em,
.discipline-row em {
  color: var(--text-muted);
  font-size: .8rem;
  font-style: normal;
  line-height: 1.45;
}

.discipline-row small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.52;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.company-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .82rem;
  font-weight: 750;
}

.company-chip span {
  color: var(--text-muted);
  font-weight: 700;
}

.risk-row,
.dont-row {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.risk-row strong,
.dont-row strong {
  letter-spacing: -.02em;
}

.risk-row small,
.dont-row small,
.muted,
.disclaimer {
  color: var(--text-muted);
  font-size: .94rem;
  line-height: 1.62;
}

.analysis-date-notice {
  margin-bottom: 14px;
  padding: 15px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--surface-74);
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.62;
}

.analysis-date-notice strong { color: var(--text); font-weight: 850; }

.table-panel {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.table-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.toolbar-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr);
  gap: 10px;
  min-width: min(100%, 420px);
}

.screener-filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.screener-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
}

.screener-filter-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.screener-filter-grid label > span {
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .055em;
  line-height: 1.2;
  text-transform: uppercase;
}

.screener-filter-grid select {
  min-height: 42px;
  padding: 9px 34px 9px 11px;
  border-radius: 12px;
  background-color: var(--surface);
  font-size: .84rem;
  font-weight: 700;
}

.screener-reset-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 11px;
  border-color: var(--line);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.screener-reset-btn:hover:not(:disabled),
.screener-reset-btn:focus-visible {
  border-color: var(--line-strong);
  color: var(--text);
}

.screener-reset-btn:disabled {
  cursor: default;
  opacity: .42;
}

.screener-table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.screener-table-meta p {
  margin: 0;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 750;
}

.screener-page-size {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}

.screener-page-size select {
  width: auto;
  min-width: 66px;
  min-height: 32px;
  padding: 5px 25px 5px 9px;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 800;
}

.screener-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 62px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.screener-pagination:empty {
  display: none;
}

.screener-pagination button {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 850;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.screener-pagination button:hover:not(:disabled),
.screener-pagination button:focus-visible,
.screener-pagination button.is-active {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--primary);
  transform: translateY(-1px);
}

.screener-pagination button.is-active {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.screener-pagination button:disabled {
  cursor: default;
  opacity: .35;
}

.pagination-ellipsis {
  min-width: 24px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 800;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 12px;
  background: var(--table-head-bg);
  color: var(--table-head-text);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .055em;
  font-size: .74rem;
  font-weight: 850;
  line-height: 1.22;
  overflow-wrap: normal;
  word-break: normal;
}

.sortable-head button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.sortable-head button:hover,
.sortable-head button.is-active {
  color: var(--primary);
}

.sort-arrow {
  flex: 0 0 1.1em;
  width: 1.1em;
  color: var(--primary-2);
  font-size: .74rem;
  line-height: 1;
  opacity: .72;
}

.sortable-head button.is-active .sort-arrow {
  opacity: 1;
}

.data-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.5;
  overflow-wrap: normal;
  word-break: normal;
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) { width: 18%; }
.data-table th:nth-child(2),
.data-table td:nth-child(2) { width: 9%; }
.data-table th:nth-child(3),
.data-table td:nth-child(3) { width: 8%; }
.data-table th:nth-child(4),
.data-table td:nth-child(4) { width: 10%; }
.data-table th:nth-child(5),
.data-table td:nth-child(5) { width: 9%; }
.data-table th:nth-child(6),
.data-table td:nth-child(6) { width: 8%; }
.data-table th:nth-child(7),
.data-table td:nth-child(7) { width: 7%; }
.data-table th:nth-child(8),
.data-table td:nth-child(8) { width: 7%; }
.data-table th:nth-child(9),
.data-table td:nth-child(9) { width: 8%; }
.data-table th:nth-child(10),
.data-table td:nth-child(10) { width: 16%; }

.data-table tbody tr.holding-row:nth-of-type(4n + 1) td { background: var(--surface); }
.data-table tbody tr.holding-row:nth-of-type(4n + 3) td { background: var(--table-row-alt); }
.data-table tbody tr.details-row td { background: var(--bg-top); }

.investment-logic-panel {
  margin-top: 18px;
}

.investment-logic-table th:nth-child(1),
.investment-logic-table .investment-logic-row > td:nth-child(1) { width: 17%; }
.investment-logic-table th:nth-child(2),
.investment-logic-table .investment-logic-row > td:nth-child(2) { width: 13%; }
.investment-logic-table th:nth-child(3),
.investment-logic-table .investment-logic-row > td:nth-child(3) { width: 28%; }
.investment-logic-table th:nth-child(4),
.investment-logic-table .investment-logic-row > td:nth-child(4) { width: 21%; }
.investment-logic-table th:nth-child(5),
.investment-logic-table .investment-logic-row > td:nth-child(5) { width: 21%; }

.investment-logic-table td {
  padding: 14px 12px;
  color: var(--text-soft);
  font-size: .85rem;
  line-height: 1.56;
  overflow-wrap: anywhere;
}

.investment-logic-panel .investment-logic-table tbody tr.logic-row-base td { background: var(--surface); }
.investment-logic-panel .investment-logic-table tbody tr.logic-row-alt td { background: var(--table-row-alt); }

.logic-text {
  display: block;
  color: var(--text-soft);
  font-weight: 560;
  line-height: 1.56;
  overflow: visible;
  white-space: normal;
}

.logic-text-thesis {
  max-width: 48ch;
}

.logic-text-risk,
.logic-text-trigger {
  padding: 7px 9px;
  border-radius: 10px;
}

.logic-text-risk {
  border: 1px solid var(--warm-line);
  background: var(--surface-warm);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
}

.logic-text-trigger {
  border-left: 3px solid var(--accent);
  background: var(--surface-tint);
  color: var(--text);
}

.investment-company-cell small {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.4;
}

.investment-logic-toggle {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-top: 9px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary);
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.investment-logic-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-tint);
  color: var(--text);
}

.investment-logic-toggle:focus-visible {
  outline: 3px solid var(--accent-focus);
  outline-offset: 2px;
}

.investment-logic-details-row[hidden] {
  display: none;
}

.investment-logic-details-row td {
  padding: 0 12px 14px;
  border-top: 0;
}

.investment-logic-details-card {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-tint);
}

.investment-logic-detail-item {
  display: grid;
  grid-template-columns: minmax(120px, .18fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.investment-logic-detail-item + .investment-logic-detail-item {
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.investment-logic-detail-item span {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.investment-logic-detail-item p {
  max-width: 72ch;
  margin: 0;
  color: var(--text);
  font-size: .86rem;
  line-height: 1.58;
}

.empty-table-cell {
  color: var(--text-muted);
  font-weight: 650;
}

.dashboard-data-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-muted);
  text-align: left;
}

.dashboard-data-state strong {
  color: var(--text);
  font-size: .9rem;
}

.dashboard-data-state span {
  font-size: .8rem;
  line-height: 1.45;
}

.dashboard-data-state.is-loading {
  background: linear-gradient(100deg, var(--surface-soft), var(--surface-tint), var(--surface-soft));
  background-size: 220% 100%;
  animation: dashboard-loading 1.6s ease-in-out infinite;
}

.portfolio-data-state {
  grid-column: 1 / -1;
}

.empty-table-cell .dashboard-data-state + .btn {
  margin-top: 12px;
}

@keyframes dashboard-loading {
  0% { background-position: 100% 0; }
  100% { background-position: -120% 0; }
}

.company-cell {
  min-width: 0;
}

.company-cell strong {
  display: block;
  color: var(--text);
  font-size: .96rem;
  line-height: 1.25;
}

.company-cell small,
.metric-sub {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.38;
}

.details-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-size: .76rem;
  font-weight: 850;
}

.details-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--line-strong);
}

.company-cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.company-cell-actions .details-toggle {
  margin-top: 0;
}

.analysis-link-pill {
  text-decoration: none;
}

.price-input {
  width: 86px;
  padding: 8px 9px;
  border-radius: 11px;
  font-weight: 800;
}

.metric-number {
  display: block;
  color: var(--text);
  font-weight: 900;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.score-cell {
  white-space: nowrap;
}

.score-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 50px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 900;
}

.score-pill.low { background: var(--warning-text); }
.score-pill.badscore { background: var(--danger-text); }
.score-pill.rr-extreme {
  background: linear-gradient(135deg, var(--text), var(--primary));
  color: var(--on-primary);
}
.score-pill.rr-strong {
  background: var(--primary-2);
  color: var(--on-primary);
}
.score-pill.rr-positive {
  border: 1px solid var(--line-success);
  background: var(--success-bg-strong);
  color: var(--success-text-strong);
}
.score-pill.rr-light {
  border: 1px solid var(--line-neutral);
  background: var(--neutral-bg-soft);
  color: var(--primary-2);
}
.score-pill.rr-neutral {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
}
.score-pill.rr-warning {
  border: 1px solid var(--line-warning);
  background: var(--warning-bg);
  color: var(--warning-text);
}

/* Score hierarchy: Final Score is strongest, R/R is secondary, GK is calmest. */
html .score-pill.score-tone-missing,
html .score-pill.final-score-strong,
html .score-pill.final-score-good,
html .score-pill.final-score-neutral,
html .score-pill.final-score-warning,
html .score-pill.final-score-danger,
html .score-pill.rr-score-strong,
html .score-pill.rr-score-good,
html .score-pill.rr-score-positive,
html .score-pill.rr-score-neutral,
html .score-pill.rr-score-warning,
html .score-pill.gk-score-strong,
html .score-pill.gk-score-good,
html .score-pill.gk-score-neutral,
html .score-pill.gk-score-warning {
  border-color: transparent;
  background-image: none;
  color: #fff;
}

html .score-pill.score-tone-missing { background: #69736f; }

html .score-pill.final-score-strong { background: #24584a; }
html .score-pill.final-score-good { background: #547044; }
html .score-pill.final-score-neutral { background: #766326; }
html .score-pill.final-score-warning { background: #87503e; }
html .score-pill.final-score-danger { background: #8f302d; }

html .score-pill.rr-score-strong { background: #315f54; }
html .score-pill.rr-score-good { background: #4e756a; }
html .score-pill.rr-score-positive { background: #39756f; }
html .score-pill.rr-score-neutral { background: #7b622d; }
html .score-pill.rr-score-warning { background: #815043; }

html .score-pill.gk-score-strong { background: #315d52; }
html .score-pill.gk-score-good { background: #4f7167; }
html .score-pill.gk-score-neutral { background: #61736b; }
html .score-pill.gk-score-warning { background: #805746; }

/* Every theme keeps the score hierarchy inside its own palette. */
html .score-pill.score-tone-missing {
  background: var(--theme-score-missing);
  color: #ffffff;
}

html .score-pill.final-score-strong { background: var(--theme-final-strong); }
html .score-pill.final-score-good { background: var(--theme-final-good); }
html .score-pill.final-score-neutral { background: var(--theme-final-neutral); }
html .score-pill.final-score-warning { background: var(--theme-final-warning); }
html .score-pill.final-score-danger { background: var(--theme-final-danger); }
html .score-pill.rr-score-strong { background: var(--theme-rr-strong); }
html .score-pill.rr-score-good { background: var(--theme-rr-good); }
html .score-pill.rr-score-positive { background: var(--theme-rr-positive); }
html .score-pill.rr-score-neutral { background: var(--theme-rr-neutral); }
html .score-pill.rr-score-warning { background: var(--theme-rr-warning); }
html .score-pill.gk-score-strong { background: var(--theme-gk-strong); }
html .score-pill.gk-score-good { background: var(--theme-gk-good); }
html .score-pill.gk-score-neutral { background: var(--theme-gk-neutral); }
html .score-pill.gk-score-warning { background: var(--theme-gk-warning); }

html .score-pill.final-score-strong,
html .score-pill.final-score-good,
html .score-pill.final-score-neutral,
html .score-pill.final-score-warning,
html .score-pill.final-score-danger,
html .score-pill.rr-score-strong,
html .score-pill.rr-score-good,
html .score-pill.rr-score-positive,
html .score-pill.rr-score-neutral,
html .score-pill.rr-score-warning,
html .score-pill.gk-score-strong,
html .score-pill.gk-score-good,
html .score-pill.gk-score-neutral,
html .score-pill.gk-score-warning {
  color: #ffffff;
}

.mos-meter {
  width: 92px;
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-track);
}

.mos-meter > div {
  width: var(--w);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mos-negative), var(--mos-neutral), var(--mos-positive));
}

.formula-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-top);
}

.formula-box p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: .94rem;
  line-height: 1.55;
}

.formula-box p:last-child { margin-bottom: 0; }

.guide-hero .hero-inner {
  min-height: 0;
}

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

.guide-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-top);
}

.guide-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: .95rem;
}

.guide-card p,
.guide-steps li {
  color: var(--text-muted);
  font-size: .94rem;
  line-height: 1.55;
}

.guide-card p {
  margin: 0;
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
}

.guide-steps li + li {
  margin-top: 9px;
}

.fact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.fact-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-top);
}

.fact-list dt {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fact-list dd {
  margin: 6px 0 0;
  color: var(--text);
  font-weight: 800;
}

.glossary-section {
  padding-top: 12px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
  border-top: 1px solid var(--line-soft);
}

.glossary-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-top);
}

.glossary-grid h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: .94rem;
  letter-spacing: -.015em;
}

.glossary-grid p {
  margin: 0;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.58;
}

/* Metodhandbok */
.guide-hero .hero-inner {
  grid-template-columns: minmax(0, 1fr) minmax(420px, .92fr);
  align-items: center;
}

.guide-blueprint {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-translucent);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 46%, var(--surface-glow), transparent 44%),
    linear-gradient(145deg, var(--hero-art-top), var(--hero-art-mid) 58%, var(--warm-surface));
  box-shadow: 0 24px 58px var(--shadow-14);
}

.guide-blueprint::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--surface-line);
  border-radius: 19px;
  pointer-events: none;
}

.guide-blueprint svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 31 / 22;
}

.blueprint-grid {
  fill: url(#guideBlueprintGrid);
  opacity: .62;
}

.blueprint-grid-line {
  fill: none;
  stroke: var(--line-translucent);
  stroke-width: .7;
}

.blueprint-orbit,
.blueprint-axis {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
  opacity: .45;
}

.blueprint-orbit {
  stroke-dasharray: 4 8;
}

.orbit-inner {
  opacity: .28;
  stroke-dasharray: 2 7;
}

.blueprint-axis {
  opacity: .2;
  stroke-dasharray: 2 10;
}

.blueprint-connectors {
  fill: none;
  stroke: var(--primary-2);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: .66;
}

.blueprint-connectors-secondary {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  opacity: .45;
}

.blueprint-node rect,
.blueprint-mini-node rect {
  stroke-width: 1;
}

.blueprint-node-quality rect {
  fill: var(--success-bg);
  stroke: var(--line-success);
}

.blueprint-node-value rect {
  fill: var(--info-teal-bg);
  stroke: var(--line-tint);
}

.blueprint-node-risk rect {
  fill: var(--warning-bg);
  stroke: var(--line-warning);
}

.blueprint-node-priority rect {
  fill: var(--accent-soft);
  stroke: var(--line-strong);
}

.blueprint-node-kicker {
  fill: var(--text-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.blueprint-node-title {
  fill: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.blueprint-mini-node rect {
  fill: var(--surface-82, var(--surface));
  stroke: var(--line);
}

.blueprint-mini-node text {
  fill: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.blueprint-hub-halo {
  fill: var(--surface-glow);
  stroke: var(--primary-2);
  stroke-width: 1;
  opacity: .74;
}

.blueprint-hub-core {
  fill: var(--surface-92, var(--surface));
  stroke: var(--line-strong);
  stroke-width: 1.4;
}

.blueprint-hub-kicker {
  fill: var(--primary-2);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 1.5px;
}

.blueprint-hub-title {
  fill: var(--text);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.3px;
}

.blueprint-hub-subtitle {
  fill: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.guide-compass {
  position: relative;
  min-width: 0;
  overflow: visible;
}

.guide-compass::before,
.guide-compass::after {
  content: none;
}

.guide-compass svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 31 / 22;
}

.compass-grid { fill: url(#guideCompassGrid); opacity: .38; }
.compass-grid-line { fill: none; stroke: var(--line-translucent); stroke-width: .65; }
.compass-aura { fill: url(#guideCompassAura); }
.compass-aura-start { stop-color: var(--surface-glow); stop-opacity: .9; }
.compass-aura-mid { stop-color: var(--accent-soft); stop-opacity: .22; }
.compass-aura-end { stop-color: var(--surface); stop-opacity: 0; }

.compass-ring,
.compass-crosshair,
.compass-diagonal,
.compass-orbit-arc {
  fill: none;
  stroke: var(--line-strong);
  stroke-linecap: round;
}

.compass-ring-outer { stroke-width: 1; stroke-dasharray: 2 9; opacity: .58; }
.compass-ring-middle { stroke-width: 1.1; opacity: .42; }
.compass-ring-inner { stroke-width: .8; stroke-dasharray: 3 7; opacity: .34; }
.compass-crosshair { stroke-width: 1; opacity: .45; }
.compass-diagonal { stroke-width: .8; opacity: .24; }
.compass-orbit-arc { stroke: var(--primary-2); stroke-width: 1.5; opacity: .44; }
.compass-orbit-arc-lower { stroke: var(--accent); opacity: .3; }
.compass-glow { fill: var(--surface-glow); opacity: .8; }
.compass-shadow-shape { fill: var(--primary-dark-16); opacity: .34; }
.compass-shadow-shape-lower { fill: var(--accent-soft); opacity: .42; }
.compass-needle-start { stop-color: var(--primary); }
.compass-needle-end { stop-color: var(--primary-2); }

.compass-needle-primary {
  fill: url(#guideCompassNeedle);
  stroke: var(--line-strong);
  stroke-width: 1;
}

.compass-needle-secondary {
  fill: var(--surface-82, var(--surface));
  stroke: var(--line-strong);
  stroke-width: 1;
  opacity: .82;
}

.compass-wing {
  fill: var(--surface-74, var(--surface));
  stroke: var(--line-strong);
  stroke-width: .8;
  opacity: .76;
}

.compass-wing-west { fill: var(--accent-soft); opacity: .62; }
.compass-facet { fill: var(--info-teal-bg); stroke: var(--line-tint); stroke-width: .7; opacity: .58; }
.compass-facet-sw { fill: var(--success-bg); opacity: .45; }
.compass-facet-se { fill: var(--warning-bg); opacity: .42; }
.compass-facet-nw { fill: var(--surface-78, var(--surface)); opacity: .54; }
.compass-center-halo { fill: var(--surface-glow); stroke: var(--line-strong); stroke-width: 1; }
.compass-center-ring { fill: var(--surface-92, var(--surface)); stroke: var(--primary-2); stroke-width: 1.4; }
.compass-center-dot { fill: var(--primary); }
.compass-markers { fill: var(--primary-2); opacity: .66; }

.guide-toc-section {
  padding-top: 10px;
}

.guide-toc nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.guide-toc a:hover,
.guide-toc a:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--text);
  transform: translateY(-1px);
}

.guide-section-intro {
  max-width: 860px;
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: .98rem;
  line-height: 1.65;
}

.guide-process-intro {
  max-width: 980px;
  margin-bottom: 18px;
}

.guide-process-panel > .panel-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.guide-process-panel > .panel-head h2 {
  margin-bottom: 0;
}

.guide-process-panel > .panel-head .soft-pill {
  max-width: 100%;
  text-align: center;
}

.guide-process-intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: .98rem;
  line-height: 1.65;
}

.guide-process-intro p + p {
  margin-top: 8px;
}

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

.guide-process-step {
  position: relative;
  background: var(--surface-soft);
}

.guide-process-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.guide-process-step-head .guide-tag {
  margin-bottom: 0;
}

.guide-process-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 900;
}

.guide-process-step > .kicker {
  display: block;
  margin-bottom: 7px;
  font-size: .68rem;
}

.guide-process-list {
  margin: 12px 0 0;
  padding: 11px 12px 11px 28px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.55;
}

.guide-process-ai {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-muted);
}

.guide-process-ai h3 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 1rem;
}

.guide-process-ai p {
  margin: 0;
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.62;
}

.guide-process-ai p + p {
  margin-top: 8px;
}

.guide-process-ai p strong {
  color: var(--text);
}

.guide-process-disclaimer {
  margin: 12px 0 0;
}

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

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

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

.guide-layer-card h3 {
  margin: 12px 0 10px;
  color: var(--text);
  font-size: .95rem;
  line-height: 1.35;
}

.guide-layer-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.65;
}

.guide-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin-bottom: 9px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.panel-head > .guide-tag {
  margin-bottom: 0;
}

.guide-tag-price {
  border-color: var(--line-success);
  background: var(--success-bg);
  color: var(--success-text);
}

.guide-tag-growth {
  border-color: var(--line-tint);
  background: var(--info-teal-bg);
  color: var(--info-teal-text);
}

.guide-tag-risk {
  border-color: var(--line-warning);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.guide-tag-signal,
.guide-tag-tools {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--primary);
}

.guide-tag-data {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.guide-formula-hero {
  margin-bottom: 12px;
  text-align: center;
}

.guide-formula-hero p {
  color: var(--text);
  font-size: 1rem;
}

.guide-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.guide-inner-grid {
  align-items: stretch;
}

.guide-inner-grid + .guide-grid,
.guide-reference-grid + .guide-grid,
.guide-grid + .guide-grid {
  margin-top: 12px;
}

.guide-inner-grid > .guide-card {
  height: 100%;
}

.guide-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.guide-card-link:hover,
.guide-card-link:focus-visible {
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px var(--shadow-soft);
  transform: translateY(-2px);
}

.guide-card-link > span:last-child {
  display: inline-block;
  margin-top: 12px;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 850;
}

.guide-source-facts {
  margin-top: 14px;
}

.guide-details-list {
  display: grid;
  gap: 10px;
}

.guide-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  overflow: clip;
}

.guide-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-size: .92rem;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.guide-details summary::-webkit-details-marker {
  display: none;
}

.guide-details summary::after {
  content: "+";
  color: var(--text-muted);
  font-size: 1.05rem;
}

.guide-details[open] summary {
  border-bottom: 1px solid var(--line-soft);
}

.guide-details[open] summary::after {
  content: "−";
}

.guide-details .glossary-grid {
  padding: 12px;
  border-top: 0;
}

.guide-details > .guide-steps {
  padding: 14px 18px 16px 36px;
}

.guide-details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.guide-warning-panel {
  border-color: var(--line-warning);
  background: var(--surface-warm);
}

.guide-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.guide-hero-points span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-78, var(--surface));
  color: var(--text);
  font-size: .76rem;
  font-weight: 850;
}

.guide-scenario-strip,
.guide-scale-grid,
.guide-weight-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.guide-scenario-strip div,
.guide-scale-grid div,
.guide-weight-grid div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.guide-scenario-strip span,
.guide-scale-grid span,
.guide-weight-grid span,
.guide-weight-grid small {
  display: block;
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.4;
}

.guide-scenario-strip strong,
.guide-scale-grid strong,
.guide-weight-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: .92rem;
}

.guide-scale-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.guide-scale-grid div:first-child,
.guide-weight-grid div:first-child {
  border-color: var(--line-success);
  background: var(--success-bg);
}

.guide-risk-scale {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.guide-risk-scale div:last-child {
  border-color: var(--line-warning);
  background: var(--warning-bg);
}

.guide-weight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.guide-weight-grid strong {
  margin: 0 0 5px;
  font-size: 1.25rem;
}

.guide-weight-grid span {
  color: var(--text);
  font-weight: 850;
}

.guide-memory-rule {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-muted);
}

.guide-memory-rule p {
  margin: 0;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.6;
}

.guide-memory-rule p + p {
  margin-top: 5px;
}

.guide-memory-rule strong {
  color: var(--text);
}

.guide-flow-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.guide-flow-line span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .8rem;
  font-weight: 850;
}

.guide-flow-line b {
  color: var(--text-muted);
}

/* Velvet guide contrast: dark handbook elements must use light foregrounds. */
html[data-theme="velvet"] .guide-toc a {
  border-color: rgba(255, 248, 241, .16);
  background: var(--velvet-deep);
  color: #fff8f1;
}

html[data-theme="velvet"] .guide-toc a:hover,
html[data-theme="velvet"] .guide-toc a:focus-visible {
  border-color: rgba(217, 154, 108, .72);
  background: #5b3762;
  color: #fff8f1;
}

html[data-theme="velvet"] .guide-layer-card {
  border-color: rgba(255, 248, 241, .14);
  background: var(--velvet-deep);
}

html[data-theme="velvet"] .guide-layer-card h3 {
  color: #fff8f1;
}

html[data-theme="velvet"] .guide-layer-card ul {
  color: #d9c8d2;
}

html[data-theme="velvet"] .guide-layer-card .guide-tag-signal {
  border-color: rgba(217, 154, 108, .62);
  background: rgba(201, 123, 99, .22);
  color: #f4c7b6;
}

html[data-theme="velvet"] .guide-layer-card .guide-tag-price,
html[data-theme="velvet"] .guide-layer-card .guide-tag-growth {
  border-color: rgba(127, 174, 158, .56);
  background: rgba(91, 140, 132, .22);
  color: #b9e1d8;
}

html[data-theme="velvet"] .guide-layer-card .guide-tag-risk {
  border-color: rgba(200, 164, 93, .58);
  background: rgba(200, 164, 93, .18);
  color: #f0d28d;
}

html[data-theme="velvet"] .guide-details {
  background: var(--surface-soft);
}

html[data-theme="velvet"] .guide-warning-panel {
  border-color: rgba(201, 123, 99, .42);
  background: #f2e2db;
}

@media (max-width: 1020px) {
  .guide-hero .hero-inner {
    grid-template-columns: 1fr;
  }

  .guide-compass {
    width: min(100%, 680px);
    justify-self: center;
  }

  .guide-layer-grid,
  .guide-three-grid,
  .guide-process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 780px) {
  .guide-compass {
    border-radius: 20px;
  }

  .guide-compass svg {
    min-height: 290px;
  }

  .guide-layer-grid,
  .guide-three-grid,
  .guide-process-grid,
  .guide-reference-grid,
  .guide-details-grid,
  .guide-scenario-strip,
  .guide-scale-grid,
  .guide-risk-scale,
  .guide-weight-grid {
    grid-template-columns: 1fr;
  }

  .guide-process-flow {
    align-items: stretch;
    flex-direction: column;
  }

  .guide-process-flow span {
    text-align: center;
  }

  .guide-process-flow b {
    text-align: center;
    transform: rotate(90deg);
  }

  .guide-toc nav {
    gap: 7px;
  }

  .guide-toc a {
    min-height: 32px;
    padding: 6px 9px;
    font-size: .76rem;
  }
}

.footer {
  padding: 28px 0 44px;
  color: var(--text-muted);
  font-size: .92rem;
}

.tools-section {
  padding-top: 12px;
}

.tools-panel {
  padding: 16px 18px;
  background: var(--bg-top);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-actions .btn {
  min-height: 34px;
  padding: 0 13px;
  font-size: .84rem;
  box-shadow: none;
}

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

.portfolio-company-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.portfolio-card-head {
  display: block;
  min-width: 0;
}

.portfolio-card-head > div {
  min-width: 0;
  padding-right: 0;
}

.portfolio-card-head > .badge {
  position: absolute;
  top: 16px;
  right: 16px;
  min-height: 24px;
  padding: 0 9px;
  font-size: .7rem;
}

.portfolio-card-head h2 {
  padding-right: 104px;
  margin: 4px 0 5px;
  font-size: 1.08rem;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.portfolio-card-head p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.portfolio-card-thesis {
  display: -webkit-box;
  margin-top: 6px !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.portfolio-card-metrics,
.company-snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.portfolio-card-metrics div,
.company-snapshot div {
  min-width: 0;
  min-height: 50px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-top);
}

.portfolio-card-metrics dt,
.company-snapshot span {
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.portfolio-card-metrics dd,
.company-snapshot strong {
  display: block;
  margin: 3px 0 0;
  color: var(--text);
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.portfolio-company-card .kicker {
  max-width: calc(100% - 104px);
  font-size: .68rem;
  letter-spacing: .065em;
  line-height: 1.2;
}

.portfolio-company-card .portfolio-card-metrics dt {
  font-size: .62rem;
  letter-spacing: .035em;
  line-height: 1.15;
}

.portfolio-company-card .portfolio-card-metrics dd {
  font-size: .82rem;
  letter-spacing: -.01em;
}

.portfolio-company-card .portfolio-card-metrics .badge {
  min-height: 20px;
  padding: 0 7px;
  font-size: .66rem;
}

.portfolio-company-card .btn {
  min-height: 38px;
  margin-top: 3px;
  padding: 0 12px;
  font-size: .88rem;
}

.company-snapshot {
  gap: 8px;
}

.company-snapshot div {
  padding: 8px;
  border-radius: 12px;
}

.company-snapshot span {
  font-size: .7rem;
  letter-spacing: .055em;
}

.company-snapshot strong {
  line-height: 1.25;
}

.company-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 20px;
  align-items: start;
  padding: 28px 30px;
}

.company-back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
}

.company-hero-thesis {
  max-width: 62ch;
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 650;
  line-height: 1.58;
}

.company-facts {
  grid-template-columns: 1fr;
}

.company-facts dd {
  color: var(--text-muted);
  font-weight: 650;
  line-height: 1.6;
}

.company-gatekeeper-grid {
  margin-top: 4px;
}

.company-gatekeeper-grid .gatekeeper-item p {
  font-size: .84rem;
  line-height: 1.58;
}

.company-external-view p {
  margin: 0;
  line-height: 1.6;
}

.portfolio-risk-badge {
  width: fit-content;
}

.company-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-state-panel {
  display: grid;
  gap: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.kpi-card,
.panel,
.risk-row,
.dont-row,
.formula-box,
.soft-pill,
.badge {
  overflow-wrap: anywhere;
}

.data-table td:nth-child(1),
.data-table td:nth-child(1) .metric-sub {
  overflow-wrap: anywhere;
  white-space: normal;
}

.details-row[hidden] {
  display: none;
}

.details-row > td {
  padding: 0;
  border-top: 0;
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line-soft);
}

.details-grid section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.details-grid section > span {
  display: block;
  margin-bottom: 10px;
  color: var(--primary-2);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.model-assumptions {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
}

.model-assumptions h3 {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.model-assumptions dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.model-assumptions dt {
  font-size: .65rem;
}

.model-assumptions dd {
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.32;
}

.value-zone-detail p {
  margin: -2px 0 13px;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.55;
}

.value-zone-detail .value-zone-interpretation {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.estimate-comparison {
  display: grid;
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.estimate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 3px 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}

.estimate-row span {
  color: var(--text-muted);
  font-size: .71rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.estimate-row strong {
  color: var(--text);
  font-size: .84rem;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.estimate-diff {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--primary);
  font-size: .73rem;
  font-style: normal;
  font-weight: 850;
}

.estimate-diff.positive {
  color: var(--primary);
}

.estimate-diff.negative {
  background: var(--surface-warm-soft);
  color: var(--danger-text);
}

.estimate-interpretation {
  margin: 10px 0 0;
  padding: 10px 11px;
  border: 1px solid var(--line-tint);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: .8rem;
  line-height: 1.5;
  font-weight: 700;
}

.estimate-scenario {
  margin-top: 8px;
  background: var(--surface-warm);
  color: var(--text-muted);
  font-weight: 700;
}

.estimate-interpretation strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.estimate-interpretation span {
  display: block;
}

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

.details-grid .gatekeeper-summary,
.details-grid .detail-summary-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

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

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

.case-key-grid .case-action-metric {
  grid-column: span 2;
}

.case-key-grid .case-final-score small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: .67rem;
  line-height: 1.3;
}

.case-followup-list {
  padding-top: 2px;
}

@media (max-width: 560px) {
  .detail-summary-strip.case-key-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gatekeeper-summary > div,
.detail-summary-strip > div {
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--bg-top);
}

.gatekeeper-summary span,
.detail-summary-strip span {
  color: var(--text-muted);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gatekeeper-summary strong,
.detail-summary-strip strong {
  color: var(--text);
  font-size: .9rem;
}

.scenario-table {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
}

.details-grid .scenario-table-row {
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(82px, .8fr));
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line-soft);
}

.details-grid .scenario-table-row:first-child {
  border-top: 0;
}

.scenario-table-row > :not(:first-child) {
  text-align: right;
}

.scenario-table-head {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.scenario-table-row strong,
.scenario-table-row span {
  font-size: .8rem;
}

.scenario-return {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: .72rem;
}

.scenario-return strong {
  color: var(--text);
  font-size: .8rem;
}

.gatekeeper-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg-top);
}

.gatekeeper-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.gatekeeper-item-head strong {
  color: var(--text);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.gatekeeper-item h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: .82rem;
  line-height: 1.25;
}

.gatekeeper-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.45;
}

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

.details-grid div {
  display: grid;
  gap: 2px;
}

.details-grid > .detail-primary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.details-grid > .detail-secondary-grid {
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.details-grid > .detail-secondary-grid.no-external {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.details-grid .estimate-comparison {
  gap: 0;
}

.details-grid .estimate-row {
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 3px 10px;
}

.details-grid dt {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.details-grid dd {
  margin: 0;
  color: var(--text);
  font-size: .86rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.details-grid .gatekeeper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.details-grid .gatekeeper-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

@media (max-width: 1100px) {
  .hero-inner,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  h1 { max-width: none; }

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

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

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

  .screener-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .screener-reset-btn {
    align-self: flex-end;
  }

  .guide-grid,
  .flow-grid,
  .fact-list,
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .details-grid > .detail-primary-grid,
  .details-grid > .detail-secondary-grid,
  .details-grid > .detail-secondary-grid.no-external,
  .details-grid .gatekeeper-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  html { scroll-padding-top: 84px; }
  body { padding-top: 68px; }
  .section { scroll-margin-top: 84px; }
  .container { width: min(var(--container), calc(100% - 24px)); }
  .top-nav { display: none; }
  .nav-wrap { min-height: 68px; }
  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .brand-logo-svg {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    flex-basis: 42px;
  }
  .brand small { display: none; }
  .hero { padding: 26px 0 18px; }
  .page-actions .btn {
    flex: 0 0 auto;
  }
  .hero-card { border-radius: 22px; }
  .hero-inner {
    padding: 22px;
    gap: 18px;
  }

  .company-hero-inner {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .portfolio-card-head {
    display: grid;
  }

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

  .portfolio-card-metrics,
  .company-snapshot {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.18rem;
    letter-spacing: -.035em;
  }
  .hero-lead {
    font-size: 1rem;
    line-height: 1.65;
  }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 26px 0; }
  .panel {
    padding: 18px;
  }

  .composite-row-head {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .composite-company {
    white-space: normal;
  }

  .composite-meta {
    padding-left: 0;
  }

  .composite-mini-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar-controls {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .screener-filter-grid {
    grid-template-columns: 1fr;
  }

  .screener-reset-btn {
    align-self: stretch;
  }

  .screener-table-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-scroll {
    overflow-x: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .holding-row {
    padding: 14px;
    border-top: 1px solid var(--line-soft);
    background: var(--surface);
  }

  .holding-row td {
    display: grid;
    grid-template-columns: minmax(110px, .45fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-top: 0;
    background: transparent !important;
  }

  .holding-row td::before {
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
  }

  .holding-row td:nth-child(1) {
    display: block;
    padding-top: 0;
  }

  .holding-row td:nth-child(1)::before { content: ""; }
  .holding-row td:nth-child(2)::before { content: "Aktuell kurs"; }
  .holding-row td:nth-child(3)::before { content: "FV Base"; }
  .holding-row td:nth-child(4)::before { content: "Base Upside"; }
  .holding-row td:nth-child(5)::before { content: "Bear Downside"; }
  .holding-row td:nth-child(6)::before { content: "Bull Upside"; }
  .holding-row td:nth-child(7)::before { content: "R/R Index"; }
  .holding-row td:nth-child(8)::before { content: "GK Score"; }
  .holding-row td:nth-child(9)::before { content: "Final Score"; }
  .holding-row td:nth-child(10)::before { content: "Value Zone"; }

  .investment-logic-row {
    padding: 14px;
    border-top: 1px solid var(--line-soft);
    background: var(--surface);
  }

  .investment-logic-row.logic-row-alt {
    background: var(--table-row-alt);
  }

  .investment-logic-row td {
    display: grid;
    grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-top: 0;
    background: transparent !important;
  }

  .investment-logic-row td::before {
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
  }

  .investment-logic-row td:nth-child(1) {
    display: block;
    padding-top: 0;
  }

  .investment-logic-row td:nth-child(1)::before { content: ""; }
  .investment-logic-row td:nth-child(2)::before { content: "Case-typ"; }
  .investment-logic-row td:nth-child(3)::before { content: "Thesis"; }
  .investment-logic-row td:nth-child(4)::before { content: "Största risk"; }
  .investment-logic-row td:nth-child(5)::before { content: "Nästa trigger"; }

  .investment-logic-table .logic-text {
    display: block;
    overflow: visible;
    -webkit-line-clamp: initial;
  }

  .investment-logic-details-row {
    padding: 0 14px 14px;
    background: var(--surface);
  }

  .investment-logic-details-row td {
    padding: 0;
    border-top: 0;
    background: transparent !important;
  }

  .investment-logic-detail-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .details-grid {
    grid-template-columns: 1fr;
    padding: 0 14px 16px;
  }

  .glossary-grid {
    padding: 0 14px 16px;
  }
}

@media (max-width: 520px) {
  .container { width: calc(100% - 22px); }
  .theme-controls { gap: 6px; }
  .mode-toggle {
    width: 82px;
    flex-basis: 82px;
  }
  .mode-toggle-option { padding: 0 6px; }
  .theme-picker-button { padding: 0 10px; }
  .theme-picker-menu {
    left: auto;
    right: 0;
    width: min(310px, calc(100vw - 22px));
  }
  .brand strong { font-size: .92rem; }
  .brand-mark {
    width: 40px;
    height: 40px;
  }
  .brand-logo-svg {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    flex-basis: 40px;
  }
  .hero-inner { padding: 20px; }
  h1 { font-size: 2.1rem; }
  .kpi-grid { grid-template-columns: 1fr; }
  .portfolio-company-grid { grid-template-columns: 1fr; }
  .hero-art,
  .hero-art svg {
    min-height: 300px;
  }
  .hero-mos-card {
    left: 50%;
    right: auto;
    top: 50%;
    width: min(calc(100% - 36px), 330px);
    padding: 18px;
  }
}

/* Tools navigation */
.nav-dropdown { position: relative; }
.nav-dropdown-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
}
.nav-dropdown-button:hover,
.nav-dropdown-button.active,
.nav-dropdown:focus-within .nav-dropdown-button {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}
.nav-dropdown-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: 210px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-96, var(--surface));
  box-shadow: var(--shadow-card);
}
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 10px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: grid; }
.nav-dropdown-menu a {
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 750;
  text-decoration: none;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: var(--primary);
  color: var(--on-primary);
}

/* Keep dropdown contrast independent from header-specific link colors. */
html[data-theme] .site-header .top-nav .nav-dropdown-menu a {
  color: var(--text-muted);
}
html[data-theme] .site-header .top-nav .nav-dropdown-menu a:hover,
html[data-theme] .site-header .top-nav .nav-dropdown-menu a:focus-visible,
html[data-theme] .site-header .top-nav .nav-dropdown-menu a.active {
  background: var(--primary);
  color: var(--on-primary);
}

.analysis-metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0 0;
  overflow: hidden;
  border: 1px solid var(--line-card, var(--line));
  border-radius: 12px;
  background: var(--surface-82, var(--surface-soft));
}
.guide-subsection {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-card, var(--line));
}
.guide-subsection > h3 { margin: 0 0 10px; }
.guide-subsection > p { color: var(--text-muted); line-height: 1.7; }
.guide-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 430px;
}
.guide-table th,
.guide-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-card, var(--line));
  text-align: left;
}
.guide-table th { color: var(--text-muted); font-size: .78rem; }
.guide-table td { color: var(--text); font-size: .86rem; font-weight: 700; }
.analysis-metadata > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(100px, .8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
}
.analysis-metadata > div:nth-child(even) { border-left: 1px solid var(--line-card, var(--line)); }
.analysis-metadata > div:nth-child(n + 3) { border-top: 1px solid var(--line-card, var(--line)); }
.analysis-metadata dt,
.analysis-metadata dd { margin: 0; }
.analysis-metadata dt {
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
}
.analysis-metadata dd {
  color: var(--text);
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
.analysis-metadata-note {
  margin: 6px 2px 12px;
  color: var(--text-muted);
  font-size: .71rem;
  line-height: 1.4;
}
.company-analysis-metadata { margin-bottom: 0; }
.screener-notice-compact,
.analysis-date-notice-compact {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-style: solid;
  border-radius: 14px;
  background: var(--surface-74, var(--surface-soft));
  font-size: .8rem;
  line-height: 1.5;
}
.screener-notice-compact a,
.analysis-date-notice-compact a {
  color: var(--primary);
  font-weight: 800;
}
@media (max-width: 620px) {
  .analysis-metadata { grid-template-columns: 1fr; }
  .analysis-metadata > div:nth-child(even) { border-left: 0; }
  .analysis-metadata > div:nth-child(n + 2) { border-top: 1px solid var(--line-card, var(--line)); }
  .screener-notice-compact,
  .analysis-date-notice-compact { padding: 9px 12px; font-size: .76rem; }
}
