@import url('../fonts/fonts.css');

/* ==========================================================================
   schlaf-wissen.de
   Nacht ist der Normalzustand dieser Seite: Wer sie sucht, liegt um halb vier
   wach. Deshalb ist der dunkle Modus der Standard, nicht die Ausnahme.
   Farbstrategie: Committed — ein tiefes, warmes Indigo trägt die Fläche,
   Kerzenlicht-Bernstein ist das einzige Signal.
   ========================================================================== */

:root {
  /* ---- Nacht (Standard) ---- */
  --bg:           oklch(0.185 0.042 268);
  --bg-deep:      oklch(0.155 0.045 268);
  --surface:      oklch(0.235 0.040 268);
  --surface-2:    oklch(0.285 0.038 268);
  --ink:          oklch(0.945 0.012 78);
  --ink-soft:     oklch(0.815 0.018 78);
  --muted:        oklch(0.685 0.020 78);
  --line:         oklch(0.335 0.034 268);
  --line-strong:  oklch(0.425 0.036 268);

  --accent:       oklch(0.815 0.125 72);
  --accent-deep:  oklch(0.700 0.135 62);
  --accent-ink:   oklch(0.200 0.050 60);
  --accent-wash:  oklch(0.285 0.050 62);

  --cool:         oklch(0.760 0.085 245);
  --cool-wash:    oklch(0.290 0.045 258);

  --shadow-s: 0 1px 2px oklch(0.12 0.04 268 / .5);
  --shadow-m: 0 2px 8px oklch(0.12 0.04 268 / .45), 0 16px 40px -20px oklch(0.10 0.04 268 / .7);
  --shadow-l: 0 4px 16px oklch(0.12 0.04 268 / .5), 0 32px 64px -28px oklch(0.08 0.04 268 / .8);

  color-scheme: dark;

  /* ---- Raum ---- */
  --s1: .25rem; --s2: .5rem;  --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem;   --s7: 3rem;   --s8: 4.5rem; --s9: 7rem;
  --r-s: 4px; --r: 10px; --r-l: 18px;
  --wrap: 1180px;
  --measure: 68ch;

  --f-head: 'Piazzolla', Georgia, serif;
  --f-body: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 140ms var(--ease);
  --t: 260ms var(--ease);

  /* Z-Skala */
  --z-sticky: 100; --z-dropdown: 200; --z-overlay: 300;
}

/* ---- Tag ---- */
:root[data-theme="light"] {
  --bg:           oklch(0.972 0.008 262);
  --bg-deep:      oklch(0.945 0.012 262);
  --surface:      oklch(0.995 0.004 262);
  --surface-2:    oklch(0.958 0.010 262);
  --ink:          oklch(0.225 0.032 268);
  --ink-soft:     oklch(0.395 0.028 268);
  --muted:        oklch(0.520 0.024 268);
  --line:         oklch(0.885 0.014 262);
  --line-strong:  oklch(0.795 0.020 262);

  --accent:       oklch(0.520 0.135 55);
  --accent-deep:  oklch(0.435 0.130 50);
  --accent-ink:   oklch(0.995 0.004 60);
  --accent-wash:  oklch(0.945 0.030 68);

  --cool:         oklch(0.430 0.105 258);
  --cool-wash:    oklch(0.940 0.022 258);

  --shadow-s: 0 1px 2px oklch(0.30 0.03 268 / .07);
  --shadow-m: 0 2px 8px oklch(0.30 0.03 268 / .07), 0 16px 40px -22px oklch(0.30 0.03 268 / .22);
  --shadow-l: 0 4px 16px oklch(0.30 0.03 268 / .09), 0 32px 64px -30px oklch(0.30 0.03 268 / .3);

  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:           oklch(0.972 0.008 262);
    --bg-deep:      oklch(0.945 0.012 262);
    --surface:      oklch(0.995 0.004 262);
    --surface-2:    oklch(0.958 0.010 262);
    --ink:          oklch(0.225 0.032 268);
    --ink-soft:     oklch(0.395 0.028 268);
    --muted:        oklch(0.520 0.024 268);
    --line:         oklch(0.885 0.014 262);
    --line-strong:  oklch(0.795 0.020 262);
    --accent:       oklch(0.520 0.135 55);
    --accent-deep:  oklch(0.435 0.130 50);
    --accent-ink:   oklch(0.995 0.004 60);
    --accent-wash:  oklch(0.945 0.030 68);
    --cool:         oklch(0.430 0.105 258);
    --cool-wash:    oklch(0.940 0.022 258);
    --shadow-s: 0 1px 2px oklch(0.30 0.03 268 / .07);
    --shadow-m: 0 2px 8px oklch(0.30 0.03 268 / .07), 0 16px 40px -22px oklch(0.30 0.03 268 / .22);
    --shadow-l: 0 4px 16px oklch(0.30 0.03 268 / .09), 0 32px 64px -30px oklch(0.30 0.03 268 / .3);
    color-scheme: light;
  }
}

