/* 15 mmHg — Compresiile toracice & perfuzia coronariană */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/fraunces-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D1, U+02D7, U+02DD, U+02EE, U+0300-030F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/fraunces-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-serif-4-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D1, U+02D7, U+02DD, U+02EE, U+0300-030F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-serif-4-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-serif-4-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D1, U+02D7, U+02DD, U+02EE, U+0300-030F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-serif-4-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("fonts/IBMPlexSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D1, U+02D7, U+02DD, U+02EE, U+0300-030F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("fonts/IBMPlexSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexMono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D1, U+02D7, U+02DD, U+02EE, U+0300-030F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexMono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/IBMPlexMono-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D1, U+02D7, U+02DD, U+02EE, U+0300-030F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/IBMPlexMono-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Light: Netter Anatomical Plate · Dark: Cath-Lab Fluoroscopy */
:root {
  color-scheme: light dark;
  --col: 62rem;
  --prose: 42rem;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-ui: "Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --bg-light: #f7f3ea;
  --bg-dark: #070b12;
  --surface-light: #fbf8f2;
  --surface-dark: #0d1421;
  --surface-alt-light: #efe9dc;
  --surface-alt-dark: #131c2e;
  --ink-light: #191612;
  --ink-dark: #edf2f7;
  --muted-light: #5c5448;
  --muted-dark: #94a3b8;
  --line-light: rgba(25, 22, 18, 0.14);
  --line-dark: rgba(237, 242, 247, 0.14);
  --line-soft-light: rgba(25, 22, 18, 0.08);
  --line-soft-dark: rgba(237, 242, 247, 0.08);

  --art-light: #b8252a;
  --art-dark: #ff4d5a;
  --ven-light: #24538a;
  --ven-dark: #4e89cf;
  --gold-light: #9c6608;
  --gold-dark: #f5b841;
  --ecg-light: #0d7a5f;
  --ecg-dark: #29e3b1;

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-alt: var(--surface-alt-light);
  --ink: var(--ink-light);
  --muted: var(--muted-light);
  --line: var(--line-light);
  --line-soft: var(--line-soft-light);
  --art: var(--art-light);
  --ven: var(--ven-light);
  --gold: var(--gold-light);
  --ecg: var(--ecg-light);

  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-alt: var(--surface-alt-dark);
    --ink: var(--ink-dark);
    --muted: var(--muted-dark);
    --line: var(--line-dark);
    --line-soft: var(--line-soft-dark);
    --art: var(--art-dark);
    --ven: var(--ven-dark);
    --gold: var(--gold-dark);
    --ecg: var(--ecg-dark);
  }

  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-alt: light-dark(var(--surface-alt-light), var(--surface-alt-dark));
    --ink: light-dark(var(--ink-light), var(--ink-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --line: light-dark(var(--line-light), var(--line-dark));
    --line-soft: light-dark(var(--line-soft-light), var(--line-soft-dark));
    --art: light-dark(var(--art-light), var(--art-dark));
    --ven: light-dark(var(--ven-light), var(--ven-dark));
    --gold: light-dark(var(--gold-light), var(--gold-dark));
    --ecg: light-dark(var(--ecg-light), var(--ecg-dark));
  }

  --to-top-bg: var(--surface);
  --to-top-fg: var(--ink);
  accent-color: var(--ecg);
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
}
:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

/* Explicit fallback when :has() is absent or data-theme is set */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--bg-dark);
  --surface: var(--surface-dark);
  --surface-alt: var(--surface-alt-dark);
  --ink: var(--ink-dark);
  --muted: var(--muted-dark);
  --line: var(--line-dark);
  --line-soft: var(--line-soft-dark);
  --art: var(--art-dark);
  --ven: var(--ven-dark);
  --gold: var(--gold-dark);
  --ecg: var(--ecg-dark);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-alt: var(--surface-alt-light);
  --ink: var(--ink-light);
  --muted: var(--muted-light);
  --line: var(--line-light);
  --line-soft: var(--line-soft-light);
  --art: var(--art-light);
  --ven: var(--ven-light);
  --gold: var(--gold-light);
  --ecg: var(--ecg-light);
}

