/* Investment Research — report styles
   Vanilla, no build. Design system via CSS custom properties.
   Theme: the Tech Coach "quiet Swiss / technical" system — cool neutrals, one deep-navy
   accent, system grotesque + IBM Plex Mono. Ported from techcoach/site/app/globals.css. */

@import url("fonts.css");   /* IBM Plex Mono, base64-embedded — keeps file:// safe */

:root {
  /* ---- surfaces ---- */
  --paper:      #F4F6F8;   /* page ground, cool off-white */
  --paper-2:    #ECEFF2;   /* filled surface / table head */
  --panel-2:    #E6EAEE;   /* deeper panel */
  --card:       #FFFFFF;   /* raised card */

  /* ---- text ---- */
  --ink:        #15181C;   /* primary, doubles as the dark band ground */
  --ink-2:      #22272D;
  --ink-soft:   #56606B;   /* secondary / lede */
  --ink-faint:  #7E8893;   /* meta / mono captions */

  /* ---- lines ---- */
  --line:       #D8DCE1;
  --line-2:     #E6E9ED;

  /* ---- the single accent ---- */
  --accent:      #1D3A5F;
  --accent-h:    #16304E;
  --accent-tint: #E9EEF4;
  --accent-soft: #3A5D88;
  --good:        #1F6F52;  /* muted green */
  --bad:         #9A6A4A;  /* muted terracotta, deliberately not a bright red */

  /* ---- legacy aliases → new palette (keeps the existing rules working) ---- */
  --teal:       var(--accent);
  --teal-soft:  var(--accent-tint);
  --gold:       var(--accent-soft);
  --gold-soft:  var(--paper-2);
  --rust:       var(--bad);

  --shadow:      0 1px 2px rgba(20,28,45,.05), 0 6px 22px rgba(20,28,45,.07);
  --shadow-lift: 0 24px 60px -34px rgba(29,58,95,.55);

  /* ---- type: grotesque body + mono labels, no serif ---- */
  --sans:  "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --serif: var(--sans);   /* the theme is grotesque-only; headings share the sans */
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1200px;
  --radius: 8px;
  --radius-sm: 4px;
}

