/* ============================================================
   NEUROLOGIA - design system "Atlas"
   Paleta: kredowa biel, atrament oliwkowy, cynober (barwnik
   histologiczny), ciemna szyna nawigacji jak grzbiet atlasu.
   Typografia: Literata (tekst i naglowki) + Archivo (UI).
   ============================================================ */

:root {
  --bg: #f2f2ee;
  --bg-alt: #e9e9e1;
  --surface: #fbfbf6;
  --text: #1b1c18;
  --muted: #5b5e52;
  --border: #d7d7cb;
  --border-strong: #bfc0b2;

  --accent: #a3342b;
  --accent-strong: #84251e;
  --accent-light: #f7e9e5;
  --accent-subtle: #e6cdc6;

  --ink: #23261e;
  --ink-text: #f4f3ea;
  --rail: #1e211a;
  --rail-line: #343829;
  --rail-text: #d0d2c3;
  --rail-muted: #8f9482;

  --amber: #8a5a12;
  --amber-light: #fbf1dd;
  --amber-border: #e6d3ae;

  --table-head: #23261e;
  --table-head-text: #f4f3ea;

  --shadow-pop: 0 10px 28px rgba(27, 28, 24, 0.14);
  --radius: 14px;
  --radius-sm: 9px;

  --header-height: 66px;
  --sidebar-width: 288px;

  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --transition: color 0.18s var(--ease), background-color 0.18s var(--ease),
    border-color 0.18s var(--ease), transform 0.18s var(--ease),
    opacity 0.18s var(--ease);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12140f;
    --bg-alt: #181b13;
    --surface: #1b1e16;
    --text: #e9e9dc;
    --muted: #a7aa99;
    --border: #2d3126;
    --border-strong: #404534;

    --accent: #e0796c;
    --accent-strong: #f09a8d;
    --accent-light: #2a1a17;
    --accent-subtle: #452a24;

    --ink: #0e100b;
    --ink-text: #e9e9dc;
    --rail: #191c14;
    --rail-line: #2f3325;
    --rail-text: #d0d2c3;
    --rail-muted: #8f9482;

    --amber: #e5b062;
    --amber-light: #2a2114;
    --amber-border: #4a3a1d;

    --table-head: #262b1d;
    --table-head-text: #ececdf;

    --shadow-pop: 0 10px 28px rgba(0, 0, 0, 0.45);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 17.5px;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
svg { display: block; }

/* ---------- Header ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.header-inner {
  max-width: 1320px; height: 100%;
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 22px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-text {
  font-family: var(--font-display);
  font-size: 1.42rem; font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-text em { font-style: normal; color: var(--accent-strong); }
.brand-mark {
  display: inline-flex; width: 32px; height: 32px;
  align-items: center; justify-content: center;
  background: var(--ink); color: var(--ink-text);
  border-radius: 8px;
}
.brand-mark svg { width: 19px; height: 19px; }

.search-box { position: relative; flex: 1; max-width: 400px; margin-left: auto; }
.search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted);
  pointer-events: none;
}
#searchInput {
  width: 100%; min-height: 42px;
  padding: 10px 16px 10px 40px;
  font-family: var(--font-ui); font-size: 0.9rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  outline: none; transition: var(--transition);
}
#searchInput::placeholder { color: var(--muted); opacity: 1; }
#searchInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  max-height: 380px; overflow-y: auto; z-index: 200;
}
.search-results a {
  display: block; padding: 11px 16px;
  font-family: var(--font-ui); font-size: 0.88rem;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--accent-light); text-decoration: none; color: var(--accent-strong); }
.search-results .sr-section {
  font-family: var(--font-ui); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); padding: 10px 16px 3px;
}
.search-empty { padding: 13px 16px; font-family: var(--font-ui); font-size: 0.86rem; color: var(--muted); }

.menu-toggle {
  display: none; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer;
}
.menu-toggle span {
  display: block; width: 21px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout ---------- */
.layout {
  max-width: 1320px; margin: 0 auto;
  padding: calc(var(--header-height) + 28px) 24px 72px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 48px; align-items: start;
}

/* ---------- Sidebar (ciemna szyna) ---------- */
.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  background: var(--rail);
  color: var(--rail-text);
  border-radius: var(--radius);
  padding: 20px 14px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--rail-line) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--rail-line); border-radius: 3px; }
