/* ============================================================
   Hausarztzentrum Berlin — Design-System
   Basierend auf dem Claude-Design-Projekt „Landing Page
   Hausarztpraxis" (Space Grotesk, kühles Grau + OKLCH-Blau,
   Pill-Buttons, weiche 20er-Radien), zusammengeführt mit den
   bestehenden Funktionsbausteinen (Auslastungs-Matrix,
   Scroll-Story, View Transitions, Cursor-Effekte).
   Eine Datei, kein Build-Step. Kein Byte von Drittservern.
   ============================================================ */

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

@layer reset, tokens, base, layout, components, utilities;

/* ---------- Reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; }
  body { min-height: 100svh; }
  img, svg { display: block; max-width: 100%; height: auto; }
  input, button { font: inherit; color: inherit; }
  h1, h2, h3, p { overflow-wrap: break-word; }
  fieldset { border: 0; padding: 0; }
  table { border-collapse: collapse; }
}

/* ---------- Tokens ---------- */
@layer tokens {
  :root {
    /* Akzent aus dem Claude-Design (OKLCH-Blau) */
    --color-accent: oklch(0.52 0.14 255);
    --color-accent-deep: oklch(0.45 0.14 255);
    --color-accent-text: oklch(0.48 0.14 255);
    --color-accent-tint: oklch(0.95 0.025 255);
    --color-accent-tint-2: oklch(0.96 0.015 255);

    --color-bg: #f9fafb;
    --color-card: #ffffff;
    --color-ink: #171a20;
    --color-ink-soft: rgb(23 26 32 / .62);
    --color-line: rgb(23 26 32 / .08);
    --color-line-strong: rgb(23 26 32 / .13);

    --state-frei: #17805f;    --state-frei-bg: #e2f2ec;
    --state-mittel: #9a6a00;  --state-mittel-bg: #f7edd8;
    --state-voll: #a83f38;    --state-voll-bg: #f8e7e5;
    --state-neutral: #6b7473; --state-neutral-bg: #eceeed;

    --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --step--1: clamp(0.84rem, 0.81rem + 0.15vw, 0.92rem);
    --step-0:  clamp(1.00rem, 0.95rem + 0.25vw, 1.10rem);
    --step-1:  clamp(1.15rem, 1.06rem + 0.45vw, 1.35rem);
    --step-2:  clamp(1.50rem, 1.32rem + 0.90vw, 1.95rem);
    --step-3:  clamp(1.95rem, 1.62rem + 1.65vw, 2.60rem);
    --step-4:  clamp(2.45rem, 1.95rem + 2.60vw, 3.65rem);

    --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
    --space-5: 1.5rem; --space-6: 2.5rem; --space-7: 4rem;  --space-8: 5.5rem;

    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 24px;
    --radius-pill: 999px;
    --shadow-1: 0 2px 8px rgb(23 26 32 / .04);
    --shadow-2: 0 14px 30px rgb(23 26 32 / .08);
    --shadow-float: 0 12px 32px rgb(23 26 32 / .12);
  }
}

/* ---------- Base ---------- */
@layer base {
  body {
    font-family: var(--font-sans);
    font-size: var(--step-0);
    line-height: 1.55;
    color: var(--color-ink);
    background: var(--color-bg);
  }
  h1, h2, h3 { line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; font-weight: 700; }
  a { color: var(--color-accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
  a:hover { color: var(--color-accent-deep); }
  :focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 6px;
  }
  ::selection { background: oklch(0.9 0.05 255); }
  code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
    a, .btn { transition: color .15s ease, background-color .2s ease, border-color .2s ease; }
  }
}

/* ---------- Layout ---------- */
@layer layout {
  .wrap { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
  .narrow { width: min(100%, 46rem); }
  .section { padding-block: var(--space-8); }
  .section-white { background: var(--color-card); border-block: 1px solid var(--color-line); }
  .section-inner { margin-top: var(--space-6); }
  .split {
    display: grid;
    gap: var(--space-6);
    align-items: start;
    grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  }
  .duo {
    display: grid;
    gap: var(--space-4);
    align-items: stretch;
    grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  }
  .card-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(min(15.5rem, 100%), 1fr));
    margin-block: var(--space-5);
  }
}

