/* mai-multe-femei-decat-barbati — Mineral Bathymetry & Copperplate Survey System (Dual Theme, WCAG AAA) */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-normal-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-normal-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic-az.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic-ro.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/IBMPlexSans-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ui: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Light Theme — Warm Rag Paper & Copperplate Verdigris Ink (every text pair >= 7.5:1 WCAG AAA) */
  --bg: #f6f3ec;
  --bg-elev: #ede8dd;
  --surface: #fbf9f4;
  --surface-alt: #e6dfd1;
  --map-sea: #dfe6e9;
  --map-empty: #cfc7b7;
  --fg: #171614;          /* 16.0:1 on --bg */
  --fg-sec: #38342e;      /* 10.8:1 on --bg */
  --mut: #47423b;         /*  8.6:1 on --bg & >7.8:1 on --bg-elev */
  --line: #b8ae9c;
  --line-soft: #d6cfc0;
  --male: #823605;        /*  8.0:1 on --bg & >7.3:1 on --surface */
  --male-fill: rgba(168, 76, 16, 0.19);
  --female: #07504c;      /*  8.6:1 on --bg & >7.8:1 on --surface */
  --female-fill: rgba(11, 102, 97, 0.19);
  --parity: #171614;
  --cohort: #6b215c;      /*  8.6:1 on --bg */
  --acc: #07504c;
  --focus: #07504c;
  --topbar-bg: #f6f3ec;
  --col: 70rem;
  --measure: 42rem;
  --topbar-h: 44px;
  --to-top-bg: #fbf9f4;
  --to-top-fg: #171614;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e13;
  --bg-elev: #121720;
  --surface: #141a24;
  --surface-alt: #1c2534;
  --map-sea: #070a0f;
  --map-empty: #2a3446;
  --fg: #f4f1eb;          /* 16.9:1 on --bg */
  --fg-sec: #d2cdc3;      /* 11.9:1 on --bg */
  --mut: #b6b0a5;         /*  8.9:1 on --bg & 7.4:1 on --surface */
  --line: #3c495f;
  --line-soft: #252f40;
  --male: #f4aa67;        /* 10.1:1 on --bg */
  --male-fill: rgba(244, 170, 103, 0.22);
  --female: #66ded0;      /* 11.8:1 on --bg */
  --female-fill: rgba(102, 222, 208, 0.22);
  --parity: #fff8e7;
  --cohort: #f7d060;
  --acc: #66ded0;
  --focus: #66ded0;
  --topbar-bg: #0b0e13;
  --to-top-bg: #141a24;
  --to-top-fg: #f4f1eb;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0e13;
    --bg-elev: #121720;
    --surface: #141a24;
    --surface-alt: #1c2534;
    --map-sea: #070a0f;
    --map-empty: #2a3446;
    --fg: #f4f1eb;
    --fg-sec: #d2cdc3;
    --mut: #b6b0a5;
    --line: #3c495f;
    --line-soft: #252f40;
    --male: #f4aa67;
    --male-fill: rgba(244, 170, 103, 0.22);
    --female: #66ded0;
    --female-fill: rgba(102, 222, 208, 0.22);
    --parity: #fff8e7;
    --cohort: #f7d060;
    --acc: #66ded0;
    --focus: #66ded0;
    --topbar-bg: #0b0e13;
    --to-top-bg: #141a24;
    --to-top-fg: #f4f1eb;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
svg[hidden] { display: none !important; }

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.64;
  scroll-padding-top: calc(var(--topbar-h) + var(--browser-safe-top, env(safe-area-inset-top, 0px)) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--female);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2.5px;
}
a:hover { color: var(--male); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: -120px;
  left: 12px;
  z-index: 950;
  padding: 10px 14px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

/* Scroll progress hairline */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 620;
  pointer-events: none;
}
.scroll-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--male) 0%, var(--female) 100%);
}

/* Quiet single-line topbar with embedded-browser top inset protection */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--browser-safe-top, env(safe-area-inset-top, 0px)) 16px 0;
  min-height: calc(var(--topbar-h) + var(--browser-safe-top, env(safe-area-inset-top, 0px)));
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line-soft);
  font: 500 0.86rem/1 var(--ui);
}