/* ==========================================================================
   Basis
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  background: var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { font-size: 1.09rem; line-height: 1.75; } }

img, svg, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--f-head);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-wrap: balance;
  font-variation-settings: 'opsz' 30;
}
h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4.1rem); letter-spacing: -0.032em; }
h2 { font-size: clamp(1.62rem, 1.25rem + 1.6vw, 2.5rem); }
h3 { font-size: clamp(1.16rem, 1.04rem + .52vw, 1.42rem); letter-spacing: -0.014em; }
h4 { font-family: var(--f-body); font-size: 1.02rem; font-weight: 700; color: var(--ink); line-height: 1.4; }

p { text-wrap: pretty; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent-deep); }
:root:not([data-theme="light"]) a:hover { color: oklch(0.885 0.115 78); }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s5); }
@media (min-width: 768px) { .wrap { padding-inline: var(--s6); } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: var(--z-overlay);
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s3) var(--s5); font-weight: 700;
}
.skip-link:focus { left: 0; }

.section { padding-block: clamp(2.75rem, 1.6rem + 4.4vw, 5rem); }
.section--tight { padding-block: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }
.section--deep { background: var(--bg-deep); }

.lede { max-width: 44rem; }
.lede p { color: var(--ink-soft); margin-top: var(--s4); font-size: 1.06em; }

/* Sektionstrenner: Kurvensegment statt Linie */
.section-rule { color: var(--line); height: 40px; opacity: .9; }
.section-rule svg { width: 100%; height: 40px; }

/* ==========================================================================
   Kopfzeile
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: var(--s4); min-height: 4.4rem; }

.site-logo {
  display: inline-flex; align-items: baseline; gap: .1rem;
  font-family: var(--f-head); font-size: 1.24rem; font-weight: 600;
  letter-spacing: -0.03em; color: var(--ink); text-decoration: none;
  margin-right: auto; flex-shrink: 0;
  font-variation-settings: 'opsz' 30;
}
.site-logo:hover { color: var(--ink); }
.site-logo .dot { color: var(--accent); }
.site-logo .tld { color: var(--muted); font-weight: 400; }

.site-nav { display: flex; align-items: center; gap: var(--s1); list-style: none; padding: 0; }
.site-nav > li { position: relative; }
.site-nav a {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .5rem .68rem; border-radius: var(--r-s);
  color: var(--ink-soft); text-decoration: none; font-weight: 400; font-size: .96rem;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.site-nav a:hover { color: var(--ink); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav .caret { width: 13px; height: 13px; opacity: .6; transition: transform var(--t-fast); }
.has-drop:hover .caret, .has-drop:focus-within .caret { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + .35rem); left: 0; min-width: 16rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-l); padding: var(--s2); list-style: none;
  z-index: var(--z-dropdown);
  opacity: 0; visibility: hidden; transform: translateY(-5px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}
.has-drop:hover .dropdown, .has-drop:focus-within .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a { display: block; padding: .5rem .7rem; font-size: .93rem; }
.dropdown a:hover { background: var(--surface-2); color: var(--ink); }

.icon-btn {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: var(--r-s); background: transparent;
  color: var(--ink-soft); cursor: pointer; transition: all var(--t-fast);
}
.icon-btn:hover { color: var(--accent); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .i-moon { display: none; }
}
.menu-toggle { display: none; }
.menu-toggle .i-x { display: none; }
.menu-toggle[aria-expanded="true"] .i-x { display: block; }
.menu-toggle[aria-expanded="true"] .i-menu { display: none; }

@media (max-width: 999px) {
  .menu-toggle { display: grid; }
  .site-nav {
    position: fixed; inset: 4.4rem 0 auto 0; z-index: var(--z-dropdown);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-l); padding: var(--s3);
    max-height: calc(100dvh - 4.4rem); overflow-y: auto; display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .78rem .6rem; font-size: 1.04rem; }
  .site-nav > li + li { border-top: 1px solid var(--line); }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-radius: 0; padding: 0 0 var(--s2) var(--s4); min-width: 0;
    background: transparent;
  }
  .site-nav .caret { display: none; }
}

/* ==========================================================================
   Brotkrumen
   ========================================================================== */