::selection { background: var(--accent); color: #fff; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,246,248,.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  max-width: var(--maxw); margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
/* Boxed mono wordmark, in the theme's technical register. */
.brand .mark {
  flex: none; border: 1.5px solid var(--ink); border-radius: 3px;
  padding: .2rem .4rem; line-height: 1; background: none; color: var(--ink);
  font-family: var(--mono); font-weight: 600; font-size: .8rem; letter-spacing: .04em;
  display: grid; place-items: center;
}
.brand b { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.brand small { color: var(--ink-faint); font-size: .72rem; display: block; margin-top: -2px; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--ink-soft); font-size: .88rem;
  padding: .35rem .6rem; border-radius: var(--radius-sm); white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.nav a:hover { background: var(--accent-tint); color: var(--accent); }
.nav a.active { background: var(--accent); color: #fff; }

/* ---------- side navigation (replaces the top bar on desktop) ---------- */
:root { --sidenav-w: 480px; }                      /* wide rail; ~1.5x-larger type inside */
body { padding-left: var(--sidenav-w); }           /* shift all content clear of the fixed rail */
.side-nav {
  position: fixed; top: 0; left: 0; width: var(--sidenav-w); height: 100vh;
  box-sizing: border-box; padding: 2rem 1.6rem 2rem;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1.7rem; overflow-y: auto; z-index: 60;
}
.side-nav .sn-top {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding-bottom: 1.4rem; border-bottom: 1px solid var(--line);
}
.side-nav .brand .mark { font-size: .92rem; padding: .28rem .46rem; }
.side-nav .brand b { font-size: 1.16rem; letter-spacing: -.015em; }
.side-nav .brand small { font-size: .72rem; color: var(--ink-faint); font-family: var(--mono); letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
/* grotesque, semibold, negative tracking — the theme's heading register; generous line spacing */
.sn-links { display: flex; flex-direction: column; gap: .55rem; }
.sn-item > a {
  display: block; text-decoration: none; color: var(--ink-2);
  font-family: var(--sans); font-size: 1.24rem; font-weight: 600; letter-spacing: -.015em;
  padding: .5rem .7rem; border-radius: var(--radius-sm);
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.sn-item > a:hover { background: var(--accent-tint); color: var(--accent); }
.sn-item > a.active { background: var(--accent-tint); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.sn-sub { list-style: none; margin: .5rem 0 .35rem; padding: 0 0 0 .9rem; border-left: 1px solid var(--line); }
.sn-sub li { margin: 0; }
.sn-sub a {
  display: block; text-decoration: none; color: var(--ink-faint);
  font-family: var(--sans); font-size: 1.02rem; font-weight: 400; letter-spacing: -.005em; line-height: 1.4;
  padding: .42rem .65rem; border-radius: var(--radius-sm); transition: color .16s ease, background .16s ease;
}
.sn-sub a:hover { color: var(--accent); background: var(--accent-tint); }
.sn-sub a.here { color: var(--accent); font-weight: 600; }
.sn-toggle { display: none; }

/* Below 1100px the wide rail would crowd the content, so fall back to a top bar. */
@media (max-width: 1100px) {
  body { padding-left: 0; }
  .side-nav {
    position: sticky; top: 0; left: auto; width: 100%; height: auto; flex-direction: column;
    border-right: none; border-bottom: 1px solid var(--line); padding: .7rem 1.1rem; gap: 0;
    background: rgba(244,246,248,.92); backdrop-filter: saturate(140%) blur(10px);
  }
  .side-nav .sn-top { margin: 0; }
  .side-nav .brand b { font-size: 1.1rem; }
  .side-nav .brand small { font-size: .74rem; }
  .side-nav .brand .mark { font-size: .8rem; padding: .2rem .4rem; }
  .sn-toggle {
    display: grid; gap: 3px; align-content: center; background: none; cursor: pointer;
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .6rem;
  }
  .sn-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }
  .sn-links { display: none; margin-top: .7rem; }
  .side-nav.open .sn-links { display: flex; }
  .sn-item > a { font-size: 1.05rem; padding: .55rem .6rem; }
  .sn-sub { display: none; }                              /* keep the mobile menu to page-level links */
  .sn-sub a { font-size: .95rem; }
  .side-nav.open .sn-item > a.active + .sn-sub { display: block; }
}

/* ---------- layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 64ch; }

/* Headings: grotesque, weight 600, negative tracking — never heavier, that's the quiet feel. */
h1, h2, h3 { font-family: var(--sans); font-weight: 600; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.04; letter-spacing: -.03em; margin: .2rem 0 .6rem; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem);  line-height: 1.1;  letter-spacing: -.025em; margin: 2.4rem 0 .8rem; }
h3 { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.2; letter-spacing: -.02em; margin: 1.6rem 0 .5rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-h); }

/* The signature label: uppercase mono, wide tracking, preceded by a short accent tick. */
.eyebrow {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: .625rem;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent); opacity: .7; flex: none;
}

/* ---------- hero ---------- */
/* Faint 64px engineering-paper grid, feathered top and bottom — the theme's hero motif. */
.hero {
  position: relative;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 100% 64px;
  /* Fade out well before the body copy — behind paragraphs the grid reads as an artifact. */
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 42%);
          mask-image: linear-gradient(180deg, #000, transparent 42%);
  opacity: .35;
}
.hero .container { position: relative; padding-top: 3rem; padding-bottom: 2rem; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* strategies: five cards as a balanced 3-then-2, with the second row centred */
#strategy-cards { grid-template-columns: repeat(6, 1fr); }
#strategy-cards > .card { grid-column: span 2; }
#strategy-cards > .card:nth-child(4) { grid-column: 2 / span 2; }
#strategy-cards > .card:nth-child(5) { grid-column: 4 / span 2; }
@media (max-width: 900px) {
  #strategy-cards { grid-template-columns: repeat(2, 1fr); }
  #strategy-cards > .card,
  #strategy-cards > .card:nth-child(4),
  #strategy-cards > .card:nth-child(5) { grid-column: auto; }
}
@media (max-width: 560px) { #strategy-cards { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: .2rem; }
.card .num { font-family: var(--serif); font-size: 2rem; color: var(--teal); line-height: 1; }
.card.step { display: flex; gap: .9rem; }
.card.step .badge {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal); font-weight: 700;
  display: grid; place-items: center; font-family: var(--serif);
}

/* ---------- callouts ---------- */
.callout { border-left: 4px solid var(--gold); background: var(--gold-soft);
  padding: .9rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.2rem 0; }
.callout.info { border-color: var(--teal); background: var(--teal-soft); }
.callout.warn { border-color: var(--rust); background: #f6e7e0; }
.callout p:last-child { margin-bottom: 0; }
.callout p:first-child { margin-top: 0; }

/* status pills */
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .5rem;
  border-radius: 999px; font-family: var(--sans); letter-spacing: .02em; }
.pill.todo  { background: var(--paper-2); color: var(--ink-faint); }
.pill.prog  { background: var(--gold-soft); color: var(--gold); }
.pill.done  { background: var(--teal-soft); color: var(--teal); }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .94rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  background: var(--paper-2); color: var(--ink); font-weight: 600;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .03em; text-transform: uppercase;
}
tbody tr:hover { background: var(--accent-tint); }

/* ---------- code / tutorial ---------- */
code { font-family: var(--mono); font-size: .86em; background: var(--paper-2);
  padding: .1rem .35rem; border-radius: 5px; }
pre { background: var(--ink); color: #E6E9ED; padding: 1rem 1.1rem; border-radius: var(--radius-sm);
  overflow-x: auto; font-family: var(--mono); font-size: .82rem; line-height: 1.55; }
pre code { background: none; padding: 0; color: inherit; }

/* ---------- collapsibles ---------- */
details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  padding: .2rem .4rem; margin: .6rem 0; }
details summary { cursor: pointer; padding: .7rem .6rem; font-weight: 600; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; color: var(--teal); font-weight: 700; margin-right: .6rem; }
details[open] summary::before { content: "–"; }
details .body { padding: 0 .8rem .8rem; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin: 1rem 0 .2rem; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: .55rem .9rem; cursor: pointer;
  font: inherit; color: var(--ink-soft); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- donut chart ---------- */
.donut-wrap { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.legend { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }

/* ---------- the three-lens motif + the "forces" showcase band ---------- */
.lenses { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 1rem;
  letter-spacing: .04em; color: var(--accent); background: var(--accent-tint);
  border: 1px solid var(--accent-soft); border-radius: 999px; padding: .34rem 1rem; margin: 0 0 1.1rem; }
.lenses .x { color: var(--accent-soft); font-weight: 400; margin: 0 .15rem; }

.forces { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.forces .container { padding-top: 2.6rem; padding-bottom: 2.8rem; }
.forces h2 { margin-top: 0; }
.forces .lead { color: var(--ink-soft); max-width: 66ch; margin: 0 0 1.4rem; }

/* factor pie: donut + a legend that names every factor in each layer */
.fp-wrap { display: flex; gap: 1.8rem; align-items: center; flex-wrap: wrap; }
.fp-chart { position: relative; flex: none; }
.fp-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.fp-center strong { display: block; font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -.02em; }
.fp-center span { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); }
.fp-legend { flex: 1; min-width: 280px; }
.fp-legend .lg-lab { font-weight: 600; }
.fp-names { display: block; font-weight: 400; font-size: .74rem; color: var(--ink-faint); line-height: 1.4; margin-top: .1rem; }
@media (max-width: 560px) { .fp-wrap { justify-content: center; } }

/* ---------- hero: concept 1a — headline left, forces globe right ---------- */
/* the design supplies its own hairline grid texture, so drop the section's default one */
.hero::before { display: none; }
.hero-inner { position: relative; padding: 2.8rem 0 2.4rem; }
.gridtex { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 27px, var(--line) 27px 28px);
  opacity: .5; -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
          mask-image: linear-gradient(to bottom, #000, transparent 78%); }
.hero-body { position: relative; }

.eyb { display: flex; align-items: center; gap: 12px; font: 500 12px var(--mono);
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }
.eyb .rule { width: 26px; height: 2px; background: var(--accent); flex: none; }

.hero-grid { display: grid; grid-template-columns: 1.04fr 1fr; gap: 44px;
  align-items: center; margin-top: 34px; }
.hero-copy { min-width: 0; }

.hero-h1 { margin: 0; }
.h-lead { display: block; font: 500 clamp(15px, 1.4vw, 18px)/1.35 var(--sans);
  color: var(--ink-soft); letter-spacing: 0; margin: 0 0 14px; }
.motif { display: block; font-weight: 600; color: var(--ink); letter-spacing: -.025em;
  line-height: .98; font-size: clamp(2.1rem, 4.7vw, 57px); }
.motif .x { font-family: var(--mono); font-weight: 400; color: var(--accent-soft);
  font-size: .56em; vertical-align: .14em; margin: 0 .16em; }
.h-tail { display: block; font: 500 clamp(20px, 2vw, 27px)/1.1 var(--sans);
  color: var(--ink-soft); letter-spacing: -.015em; margin-top: 8px; }
.hero-rule { width: 56px; height: 2px; background: var(--accent); opacity: .5; margin: 22px 0 0; }
.hero-lede { font: 400 16.5px/1.64 var(--sans); color: var(--ink-soft); text-wrap: pretty;
  max-width: 56ch; margin: 20px 0 0; }
.hero-lede strong { color: var(--ink); font-weight: 600; }
.disc { display: inline-block; font: 500 10.5px var(--mono); letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); border: 1px solid var(--line);
  padding: 6px 11px; border-radius: 4px; margin-top: 24px; }

.hero-globe { display: flex; justify-content: center; align-items: center; min-width: 0; }
.hero-globe svg { width: 100%; max-width: 580px; display: block; overflow: visible; }

/* animated hero globe: spinning dot-sphere (canvas) + semi-random highlight tags (svg) */
.globe-stage { position: relative; width: 100%; max-width: 580px; aspect-ratio: 640 / 480; }
.globe-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe-ovl { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.gc-leader { stroke-width: 1.1; stroke-opacity: .55; }
.gc-halo { transform-box: fill-box; transform-origin: center; }
.gc-tag { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: .02em; dominant-baseline: middle; }
.gcall { opacity: 0; animation: gpulse var(--dur, 6s) ease-in-out var(--delay, 0s) infinite; }
.gc-halo { animation: ghalo var(--dur, 6s) ease-out var(--delay, 0s) infinite; }
@keyframes gpulse { 0% { opacity: 0; } 9% { opacity: 1; } 48% { opacity: 1; } 62% { opacity: 0; } 100% { opacity: 0; } }
@keyframes ghalo { 0%, 9% { opacity: .5; transform: scale(.5); } 44%, 100% { opacity: 0; transform: scale(2.4); } }
@media (prefers-reduced-motion: reduce) {
  .gcall { opacity: 1; animation: none; }
  .gc-halo { display: none; }
}
.tagtext { font-family: var(--mono); font-weight: 500; }
.pindot, .pinhalo { transform-box: fill-box; transform-origin: center; }

@keyframes drawIn { to { stroke-dashoffset: 0; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.2); } 60% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); } }
@keyframes halo { 0% { opacity: .55; transform: scale(.5); } 100% { opacity: 0; transform: scale(2.5); } }
@keyframes fadeIn { to { opacity: 1; } }
.fx.leader { stroke-dasharray: 230; stroke-dashoffset: 230; animation: drawIn .75s ease forwards; animation-delay: var(--d); }
.fx.pindot { opacity: 0; animation: popIn .55s cubic-bezier(.34,1.4,.5,1) forwards; animation-delay: var(--d); }
.fx.pinhalo { opacity: 0; animation: halo 1.5s ease-out forwards; animation-delay: var(--d); }
.fx.tagtext { opacity: 0; animation: fadeIn .6s ease forwards; animation-delay: var(--d); }
@media (prefers-reduced-motion: reduce) {
  .fx { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; transform: none !important; }
  .fx.pinhalo { display: none; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; margin-top: 26px; }
  /* explicit width so the flex box doesn't shrink-wrap the absolutely-positioned globe stage to 0 */
  .hero-globe { order: -1; width: min(440px, 100%); margin: 0 auto; }
}

/* ---------- timeline (process steps) ---------- */
.timeline { list-style: none; padding: 0; margin: 1.4rem 0; position: relative; }
.timeline:before { content: ""; position: absolute; left: 16px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 1.2rem 3rem; }
.timeline li:before { content: ""; position: absolute; left: 9px; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--card); border: 3px solid var(--teal); }
.timeline h3 { margin: 0 0 .2rem; }