.topbar-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  min-height: 40px;
  white-space: nowrap;
}
.topbar-home:hover { color: var(--female); }
.topbar-glyph {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  margin-right: 8px;
}
.topbar-nav a {
  color: var(--fg-sec);
  text-decoration: none;
  padding: 8px 2px;
  white-space: nowrap;
}
.topbar-nav a:hover { color: var(--fg); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lang-switch, .theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--fg-sec);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font: 600 0.8rem/1 var(--ui);
  text-decoration: none;
  cursor: pointer;
}
.theme-btn svg {
  stroke: var(--fg);
  stroke-width: 2.2;
}
.lang-switch:hover, .theme-btn:hover {
  border-color: var(--fg);
  background: var(--surface-alt);
  color: var(--fg);
}

@media (pointer: coarse) {
  .lang-switch, .theme-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 900px) {
  .topbar-nav { display: none; }
}

/* Main containers */
main {
  display: block;
  padding-bottom: 3rem;
}

.wrap-wide {
  width: min(var(--col), calc(100% - 32px));
  margin-inline: auto;
}

.wrap-prose {
  width: min(var(--measure), calc(100% - 32px));
  margin-inline: auto;
}

/* Opening header — crisp, literary, immediate (fits full Lexis 1950-2025 above fold on 1440x900) */
.hero-head {
  padding: clamp(0.65rem, 1.4vw, 1.05rem) 0 0.5rem;
}

/* Override chrome.css reading rail column width (--col: 70rem) & hide unless wide outer margin exists (FM-1018) */
.rail {
  --col: 70rem !important;
  --gut: 1.1rem !important;
}
@media (max-width: 1320px) {
  .rail { display: none !important; }
}

.kicker {
  margin: 0 0 0.35rem;
  font: 600 0.76rem/1.3 var(--ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
}

.hero-head h1 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.58rem, 2.85vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.018em;
  color: var(--fg);
  max-width: 56rem;
}

.deck {
  margin: 0;
  font-size: clamp(0.96rem, 1.25vw, 1.06rem);
  line-height: 1.48;
  color: var(--fg-sec);
  max-width: 56rem;
}
.deck strong { color: var(--fg); font-weight: 600; }

/* Own-Case Lookup Bar — docked cleanly above the Horizon Plate */
.own-bar {
  margin-top: 0.55rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--fg);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  position: relative;
}
.field-group label {
  font: 600 0.76rem/1.2 var(--ui);
  color: var(--fg-sec);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field-input {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font: 500 0.92rem/1.2 var(--ui);
  border-radius: 2px;
}
@media (pointer: coarse) {
  .field-input { min-height: 44px; font-size: 1rem; }
}
.field-input::placeholder { color: var(--mut); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 420;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--fg-sec);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  margin: 0;
  padding: 4px 0;
  list-style: none;
}
.search-dropdown li button {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--fg);
  text-align: left;
  font: 500 0.9rem/1.3 var(--ui);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.search-dropdown li button:hover,
.search-dropdown li button[aria-selected="true"] {
  background: var(--surface-alt);
}
.search-meta {
  font-size: 0.78rem;
  color: var(--mut);
  white-space: nowrap;
}

.preset-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 0.45rem;
}
.preset-label {
  font-size: 0.77rem;
  color: var(--mut);
  margin-right: 2px;
}
.preset-btn {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-sec);
  font: 500 0.8rem/1.1 var(--ui);
  cursor: pointer;
  border-radius: 2px;
}
.preset-btn:hover {
  border-color: var(--fg);
  color: var(--fg);
}
.preset-btn[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  font-weight: 600;
}

.reset-btn {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg);
  font: 600 0.83rem/1.1 var(--ui);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 2px;
}
.reset-btn:hover {
  border-color: var(--fg);
}

@media (max-width: 760px) {
  .own-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
  }
  .preset-btn {
    min-height: 44px;
    padding: 6px 12px;
  }
}

/* Survey Instrument Plates */
.plate {
  margin-top: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--fg);
}

.plate-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.55rem 0.95rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-elev);
}
.plate-title {
  margin: 0;
  font: 600 0.9rem/1.3 var(--ui);
  color: var(--fg);
}
.plate-sub {
  font-weight: 400;
  color: var(--mut);
  margin-left: 6px;
}