.crumbs-bar { border-bottom: 1px solid var(--line); }
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  list-style: none; padding: .5rem 0; margin: 0; font-size: .84rem; color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.crumbs a:hover { color: var(--accent); }
.crumbs svg { width: 12px; height: 12px; opacity: .45; }

/* ==========================================================================
   Hypnogramm — Signature
   ========================================================================== */
.hypnogram { width: 100%; display: block; }
.hypnogram--hero { height: clamp(180px, 26vw, 320px); color: var(--accent); }
.hyp-stars { color: var(--ink); }
:root[data-theme="light"] .hyp-stars { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .hyp-stars { display: none; } }

.hypnogram-figure { margin: var(--s7) 0; }
.hypnogram--full { height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); }
.hyp-grid { stroke: var(--line); stroke-width: 1; }
.hyp-split { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.hyp-label { fill: var(--muted); font-family: var(--f-body); font-size: 12px; }
.hypnogram-figure figcaption {
  font-size: .9rem; color: var(--muted); margin-top: var(--s4);
  max-width: 46rem; line-height: 1.6;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-inner { padding-block: clamp(3rem, 2rem + 5vw, 6rem) 0; position: relative; z-index: 1; }
.hero h1 { max-width: 17ch; }
.hero-lead {
  font-size: clamp(1.1rem, 1rem + .5vw, 1.34rem);
  line-height: 1.6; color: var(--ink-soft); margin-top: var(--s5); max-width: 46ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.hero-graph { margin-top: clamp(2rem, 1rem + 4vw, 3.5rem); }
.hero-graph-note {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5);
  font-size: .84rem; color: var(--muted); padding-block: var(--s3) var(--s6);
  border-top: 1px solid var(--line); margin-top: -.5rem;
}
.hero-graph-note b { color: var(--ink-soft); font-weight: 400; }

/* ==========================================================================
   Schaltflächen
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.35rem; border-radius: var(--r-s);
  font-family: var(--f-body); font-weight: 700; font-size: .99rem; line-height: 1.3;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; min-height: 46px;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { background: var(--accent-deep); color: var(--accent-ink); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   Einstiege — bewusst als Liste mit Gewichtung, nicht als Kachelraster
   ========================================================================== */
.entries { display: grid; gap: 0; border-top: 1px solid var(--line); }
.entry {
  display: grid; gap: var(--s2) var(--s5); align-items: baseline;
  padding: var(--s5) 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: background-color var(--t-fast);
}
@media (min-width: 760px) {
  .entry { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr) auto; align-items: center; }
}
.entry:hover { background: var(--surface); }
.entry-q { font-family: var(--f-head); font-size: clamp(1.1rem, 1rem + .5vw, 1.36rem); color: var(--ink); font-variation-settings: 'opsz' 20; }
.entry:hover .entry-q { color: var(--accent); }
.entry-a { color: var(--muted); font-size: .96rem; }
.entry-go { color: var(--accent); display: inline-flex; }
.entry-go svg { width: 18px; height: 18px; transition: transform var(--t-fast); }
.entry:hover .entry-go svg { transform: translateX(4px); }

/* ==========================================================================
   Themenbereiche — asymmetrisch, mit Bild
   ========================================================================== */
.areas { display: grid; gap: var(--s6); }
@media (min-width: 860px) { .areas { grid-template-columns: 1fr 1fr; } }
.area {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background: var(--surface);
  transition: border-color var(--t-fast), transform var(--t);
}
.area:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.area img { width: 100%; aspect-ratio: 16/9; object-fit: cover; filter: saturate(.9); }
:root:not([data-theme="light"]) .area img { filter: saturate(.82) brightness(.82); }
.area-body { padding: var(--s5); }
.area h3 { margin-bottom: var(--s2); }
.area:hover h3 { color: var(--accent); }
.area p { color: var(--muted); font-size: .96rem; }
.area-list { margin-top: var(--s4); font-size: .88rem; color: var(--muted); }
.area-list b { color: var(--ink-soft); font-weight: 400; }
@media (min-width: 860px) {
  .area:first-child { grid-column: span 2; display: grid; grid-template-columns: 1.1fr 1fr; }
  .area:first-child img { height: 100%; aspect-ratio: auto; }
  .area:first-child .area-body { padding: var(--s6); align-self: center; }
}

/* ==========================================================================
   Artikel
   ========================================================================== */
.article-grid { display: grid; gap: var(--s7); }
@media (min-width: 1040px) {
  .article-grid { grid-template-columns: minmax(0, 1fr) 15.5rem; gap: var(--s8); align-items: start; }
}
.article-grid > *, .areas > *, .next > * { min-width: 0; }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--s5); }
.prose h2 { margin-top: var(--s8); scroll-margin-top: 6.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--s6); scroll-margin-top: 6.5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: var(--s2); }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose figure { margin: var(--s6) 0; }
.prose figure img { border-radius: var(--r); width: 100%; }
.prose figcaption { font-size: .87rem; color: var(--muted); margin-top: var(--s3); }
.prose blockquote {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s5); font-style: italic; color: var(--ink-soft);
}