/* ---------- Components ---------- */
@layer components {

  .skip-link {
    position: absolute; left: -999px; top: var(--space-2);
    background: var(--color-ink); color: #fff;
    padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
    z-index: 100;
  }
  .skip-link:focus-visible { left: var(--space-2); }

  .scroll-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px;
    background: var(--color-accent);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 60;
    pointer-events: none;
  }


  /* Header */
  .site-header {
    border-bottom: 1px solid var(--color-line);
    background: rgb(249 250 251 / .85);
    backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 50;
  }
  .header-inner {
    display: flex; align-items: center; gap: var(--space-5);
    padding-block: 1.1rem;
    flex-wrap: wrap;
  }
  .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
  .brand-mark {
    display: grid; place-items: center;
    width: 3rem; height: 3rem;
    background: var(--color-accent); color: #fff;
    font-weight: 700; font-size: .8rem; letter-spacing: .04em;
    border-radius: 10px;
  }
  .brand-name { display: block; font-weight: 700; line-height: 1.2; font-size: 1.12rem; }
  .brand-sub { display: block; font-size: .8rem; color: var(--color-ink-soft); line-height: 1.2; }
  .site-nav { display: flex; gap: var(--space-5); flex-wrap: wrap; margin-inline-start: auto; }
  .site-nav a {
    color: var(--color-ink-soft); text-decoration: none;
    font-size: .92rem; font-weight: 500;
    padding-block: var(--space-1);
  }
  .site-nav a:hover { color: var(--color-accent-text); }
  .site-nav a[aria-current="page"] { color: var(--color-ink); font-weight: 600; box-shadow: inset 0 -2px var(--color-accent); }
  .header-actions { display: flex; align-items: center; gap: var(--space-3); }
  .phone-link { text-decoration: none; text-align: right; line-height: 1.2; }
  .phone-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--color-ink-soft); }
  .phone-number { font-weight: 700; color: var(--color-ink); white-space: nowrap; font-size: .95rem; }
  .btn-nav { padding: 10px 20px; font-size: .9rem; }
  .label-short { display: none; }
  .btn-nav[aria-current="page"] { background: var(--color-accent-deep); }
  .lang-switch {
    font-size: .85rem; font-weight: 600; text-decoration: none;
    border: 1px solid var(--color-line-strong); border-radius: var(--radius-pill);
    padding: 7px 14px;
    color: var(--color-ink-soft); white-space: nowrap;
  }
  .lang-switch:hover { border-color: var(--color-accent); color: var(--color-accent-text); }

  /* Abwesenheits-Banner */
  .absence-banner {
    text-align: center;
    background: var(--state-mittel-bg);
    border-bottom: 1px solid color-mix(in srgb, var(--state-mittel) 25%, transparent);
    color: #5c4200;
    padding-block: var(--space-3);
    font-size: var(--step--1);
  }
  .absence-banner p { font-weight: 500; }
  .absence-banner p + p { margin-top: var(--space-1); }

  /* Buttons: Pill-Formen aus dem Design */
  .btn {
    display: inline-block;
    padding: 14px 26px;
    border-radius: var(--radius-pill);
    border: 1.5px solid transparent;
    font-weight: 600; font-size: var(--step-0);
    text-decoration: none; text-align: center;
    cursor: pointer;
  }
  .btn-primary { background: var(--color-ink); color: #fff; }
  .btn-primary:hover { background: #000; color: #fff; }
  .btn-accent { background: var(--color-accent); color: #fff; }
  .btn-accent:hover { background: var(--color-accent-deep); color: #fff; }
  .btn-ghost { background: transparent; color: var(--color-ink); border-color: var(--color-line-strong); }
  .btn-ghost:hover { border-color: var(--color-accent); background: var(--color-accent-tint-2); color: var(--color-ink); }
  .btn-danger { background: var(--state-voll); color: #fff; }
  .btn-danger:hover { background: color-mix(in srgb, var(--state-voll) 85%, black); }
  /* Sanfte Gefahr: helles Rot für die Absage im Vormerkungs-Panel. */
  .btn-danger-soft { background: var(--state-voll-bg); color: var(--state-voll); border-color: transparent; }
  .btn-danger-soft:hover { border-color: var(--state-voll); }
  .btn-small { padding: 8px 16px; font-size: var(--step--1); }
  .btn-wide { width: 100%; margin-top: var(--space-4); }
  @media (prefers-reduced-motion: no-preference) {
    .btn { transition: transform .15s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
    .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(23 26 32 / .18); }
    .btn:active { transform: translateY(0); }
  }

  /* Typografische Bausteine */
  .kicker {
    font-size: .82rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--color-accent-text);
    margin-bottom: var(--space-3);
  }
  .page-title { font-size: var(--step-3); margin-bottom: var(--space-4); }
  .section-title { font-size: var(--step-2); margin-bottom: var(--space-3); }
  /* Neuer Abschnitt nach Fließtext oder Schrittliste braucht Luft
     (Praxis-Seite: „Offene Sprechzeiten“ unter dem Kontaktblock;
     Video-Seite: „Was Sie brauchen“ unter den Ablauf-Schritten). */
  .prose + .section-title,
  .steps + .section-title { margin-top: var(--space-6); }
  /* Fließtext nach einer Fußnote ebenso (Anfahrt: Kartendienst-Hinweis
     → S-Bahn-Absatz). */
  .note + .prose { margin-top: var(--space-5); }
  /* Seitentitel → erster Inhaltsabschnitt („Praxis & Anfahrt“ → „Adresse“);
     space-6, weil die Margins mit dem h1-Abstand kollabieren (max, nicht Summe). */
  .page-title + .split { margin-top: var(--space-6); }
  .section-head { max-width: 36rem; margin-bottom: var(--space-5); }
  .section-sub { color: var(--color-ink-soft); margin-bottom: var(--space-4); }
  .card-heading { font-size: var(--step-1); margin-bottom: var(--space-3); }
  .prose { max-width: 62ch; }
  .prose + .prose { margin-top: var(--space-3); }
  .intro { margin-bottom: var(--space-5); color: var(--color-ink-soft); }
  .note { font-size: var(--step--1); color: var(--color-ink-soft); max-width: 62ch; margin-top: var(--space-4); }
  .arrow-link { font-weight: 600; text-decoration: none; }
  .arrow-link::after { content: " →"; }
  .arrow-link:hover { text-decoration: underline; }

  /* Hero (zweispaltig, mit Live-Karte) */
  .hero { position: relative; overflow: clip; padding-block: var(--space-7) var(--space-7); }
  .hero-deco { position: absolute; inset: -12% -6%; pointer-events: none; z-index: 0; }
  .hero-layer { position: absolute; inset: 0; }
  .hero-blob { background: radial-gradient(36rem 24rem at 76% 12%, var(--color-accent-tint) 0%, transparent 68%); }
  .hero-grid {
    background-image:
      linear-gradient(var(--color-line) 1px, transparent 1px),
      linear-gradient(90deg, var(--color-line) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(44rem 28rem at 72% 18%, rgb(0 0 0 / .55), transparent 72%);
    -webkit-mask-image: radial-gradient(44rem 28rem at 72% 18%, rgb(0 0 0 / .55), transparent 72%);
  }
  .hero-split {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: 1.12fr 1fr;
    gap: var(--space-6);
    align-items: center;
  }
  .hero-title { font-size: var(--step-4); letter-spacing: -0.02em; margin-bottom: var(--space-4); }
  .hero-accent { color: var(--color-accent); }
  .hero-lead { font-size: var(--step-1); line-height: 1.5; color: var(--color-ink-soft); max-width: 46ch; margin-bottom: var(--space-5); }
  .hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
  .hero-meta {
    margin-top: var(--space-4);
    font-size: .9rem; font-weight: 500;
    color: var(--color-ink-soft);
  }
  .hero-meta a { color: var(--color-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
  .hero-meta a:hover { color: var(--color-accent-text); }

  .hero-panel { position: relative; min-width: 0; }
  .live-card {
    min-width: 0;
    background: var(--color-card);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    padding: var(--space-5);
    display: grid; gap: var(--space-3);
  }
  .live-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
  .live-card-day { font-size: .82rem; font-weight: 500; color: var(--color-ink-soft); }
  .live-card-empty { color: var(--color-ink-soft); font-size: var(--step--1); }
  .float-badge {
    display: flex; align-items: center; gap: 12px;
    width: fit-content;
    background: var(--color-card);
    border: 1px solid var(--color-line);
    border-radius: 16px;
    box-shadow: var(--shadow-float);
    padding: 12px 18px;
    /* Dockt an der Kartenunterkante an, ohne Inhalte zu verdecken. */
    margin: -14px 0 0 18px;
    position: relative;
  }
  .float-badge-icon {
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--color-accent-tint);
    color: var(--color-accent-text);
    font-size: 1.05rem; font-weight: 700;
  }
  .float-badge-title { display: block; font-weight: 600; font-size: .88rem; }
  .float-badge-sub { display: block; font-size: .78rem; color: var(--color-ink-soft); }


  /* Karten (Leistungen) mit Icon-Chip */
  .card {
    position: relative;
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: var(--space-5);
  }
  .section-white .card, .section-tint .card { background: var(--color-bg); }
  .section .card-grid .card { background: var(--color-card); }
  .card h2, .card h3 { font-size: 1.05rem; margin-bottom: var(--space-2); }
  .card p { font-size: var(--step--1); line-height: 1.55; color: var(--color-ink-soft); }
  .chip {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--color-accent-tint);
    margin-bottom: var(--space-4);
  }
  .chip-shape { width: 14px; height: 14px; background: var(--color-accent); border-radius: 3px; }
  .card:nth-child(3n+1) .chip-shape { border-radius: 50%; }
  .card:nth-child(3n) .chip-shape { transform: rotate(45deg); }


  /* Kontakt-Karte + dunkle Video-Karte (Design-Elemente) */
  .contact-card {
    background: var(--color-card);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-1);
    display: grid; gap: var(--space-4); align-content: start;
  }
  /* Eine Zeile Luft zwischen Kontaktdaten und dem „Praxis & Anfahrt“-Link. */
  .contact-rows { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); }
  .contact-row { display: flex; gap: var(--space-3); font-size: .98rem; }
  .contact-key { color: var(--color-accent-text); font-weight: 700; width: 5.2rem; flex: none; }
  .contact-val {
    font-weight: 500; color: var(--color-ink); text-decoration: none;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  a.contact-val:hover { color: var(--color-accent-text); }

  .dark-card {
    background: var(--color-ink);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: grid; gap: var(--space-4); align-content: start;
    justify-items: start;
  }
  .dark-card .card-heading { color: #fff; }
  .dark-card-text { font-size: .95rem; line-height: 1.55; color: rgb(255 255 255 / .65); max-width: 44ch; }
  .emergency-note {
    border-top: 1px solid rgb(255 255 255 / .12);
    padding-top: var(--space-4);
    font-size: .85rem;
    color: rgb(255 255 255 / .55);
    width: 100%;
  }

  /* Öffnungszeiten */
  .hours-table th { text-align: left; padding-inline-end: var(--space-4); font-weight: 600; }
  .hours-table td { color: var(--color-ink-soft); }
  .hours-table tr + tr :is(th, td) { padding-top: var(--space-1); }
  .hours-table-page { font-size: var(--step-0); margin-block: var(--space-3); }
  .hours-table-page tr { border-bottom: 1px solid var(--color-line); }
  .hours-table-page :is(th, td) { padding-block: 10px; }

  /* Ein-Klick-Raster (Startseite + /besuch): Stundenachse + Status-Kacheln.
     Jede wählbare Kachel ist ein Submit-Button — Klick = vorgemerkt. */
  .click-grid {
    display: grid;
    grid-template-columns: auto repeat(8, 1fr);
    gap: 6px;
    align-items: center;
  }
  /* Spaltenzahl als Klasse statt Inline-Style: die CSP (style-src 'self',
     ohne unsafe-inline) blockiert style-Attribute — und repeat() mit var()
     ist ohnehin fragil. Deckt 4–12 Stunden ab. */
  .click-grid.cols-4  { grid-template-columns: auto repeat(4, 1fr); }
  .click-grid.cols-5  { grid-template-columns: auto repeat(5, 1fr); }
  .click-grid.cols-6  { grid-template-columns: auto repeat(6, 1fr); }
  .click-grid.cols-7  { grid-template-columns: auto repeat(7, 1fr); }
  .click-grid.cols-9  { grid-template-columns: auto repeat(9, 1fr); }
  .click-grid.cols-10 { grid-template-columns: auto repeat(10, 1fr); }
  .click-grid.cols-11 { grid-template-columns: auto repeat(11, 1fr); }
  .click-grid.cols-12 { grid-template-columns: auto repeat(12, 1fr); }
  .cg-hour {
    position: relative;
    font-size: .68rem; font-weight: 600;
    color: var(--color-ink-soft);
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding-bottom: 3px;
  }
  .cg-hour.is-now::after {
    content: "";
    position: absolute; left: 50%; bottom: -2px;
    width: 5px; height: 5px; border-radius: 50%;
    translate: -50% 0;
    background: var(--color-accent);
  }
  .cg-lane {
    font-size: .82rem; font-weight: 600;
    padding-inline-end: var(--space-2);
    white-space: nowrap;
  }
  .cg-cell {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0;
    border-radius: 9px;
    border: 1.5px solid transparent;
    background: none;
    cursor: pointer;
  }
  .cg-cell.is-off { cursor: default; }
  /* Zustände unterscheiden sich in Form UND Farbe (nie nur Farbe): */
  .cg-cell.is-frei   { border-color: var(--state-frei); background: var(--state-frei-bg); }
  .cg-cell.is-mittel { border-color: var(--state-mittel);
    background: linear-gradient(to top, var(--state-mittel) 55%, var(--state-mittel-bg) 55%); }
  .cg-cell.is-voll   { border-color: var(--state-voll);
    background: repeating-linear-gradient(135deg, var(--state-voll) 0 4px, var(--state-voll-bg) 4px 8px); }
  .cg-cell.is-vorbei { background: var(--state-neutral-bg); opacity: .5; }
  .cg-cell.is-abwesend { background: var(--state-neutral-bg); opacity: .3; }
  .cg-cell.is-zu { visibility: hidden; }
  /* Eigene Vormerkung: Seitenblau statt Zustandsgrün, mit Häkchen. */
  .cg-cell.is-yours {
    display: grid;
    place-items: center;
    background: var(--color-accent);
    border-color: var(--color-accent);
  }
  .cg-cell.is-yours::after {
    content: "✓";
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
  }
  .pill.is-yours { background: var(--color-accent); color: #fff; }
  button.cg-cell:not(:disabled):hover { transform: translateY(-2px) scale(1.04); box-shadow: var(--shadow-1); }
  button.cg-cell:not(:disabled):active { transform: translateY(0) scale(.98); }
  button.cg-cell:disabled { cursor: default; }
  @media (prefers-reduced-motion: no-preference) {
    button.cg-cell { transition: transform .15s ease, box-shadow .15s ease; }
  }
  .mini-legend { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
  .mini-legend .pill { font-size: .7rem; padding: .1rem .55rem; }
  .pill {
    display: inline-flex; align-items: center; gap: .4ch;
    border-radius: var(--radius-pill);
    padding: .18rem .68rem;
    font-size: .78rem; font-weight: 600;
    background: var(--state-neutral-bg); color: var(--state-neutral);
  }
  .pill-hour { font-variant-numeric: tabular-nums; font-weight: 700; }
  .pill.is-frei   { background: var(--state-frei-bg);   color: var(--state-frei); }
  .pill.is-mittel { background: var(--state-mittel-bg); color: var(--state-mittel); }
  .pill.is-voll   { background: var(--state-voll-bg);   color: var(--state-voll); }
  .pill.is-vorbei, .pill.is-abwesend, .pill.is-zu { opacity: .55; }

  /* Tages-Navigation */
  /* Immer EINE Zeile: kein Umbruch, notfalls scrollt die Reihe intern
     (Scrollbar unsichtbar, Seite selbst läuft nie über). */
  .day-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: 3px; /* Platz für Focus-Ring beim internen Scrollen */
    margin-block: var(--space-5) var(--space-4);
  }
  .day-nav::-webkit-scrollbar { display: none; }
  .day-pill { flex: 0 0 auto; }
  /* Rein visueller Wochen-Trenner (Label steckt im aria-label). */
  .day-sep {
    flex: 0 0 auto;
    width: 1.5px;
    height: 24px;
    margin-inline: var(--space-2);
    border-radius: 1px;
    background: var(--color-line-strong);
  }
  /* Folgewoche nur kompakter — volle Farben, sonst wirkt sie deaktiviert. */
  .day-pill.is-far {
    padding: 8px 12px;
    font-size: .8rem;
  }
  .day-pill {
    text-decoration: none; font-weight: 600; font-size: var(--step--1);
    border: 1.5px solid var(--color-line-strong); border-radius: var(--radius-pill);
    padding: 10px 18px;
    color: var(--color-ink);
    background: var(--color-card);
  }
  .day-pill:hover { border-color: var(--color-accent); color: var(--color-accent-text); }
  .day-pill.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

  .matrix-day { font-size: var(--step-1); margin-block: var(--space-4) var(--space-3); }

  /* min-width: 0 bricht die Grid-min-content-Kette (Hero-Karte darf
     schmaler werden als das Raster); das Raster wischt dann intern. */
  .matrix { display: block; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  @media (prefers-reduced-motion: no-preference) {
    .now-dot { animation: pulse 2.2s ease-in-out infinite; }
    @keyframes pulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: .45; transform: scale(.82); }
    }
  }

  /* „Ihre Vormerkung“ */
  .yours {
    border: 1.5px solid var(--color-accent);
    border-radius: var(--radius);
    background: var(--color-accent-tint-2);
    padding: var(--space-4) var(--space-5);
    margin-block: var(--space-4);
  }
  .yours-title { font-size: var(--step-0); margin-bottom: var(--space-2); color: var(--color-accent-deep); }
  .yours-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3); flex-wrap: wrap;
    font-weight: 500;
  }
  .yours-item + .yours-item { margin-top: var(--space-2); }
  /* Aktionszeile der Vormerkung: QR-Code ganz links, Absagen ganz rechts. */
  .yours-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    flex: 1 1 100%;
  }

  /* Flash */
  .flash {
    border-radius: 14px;
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    margin-block: var(--space-4);
  }
  .flash.is-success { background: var(--state-frei-bg); color: var(--state-frei); }
  .flash.is-error { background: var(--state-voll-bg); color: var(--state-voll); }

  /* Reservierungsseite */
  .visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    clip-path: inset(50%); overflow: hidden; white-space: nowrap;
  }
  .code-form { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-block: var(--space-4) var(--space-5); }
  .code-form input {
    font: inherit; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    padding: .55rem .9rem; min-width: 15ch;
    border: 1px solid var(--color-line); border-radius: 10px;
    background: var(--color-card); color: inherit;
  }
  .code-form input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
  .reservation-card {
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    background: var(--color-card);
    box-shadow: var(--shadow-2);
    padding: var(--space-6);
    margin-block: var(--space-5);
    display: grid; justify-items: center; gap: var(--space-4);
    text-align: center;
  }
  .reservation-slot { font-size: var(--step-1); }
  .reservation-qr svg { width: 196px; height: 196px; }
  .reservation-qr-hint { font-size: var(--step--1); color: var(--color-ink-soft); max-width: 40ch; }
  .reservation-code { display: grid; gap: var(--space-1); }
  .reservation-code-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--color-ink-soft); }
  .reservation-code code { font-size: var(--step-1); font-weight: 700; }

  /* Video-Seite */
  .callout {
    border-left: 4px solid var(--color-accent);
    background: var(--color-accent-tint-2);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: var(--space-4) var(--space-5);
    margin-block: var(--space-5);
  }
  .callout h2 { font-size: var(--step-0); margin-bottom: var(--space-2); }
  .steps { padding-left: 1.2rem; display: grid; gap: var(--space-2); max-width: 62ch; }
  .steps li::marker { color: var(--color-accent); font-weight: 700; }
  /* Hervorgehobener Handlungskasten der Video-Seite (Button/Telefon/Status) */
  .video-cta {
    border: 1px solid var(--color-accent);
    background: var(--color-accent-tint);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    padding: var(--space-5);
    margin-block: var(--space-5) var(--space-6);
    text-align: center;
  }
  .video-cta > * { margin: 0; margin-inline: auto; }
  .video-cta > * + * { margin-top: var(--space-3); }
  .video-cta p { line-height: 2; }
  .phone-strong { font-weight: 700; white-space: nowrap; }

  /* Sicherheits-Check vor der Video-Buchung (Popup + No-JS-Seite):
     einspaltig — die Ja/Nein-Antworten stehen unter ihrer Frage. */
  .vc-row { border: 0; margin: 0; padding: 0; text-align: left; }
  .vc-row + .vc-row { margin-top: var(--space-4); }
  .vc-row legend { padding: 0; }
  .vc-choices { display: flex; gap: var(--space-5); margin-top: var(--space-2); }
  .vc-choices label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; cursor: pointer; }
  .vc-choices-stack { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .vc-choices input { accent-color: var(--color-accent); width: 1.05rem; height: 1.05rem; }
  .vc-choices input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 50%; }
  .vc-form { max-width: 34rem; margin-top: var(--space-5); }
  .vc-form > .btn { margin-top: var(--space-6); }
  .vc-form .note { margin-top: var(--space-3); }
  .vc-stop {
    border: 1px solid var(--state-voll);
    background: var(--state-voll-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-block: var(--space-5);
  }
  /* (Die dialog.vc-Overrides stehen un-layered beim qd-Dialog —
     ungelayerte Basisregeln würden sie hier im Layer überstimmen.) */

  /* Karte + schwebende Info-Karte */
  .map { position: relative; border: 1px solid var(--color-line); border-radius: var(--radius-lg); background: var(--color-card); overflow: hidden; }
  .map .mapsvg { display: block; width: 100%; height: auto; }
  .map-float {
    position: absolute; top: 18px; left: 18px;
    background: var(--color-card);
    border-radius: 16px;
    box-shadow: var(--shadow-float);
    padding: 14px 18px;
    display: grid; gap: 2px;
    max-width: 17rem;
  }
  .map-float-title { font-weight: 700; font-size: .92rem; }
  .map-float-text { font-size: .82rem; color: var(--color-ink-soft); line-height: 1.5; }
  .map-links { margin-top: var(--space-3); font-weight: 600; }

  /* Rechtstexte */
  .legal h2 { font-size: var(--step-1); margin-block: var(--space-5) var(--space-2); }
  .legal p, .legal li { max-width: 68ch; }
  .legal ul { padding-left: 1.2rem; display: grid; gap: var(--space-2); }

  /* Footer */
  .site-footer {
    border-top: 1px solid var(--color-line);
    background: var(--color-card);
    padding-block: var(--space-6);
    margin-top: var(--space-7);
    font-size: var(--step--1);
  }
  .footer-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
  .footer-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--space-3); color: var(--color-ink-soft); }
  .footer-note { margin-top: var(--space-3); color: var(--color-ink-soft); max-width: 34ch; }
  .site-footer p + p { margin-top: var(--space-2); }

  .error-page { text-align: center; padding-block: var(--space-7); }

  /* ---------- Scroll-Story „So funktioniert die offene Sprechstunde“ ----------
     Basis-Layout gilt immer (Fallback: statische Sektion mit dem Endzustand
     der Demo); Sticky + Scroll-Animationen nur bei Support. */
  .story { background: var(--color-bg); }
  .story-track { padding-block: var(--space-8); }
  .story-sticky {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
    align-items: center;
  }
  .story-intro { color: var(--color-ink-soft); max-width: 52ch; margin-bottom: var(--space-4); }
  .story-step { display: flex; gap: var(--space-3); align-items: flex-start; margin-top: var(--space-4); }
  .story-step h3 { font-size: var(--step-0); margin-bottom: var(--space-1); }
  .story-step p { font-size: var(--step--1); color: var(--color-ink-soft); max-width: 44ch; }
  .story-step-num {
    display: grid; place-items: center; flex: none;
    width: 1.9rem; height: 1.9rem; border-radius: 50%;
    background: var(--color-accent); color: #fff;
    font-weight: 700; font-size: var(--step--1);
  }
  .story-demo {
    position: relative;
    display: grid; gap: var(--space-4); align-content: center;
    background: var(--color-card);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: var(--space-6) var(--space-5);
    min-height: 12rem;
  }
  .demo-row {
    display: grid;
    grid-template-columns: 4.2rem 1fr 3.6rem;
    gap: var(--space-3);
    align-items: center;
    height: 44px;
  }
  .demo-time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: var(--step--1); color: var(--color-ink-soft); }
  .demo-track { height: 12px; border-radius: var(--radius-pill); background: var(--color-bg); border: 1px solid var(--color-line); overflow: hidden; position: relative; }
  .demo-fill { position: absolute; inset: 0; border-radius: inherit; }
  .demo-fill-9 { width: 58%; background: var(--state-mittel); }
  .demo-fill-11 { width: 50%; background: var(--state-mittel); }
  .demo-badge { position: relative; font-size: .8rem; font-weight: 700; display: grid; }
  .demo-badge > span { grid-area: 1 / 1; }
  .demo-badge .badge-a { opacity: 0; }
  .demo-badge-9 .badge-a { color: var(--state-voll); }
  .demo-badge-9 .badge-b { color: var(--state-mittel); }
  .demo-badge-11 .badge-a { color: var(--state-frei); }
  .demo-badge-11 .badge-b { color: var(--state-mittel); }
  .demo-dot {
    position: absolute; left: 52%; top: 66px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-tint);
    opacity: 0;
  }
}