.legend-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--fg-sec);
}
.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.leg-swatch {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  display: inline-block;
  border: 1px solid var(--line);
}
.leg-swatch.sw-male { background: var(--male); }
.leg-swatch.sw-female { background: var(--female); }
.leg-line {
  width: 18px;
  height: 2.5px;
  background: var(--parity);
  display: inline-block;
}
.leg-line.sw-cohort {
  background: var(--cohort);
  height: 3px;
}
.leg-line.sw-dashed {
  background: transparent;
  height: 0;
  border-top: 2px dashed var(--mut);
}

.canvas-stage {
  position: relative;
  width: 100%;
  background: var(--bg-elev);
}
.canvas-stage canvas {
  display: block;
  width: 100%;
  touch-action: pan-y;
}

.lexis-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-sec);
  min-height: 44px;
}
.lexis-readout strong { color: var(--fg); }

/* Year scrubber + play button */
.time-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-elev);
}
.play-btn {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--fg-sec);
  background: var(--surface);
  color: var(--fg);
  font: 600 0.84rem/1 var(--ui);
  cursor: pointer;
  border-radius: 2px;
  white-space: nowrap;
}
.play-btn[data-on="1"] {
  background: var(--fg);
  color: var(--bg);
}
.year-slider-wrap {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.year-slider {
  flex: 1;
  min-height: 44px;
  accent-color: var(--acc);
  cursor: pointer;
}
.year-badge {
  font: 700 1.05rem/1 var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  min-width: 3.2rem;
  text-align: right;
}

/* Personal Result Banner & Share Row directly under the chart */
.own-result {
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.own-result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.own-verdict {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.52;
  color: var(--fg);
  max-width: 54rem;
}
.own-verdict .v-male { color: var(--male); font-weight: 700; }
.own-verdict .v-female { color: var(--female); font-weight: 700; }
.own-verdict .v-note { color: var(--mut); font-size: 0.92em; }
.table-filter-input { max-width: 340px; }

.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line-soft);
}
.share-label {
  font-size: 0.82rem;
  color: var(--mut);
  margin-right: 4px;
}
.share-icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.share-icon-btn:hover {
  border-color: var(--fg);
  color: var(--acc);
}
.share-icon-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
@media (pointer: coarse) {
  .share-icon-btn {
    width: 44px;
    height: 44px;
  }
}
.share-status {
  font-size: 0.82rem;
  color: var(--female);
  font-weight: 600;
  min-height: 1.2em;
}

/* Editorial Chapters */
.chapter {
  padding-top: clamp(2.4rem, 5vw, 3.8rem);
}
.chapter h2 {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.38rem, 2.5vw, 1.92rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--fg);
}
.chapter p {
  margin: 0 0 1.05rem;
  color: var(--fg-sec);
  font-size: 1.03rem;
}
.chapter p strong {
  color: var(--fg);
  font-weight: 600;
}

.callout-note {
  margin: 1.2rem 0;
  padding: 0.85rem 1.05rem;
  border-left: 3px solid var(--acc);
  background: var(--bg-elev);
  font-size: 0.95rem;
  color: var(--fg-sec);
}
.callout-note strong { color: var(--fg); }

/* Decomposition comparison strip (World vs World ex-CHN/IND/GCC) */
.decomp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 1.4rem 0;
}
.decomp-cell {
  background: var(--surface);
  padding: 1.05rem 1.15rem;
}
.decomp-kicker {
  font: 600 0.76rem/1.3 var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mut);
  margin: 0 0 0.35rem;
}
.decomp-num {
  font: 700 clamp(1.45rem, 2.5vw, 2rem)/1.15 var(--serif);
  color: var(--fg);
  margin: 0 0 0.4rem;
  font-variant-numeric: tabular-nums;
}
.decomp-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.48;
  color: var(--fg-sec);
}
@media (max-width: 680px) {
  .decomp-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Dual-Scale Interactive Map + Side-by-Side Answer Card */
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.75rem 1rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line-soft);
}
.tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tab-btn {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg-sec);
  font: 600 0.82rem/1.15 var(--ui);
  cursor: pointer;
  border-radius: 2px;
}
.tab-btn:hover {
  border-color: var(--fg);
  color: var(--fg);
}
.tab-btn[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
@media (pointer: coarse) {
  .tab-btn { min-height: 44px; }
}
@media (max-width: 640px) {
  .tab-btn {
    padding: 5px 9px;
    font-size: 0.77rem;
  }
}

/* Map Colorbar Legend Strip — 100 parity anchored dead-center on midpoint tick */
.map-legend-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 0.55rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-sec);
}
.colorbar-mid-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.colorbar-mid-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: var(--fg);
}
.colorbar-ramp-box {
  position: relative;
  width: 164px;
  height: 11px;
}
.colorbar-ramp {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--female) 0%, var(--surface-alt) 50%, var(--male) 100%);
}
.colorbar-mid-tick {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  transform: translateX(-50%);
  background: var(--fg);
}
.nowrap {
  white-space: nowrap;
}