.article-head { border-bottom: 1px solid var(--line); padding-bottom: var(--s5); margin-bottom: var(--s6); }
.article-lead {
  font-size: clamp(1.1rem, 1.02rem + .4vw, 1.3rem); line-height: 1.6;
  color: var(--ink-soft); max-width: 52ch; margin-top: var(--s4);
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5);
  margin-top: var(--s5); font-size: .84rem; color: var(--muted);
}
.article-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.article-meta svg { width: 14px; height: 14px; opacity: .65; }

/* Inhaltsverzeichnis */
.toc { border-top: 1px solid var(--line-strong); padding-top: var(--s4); }
.toc h2, .toc p.toc-title {
  font-family: var(--f-body); font-size: .82rem; font-weight: 700;
  color: var(--muted); margin: 0 0 var(--s3) 0; letter-spacing: 0;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a {
  display: flex; gap: .55rem; text-decoration: none; color: var(--ink-soft);
  font-size: .93rem; padding: .42rem 0; line-height: 1.4;
}
.toc a::before { content: counter(t); color: var(--accent); font-variant-numeric: tabular-nums; opacity: .75; }
.toc a:hover { color: var(--accent); }

.rail { display: grid; gap: var(--s6); }
@media (min-width: 1040px) { .rail { position: sticky; top: 6rem; } }

/* ==========================================================================
   Hinweiskästen — Flächentönung statt Seitenstreifen
   ========================================================================== */
.note {
  border-radius: var(--r); padding: var(--s5);
  background: var(--surface); border: 1px solid var(--line);
  display: grid; gap: var(--s3);
}
.note-head { display: flex; align-items: center; gap: var(--s3); }
.note-head svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--muted); }
.note-head h4 { font-size: .95rem; }
.note p, .note li { font-size: .95rem; color: var(--ink-soft); }
.note > p + p, .note > div > p + p { margin-top: var(--s3); }
.note ul { padding-left: 1.2rem; }

.note--evidence { background: var(--cool-wash); border-color: color-mix(in oklab, var(--cool) 30%, transparent); }
.note--evidence .note-head svg { color: var(--cool); }
.note--warn { background: var(--accent-wash); border-color: color-mix(in oklab, var(--accent) 34%, transparent); }
.note--warn .note-head svg { color: var(--accent); }
.note--med { background: var(--surface-2); }
.note--med .note-head svg { color: var(--accent); }

