/* ============================================================
   Niepłodność - kompendium
   Paleta: głęboka zieleń petrol + glina + papier z zielonym tłem
   Typografia: Spectral (display) + Figtree (tekst i UI)
   ============================================================ */

:root {
  --bg: #f5f7f2;
  --bg-elev: #fbfcf9;
  --surface: #ffffff;
  --ink: #14201d;
  --ink-soft: #37453f;
  --muted: #5a6862;
  --line: #dde3db;
  --line-strong: #c6d1c7;
  --brand: #0e3b36;
  --brand-2: #16544b;
  --brand-ink: #eef4ef;
  --accent: #a8452a;
  --accent-hover: #8d3820;
  --accent-ink: #ffffff;
  --accent-soft: #f7e9e2;
  --info-bg: #e9f1ed;
  --info-line: #c3d8cf;
  --warn-bg: #fbeee2;
  --warn-line: #e6c19e;
  --tip-bg: #eef2e4;
  --tip-line: #d3dcbd;
  --code-bg: #e8ece5;
  --shadow-sm: 0 1px 2px rgba(20, 32, 29, .06);
  --shadow-md: 0 6px 20px -8px rgba(20, 32, 29, .18);
  --radius: 6px;
  --radius-lg: 10px;
  --header-h: 66px;
  --sidebar-w: 288px;
  --measure: 42rem;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --sans: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Spectral", "Iowan Old Style", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1210;
    --bg-elev: #0f1a17;
    --surface: #111d1a;
    --ink: #e9efe9;
    --ink-soft: #cbd6cf;
    --muted: #a2b0a9;
    --line: #22302c;
    --line-strong: #31433d;
    --brand: #0c332f;
    --brand-2: #175a50;
    --brand-ink: #e8f1ec;
    --accent: #e79b7d;
    --accent-hover: #f0ae92;
    --accent-ink: #1a0e09;
    --accent-soft: #24160f;
    --info-bg: #12241f;
    --info-line: #24443a;
    --warn-bg: #2a1d13;
    --warn-line: #4a3320;
    --tip-bg: #1a2416;
    --tip-line: #2f3f26;
    --code-bg: #16211d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, .7);
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 18px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- header ---------- */
.app-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .35;
  pointer-events: none;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand .brand-mark {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-2px);
}
.brand small {
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.header-spacer { flex: 1; }

.search-wrap { position: relative; width: min(340px, 38vw); }
.search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: .95rem;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 16%, transparent);
}
.search-icon {
  position: absolute;
  right: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(460px, 86vw);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 70;
}
.search-results.is-open { display: block; }
.search-hit {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.35;
}
.search-hit span { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.search-hit:hover, .search-hit:focus-visible { background: var(--bg-elev); color: var(--ink); }
.search-empty { padding: 14px 12px; color: var(--muted); font-size: .92rem; }

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
}

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1240px;
  margin: 0 auto;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 20px 64px 24px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 26px; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-group + .nav-group { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-group-title {
  margin: 0 0 7px;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-link {
  display: block;
  padding: 6px 10px 6px 11px;
  margin-left: -11px;
  border-radius: 5px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.4;
  transition: background 140ms var(--ease-out), color 140ms var(--ease-out);
}
.nav-link:hover { background: var(--bg-elev); color: var(--ink); }
.nav-link.is-active {
  background: var(--info-bg);
  color: var(--brand);
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .nav-link.is-active { color: var(--accent); background: var(--accent-soft); }
}
.sidebar-foot {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.55;
}
.sidebar-foot strong { color: var(--ink-soft); font-weight: 600; }

.sidebar-search { display: none; margin-bottom: 22px; }

/* ---------- main ---------- */
.main {
  min-width: 0;
  padding: 30px clamp(20px, 4vw, 52px) 96px;
}
.main:focus { outline: none; }
.view { max-width: 860px; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, .9fr);
  min-height: 452px;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 54px;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: clamp(32px, 4vw, 56px);
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 4.6vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -.025em;
  color: #f4f8f2;
  text-wrap: balance;
}
.hero p {
  margin: 0;
  max-width: 34ch;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #d3e2d9;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  margin-top: 8px;
  padding: 12px 22px;
  background: #f2ede1;
  color: #123f39;
  font-size: .98rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  transition: background 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.hero-cta:hover { background: #fffdf6; color: #0e3b36; }
.hero-cta:focus-visible { outline: 2px solid #f2ede1; outline-offset: 3px; }
.hero-cta:active { transform: scale(.98); }
.hero-cta svg { transition: transform 200ms var(--ease-out); }
.hero-cta:hover svg { transform: translateX(3px); }
.hero-media { position: relative; overflow: hidden; }
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
  filter: saturate(.82) sepia(.1) contrast(1.03);
  animation: heroReveal 900ms var(--ease-out) both;
}
@keyframes heroReveal {
  from { clip-path: inset(0 0 0 100%); transform: scale(1.04); }
  to { clip-path: inset(0 0 0 0); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media img { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- home sections ---------- */
.start-here { margin-bottom: 52px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 9px;
  margin-bottom: 20px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.42rem;
  font-weight: 600;
  letter-spacing: -.015em;
}
.section-head span { font-size: .8rem; color: var(--muted); }

.path { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 2px; }
.path li { counter-increment: step; }
.path a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 17px 4px 17px 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  text-decoration: none;
}
.path a::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.5;
}
.path strong { font-weight: 600; font-size: 1.08rem; line-height: 1.45; }
.path small { grid-column: 2; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.path a:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.index-section { margin-bottom: 44px; }
.index-section h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.index-section p.lede { margin: 0 0 16px; color: var(--muted); font-size: .95rem; max-width: 60ch; }
.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 44px;
}
.index-list li { break-inside: avoid; }
.index-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--line-strong);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .99rem;
  line-height: 1.45;
  transition: color 140ms var(--ease-out);
}
.index-list a:hover { color: var(--accent); }
.index-list a .n { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.editorial {
  background: var(--accent-soft);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 28px 30px;
  margin: 10px 0 48px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.editorial h2 { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
.editorial p { margin: 0 0 10px; color: var(--ink-soft); font-size: 1rem; }
.editorial p:last-child { margin-bottom: 0; }

/* ---------- article ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-soft); margin-bottom: 14px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

.article-head { margin-bottom: 26px; }
.article-head h1 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.95rem, 3.9vw, 2.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.022em;
  text-wrap: balance;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: .82rem;
  color: var(--ink-soft);
  letter-spacing: .01em;
}
.article-meta .dot { opacity: .5; }

.toc {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 24px 18px;
  margin: 0 0 34px;
}
.toc h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: -.01em;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
}
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 0; font-size: .95rem; line-height: 1.55; padding: 3px 0; }
.toc li::marker { color: var(--muted); font-size: .85em; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.article-head, .toc, .prose, .article-foot, .read-next { max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.05em; }
.prose h2 {
  margin-top: 2.1em;
  margin-bottom: .55em;
  font-family: var(--serif);
  font-size: 1.52rem;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.prose h2::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin-top: 9px;
  background: var(--accent);
  opacity: .85;
}
.prose h3 {
  margin-top: 1.7em;
  margin-bottom: .25em;
  font-family: var(--sans);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.4;
}
.prose p { margin: 0; font-size: 1.06rem; line-height: 1.72; color: var(--ink); }
.prose ul, .prose ol { margin: 0; padding-left: 22px; }
.prose li { margin: 6px 0; font-size: 1.04rem; line-height: 1.66; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 600; }
.prose a { color: var(--accent); }
.prose blockquote {
  margin: 1.4em 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose code { background: var(--code-bg); padding: 1px 5px; border-radius: 3px; font-size: .9em; }

.table-responsive { overflow-x: auto; margin: 1.4em 0; }
.prose table, table.error-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  line-height: 1.5;
  min-width: 520px;
}
.prose th, table.error-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--brand);
}
.prose td, table.error-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tbody tr:nth-child(even) td { background: var(--bg-elev); }

.info-box, .warning-box, .key-takeaways, .tip-box {
  margin: 1.5em 0;
  padding: 16px 18px;
  border: 1px solid var(--info-line);
  border-radius: var(--radius);
  background: var(--info-bg);
  color: var(--ink);
  font-size: .99rem;
  line-height: 1.62;
}
.info-box > :first-child, .warning-box > :first-child,
.key-takeaways > :first-child, .tip-box > :first-child { margin-top: 0; }
.info-box > :last-child, .warning-box > :last-child,
.key-takeaways > :last-child, .tip-box > :last-child { margin-bottom: 0; }
.info-box strong, .warning-box strong { color: var(--ink); }
.warning-box { background: var(--warn-bg); border-color: var(--warn-line); }
.tip-box, .key-takeaways { background: var(--tip-bg); border-color: var(--tip-line); }
.key-takeaways ul { padding-left: 18px; }
.key-takeaways li { font-size: .98rem; }

details.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
details.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 26px 12px 0;
  position: relative;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--ink);
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 2px; top: 10px;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 180ms var(--ease-out);
}
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item .faq-a { padding: 0 0 14px; color: var(--ink-soft); font-size: 1rem; }
details.faq-item .faq-a > :first-child { margin-top: 0; }

.prose dl { margin: 1.4em 0; }
.prose dt { font-weight: 600; margin-top: 1.05em; font-size: 1.02rem; color: var(--ink); }
.prose dd { margin: 4px 0 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.65; }

.article-foot { margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 34px; }
.prevnext a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.prevnext a:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.prevnext .k { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.prevnext .t { font-size: .96rem; font-weight: 600; line-height: 1.4; }
.prevnext .next { text-align: right; }

.read-next h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 1.24rem; font-weight: 600; }
.read-next ul { list-style: none; margin: 0; padding: 0; }
.read-next li { border-bottom: 1px dotted var(--line-strong); }
.read-next a { display: block; padding: 9px 0; color: var(--ink-soft); text-decoration: none; font-size: .99rem; }
.read-next a:hover { color: var(--accent); }

.disclaimer {
  margin-top: 30px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .84rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 60px;
  padding: 26px 0 8px;
  border-top: 1px solid var(--line);
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.7;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- overlay / mobile ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 15, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out);
  z-index: 55;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

/* ---------- consent bar ---------- */
.vd-cookie-bar {
  position: fixed;
  right: 24px; left: auto; bottom: 24px;
  max-width: 440px;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  font-size: .87rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.vd-cookie-bar.is-visible { display: flex; }
.vd-cookie-bar p { margin: 0; max-width: 62ch; }
.vd-cookie-bar a { color: var(--accent); }
.vd-cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.vd-cookie-actions button {
  padding: 8px 15px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.vd-cookie-actions button:hover { background: var(--bg-elev); }
.vd-cookie-actions button:active { transform: scale(.97); }
.vd-cookie-actions .accept { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.vd-cookie-actions .accept:hover { background: var(--brand-2); }

/* ---------- motion ---------- */
.view-enter { animation: fadeUp 300ms var(--ease-out) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view-enter { animation: none; }
  .prevnext a:hover { transform: none; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --sidebar-w: 260px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-media { order: -1; height: 240px; }
  .hero-copy { padding: 30px 28px 34px; }
  .hero p { max-width: 46ch; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    height: 100dvh;
    width: min(330px, 86vw);
    background: var(--bg);
    z-index: 56;
    padding: 22px 20px 40px;
    transform: translateX(-102%);
    transition: transform 260ms var(--ease-in-out);
    border-right: 1px solid var(--line-strong);
    overflow-y: auto;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-search { display: block; }
  .main { padding: 24px 20px 80px; }
  .header-spacer { display: none; }
  .search-wrap { width: 100%; margin-left: auto; max-width: 260px; }
  .brand small { display: none; }
  .index-list { columns: 1; }
  .editorial { grid-template-columns: 1fr; gap: 10px; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext .next { text-align: left; }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .app-header .search-wrap { display: none; }
  .vd-cookie-bar { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .sidebar-search { margin-bottom: 18px; }
  .app-header { gap: 12px; padding: 0 16px; }
  .brand { font-size: 1.14rem; }
  .search-wrap { max-width: 150px; }
  .search-input { font-size: .86rem; padding-left: 10px; }
  .hero { border-radius: 0; margin-left: -20px; margin-right: -20px; }
  .hero-media { height: 176px; }
  .hero h1 { font-size: clamp(2.4rem, 11vw, 3.1rem); }
  .hero-copy { padding: 26px 18px 30px; gap: 14px; }
  .hero p { font-size: 1rem; }
  .article-head h1 { font-size: clamp(1.72rem, 8vw, 2.1rem); }
  .prose h2 { font-size: 1.34rem; }
  .prose p, .prose li { font-size: 1.02rem; }
  .section-head { flex-direction: column; gap: 2px; align-items: flex-start; }
}