/* ---------- Utilities & Bewegung ---------- */
@layer utilities {
  .sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; border: 0;
  }

  @media (prefers-reduced-motion: no-preference) {

    /* Einmalige Reveals beim Laden. */
    .reveal { animation: rise-in .55s ease-out both; }
    .reveal:nth-child(2) { animation-delay: .06s; }
    .reveal:nth-child(3) { animation-delay: .12s; }
    .reveal:nth-child(4) { animation-delay: .18s; }
    @keyframes rise-in {
      from { opacity: 0; transform: translateY(14px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* Schwebende Live-Karte (Design-Element). */
    .floaty { animation: rise-in .55s .12s ease-out both, floaty 5.5s 1.2s ease-in-out infinite; }
    @keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

    /* Maus-Parallax im Hero (Vars von enhance.js). */
    .hero-blob {
      translate: calc(var(--mx, 0) * 18px) calc(var(--my, 0) * 12px);
      transition: translate .35s ease-out;
      animation: blob-drift 22s ease-in-out infinite alternate;
    }
    .hero-grid {
      translate: calc(var(--mx, 0) * 8px) calc(var(--my, 0) * 5px);
      transition: translate .45s ease-out;
    }
    @keyframes blob-drift {
      from { background-position: 0% 0%; filter: hue-rotate(0deg); }
      to   { background-position: 6% 10%; filter: hue-rotate(12deg); }
    }

    @supports (animation-timeline: scroll()) {
      /* Scroll-Parallax der Hero-Ebenen. */
      .hero-blob { animation: blob-drift 22s ease-in-out infinite alternate, hero-para-slow linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 120vh; }
      .hero-grid { animation: hero-para-fast linear both; animation-timeline: scroll(root); animation-range: 0 120vh; }
      @keyframes hero-para-slow { to { transform: translateY(22vh); } }
      @keyframes hero-para-fast { to { transform: translateY(11vh); } }

      /* Scroll-Progress + schrumpfender Header. */
      .scroll-progress { animation: grow-progress linear both; animation-timeline: scroll(root); }
      @keyframes grow-progress { to { transform: scaleX(1); } }
      .header-inner { animation: shrink-header linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
      @keyframes shrink-header { to { padding-block: .4rem; } }
      .brand-mark { animation: shrink-mark linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
      @keyframes shrink-mark { to { width: 2.1rem; height: 2.1rem; } }

    }

    /* Keyframes der Scroll-Story — bewusst außerhalb des @supports-Blocks,
       damit auch der JS-Scrub-Fallback (.no-sda, s. u.) sie nutzen kann.
       Ohne animation-Zuweisung sind sie wirkungslos. */
    /* Startzustände leben NUR in den from-Frames: Läuft die Scroll-Timeline
       nicht (Browser-Grauzone), bleibt so der fertige Basiszustand stehen
       statt eines eingefrorenen Startbilds. */
    @keyframes demo-relax { from { width: 92%; background-color: var(--state-voll); } to { width: 58%; background-color: var(--state-mittel); } }
    @keyframes demo-fillup { from { width: 20%; background-color: var(--state-frei); } to { width: 50%; background-color: var(--state-mittel); } }
    @keyframes badge-swap-a { from { opacity: 1; } to { opacity: 0; } }
    @keyframes badge-swap-b { from { opacity: 0; } to { opacity: 1; } }
    @keyframes dot-hop {
      0%   { opacity: 0; transform: translateY(0) scale(.6); }
      15%  { opacity: 1; transform: translateY(-14px) scale(1); }
      85%  { opacity: 1; transform: translateY(46px) scale(1); }
      100% { opacity: 0; transform: translateY(60px) scale(.6); }
    }
    @keyframes step-glow { 0% { opacity: .28; } 12% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: .32; } }
    @keyframes step-glow-stay { 0% { opacity: .28; } 15% { opacity: 1; } 100% { opacity: 1; } }
    @media (max-width: 759.98px) {
      @keyframes dot-hop {
        0%   { opacity: 0; transform: translateY(0) scale(.6); }
        15%  { opacity: 1; transform: translateY(-12px) scale(1); }
        85%  { opacity: 1; transform: translateY(38px) scale(1); }
        100% { opacity: 0; transform: translateY(50px) scale(.6); }
      }
    }

    /* Verschärfter Feature-Test: ALLE genutzten Scroll-Timeline-Bausteine
       müssen da sein (benannte view-timeline + cover-Ranges) — Browser,
       die nur view() melden, fallen sonst in eine halb-native Grauzone.
       enhance.js nutzt exakt denselben Test für den JS-Scrub-Fallback. */
    @supports ((animation-timeline: view()) and (view-timeline: --a block) and (animation-range: cover 0% cover 100%)) {
      /* Scroll-Reveal für Karten. */
      .observe {
        animation: rise-in linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 40%;
      }

      /* ---------- Scroll-Story ----------
         Gemeinsame Animationen; beide Layouts hängen an der
         --story-Timeline der Sektion: Desktop pinnt die ganze Bühne,
         Mobile pinnt nur die Demo-Karte unterm Header. */
      .demo-fill-9 { animation: demo-relax linear both; }
      .demo-fill-11 { animation: demo-fillup linear both; }
      .demo-badge > span { animation: badge-swap-a linear both; }
      .demo-badge .badge-b { animation-name: badge-swap-b; }
      .demo-dot { animation: dot-hop linear both; }
      .dot-2 { left: 46%; }
      .dot-3 { left: 58%; }

      @media (min-width: 760px) {
        .story-track { height: 240vh; padding-block: 0; view-timeline: --story block; }
        .story-sticky { position: sticky; top: max(12vh, 7rem); padding-block: var(--space-6); }
        .story-step { animation: step-glow linear both; animation-timeline: --story; }
        .step-1 { animation-range: cover 2% cover 34%; }
        .step-2 { animation-range: cover 30% cover 62%; }
        .step-3 { animation-range: cover 58% cover 95%; animation-name: step-glow-stay; }
        .demo-fill-9 { animation-timeline: --story; animation-range: cover 40% cover 78%; }
        .demo-fill-11 { animation-timeline: --story; animation-range: cover 42% cover 80%; }
        .demo-badge > span { animation-timeline: --story; animation-range: cover 55% cover 70%; }
        .demo-dot { animation-timeline: --story; }
        .dot-1 { animation-range: cover 42% cover 62%; }
        .dot-2 { animation-range: cover 48% cover 68%; }
        .dot-3 { animation-range: cover 54% cover 74%; }
      }

      @media (max-width: 759.98px) {
        /* Mobile-Pinning: Die Demo-Karte klebt kompakt oben unterm Header,
           die Schritte scrollen darunter durch und leuchten der Reihe nach —
           alles an einer gemeinsamen Timeline über die ganze Sektion. */
        .story-track { view-timeline: --story block; }
        .story-sticky {
          display: flex;
          flex-direction: column;
          align-items: stretch;
          gap: var(--space-4);
        }
        .story-demo {
          order: -1;
          position: sticky;
          top: .75rem;
          z-index: 5;
          box-shadow: var(--shadow-float);
          min-height: 0;
          padding: var(--space-4);
          gap: var(--space-3);
        }
        /* Mehr Scrollweg pro Schritt: Die Karte bleibt länger gepinnt
           und die Schritte bekommen Zeit zum Erzählen. */
        .story-step { margin-top: 12vh; }
        .story-sticky { padding-bottom: 16vh; }
        .demo-row { grid-template-columns: 3.4rem 1fr 3.2rem; height: 34px; }
        .demo-time { font-size: .78rem; }
        .demo-badge { font-size: .74rem; }
        .demo-dot { top: 50px; width: 10px; height: 10px; }
        /* Choreografie startet erst, wenn die Karte angedockt ist. */
        .story-step { animation: step-glow linear both; animation-timeline: --story; }
        .step-1 { animation-range: cover 22% cover 47%; }
        .step-2 { animation-range: cover 44% cover 69%; }
        .step-3 { animation-range: cover 66% cover 94%; animation-name: step-glow-stay; }
        .demo-fill-9 { animation-timeline: --story; animation-range: cover 26% cover 74%; }
        .demo-fill-11 { animation-timeline: --story; animation-range: cover 30% cover 78%; }
        .demo-badge > span { animation-timeline: --story; animation-range: cover 60% cover 80%; }
        .demo-dot { animation-timeline: --story; }
        .dot-1 { animation-range: cover 28% cover 60%; }
        .dot-2 { animation-range: cover 36% cover 68%; }
        .dot-3 { animation-range: cover 44% cover 76%; }
      }

      /* Anfahrtskarte zeichnet sich beim Einscrollen. */
      .map { view-timeline: --map block; }
      .map .map-draw {
        stroke-dasharray: 1;
        animation: map-draw linear both;
        animation-timeline: --map;
        animation-range: entry 10% entry 90%;
      }
      .map .map-main { animation-range: entry 5% entry 70%; }
      @keyframes map-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
      .map .map-fade { animation: map-fade linear both; animation-timeline: --map; animation-range: entry 55% entry 100%; }
      @keyframes map-fade { from { opacity: 0; } to { opacity: 1; } }
      .map .map-marker {
        transform-origin: 300px 150px;
        animation: marker-pop linear both;
        animation-timeline: --map;
        animation-range: entry 60% entry 95%;
      }
      @keyframes marker-pop { from { scale: 0; } 70% { scale: 1.15; } 100% { scale: 1; } }
    }

    /* ---------- Scroll-Story: JS-Scrub-Fallback ----------
       Für Browser OHNE Scroll-Timelines (iOS/WebKit vor Version 26 —
       dort ist auch „Chrome“ WebKit): enhance.js setzt <html class="no-sda">
       und scrubbt diese pausierten Animationen über die Web Animations
       API (currentTime aus dem Scroll-Fortschritt). Je Element definieren
       --a (Start) und --d (Dauer) das Fenster — identisch zu den
       animation-ranges oben. Ohne JavaScript bleibt der statische
       Basiszustand. */
    .no-sda .story-step,
    .no-sda .demo-fill-9,
    .no-sda .demo-fill-11,
    .no-sda .demo-badge > span,
    .no-sda .demo-dot {
      animation-duration: 1s;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-play-state: paused;
      /* Explizit zeitbasiert — neutralisiert eine etwaige Scroll-Timeline,
         damit das WAAPI-Scrubbing (currentTime in ms) immer greift. */
      animation-timeline: auto;
      animation-range: normal;
    }
    .no-sda .story-step { opacity: .28; animation-name: step-glow; }
    .no-sda .step-3 { animation-name: step-glow-stay; }
    .no-sda .demo-fill-9 { width: 92%; background: var(--state-voll); animation-name: demo-relax; }
    .no-sda .demo-fill-11 { width: 20%; background: var(--state-frei); animation-name: demo-fillup; }
    .no-sda .demo-badge .badge-a { opacity: 1; }
    .no-sda .demo-badge .badge-b { opacity: 0; }
    .no-sda .demo-badge > span { animation-name: badge-swap-a; }
    .no-sda .demo-badge .badge-b { animation-name: badge-swap-b; }
    .no-sda .demo-dot { animation-name: dot-hop; }
    .no-sda .dot-2 { left: 46%; }
    .no-sda .dot-3 { left: 58%; }
    @media (min-width: 760px) {
      .no-sda .story-track { height: 240vh; padding-block: 0; }
      .no-sda .story-sticky { position: sticky; top: max(12vh, 7rem); padding-block: var(--space-6); }
      .no-sda .step-1 { --a: .02; --d: .32; }
      .no-sda .step-2 { --a: .30; --d: .32; }
      .no-sda .step-3 { --a: .58; --d: .37; }
      .no-sda .demo-fill-9 { --a: .40; --d: .38; }
      .no-sda .demo-fill-11 { --a: .42; --d: .38; }
      .no-sda .demo-badge > span { --a: .55; --d: .15; }
      .no-sda .dot-1 { --a: .42; --d: .20; }
      .no-sda .dot-2 { --a: .48; --d: .20; }
      .no-sda .dot-3 { --a: .54; --d: .20; }
    }
    @media (max-width: 759.98px) {
      .no-sda .story-sticky {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
        padding-bottom: 16vh;
      }
      .no-sda .story-demo {
        order: -1;
        position: sticky;
        top: .75rem;
        z-index: 5;
        box-shadow: var(--shadow-float);
        min-height: 0;
        padding: var(--space-4);
        gap: var(--space-3);
      }
      .no-sda .story-step { margin-top: 12vh; }
      .no-sda .demo-row { grid-template-columns: 3.4rem 1fr 3.2rem; height: 34px; }
      .no-sda .demo-time { font-size: .78rem; }
      .no-sda .demo-badge { font-size: .74rem; }
      .no-sda .demo-dot { top: 50px; width: 10px; height: 10px; }
      .no-sda .step-1 { --a: .22; --d: .25; }
      .no-sda .step-2 { --a: .44; --d: .25; }
      .no-sda .step-3 { --a: .66; --d: .28; }
      .no-sda .demo-fill-9 { --a: .26; --d: .48; }
      .no-sda .demo-fill-11 { --a: .30; --d: .48; }
      .no-sda .demo-badge > span { --a: .60; --d: .20; }
      .no-sda .dot-1 { --a: .28; --d: .32; }
      .no-sda .dot-2 { --a: .36; --d: .32; }
      .no-sda .dot-3 { --a: .44; --d: .32; }
    }

    .map .map-marker path { animation: marker-pulse 3s ease-in-out 2s infinite; transform-origin: 0 -14px; transform-box: fill-box; }
    @keyframes marker-pulse { 50% { opacity: .82; } }

    /* Cursor-Effekte (Vars von enhance.js, nur mit Maus). */
    @media (hover: hover) and (pointer: fine) {
      .card {
        transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
        transition: transform .25s ease-out, box-shadow .2s ease;
      }
      .card:hover { --lift: -4px; box-shadow: var(--shadow-2); }
      .card::after {
        content: "";
        position: absolute; inset: 0;
        border-radius: inherit;
        pointer-events: none;
        opacity: var(--glow, 0);
        background: radial-gradient(180px circle at var(--gx, 50%) var(--gy, 50%), oklch(0.52 0.14 255 / .07), transparent 70%);
        transition: opacity .25s ease;
      }

      .matrix { position: relative; }
      .matrix::after {
        content: "";
        position: absolute; inset: 0;
        pointer-events: none;
        opacity: var(--spot, 0);
        background: radial-gradient(170px circle at var(--sx, 50%) var(--sy, 50%), oklch(0.52 0.14 255 / .08), transparent 72%);
        transition: opacity .3s ease;
      }
    }
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-panel { max-width: 34rem; }
}

@media (max-width: 900px) {
  /* Mobil kein Sticky-Header: Er stapelt mehrzeilig und würde die
     gepinnte Story-Karte verdecken; Platz ist mobil wertvoller. */
  .site-header { position: static; }
  .header-inner { gap: var(--space-3); padding-block: .8rem; }
  /* Nav in EINER Zeile, seitlich wischbar — statt drei umgebrochener Zeilen. */
  .site-nav {
    order: 3; width: 100%; min-width: 0; margin-inline-start: 0; gap: var(--space-4);
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-block: 2px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
  .header-actions { margin-inline-start: auto; flex: 0 0 auto; }
  .brand-sub { display: none; }
  .brand-mark { width: 2.5rem; height: 2.5rem; flex: 0 0 auto; }
  /* Zeile 1 (Logo + Name + Aktionen) darf NIE umbrechen: Der Name
     skaliert mit der Viewportbreite, statt die Buttons zu verdrängen. */
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-name { font-size: clamp(.82rem, 3.4vw + .1rem, 1.1rem); white-space: nowrap; }

  /* Touch (iPhone/Android): 44-px-Ziele; bei Platzmangel wischt das Raster
     seitlich statt die Kacheln unter die Fingergröße zu quetschen. */
  .matrix { padding-bottom: 4px; }
  .cg-cell { height: 44px; min-width: 42px; border-radius: 8px; }
  .cg-lane { font-size: .74rem; }
  .click-grid { gap: 5px; }
}

@media (max-width: 640px) {
  :root {
    --space-7: 2.75rem;
    --space-8: 3.25rem;
  }
  .phone-label { display: none; }
  /* Wichtigster Button bleibt — nur kompakter und mit Kurzlabel. */
  .btn-nav { padding: 9px 14px; font-size: .85rem; }
  .btn-nav .label-full, .lang-switch .label-full { display: none; }
  .btn-nav .label-short, .lang-switch .label-short { display: inline; }
  .lang-switch { padding: 7px 10px; }
  .hero { padding-block: var(--space-6) var(--space-5); }
  .hero-lead { font-size: var(--step-0); }
  /* Nur auf Handys zentrieren — iPad/Desktop bleiben linksbündig. */
  .hero-actions { justify-content: center; }
  .hero-meta { text-align: center; }
  .live-card { padding: var(--space-4); }
  .contact-card, .dark-card { padding: var(--space-5); }
  .reservation-card { padding: var(--space-5); }
  .story-demo { padding: var(--space-5) var(--space-4); }
  .day-pill { padding: 12px 16px; }
  .day-pill.is-far { padding: 9px 12px; }
  .card { padding: var(--space-4); }
  .wrap { width: min(100% - 2rem, 72rem); }
}

/* Telefon im Header braucht ~120 px — bis hierhin kollidiert er mit der
   Ein-Zeilen-Garantie für Logo + Name + Aktionen (Nummer steht ohnehin
   prominent im Hero und Footer). */
@media (max-width: 560px) {
  .phone-link { display: none; }
}

@media (max-width: 430px) {
  .header-inner { gap: var(--space-2); }
  .header-actions { gap: var(--space-2); }
  .btn-nav { padding: 8px 11px; font-size: .82rem; }
  .lang-switch { padding: 6px 9px; font-size: .82rem; }
}

@media (max-width: 374.98px) {
  .brand { gap: 7px; }
  .brand-mark { width: 2.2rem; height: 2.2rem; }
  .brand-name { font-size: .78rem; }
  .btn-nav { padding: 7px 9px; font-size: .78rem; }
  .lang-switch { padding: 5px 8px; font-size: .78rem; }
}

/* Schmalste Geräte (Galaxy Fold 344, alte 320er): Der Name stapelt
   zweizeilig neben dem Logo, statt die Buttons zu verdrängen.
   flex-basis 0 nimmt den Brand aus der Zeilenbildungs-Rechnung —
   bei flex-wrap zählt sonst die einzeilige Wunschbreite. */
@media (max-width: 344.98px) {
  .brand { flex: 1 1 0; }
  .brand-name { white-space: normal; line-height: 1.12; font-size: .8rem; }
}


/* ============================================================
   View Transitions (Top-Level): sanfte Seitenwechsel ohne JS —
   Header/Footer/Notice bleiben stehen, der Inhalt crossfadet;
   die Auslastungs-Matrix slidet beim Tageswechsel (Richtung
   setzt enhance.js via html[data-vt]).
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  .site-header { view-transition-name: site-header; }
  .site-footer { view-transition-name: site-footer; }
  .matrix { view-transition-name: matrix; }
  .matrix-day { view-transition-name: matrix-day; }

  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
  ::view-transition-old(matrix), ::view-transition-old(matrix-day) { animation: vt-out-l .28s ease both; }
  ::view-transition-new(matrix), ::view-transition-new(matrix-day) { animation: vt-in-r .28s ease both; }
  html[data-vt="back"]::view-transition-old(matrix), html[data-vt="back"]::view-transition-old(matrix-day) { animation-name: vt-out-r; }
  html[data-vt="back"]::view-transition-new(matrix), html[data-vt="back"]::view-transition-new(matrix-day) { animation-name: vt-in-l; }
  @keyframes vt-out-l { to { opacity: 0; transform: translateX(-28px); } }
  @keyframes vt-in-r { from { opacity: 0; transform: translateX(28px); } }
  @keyframes vt-out-r { to { opacity: 0; transform: translateX(28px); } }
  @keyframes vt-in-l { from { opacity: 0; transform: translateX(-28px); } }
}

/* ============================================================
   Quartals-Dialog: erscheint vor der ersten Vormerkung.
   Natives <dialog> — ohne JavaScript öffnet es nie und die
   Kacheln reservieren direkt (Progressive Enhancement).
   ============================================================ */
dialog.qd {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 26rem);
  margin: auto;
}
dialog.qd::backdrop {
  background: rgb(23 26 32 / .45);
  backdrop-filter: blur(4px);
}
.qd-card {
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgb(23 26 32 / .25);
  padding: var(--space-6);
  text-align: center;
}
.qd-icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  margin: 0 auto var(--space-4);
  border-radius: 16px;
  background: var(--color-accent-tint);
  color: var(--color-accent-text);
}
.qd-icon-ok {
  background: var(--state-frei-bg);
  color: var(--state-frei);
  font-size: 1.5rem; font-weight: 700;
  border-radius: 50%;
}
.qd-title { font-size: var(--step-1); margin-bottom: var(--space-2); }
.qd-text { color: var(--color-ink-soft); font-size: .95rem; max-width: 34ch; margin-inline: auto; }
.qd-actions {
  display: grid; gap: var(--space-2);
  margin-top: var(--space-5);
}
.qd-step-comein { display: none; }
dialog.qd[data-step="comein"] .qd-step-question { display: none; }
dialog.qd[data-step="comein"] .qd-step-comein { display: block; }

/* Video-Sicherheits-Check: Dialog-Feinschliff (un-layered wie die
   qd-Basisregeln, sonst gewännen deren margin-Werte die Kaskade). */
dialog.vc .qd-card { text-align: center; }
dialog.vc .qd-title { max-width: 30ch; margin-inline: auto; margin-bottom: var(--space-4); }
dialog.vc[data-step="questions"] .qd-title { margin-bottom: var(--space-6); }
dialog.vc .vc-row { text-align: left; }
dialog.vc .qd-actions { margin-top: var(--space-6); }
dialog.vc .note { margin-top: var(--space-3); }
dialog.vc .vc-step { display: none; }
dialog.vc[data-step="known"] .vc-step-known,
dialog.vc[data-step="new"] .vc-step-new,
dialog.vc[data-step="questions"] .vc-step-questions,
dialog.vc[data-step="stop"] .vc-step-stop { display: block; }

@media (prefers-reduced-motion: no-preference) {
  dialog.qd {
    opacity: 0;
    transform: translateY(10px) scale(.96);
    transition: opacity .22s ease, transform .22s cubic-bezier(.22, 1, .36, 1), overlay .22s ease allow-discrete, display .22s ease allow-discrete;
  }
  dialog.qd[open] { opacity: 1; transform: none; }
  @starting-style {
    dialog.qd[open] { opacity: 0; transform: translateY(10px) scale(.96); }
  }
  dialog.qd::backdrop {
    transition: opacity .22s ease, overlay .22s ease allow-discrete, display .22s ease allow-discrete;
    opacity: 0;
  }
  dialog.qd[open]::backdrop { opacity: 1; }
  @starting-style {
    dialog.qd[open]::backdrop { opacity: 0; }
  }
}