/* Evidenzstufen */
.ev {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 700; padding: .16rem .55rem; border-radius: 2px;
  white-space: nowrap; border: 1px solid;
}
.ev svg { width: 13px; height: 13px; }
.ev--strong { color: var(--cool); border-color: color-mix(in oklab, var(--cool) 42%, transparent); background: var(--cool-wash); }
.ev--medium { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 42%, transparent); background: var(--accent-wash); }
.ev--weak   { color: var(--muted); border-color: var(--line-strong); background: transparent; }
.ev-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: var(--s3); }

/* ==========================================================================
   Tabellen
   ========================================================================== */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); max-width: 100%; -webkit-overflow-scrolling: touch;
}
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .94rem; }
.table-wrap caption {
  caption-side: top; text-align: left; padding: var(--s4) var(--s4) var(--s2);
  font-size: .85rem; color: var(--muted); line-height: 1.55;
}
.table-wrap th, .table-wrap td { padding: .68rem .8rem; text-align: left; vertical-align: top; }
.table-wrap thead th {
  background: var(--surface-2); font-family: var(--f-body); font-weight: 700; font-size: .82rem;
  color: var(--ink-soft); border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
.table-wrap tbody tr + tr { border-top: 1px solid var(--line); }
.table-wrap tbody tr:hover { background: var(--surface-2); }
.table-wrap td { color: var(--ink-soft); }
.table-wrap td strong { color: var(--ink); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll-hint { font-size: .8rem; color: var(--muted); margin-top: var(--s2); }
@media (min-width: 768px) { .scroll-hint { display: none; } }
/* Fußnote unter einer Tabelle — bleibt in jeder Breite sichtbar */
.table-note { font-size: .85rem; color: var(--muted); margin-top: var(--s3); line-height: 1.55; }

/* ==========================================================================
   Fragen
   ========================================================================== */
.qa { display: grid; max-width: var(--measure); border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  padding: var(--s4) 0; cursor: pointer; font-weight: 700; color: var(--ink);
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4);
  list-style: none; min-height: 46px; font-size: 1.02rem;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; flex-shrink: 0; width: 10px; height: 10px; margin-top: .45rem;
  border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg); transition: transform var(--t-fast);
}
.qa details[open] summary::after { transform: rotate(225deg); }
.qa summary:hover { color: var(--accent); }
.qa-body { padding: 0 0 var(--s5); color: var(--ink-soft); }
.qa-body > * + * { margin-top: var(--s3); }

/* ==========================================================================
   Partnerhinweis
   ========================================================================== */
.partner {
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: var(--s5);
  background: var(--surface); display: grid; gap: var(--s4); margin: var(--s6) 0;
}
@media (min-width: 700px) { .partner { grid-template-columns: 1fr auto; align-items: center; } }
.partner h4 { margin-bottom: var(--s2); }
.partner p { font-size: .93rem; color: var(--ink-soft); }
.ad {
  display: inline-block; font-size: .7rem; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 2px; padding: .04rem .38rem;
  margin-left: .4rem; vertical-align: middle;
}

/* ==========================================================================
   Weiterlesen
   ========================================================================== */