.map-split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  align-items: stretch;
}
.map-stage-wrap {
  position: relative;
  border-right: 1px solid var(--line-soft);
  background: var(--map-sea);
  min-height: 430px;
}
.map-stage-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: crosshair;
}
.map-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--fg-sec);
  color: var(--fg);
  font-size: 0.8rem;
  line-height: 1.35;
  max-width: 240px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.map-hint {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 9px;
  background: var(--topbar-bg);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--fg-sec);
  pointer-events: none;
}
@media (max-width: 760px) {
  .map-hint {
    position: static;
    display: block;
    padding: 6px 10px;
    border: 0;
    border-top: 1px solid var(--line-soft);
    background: var(--bg-elev);
  }
}

.map-card {
  padding: 1.05rem 1.15rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}
.map-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.map-card h3 {
  margin: 0;
  font: 700 1.25rem/1.2 var(--serif);
  color: var(--fg);
}
.map-card-sub {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--mut);
}
.map-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.m-stat-lbl {
  font-size: 0.75rem;
  color: var(--mut);
  display: block;
}
.m-stat-val {
  font: 700 1.12rem/1.25 var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.flag-badge {
  padding: 0.55rem 0.75rem;
  background: var(--bg-elev);
  border-left: 3px solid var(--male);
  font-size: 0.82rem;
  line-height: 1.42;
  color: var(--fg-sec);
}
.mini-curve-wrap canvas {
  display: block;
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
}

@media (max-width: 860px) {
  .map-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .map-stage-wrap {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    min-height: 330px;
  }
}

/* Dual Audit Comparison Grid (Germany 2021-2025 + Romania ID Card vs Pillow) */
.audit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
}
@media (max-width: 820px) {
  .audit-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Server-rendered Reference Table (opens short at 12 rows, expands cleanly) */
.table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 1rem 0 0.65rem;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}
.data-table th {
  background: var(--bg-elev);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}
.data-table td.num, .data-table th.num {
  text-align: right;
}
.data-table tbody tr:hover {
  background: var(--bg-elev);
}
.table-more-btn {
  margin-top: 0.75rem;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font: 600 0.86rem/1 var(--ui);
  cursor: pointer;
  border-radius: 2px;
}
.table-more-btn:hover { border-color: var(--fg); }

/* Method & Sources + Related links */
.method-box {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.sources-list {
  padding-left: 1.2rem;
  color: var(--fg-sec);
  font-size: 0.92rem;
}
.sources-list li { margin-bottom: 0.55rem; }

.related-links {
  margin-top: 1.6rem;
  padding: 1rem 1.15rem;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
}
.related-links h3 {
  margin: 0 0 0.5rem;
  font: 600 0.9rem/1.3 var(--ui);
  color: var(--fg);
}
.related-links ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.92rem;
}
.related-links li { margin-bottom: 0.35rem; }

/* Canonical Portfolio Footer */
footer.site-footer {
  margin-top: 3rem;
  padding: 1.6rem 16px 4.2rem;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 0.88rem;
  color: var(--mut);
}
.footer-inner {
  width: min(var(--col), 100%);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}
.footer-inner a {
  color: var(--fg);
  font-weight: 500;
}

/* Reduced motion — strict zero-duration transitions so probe-browser-insets reads synchronously */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