[hidden] {
  display: none !important;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 1rem + 0.25vw, 1.16rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--surface);
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  border: 1px solid var(--line);
}
.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

/* Slim topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--art);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--art) 22%, transparent);
}
.nav-links {
  display: none;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a:focus-visible {
  color: var(--ink);
}
@media (min-width: 820px) {
  .nav-links { display: flex; }
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.lang-link, .theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
}
.theme-btn {
  min-width: 34px;
  padding: 0.25rem;
}
.lang-link:hover, .theme-btn:hover {
  border-color: var(--ink);
}

/* Branch theme toggle icons via meta[color-scheme] / html[data-theme] */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  .theme-icon-sun { display: inline; }
  .theme-icon-moon { display: none; }
}
html[data-theme="dark"] .theme-icon-sun { display: inline; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: inline; }

.progress-track {
  height: 2px;
  background: transparent;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 100%;
  background: var(--art);
  transform-origin: left center;
  transform: scaleX(0);
}

/* Reading rail */
.rail {
  display: none;
}
@media (min-width: 1280px) {
  .rail {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
  }
  .rail a {
    position: relative;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    text-decoration: none;
  }
  .rail a::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1.5px solid var(--muted);
    background: transparent;
  }
  .rail a[aria-current="true"]::before {
    background: var(--art);
    border-color: var(--art);
    transform: scale(1.2);
  }
  .rail-label {
    position: absolute;
    right: 1.55rem;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
  }
  .rail a:hover .rail-label,
  .rail a:focus-visible .rail-label {
    opacity: 1;
  }
}

/* Main container */
main {
  padding: 1.4rem 1rem 4rem;
}
.hero, .section-block {
  max-width: var(--col);
  margin: 0 auto 2.8rem;
}
.prose {
  max-width: var(--prose);
}
.kicker {
  margin: 0 0 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ecg);
}
h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.35rem + 2.3vw, 3.05rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.015em;
  max-width: 24ch;
}
.deck {
  margin: 0 0 1.25rem;
  max-width: var(--prose);
  color: var(--muted);
  font-size: clamp(1.04rem, 0.98rem + 0.35vw, 1.2rem);
}
h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.42rem, 1.2rem + 1vw, 2rem);
  line-height: 1.18;
  font-weight: 600;
  max-width: 30ch;
}
h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
}

/* Preset banner when opening /c/<preset>/ */
.preset-banner {
  max-width: var(--col);
  margin: 0 auto 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
}

/* Living Stage Panel */
.stage-panel {
  max-width: var(--col);
  margin: 0 auto 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}
.stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 820px) {
  .stage-grid {
    grid-template-columns: 1.02fr 1.18fr;
    align-items: stretch;
  }
}
.canvas-wrap {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 60%, var(--surface));
  overflow: hidden;
}
.canvas-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.canvas-caption span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}
canvas.stage-canvas {
  display: block;
  width: 100%;
  height: 290px;
}
@media (max-width: 520px) {
  canvas.stage-canvas {
    height: 240px;
  }
}

/* Controls & interactive push button */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line-soft);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn-primary {
  background: var(--ecg);
  color: #061310;
  border-color: transparent;
  font-weight: 600;
}
.btn-push {
  background: var(--art);
  color: #ffffff;
  border-color: transparent;
  font-weight: 600;
}
.btn-push[data-active="true"] {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.btn-chip {
  min-height: 36px;
  padding: 0.35rem 0.72rem;
  font-size: 0.82rem;
  background: transparent;
}
.btn-chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.sliders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 0.9rem;
}
@media (min-width: 720px) {
  .sliders-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.slider-box {
  background: color-mix(in srgb, var(--bg) 50%, var(--surface));
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}
.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.slider-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
}
input[type="range"] {
  width: 100%;
  cursor: pointer;
}
.slider-hint {
  margin: 0.25rem 0 0;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  color: var(--muted);
}