.next { display: grid; gap: var(--s4); }
@media (min-width: 700px) { .next { grid-template-columns: 1fr 1fr; } }
.next a {
  display: grid; gap: .2rem; text-decoration: none; padding: var(--s5);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.next a:hover { border-color: var(--line-strong); background: var(--surface); }
.next strong { color: var(--ink); font-size: 1.02rem; font-family: var(--f-head); font-weight: 600; }
.next a:hover strong { color: var(--accent); }
.next span { font-size: .89rem; color: var(--muted); }

/* ==========================================================================
   Quellen
   ========================================================================== */
.sources { max-width: var(--measure); }
.sources ol { padding-left: 1.25rem; font-size: .88rem; color: var(--ink-soft); }
.sources li + li { margin-top: var(--s3); }
.sources a { word-break: break-word; }
.sources-intro { font-size: .88rem; color: var(--muted); margin-bottom: var(--s4); }

/* ==========================================================================
   Fußzeile
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); margin-top: var(--s8); padding-top: var(--s7); background: var(--bg-deep); }
.footer-grid { display: grid; gap: var(--s6); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: var(--s7); } }
.footer-about p { font-size: .9rem; color: var(--muted); margin-top: var(--s3); max-width: 30rem; }
.footer-logo {
  display: inline-flex; align-items: baseline; font-family: var(--f-head); font-size: 1.1rem;
  font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.03em;
}
.footer-logo .dot { color: var(--accent); }
.footer-logo .tld { color: var(--muted); font-weight: 400; }
.footer-nav h4 { font-size: .82rem; color: var(--muted); margin-bottom: var(--s3); }
.footer-nav ul { list-style: none; padding: 0; display: grid; gap: .42rem; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; font-size: .91rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: var(--s7); padding: var(--s5) 0; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between;
  font-size: .85rem; color: var(--muted);
}
.footer-bottom a { color: var(--ink-soft); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }
.footer-legal { display: flex; gap: var(--s4); flex-wrap: wrap; }
.footer-disclosure { border-top: 1px solid var(--line); padding: var(--s4) 0; font-size: .82rem; color: var(--muted); }
.footer-disclosure p { max-width: 62rem; }

/* ==========================================================================
   Werkzeug (Koffein-Rechner)
   ========================================================================== */
.tool {
  border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface);
  padding: clamp(1.25rem, .8rem + 1.6vw, 2rem); margin-top: var(--s6);
}
.tool-form { border-bottom: 1px solid var(--line); padding-bottom: var(--s5); }
.tool-row { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-end; }
.tool-row--bed { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.field { display: grid; gap: .35rem; flex: 1 1 14rem; min-width: 0; }
.field--sm { flex: 0 1 9rem; }
.field label { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.field select, .field input {
  font-family: var(--f-body); font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-s);
  padding: .62rem .7rem; min-height: 46px; width: 100%;
}
.field select:focus-visible, .field input:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 1px; }

.tool-list { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; gap: .4rem; }
.tool-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: .6rem .8rem; background: var(--surface-2); border-radius: var(--r-s); font-size: .95rem;
}
.tool-item b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tool-mg { color: var(--muted); font-size: .88rem; }
.tool-del {
  display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-s);
  color: var(--muted); cursor: pointer;
}
.tool-del:hover { color: var(--accent); border-color: var(--line-strong); }
.tool-del svg { width: 15px; height: 15px; }
.tool-empty { margin-top: var(--s5); color: var(--muted); font-size: .93rem; }
.tool-empty[hidden] { display: none; }

.tool-out { margin-top: var(--s6); padding-top: var(--s6); border-top: 1px solid var(--line); }
.tool-figures { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.tool-fig {
  display: grid; gap: .15rem; padding: var(--s4); border-radius: var(--r);
  background: var(--surface-2); border: 1px solid transparent;
}
.tool-fig--main { border-color: color-mix(in oklab, var(--accent) 40%, transparent); background: var(--accent-wash); }
.tool-fig-label { font-size: .84rem; color: var(--muted); }
.tool-fig strong {
  font-family: var(--f-head); font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15;
}
.tool-fig--main strong { color: var(--accent); }
.tool-fig-note { font-size: .8rem; color: var(--muted); }

.tool-chart { margin: var(--s6) 0 0; }
.tool-chart svg { width: 100%; height: auto; display: block; }
.tool-chart figcaption { font-size: .87rem; color: var(--muted); margin-top: var(--s3); line-height: 1.55; }
.kf-grid { stroke: var(--line); stroke-width: 1; }
.kf-ax { fill: var(--muted); font-family: var(--f-body); font-size: 12px; }
.kf-line { fill: none; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.kf-line--mid { stroke: var(--accent); stroke-width: 2.5; }
.kf-line--fast { stroke: var(--cool); stroke-width: 1.5; stroke-dasharray: 4 3; }
.kf-line--slow { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 2 4; }
.kf-bed { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 4; }
.kf-bed-label { font-size: 11px; fill: var(--ink-soft); }
.tool-out .note { margin-top: var(--s6); }

/* ==========================================================================
   Hilfsklassen
   ========================================================================== */
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.measure { max-width: var(--measure); }
.mt-6 { margin-top: var(--s6); }
.mt-7 { margin-top: var(--s7); }