.sidebar-head { padding: 0 10px 14px; border-bottom: 1px solid var(--rail-line); margin-bottom: 14px; }
.sidebar-kicker {
  display: block; font-family: var(--font-ui);
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: #d99a8f;
}
.sidebar-count {
  font-family: var(--font-ui); font-size: 0.8rem;
  color: var(--rail-muted); margin-top: 5px; line-height: 1.4;
}
.nav-section { margin-bottom: 12px; }
.nav-section-title {
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--rail-muted); padding: 8px 10px 5px;
}
.sidebar-link {
  position: relative; display: block;
  padding: 8px 10px 8px 16px;
  font-family: var(--font-ui); font-size: 0.95rem;
  line-height: 1.38; color: var(--rail-text);
  border-radius: 7px;
  transition: var(--transition);
}
.sidebar-link::before {
  content: ""; position: absolute; left: 5px; top: 50%;
  width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%; background: transparent;
  transition: background-color 0.18s var(--ease);
}
.sidebar-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.sidebar-link.active { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 600; }
.sidebar-link.active::before { background: #e0796c; }
.sidebar-foot {
  margin-top: 16px; padding: 14px 10px 2px;
  border-top: 1px solid var(--rail-line);
  font-family: var(--font-ui); font-size: 0.76rem;
  line-height: 1.5; color: var(--rail-muted);
}
.sidebar-foot a { display: block; color: var(--rail-text); margin-bottom: 6px; }
.sidebar-foot a:hover { color: #fff; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(10, 11, 8, 0.55); z-index: 90; }

/* ---------- Main ---------- */
.main { min-width: 0; }
.page-enter { animation: fadeUp 0.3s var(--ease) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: clamp(380px, 54vh, 500px);
  display: flex; align-items: flex-end;
  padding: clamp(26px, 4vw, 44px);
  border-radius: var(--radius);
  overflow: hidden;
  background: #16180f;
  color: #f6f5ec;
  margin-bottom: 46px;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 44%;
  animation: heroIn 1.4s var(--ease) both;
}
@keyframes heroIn { from { transform: scale(1.06); } to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(16, 18, 12, 0.96) 0%, rgba(16, 18, 12, 0.86) 38%, rgba(16, 18, 12, 0.42) 72%, rgba(16, 18, 12, 0.24) 100%),
    linear-gradient(0deg, rgba(16, 18, 12, 0.72) 0%, rgba(16, 18, 12, 0) 55%);
}
.hero-content { position: relative; max-width: 620px; animation: fadeUp 0.5s var(--ease) both; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 4.6vw, 3.35rem);
  font-weight: 700; line-height: 1.07;
  letter-spacing: -0.022em; text-wrap: balance;
  color: #fbfaf3;
}
.hero p {
  margin-top: 16px; max-width: 46ch;
  font-size: 1.04rem; line-height: 1.62;
  color: #e2e2d4;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 26px; padding: 13px 24px;
  min-height: 46px;
  font-family: var(--font-ui); font-size: 0.92rem; font-weight: 600;
  color: #fdf8f2; background: var(--accent);
  border-radius: 999px; text-decoration: none;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
}
.hero-cta:hover { background: #8f2b23; transform: translateY(-2px); text-decoration: none; }
.hero-cta:active { transform: scale(0.98); }
.hero-cta svg { width: 16px; height: 16px; }
.hero-credit {
  position: absolute; right: 16px; bottom: 12px;
  font-family: var(--font-ui); font-size: 0.66rem;
  color: rgba(246, 245, 236, 0.58); text-align: right;
}

/* ---------- Strona glowna: dzialy ---------- */
.home-intro {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 10px 24px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-strong);
  margin-bottom: 8px;
}
.home-intro h2 {
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 600; letter-spacing: -0.01em;
}
.home-intro p { font-family: var(--font-ui); font-size: 0.82rem; color: var(--muted); }