/* ---------- footer ---------- */
/* Full-bleed dark band — "dark" here is compositional rhythm, not a theme mode. */
.site-footer { border-top: 1px solid var(--line); background: var(--ink); }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem;
  color: rgba(255,255,255,.7); font-size: .85rem; display: flex; gap: 1rem;
  justify-content: space-between; flex-wrap: wrap; }
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: #fff; }

.disclaimer { font-size: .8rem; color: var(--ink-faint); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: .7rem .9rem; margin-top: 1.4rem; background: var(--card); }

.muted { color: var(--ink-faint); }
ul.clean { list-style: none; padding-left: 0; }
ul.clean li { padding: .25rem 0; }
hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---------- document furniture (whitepaper feel) ---------- */
.part-label { display: inline-flex; align-items: baseline; gap: .5rem; font-family: var(--sans);
  text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700;
  color: var(--teal); }
.part-label b { font-family: var(--serif); font-size: 1rem; letter-spacing: 0; color: var(--ink); }

.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin: 1.4rem 0; box-shadow: var(--shadow); }
.toc h3 { margin: .2rem 0 .6rem; font-size: 1rem; }
.toc ol { margin: 0; padding-left: 1.1rem; columns: 2; column-gap: 2rem; }
@media (max-width: 700px) { .toc ol { columns: 1; } }
.toc li { margin: .25rem 0; }

/* recommendation banner */
.reco { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  background: var(--accent-tint); border: 1px solid var(--accent);
  box-shadow: 0 1px 0 var(--accent), var(--shadow-lift);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1.4rem 0; }