/* Telemetry Readout Strip */
.readout-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 0.9rem;
}
@media (min-width: 720px) {
  .readout-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}
.stat-cell {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: color-mix(in srgb, var(--bg) 45%, var(--surface));
}
.stat-k {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  color: var(--muted);
}
.stat-v {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 0.15rem;
}
.stat-v[data-state="ok"] { color: var(--ecg); }
.stat-v[data-state="warn"] { color: var(--gold); }
.stat-v[data-state="bad"] { color: var(--art); }

/* Section cards */
.section-card {
  max-width: var(--col);
  margin: 1rem auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}
canvas.wide-canvas {
  display: block;
  width: 100%;
  height: 230px;
}
@media (max-width: 520px) {
  canvas.wide-canvas { height: 210px; }
}

/* Survival Bars & Agonal Callout */
.cohort-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
}
@media (min-width: 740px) {
  .cohort-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.cohort-item {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 0.8rem 0.9rem;
  background: color-mix(in srgb, var(--bg) 40%, var(--surface));
}
.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
  margin: 0.35rem 0 0.55rem;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
}
.agonal-callout {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 9%, var(--surface));
  border-radius: 0 8px 8px 0;
}

/* AED Monitor */
.aed-stage {
  max-width: var(--col);
  margin: 1rem auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}
canvas.aed-canvas {
  display: block;
  width: 100%;
  height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
}
.aed-status {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.aed-status[data-shock="yes"] {
  border-color: var(--ecg);
  background: color-mix(in srgb, var(--ecg) 10%, var(--surface));
}
.aed-status[data-shock="no"] {
  border-color: var(--art);
  background: color-mix(in srgb, var(--art) 10%, var(--surface));
}

/* Responsive table (modern-web-guidance: container query + sticky headers + accessible labels) */
.table-wrapper {
  max-width: var(--col);
  margin: 1rem auto 0;
  overflow: auto;
  max-inline-size: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  container-type: inline-size;
}
.table-wrapper table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-ui);
  font-size: 0.88rem;
}
.table-wrapper caption {
  text-align: left;
  padding: 0.75rem 0.9rem 0.45rem;
  font-weight: 600;
  color: var(--ink);
}
.table-wrapper thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: var(--surface-alt);
}
.table-wrapper th, .table-wrapper td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.table-wrapper tbody th {
  font-weight: 600;
  color: var(--ink);
}
@container (width < 600px) {
  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
  }
  .table-wrapper thead {
    display: none;
  }
  .table-wrapper tbody tr {
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0.75rem;
  }
  .table-wrapper th, .table-wrapper td {
    border-bottom: 0;
    padding: 0.25rem 0;
  }
  .table-wrapper td:nth-child(2)::before {
    content: var(--label-2) ": ";
    font-weight: 600;
    color: var(--muted);
  }
  .table-wrapper td:nth-child(3)::before {
    content: var(--label-3) ": ";
    font-weight: 600;
    color: var(--muted);
  }
  .table-wrapper td:nth-child(4)::before {
    content: var(--label-4) ": ";
    font-weight: 600;
    color: var(--muted);
  }
}

/* Emergency steps & sources */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.65rem;
  max-width: var(--prose);
}
.steps-list li {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface);
}
.step-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--art);
  font-size: 0.92rem;
}

.sources-list {
  max-width: var(--prose);
  padding-left: 1.25rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.sources-list li { margin-bottom: 0.45rem; }
.sources-list a { color: var(--ink); }

/* Share row */
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-family: var(--font-ui);
  font-size: 0.84rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.share-btn:hover, .share-btn:focus-visible {
  border-color: var(--art);
  color: var(--art);
}
@media (pointer: coarse) {
  .share-btn { width: 44px; height: 44px; }
}
.share-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ecg);
}

/* Smooth optional transitions only when motion is not reduced */
@media (prefers-reduced-motion: no-preference) {
  .btn, .share-btn, .lang-link, .theme-btn {
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
  }
}

.site-footer {
  max-width: var(--col);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}
.site-footer a {
  color: var(--ink);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