.home-section { padding-top: 30px; }
.home-section + .home-section { margin-top: 22px; border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.section-head h2 {
  font-family: var(--font-display); font-size: 1.52rem;
  font-weight: 700; letter-spacing: -0.015em; text-wrap: balance;
}
.section-count {
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); white-space: nowrap;
}
.section-desc {
  font-family: var(--font-ui); font-size: 0.88rem;
  color: var(--muted); margin-top: 6px; max-width: 68ch;
}
.article-list { margin-top: 10px; }
.article-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 22px;
  gap: 18px; align-items: center;
  padding: 15px 2px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: var(--transition);
}
.article-row:hover { text-decoration: none; transform: translateX(3px); }
.article-row:last-child { border-bottom: none; }
.article-row h3 {
  font-family: var(--font-display); font-size: 1.06rem;
  font-weight: 600; line-height: 1.38; letter-spacing: -0.005em;
  transition: color 0.18s var(--ease);
}
.article-row p {
  font-family: var(--font-ui); font-size: 0.85rem;
  line-height: 1.5; color: var(--muted); margin-top: 3px;
}
.article-row:hover h3 { color: var(--accent-strong); }
.row-arrow { color: var(--accent); opacity: 0.4; transition: var(--transition); }
.row-arrow svg { width: 18px; height: 18px; }
.article-row:hover .row-arrow { opacity: 1; transform: translateX(3px); }

/* ---------- Artykul ---------- */
.article-head { padding-bottom: 20px; border-bottom: 1px solid var(--border-strong); margin-bottom: 24px; }
.breadcrumbs {
  font-family: var(--font-ui); font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); margin-bottom: 14px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent-strong); }
.breadcrumbs span { color: var(--accent-strong); }
.article-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.7vw, 2.85rem);
  font-weight: 700; line-height: 1.13;
  letter-spacing: -0.022em; text-wrap: balance;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  margin-top: 14px;
  font-family: var(--font-ui); font-size: 0.78rem; color: var(--muted);
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }

.toc {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0 14px;
  margin: 4px 0 30px;
}
.toc-title {
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); margin-bottom: 10px;
}
.toc ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 22px; counter-reset: toc; }
.toc li { counter-increment: toc; font-family: var(--font-ui); font-size: 0.86rem; }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 0.72rem; font-weight: 600; color: var(--accent);
  margin-right: 7px;
}
.toc a { color: var(--text); }
.toc a:hover { color: var(--accent-strong); }

.content-article { font-size: 17.5px; line-height: 1.75; max-width: 72ch; }
.content-article p { margin: 0 0 17px; text-wrap: pretty; }
.content-article h2 {
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 700;
  line-height: 1.25; letter-spacing: -0.012em;
  margin: 40px 0 13px; text-wrap: balance;
  scroll-margin-top: calc(var(--header-height) + 20px);
}
.content-article h2:first-child { margin-top: 0; }
.content-article h3 {
  font-family: var(--font-ui); font-size: 1.06rem; font-weight: 600;
  line-height: 1.35; margin: 28px 0 9px;
  scroll-margin-top: calc(var(--header-height) + 20px);
}
.content-article ul, .content-article ol { margin: 0 0 18px; padding-left: 22px; }
.content-article li { margin-bottom: 8px; }
.content-article li::marker { color: var(--accent); }
.content-article strong { font-weight: 700; }
.content-article a { text-decoration: underline; text-underline-offset: 2px; }
.content-article blockquote {
  margin: 24px 0; padding: 4px 0 4px 20px;
  border-left: 1px solid var(--border-strong);
  font-style: italic; color: var(--muted);
}

/* Boxes - always set both background and color (dark mode) */
.info-box, .warning-box, .tip-box, .takeaways {
  border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 22px 0;
  font-size: 0.96rem; line-height: 1.65;
  color: var(--text);
}
.info-box { background: var(--accent-light); border: 1px solid var(--accent-subtle); }
.info-box strong { color: var(--accent-strong); }
.warning-box { background: var(--amber-light); border: 1px solid var(--amber-border); }
.warning-box strong { color: var(--amber); }
.tip-box { background: var(--bg-alt); border: 1px solid var(--border); }
.takeaways { background: var(--bg-alt); border: 1px solid var(--border); }
.takeaways-title {
  font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent-strong); margin-bottom: 8px;
}
.takeaways ul { margin: 0; padding-left: 20px; }
.takeaways li { margin-bottom: 5px; }