.reco .big { font-family: var(--sans); font-weight: 600; font-size: 1.7rem;
  color: var(--accent); line-height: 1.1; letter-spacing: -.02em; }
.reco .big small { display: block; font-size: .72rem; color: var(--ink-faint); font-family: var(--mono);
  font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin-top: .3rem; }

/* ---------- compact 3×2 strategy grid (Overview) ---------- */
.grid-mini { width: 100%; border-collapse: separate; border-spacing: 6px; }
.grid-mini th { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft); text-align: left; padding: .3rem .2rem; background: none; }
.grid-mini thead th .gm-range { display: block; font-size: .64rem; color: var(--ink-faint); letter-spacing: .04em; margin-top: .15rem; }
.grid-mini th.gm-tier { vertical-align: middle; white-space: nowrap; padding-right: .6rem; }
.grid-mini td { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .7rem; vertical-align: top; }
.grid-mini td.gm-on { background: var(--card); }
.grid-mini td.gm-base { background: var(--accent-tint); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.grid-mini td.gm-off { background: repeating-linear-gradient(135deg, var(--paper-2), var(--paper-2) 6px, var(--paper) 6px, var(--paper) 12px);
  border-style: dashed; border-color: var(--line-2); }
.grid-mini .gm-num { display: block; font-weight: 600; color: var(--ink); font-size: .95rem; }
.grid-mini td.gm-base .gm-num { color: var(--accent); }
.grid-mini .gm-meta { display: block; font-family: var(--mono); font-size: .68rem; color: var(--ink-soft); margin-top: .25rem; }
.grid-mini .gm-x { display: block; font-weight: 600; color: var(--bad); font-size: .9rem; }
@media (max-width: 640px) { .grid-mini, .grid-mini thead, .grid-mini tbody, .grid-mini tr, .grid-mini td, .grid-mini th { display: block; }
  .grid-mini thead { display: none; } .grid-mini th.gm-tier { color: var(--ink); font-size: .8rem; padding-top: .6rem; } }

/* ---------- dials comparison table: highlight the base-case column ---------- */
table.dials th.col-base, table.dials td.col-base { background: var(--accent-tint); }
table.dials th.col-base { color: var(--accent); }

/* in → out flow card (reproducibility) */
.io { display: grid; grid-template-columns: 1fr auto 1fr; gap: .8rem; align-items: stretch; margin: .6rem 0; }
@media (max-width: 680px) { .io { grid-template-columns: 1fr; } .io .arrow { transform: rotate(90deg); } }
.io .box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; font-size: .9rem; }
.io .box .lab { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--ink-faint); display: block; margin-bottom: .25rem; }
.io .box.in { border-left: 3px solid var(--gold); }
.io .box.out { border-left: 3px solid var(--teal); }
.io .arrow { display: grid; place-items: center; color: var(--teal); font-size: 1.4rem; }

/* ---------- method flow map ---------- */
/* Two colours only: gold = questions we asked · teal = what the process produced.
   The central finding is the single emphasis node; the brief/report are bookends. */
.flow { margin: 1rem 0 .6rem; }
.flow-row { display: flex; justify-content: center; }
.fnode { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .55rem .9rem; font-size: .9rem; max-width: 560px; text-align: center; box-shadow: var(--shadow); }
.fnode.start, .fnode.end { background: var(--teal-soft); border-color: var(--teal); font-weight: 600; }
.fnode.ask  { border-top: 3px solid var(--gold); }
.fnode.made { border-top: 3px solid var(--teal); }
.fnode.key  { background: linear-gradient(135deg, var(--teal-soft), var(--gold-soft));
  border-color: var(--teal); font-weight: 600; max-width: 640px; }
.flow-down { text-align: center; color: var(--ink-faint); font-size: 1.15rem; line-height: 1; margin: .3rem 0; }
.flow-down span { display: block; font-size: .72rem; letter-spacing: .02em; }
/* parallel fan-out band — makes branching read as one step that splits */
.fan-band { border: 1px dashed var(--line); border-radius: var(--radius); background: var(--paper);
  padding: .5rem .7rem .7rem; margin: .3rem 0; }
.fan-cap { text-align: center; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; color: var(--ink-faint); margin: .15rem 0 .55rem; }
.fan-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.fan-grid .fnode { max-width: none; font-size: .82rem; }
/* legend */
.flow-legend { display: flex; flex-wrap: wrap; gap: 1.1rem; justify-content: center;
  font-size: .78rem; color: var(--ink-soft); margin-top: .6rem; }
.flow-legend .k { display: inline-flex; align-items: center; gap: .45rem; }
.flow-legend i { width: 16px; height: 16px; border-radius: 4px; display: inline-block;
  border: 1px solid var(--line); }
.flow-legend i.sw-ask  { border-top: 4px solid var(--gold); }
.flow-legend i.sw-made { border-top: 4px solid var(--teal); }
.flow-legend i.sw-key  { background: linear-gradient(135deg, var(--teal-soft), var(--gold-soft));
  border-color: var(--teal); }

/* chart card + caption */
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin: 1.2rem 0; }
.chart-card .cap { font-size: .82rem; color: var(--ink-faint); margin-top: .5rem; }