/* Tables */
.table-responsive { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
.error-table {
  width: 100%; min-width: 520px;
  border-collapse: collapse;
  font-family: var(--font-ui); font-size: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.error-table th {
  background: var(--table-head); color: var(--table-head-text);
  text-align: left; padding: 11px 14px;
  font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.error-table td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: top; line-height: 1.5; }
.error-table tr:nth-child(even) td { background: var(--bg-alt); }
.error-table caption {
  caption-side: top; text-align: left;
  font-family: var(--font-ui); font-size: 0.76rem;
  color: var(--muted); padding-bottom: 7px;
}
.yes { color: var(--accent-strong); font-weight: 700; }
.no { color: var(--muted); font-weight: 600; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0;
  font-family: var(--font-ui); font-size: 1rem; font-weight: 600;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex-shrink: 0;
  font-family: var(--font-ui); font-size: 1.25rem; font-weight: 400;
  color: var(--accent); line-height: 1;
  transition: transform 0.18s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 0 18px; font-size: 0.98rem; color: var(--text); }
.faq-item .faq-a p { margin-bottom: 10px; }

/* Glossary */
.glossary dl { margin: 0; }
.glossary dt {
  font-family: var(--font-ui); font-size: 0.98rem; font-weight: 600;
  color: var(--accent-strong); margin-top: 20px;
}
.glossary dd { margin: 3px 0 0; font-size: 0.98rem; }

/* Prev / next */
.article-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-strong);
}
.article-nav a {
  display: block; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); transition: var(--transition);
}
.article-nav a:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; transform: translateY(-2px); }
.article-nav .nav-label {
  display: block; font-family: var(--font-ui); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 3px;
}
.article-nav .nav-title { font-family: var(--font-display); font-size: 0.98rem; font-weight: 600; line-height: 1.35; }
.article-nav .next { text-align: right; }

/* ---------- Footer ---------- */
.app-footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 40px; }
.footer-inner { max-width: 1320px; margin: 0 auto; padding: 36px 24px 40px; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1.3fr; gap: 32px;
  font-family: var(--font-ui); font-size: 0.86rem; line-height: 1.6; color: var(--muted);
}
.footer-brand {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  color: var(--text); margin-bottom: 6px; letter-spacing: -0.01em;
}
.footer-head {
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text); margin-bottom: 8px;
}
.footer-links a { color: var(--accent-strong); line-height: 1.9; }
.footer-note { font-size: 0.82rem; }
.footer-bottom {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border);
  font-family: var(--font-ui); font-size: 0.74rem; color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  :root { --sidebar-width: 254px; }
  .layout { gap: 34px; }
  .content-article { max-width: none; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: calc(var(--header-height) + 18px) 18px 56px;
    gap: 0;
  }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(320px, 86vw); max-height: none;
    border-radius: 0; padding: 22px 14px;
    transform: translateX(-103%);
    transition: transform 0.28s var(--ease);
    z-index: 95;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.28);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: flex; }
  .search-box { max-width: none; }
  .hero { min-height: clamp(340px, 46vh, 440px); }
  .hero-credit { display: none; }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .header-inner { padding: 0 14px; gap: 10px; }
  .brand-text { font-size: 1.28rem; }
  .search-box { display: none; }
  .layout { padding-left: 14px; padding-right: 14px; }
  .hero { padding: 22px 20px; min-height: 360px; margin-bottom: 34px; }
  .hero p { font-size: 0.98rem; }
  .hero::after {
    background:
      linear-gradient(90deg, rgba(16, 18, 12, 0.96) 0%, rgba(16, 18, 12, 0.9) 55%, rgba(16, 18, 12, 0.62) 100%),
      linear-gradient(0deg, rgba(16, 18, 12, 0.8) 0%, rgba(16, 18, 12, 0) 60%);
  }
  .section-head { flex-direction: column; gap: 3px; }
  .article-row { padding: 14px 0; }
  .article-row p { display: none; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .next { text-align: left; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .toc ol { flex-direction: column; }
  .error-table { min-width: 440px; }
}

@media (max-width: 380px) {
  .brand-text { font-size: 1.14rem; }
  .hero h1 { font-size: 1.86rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-media img { animation: none; }
}

/* ---------- Focus ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 11px 18px; z-index: 300;
  font-family: var(--font-ui); font-size: 0.9rem;
}
.skip-link:focus { left: 0; }

/* ---------- Print ---------- */
@media print {
  .app-header, .sidebar, .app-footer, .toc, .article-nav, #vd-cookie-bar { display: none !important; }
  .layout { display: block; padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
}