/* CSS metric bar (dials) */
.mbar { margin: .5rem 0; }
.mbar .mhead { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .2rem; }
.mbar .track { height: 10px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.mbar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #2f9377); }
.mbar .fill.rust { background: linear-gradient(90deg, var(--rust), #c4683f); }
.mbar .fill.gold { background: linear-gradient(90deg, var(--gold), #c89a4a); }

/* stacked tier ribbon */
.ribbon { display: flex; height: 26px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); margin: .5rem 0; font-size: .7rem; }
.ribbon span { display: grid; place-items: center; color: #fff; white-space: nowrap; overflow: hidden; }

/* BT-status pills */
.pill.ok   { background: var(--teal-soft); color: var(--teal); }
.pill.like { background: var(--gold-soft); color: var(--gold); }
.pill.unc  { background: #f6e7e0; color: var(--rust); }

/* persona color chips */
.who { font-size: .72rem; font-weight: 700; letter-spacing: .03em; display: inline-flex; align-items: center; gap: .32rem; }
.who .pic { display: inline-flex; }
.who .pic svg { display: block; }
.who.skeptic { color: var(--rust); }
.who.opportunist { color: var(--gold); }
.who.conservator { color: var(--teal); }
.who.macro { color: #5566c4; }

/* ---------- euro-aware legend / money ribbon ---------- */
.legend li, .ribbon-key li { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; }
.lg-lab { flex: 1; }
.lg-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; white-space: nowrap; }
.lg-eur { font-size: .72rem; color: var(--ink-faint); }
.ribbon-key { list-style: none; padding: 0; margin: .7rem 0 0; font-size: .9rem; }
.ribbon-key .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.ribbon span { font-weight: 700; }

/* ---------- decisions ledger (one-scan) ---------- */
.decisions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 760px) { .decisions { grid-template-columns: 1fr; } }
.dec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .55rem; }
.dec .q { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint);
  font-weight: 700; font-family: var(--sans); }
.dec .call { font-family: var(--serif); font-size: 1.12rem; color: var(--teal); line-height: 1.25;
  display: flex; gap: .45rem; align-items: baseline; }
.dec .call::before { content: "✓"; color: var(--gold); font-weight: 700; }
.dec .pc { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; color: var(--ink-soft); }
.dec .pro, .dec .con { padding-left: 1.4rem; position: relative; }
.dec .pro::before { content: "▲"; position: absolute; left: 0; color: var(--teal); font-size: .7rem; top: .15rem; }
.dec .con::before { content: "▼"; position: absolute; left: 0; color: var(--rust); font-size: .7rem; top: .15rem; }
.dec .pos { align-self: flex-start; margin-top: .1rem; font-size: .78rem; background: var(--teal-soft);
  color: var(--teal); border-radius: 999px; padding: .18rem .7rem; font-weight: 700; }

/* ---------- compact force-field + historical line chart ---------- */
#force-field svg, #history-chart svg { display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: .7rem 0 0; padding: 0;
  list-style: none; font-size: .84rem; color: var(--ink-soft); }
.chart-legend li { display: flex; align-items: center; gap: .4rem; }
.chart-legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.chart-legend strong { color: var(--ink); }
.spark { vertical-align: middle; }
td .spark { display: block; }

/* ---------- BT-Trade access badge ---------- */
.bt { display: inline-flex; align-items: center; gap: .28rem; font-size: .66rem; font-weight: 800;
  padding: .12rem .42rem; border-radius: 5px; font-family: var(--sans); letter-spacing: .02em;
  border: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.bt .dot { width: 5px; height: 5px; border-radius: 50%; }
.bt-yes { background: var(--teal); color: #fff; border-color: var(--teal); }
.bt-yes .dot { background: #bfeada; }
.bt-likely { background: var(--gold-soft); color: #7a5a16; border-color: #e3cf9b; }
.bt-likely .dot { background: var(--gold); }
.bt-no { background: #f0ece2; color: var(--ink-faint); border-color: var(--line); }
.bt-no .dot { background: var(--ink-faint); }
.bt-key { display: flex; flex-wrap: wrap; gap: .6rem 1rem; font-size: .8rem; color: var(--ink-soft); align-items: center; margin: .5rem 0 0; }

/* ---------- persona voice-focus (factors page) ---------- */
.voices { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .2rem 0 1.2rem; }
.voices .ctl-lab { margin-right: .2rem; }
.vbtn { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem;
  font: inherit; font-size: .84rem; cursor: pointer; color: var(--ink-soft); display: inline-flex; align-items: center; gap: .4rem; }
.vbtn:hover { background: var(--paper-2); }
.vbtn .pic { display: inline-flex; }
.vbtn.skeptic { color: var(--rust); } .vbtn.opportunist { color: var(--gold); }
.vbtn.conservator { color: var(--teal); } .vbtn.macro { color: #5566c4; }
.vbtn.on.skeptic { background: var(--rust); color: #fff; border-color: var(--rust); }
.vbtn.on.opportunist { background: var(--gold); color: #fff; border-color: var(--gold); }
.vbtn.on.conservator { background: var(--teal); color: #fff; border-color: var(--teal); }
.vbtn.on.macro { background: #5566c4; color: #fff; border-color: #5566c4; }
.vbtn.allv.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pstance.dim { opacity: .22; }
.pstance.spot { background: var(--paper-2); border-radius: 6px; }
.pstance .tag { color: var(--ink-faint); font-weight: 600; font-size: .72rem; margin-left: .3rem; }

/* ---------- factor → reaction matrix (standalone app) ---------- */
/* stacked: the grid takes the full text-column width, the per-cell reasoning opens below it */
.fm-layout { display: block; }
.fm-grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }

/* hint that a cell expands into its full-size reasoning underneath */
.fm-expand-hint { display: flex; align-items: center; gap: .5rem; margin: .7rem 0 0;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .01em; color: var(--ink-faint); }
.fm-expand-hint .fm-eh-plus { display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 4px; color: var(--accent-soft);
  font-size: .8rem; line-height: 1; }
.fm-expand-hint .fm-eh-arr { color: var(--accent-soft); animation: fmNudge 1.8s ease-in-out infinite; }
@keyframes fmNudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (max-width: 720px) { .fm-expand-hint { display: none; } } /* card view: chips are self-evidently tappable */
@media (prefers-reduced-motion: reduce) { .fm-expand-hint .fm-eh-arr { animation: none; } }

#controls { display: flex; flex-wrap: wrap; gap: 1.2rem; margin: .4rem 0 1rem; }
.ctl { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ctl-lab { font-size: .78rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.chipbtn { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem;
  font: inherit; font-size: .82rem; cursor: pointer; color: var(--ink-soft); }
.chipbtn:hover { background: var(--paper-2); }
.chipbtn.on { background: var(--teal); color: #fff; border-color: var(--teal); }

table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .8rem; margin: 0; }
table.matrix th, table.matrix td { border: none; }
table.matrix th.corner { text-align: left; font-size: .68rem; color: var(--ink-faint); padding: .5rem .6rem;
  position: sticky; left: 0; background: var(--card); z-index: 3; }
/* column headers: an icon over a short horizontal label (no more diagonal text) */
table.matrix th.dir { padding: .55rem .3rem .5rem; vertical-align: bottom; cursor: pointer; min-width: 58px; }
table.matrix th.dir .dir-hd { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-soft); }
table.matrix th.dir .dir-ic { color: var(--accent-soft); }
table.matrix th.dir .dir-lb { font-family: var(--mono); font-size: .62rem; letter-spacing: .01em;
  color: var(--ink-faint); line-height: 1; white-space: nowrap; }
table.matrix th.dir:hover .dir-ic, table.matrix th.dir:hover .dir-lb { color: var(--accent); }
table.matrix th.dir.sel .dir-ic, table.matrix th.dir.sel .dir-lb { color: var(--accent); }
table.matrix th.dir.sel { background: var(--accent-tint); }
table.matrix th.facname { text-align: left; font-weight: 500; font-size: .82rem; color: var(--ink);
  padding: .3rem .7rem .3rem .6rem; cursor: pointer; position: sticky; left: 0; background: var(--card); z-index: 2;
  border-right: 1px solid var(--line); white-space: nowrap; }
table.matrix th.facname:hover { color: var(--teal); }

/* legend decoding the column icons → full direction names (also a filter row) */
.fm-dir-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem;
  margin: 0 0 1rem; font-size: .8rem; color: var(--ink-soft); }
.fm-dir-legend > strong { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); margin-right: .1rem; }
.fm-dir-legend .dir-k { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .28rem .7rem .28rem .5rem;
  font: inherit; font-size: .8rem; color: var(--ink-soft); }
.fm-dir-legend .dir-k .dir-ic { color: var(--accent-soft); width: 18px; height: 18px; }
.fm-dir-legend .dir-k:hover { background: var(--paper-2); }
.fm-dir-legend .dir-k.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fm-dir-legend .dir-k.on .dir-ic { color: #fff; }
table.matrix tr.sel-row th.facname, table.matrix tr.sel-row td.cell { outline: 2px solid var(--teal); outline-offset: -2px; }

tr.tier-row td.tier-cell { font-family: var(--serif); font-size: .82rem; color: var(--gold); font-weight: 700;
  padding: .6rem .6rem .2rem; position: sticky; left: 0; background: var(--paper-2); }
tr.tier-row td.tier-spacer { background: var(--paper-2); }

td.cell { width: 52px; height: 34px; text-align: center; cursor: pointer; color: #fff; font-weight: 700;
  border: 1px solid var(--paper); transition: transform .05s; }
td.cell span { pointer-events: none; }
td.cell:hover { transform: scale(1.12); position: relative; z-index: 1; box-shadow: var(--shadow); }
td.cell.dim { opacity: .18; }
/* on the full (clickable) map, a corner badge on hover hints the cell opens into full text below */
table.matrix:not(.mini) td.cell { position: relative; }
table.matrix:not(.mini) td.cell::after { content: "＋"; position: absolute; top: 2px; right: 2px;
  display: inline-flex; align-items: center; justify-content: center; min-width: 12px; height: 12px;
  padding: 0 1px; border-radius: 3px; background: rgba(255, 255, 255, .9); color: var(--accent);
  font-size: .55rem; line-height: 1; opacity: 0; transform: scale(.6);
  transition: opacity .12s, transform .12s; pointer-events: none; }
table.matrix:not(.mini) td.cell:hover::after { opacity: 1; transform: scale(1); }
.r-bb { background: #15604c; }
.r-b  { background: #5aa888; }
.r-m  { background: #e0b94e; color: #4a3a10; }
.r-h  { background: #dd9b78; color: #4a2a18; }
.r-hh { background: #a4502f; }
.r-n  { background: #efece4; color: transparent; }

/* ---------- factor map: mobile card view (replaces the 11-col heatmap on phones) ---------- */
.fm-cards-view { display: none; }
.fmc-group { margin-bottom: 1.1rem; }
.fmc-tier { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-soft); margin: .7rem 0 .5rem; }
.fmc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .8rem; margin-bottom: .6rem; }
.fmc.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fmc-name { display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 1.02rem; font-weight: 600; color: var(--ink); padding: 0 0 .55rem; line-height: 1.3; }
.fmc-tilt { font-family: var(--mono); font-size: .66rem; font-weight: 500; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .04em; }
.fmc-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.fmc-chip { display: inline-flex; align-items: center; gap: .35rem; border: none; border-radius: 999px;
  padding: .3rem .6rem; font-size: .82rem; font-weight: 700; color: #fff; cursor: pointer; }
.fmc-chip .fmc-dir { font-weight: 500; }
.fmc-chip .fmc-r { font-size: .92rem; }
.fmc-none { font-size: .82rem; }
@media (max-width: 720px) {
  .fm-table-view { display: none; }
  .fm-cards-view { display: block; }
  .fm-grid-wrap { overflow: visible; border: none; background: none; }
  #detail { position: static; }
}

/* ---------- mobile safety: wide tables scroll inside their own box, page never does ---------- */
@media (max-width: 720px) {
  main table:not(.grid-mini) {
    display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  /* the compressed reaction map on the Overview is a preview — let it scroll horizontally */
  #mini-matrix { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* the method flow map: let its fan-out rows stack rather than overflow */
  .fan-grid { grid-template-columns: 1fr !important; }
  .fnode, .fan-grid .fnode { max-width: none; }
}

/* legend */
.fm-legend { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1rem 0; font-size: .8rem; align-items: center; }
.fm-legend span.k { display: inline-flex; align-items: center; gap: .35rem; }
.fm-legend i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* detail panel — full width, opens beneath the grid */
#detail { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 2px solid var(--accent); padding: 1.1rem 1.3rem; box-shadow: var(--shadow); margin-top: 1rem; }
#detail:empty { display: none; }
/* let the full-width reasoning breathe into columns on wide screens */
@media (min-width: 860px) {
  #detail .persona-stances { columns: 2; column-gap: 1.6rem; }
  #detail .persona-stances h4 { column-span: all; }
  #detail .pstance { break-inside: avoid; }
}
#detail h3 { margin-top: .2rem; font-size: 1.15rem; }
#detail h4 { font-size: .85rem; margin: 1rem 0 .3rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
#detail .arrow { color: var(--teal); }
#detail .src { display: block; font-size: .72rem; color: var(--ink-faint); margin-top: .3rem; font-family: var(--mono); }
.chip { display: inline-block; min-width: 22px; text-align: center; border-radius: 5px; padding: 0 .35rem;
  font-weight: 700; font-size: .8rem; color: #fff; }
.rx-list { list-style: none; padding: 0; margin: .4rem 0; font-size: .86rem; }
.rx-list li { padding: .25rem 0; display: flex; gap: .5rem; align-items: baseline; }
.persona-stances { margin-top: .8rem; }
.pstance { font-size: .85rem; margin: .4rem 0; padding-left: .2rem; border-left: 3px solid var(--line); padding: .2rem .6rem; }
.pstance.skeptic { border-color: var(--rust); }
.pstance.opportunist { border-color: var(--gold); }
.pstance.conservator { border-color: var(--teal); }
.pstance.macro { border-color: #5566c4; }

/* ---------- in-page section jump-bar (Factors) ---------- */
.section-nav { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; gap: .4rem;
  padding: .55rem 0; margin: .2rem 0 1.2rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.section-nav a { font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--ink-soft);
  padding: .25rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.section-nav a:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- tilt pills (risk / opportunity / two-sided) ---------- */
.pill.risk  { background: #f6e7e0; color: var(--rust); }
.pill.opp   { background: #e5efe9; color: var(--good); }
.pill.mixed { background: var(--gold-soft); color: var(--gold); }

/* ---------- geopolitics world map ---------- */
.geo-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .3rem 0 .8rem; }
.geo-chips .ctl-lab { font-size: .72rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.gchip { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 600; padding: .28rem .62rem .28rem .5rem;
  border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink-soft); cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
/* the numbered badge shared by a chip, its detail card, and its map pin — the one glyph
   that ties "which chip owns which region" together when several factors share a tilt */
.gnum { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 1.3em; height: 1.3em; margin-right: .4rem; border-radius: 50%; background: var(--ink);
  color: #fff; font-family: var(--mono); font-size: .64rem; font-weight: 700; opacity: .68;
  transition: opacity .15s ease, background .15s ease; vertical-align: -.15em; }
.gchip.risk { border-color: var(--rust); }
.gchip.opp { border-color: var(--good); }
.gchip.mixed { border-color: var(--gold); }
.gchip:hover, .gchip:focus-visible { background: var(--paper-2); }
.gchip:hover .gnum, .gchip:focus-visible .gnum, .gchip.on .gnum { opacity: 1; }
.gchip.on.risk { background: var(--rust); color: #fff; border-color: var(--rust); }
.gchip.on.opp { background: var(--good); color: #fff; border-color: var(--good); }
.gchip.on.mixed { background: var(--gold); color: #fff; border-color: var(--gold); }
.gchip.on .gnum { background: #fff; color: var(--ink); }
.gchip.clear { border-style: dashed; color: var(--ink-faint); }
.gchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gchip:active { transform: translateY(1px); }

.geo-stage { position: relative; border-radius: 10px; overflow: hidden; }
.wmap { width: 100%; height: auto; display: block; background: var(--paper-2); }
.wmap path.c { fill: var(--line-2); stroke: var(--paper); stroke-width: .5; }
.wmap path,
.wmap path.play { transition: fill .22s ease, opacity .22s ease, stroke .18s ease, stroke-width .18s ease, filter .18s ease; }

/* resting tint: in-play countries are already coloured by their net read, so the chips
   and the map correspond without any interaction — hover/selection only raises the signal. */
.wmap path.play { cursor: pointer; stroke: var(--line); stroke-width: .5; }
.wmap path.play.risk  { fill: color-mix(in srgb, var(--rust) 26%, var(--paper-2)); }
.wmap path.play.opp   { fill: color-mix(in srgb, var(--good) 24%, var(--paper-2)); }
.wmap path.play.mixed { fill: color-mix(in srgb, var(--gold) 26%, var(--paper-2)); }

/* hover/keyboard-focus lift on any in-play country, even before a factor is selected */
.wmap path.play:hover, .wmap path.play:focus-visible { stroke: var(--ink); stroke-width: 1.6; filter: brightness(.94); }
.wmap path.play:focus-visible { outline: none; }

/* an active factor (chip hover/focus/click) raises its own countries to full strength... */
.wmap path.play.hi { stroke: var(--ink); stroke-width: 1.8; }
/* ...and recedes every other in-play country so the correspondence is unambiguous */
.wmap path.play.dim { opacity: .3; filter: grayscale(45%); }
.wmap path.play.dim:hover { opacity: .55; filter: grayscale(20%); }

/* first-paint affordance: a couple of quiet pulses to say "these are explorable" */
@keyframes geoPulse { 0%, 100% { stroke-opacity: .35; } 50% { stroke-opacity: 1; stroke-width: 2.2; } }
.wmap path.play.pulse { stroke: var(--ink); animation: geoPulse 1.5s ease-in-out 2; }

/* number badges pinned on the region cluster of the active factor — same glyph as the chip's .gnum */
.geo-marker circle { fill: var(--ink); stroke: var(--paper); stroke-width: 1.4; opacity: 0; transition: opacity .18s ease; }
.geo-marker text { fill: #fff; font-family: var(--mono); font-size: 10px; font-weight: 700; text-anchor: middle; dominant-baseline: central; opacity: 0; transition: opacity .18s ease; }
.geo-marker.on circle, .geo-marker.on text { opacity: 1; }

.geo-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: #fff;
  padding: .4rem .55rem; border-radius: 8px; font-size: .76rem; max-width: 240px; box-shadow: var(--shadow); }
.geo-tip[hidden] { display: none; }
.geo-tip b { display: block; margin-bottom: .2rem; }
.geo-tip .ti { display: block; font-size: .72rem; opacity: .94; }
.geo-tip .ti::before { content: "\2022"; margin-right: .3rem; }
.geo-tip .ti.risk::before { color: #e08a63; }
.geo-tip .ti.opp::before { color: #6fbf9a; }
.geo-tip .ti.mixed::before { color: #8fa9cc; }

.geo-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: .65rem 0; font-size: .78rem; color: var(--ink-soft); }
.geo-legend .lg { display: inline-flex; align-items: center; gap: .35rem; }
.geo-legend .lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.geo-legend .lg.risk i { background: var(--rust); }
.geo-legend .lg.opp i { background: var(--good); }
.geo-legend .lg.mixed i { background: var(--gold); }
.geo-legend .hint { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--ink); }
.geo-legend .hint::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  display: inline-block; animation: geoHint 1.8s ease-in-out infinite; }
@keyframes geoHint { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .wmap path, .wmap path.play, .gchip, .gchip .gnum, .geo-marker circle, .geo-marker text {
    transition: none !important; }
  .wmap path.play.pulse { animation: none !important; }
  .geo-legend .hint::before { animation: none !important; opacity: .8; }
}

.geo-detail { margin-top: .5rem; }
.gd-card { border: 1px solid var(--line); border-left: 4px solid var(--line); background: var(--card); border-radius: 10px; padding: .8rem 1rem; }
.gd-card.risk { border-left-color: var(--rust); }
.gd-card.opp { border-left-color: var(--good); }
.gd-card.mixed { border-left-color: var(--gold); }
.gd-card h4 { margin: .1rem 0 .45rem; font-family: var(--serif); font-size: 1.05rem; }
.gd-card p { margin: .35rem 0; font-size: .9rem; }
.gd-cs { display: flex; flex-wrap: wrap; gap: .35rem 1.4rem; font-size: .82rem; margin: .45rem 0; }
.gd-card .src { font-size: .72rem; color: var(--ink-faint); font-family: var(--mono); }
.gd-card ul.clean { margin: .4rem 0 0; }
.gd-card .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: .35rem; }
.gd-card .dot.risk { background: var(--rust); }
.gd-card .dot.opp { background: var(--good); }
.gd-card .dot.mixed { background: var(--gold); }

/* ---------- interactive line chart (legend toggles + hover) ---------- */
.ichart { position: relative; }
.ic-plot { position: relative; }
.ic-svg { cursor: crosshair; }
.chart-legend.toggles li { cursor: pointer; user-select: none; }
.chart-legend.toggles li.off { opacity: .4; }
.chart-legend.toggles li.off .sw { filter: grayscale(1); }
.ic-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: #fff;
  padding: .42rem .55rem; border-radius: 8px; font-size: .74rem; box-shadow: var(--shadow); min-width: 130px; }
.ic-tip[hidden] { display: none; }
.ic-tip-yr { font-weight: 700; margin-bottom: .25rem; }
.ic-tip div { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.ic-tip .sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ---------- inspectable research accordions (Reproduce) ---------- */
.rbatch { margin: 1.4rem 0 .6rem; font-size: 1.05rem; }
.racc { border: 1px solid var(--line); border-radius: 10px; margin: .5rem 0; background: var(--card); overflow: hidden; }
.racc summary { cursor: pointer; padding: .7rem .9rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .55rem; list-style: none; }
.racc summary::-webkit-details-marker { display: none; }
.racc summary::before { content: "\25B8"; color: var(--ink-faint); font-size: .8rem; }
.racc[open] summary::before { content: "\25BE"; }
.racc summary:hover { background: var(--paper-2); }
.racc .rid { font-family: var(--mono); font-size: .74rem; font-weight: 700; color: #fff; background: var(--teal); padding: .06rem .42rem; border-radius: 5px; }
.racc .rtitle { font-weight: 700; }
.racc .rhook { color: var(--ink-faint); font-size: .85rem; flex: 1; min-width: 160px; }
.racc .rbody { padding: .3rem 1rem 1rem; border-top: 1px solid var(--line); font-size: .9rem; }
.racc .rfind { margin: .5rem 0; padding-left: 1.1rem; }
.racc .rfind li { margin: .25rem 0; }
.racc .rsrc { font-size: .8rem; color: var(--ink-soft); }
.racc .rdl a { display: inline-block; margin-top: .35rem; font-weight: 600; color: var(--teal); text-decoration: none;
  border: 1px solid var(--teal); padding: .28rem .65rem; border-radius: 7px; }
.racc .rdl a:hover { background: var(--teal-soft); }

/* ---------- AI-bubble scenario (Insights) ---------- */
#ai-scenario { margin-top: .4rem; }
#ai-scenario .cap { font-size: .82rem; color: var(--ink-faint); margin: .4rem 0 .8rem; }
.scn-lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 68ch; }
.scn-head { margin: 1rem 0 .4rem; }
.scn-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1.05rem; box-shadow: var(--shadow); }
.scn-card h4 { font-family: var(--serif); font-size: 1.02rem; margin: 0 0 .3rem; color: var(--teal); }
.scn-card p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.scn-h { font-size: 1.12rem; margin: 1.6rem 0 .3rem; }
table.scn-trans { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.scn-trans th, table.scn-trans td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.scn-trans thead th { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
table.scn-trans .scn-num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
table.scn-trans .scn-why { color: var(--ink-soft); font-size: .85rem; }
.scn-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: .5rem; }
@media (max-width: 760px) { .scn-tiers { grid-template-columns: 1fr; } }
.scn-tier { background: var(--paper-2); border-radius: var(--radius); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .3rem; }
.scn-tier-name { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); }
.scn-tier-band { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--rust); }
.scn-tier-band em { font-style: normal; font-weight: 400; font-size: .72rem; color: var(--ink-faint); margin-left: .4rem; }
.scn-tier-note { font-size: .82rem; color: var(--ink-soft); margin-top: .1rem; }
ol.scn-hedges { margin: .5rem 0 0; padding-left: 1.3rem; }
ol.scn-hedges li { margin: .4rem 0; color: var(--ink-soft); }
ol.scn-hedges li:first-child { color: var(--ink); font-weight: 500; }
.scn-watch { margin-top: 1.2rem; padding: .8rem 1rem; background: var(--gold-soft); border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0; font-size: .9rem; color: var(--ink-soft); }
