/* =============================================================================
   studioherz — Stylesheet

   0.  Schrift
   1.  Design-Tokens, hell und dunkel
   2.  Reset & Basis
   3.  Typografie
   4.  Layout & Container
   5.  Leiste mit den Profilen
   6.  Kopfbereich & Navigation
   7.  Umschalter (Sprache, Darstellung)
   8.  Buttons
   9.  Auftakt
   10. Abschnitte & Karten
   11. Playlisten
   12. Stimmen
   13. Wissensseite
   14. Fußbereich
   15. Rechtsseiten & 404
   16. Lernchallenge: Steuerung
   17. Lernchallenge: Themenrad
   18. Lernchallenge: Timer
   19. Lernchallenge: Einstellungen
   20. Cookie-Banner
   21. Hilfsklassen
   22. Animationen
   23. Breakpoints
   24. Barrierefreiheit & Fallbacks
   ============================================================================= */


/* ============================== 0. SCHRIFT ============================== */

/* Eine selbstgehostete Variable-Schrift statt der 24 Schriften, die das
   frühere Theme vorsorglich geladen hat. */
@font-face {
    font-family: "Inter";
    src: url("assets/fonts/inter-variable.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}


/* ==================== 1. DESIGN-TOKENS, HELL UND DUNKEL ====================
   Grundstellung ist hell. Steht das Gerät auf dunkel, greift der
   prefers-color-scheme-Block. Der Umschalter im Kopf setzt data-theme am
   Wurzelelement und gewinnt in beide Richtungen. */

:root {
    /* Marke: das Blau stammt aus dem Verifikationshaken im Logo (#2A77F2).
       Als Arbeitsfarbe eine Spur dunkler, damit weisser Text darauf und der
       Farbwert selbst auf Weiss die 4,5:1 aus WCAG AA erreichen — #2A77F2
       kaeme nur auf 4,18:1. Dazu Apples Schwarz- und Grauwerte. */
    --brand-blue: #2A77F2;
    --ink-brand: #1D1D1F;
    --mist: #F5F5F7;

    --bg: #FFFFFF;
    --bg-alt: var(--mist);
    --surface: #FFFFFF;
    --surface-alt: var(--mist);
    --text: var(--ink-brand);
    --muted: #6E6E73;
    --accent: #1A6BE8;
    --accent-strong: #0A5FD0;
    --on-accent: #FFFFFF;
    --line: #D2D2D7;
    --ring: #1a6be829;
    --topbar-bg: #F5F5F7;
    --topbar-text: #1D1D1F;
    --shadow: 0 18px 45px #0000001a;
    --shadow-sm: 0 4px 14px #00000012;
    --glow: radial-gradient(70% 60% at 20% 0%, #1a6be814, #0000 60%),
            radial-gradient(60% 55% at 90% 10%, #2a77f20f, #0000 55%);

    --container: 1140px;
    --container-narrow: 760px;
    --radius-sm: 0.75rem;
    --radius-md: 1.15rem;
    --radius-lg: 1.75rem;
    --radius-pill: 9999px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --dur-fast: 0.18s;
    --dur-mid: 0.32s;

    color-scheme: light;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Die Seite startet immer hell — auch auf Geraeten, die auf Dunkel stehen.
   Dunkel gibt es ausschliesslich ueber den Umschalter im Kopf, der die Wahl
   als data-theme="dark" setzt und im lokalen Speicher merkt. Deshalb gibt es
   hier bewusst keinen prefers-color-scheme-Block. */
:root[data-theme="dark"] {
    --bg: #000000;
    --bg-alt: #111113;
    --surface: #1C1C1E;
    --surface-alt: #2C2C2E;
    --text: #F5F5F7;
    --muted: #98989D;
    --accent: #4E93FF;
    --accent-strong: #6FA8FF;
    --on-accent: #000000;
    --line: #38383D;
    --ring: #4e93ff2e;
    --topbar-bg: #1C1C1E;
    --topbar-text: #F5F5F7;
    --shadow: 0 18px 45px #00000080;
    --shadow-sm: 0 4px 14px #00000059;
    --glow: radial-gradient(70% 60% at 20% 0%, #4e93ff1f, #0000 60%),
            radial-gradient(60% 55% at 90% 10%, #2a77f214, #0000 55%);
    color-scheme: dark;
}


/* ============================= 2. RESET & BASIS ============================= */

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

html {
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
    scroll-padding-top: 6.5rem;
}

body {
    min-height: 100svh;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-wrap: anywhere;
    transition: background var(--dur-mid), color var(--dur-mid);
}

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

button,
input {
    font: inherit;
    color: inherit;
}

a {
    color: var(--accent);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent-strong);
}

[hidden] {
    display: none !important;
}

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

::selection {
    background: var(--accent);
    color: var(--on-accent);
}


/* ============================= 3. TYPOGRAFIE ============================= */

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
h4 { font-size: 1.05rem; letter-spacing: -0.01em; }

/* Utility fuer Ueberschriften, die in der Gliederung hoeher stehen muessen,
   als sie aussehen sollen — etwa die Albumtitel in den Musikkarten: dort
   traegt ein h2 die Karte, optisch passt aber die h3-Groesse. */
.h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }

p { text-wrap: pretty; }

.lead {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.6;
    color: var(--muted);
}

.eyebrow {
    display: block;
    margin-bottom: 0.9rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}


/* ========================= 4. LAYOUT & CONTAINER ========================= */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: max(1.15rem, env(safe-area-inset-left, 0px));
}

.container-narrow { max-width: var(--container-narrow); }

/* Kompakt, aber mit Luft: unten 2,75 rem auf dem Handy, oben bis 4,5 rem
   auf grossen Schirmen. */
.section { padding-block: clamp(2.75rem, 6vw, 4.5rem); }

.section-alt {
    background: var(--bg-alt);
    transition: background var(--dur-mid);
}

.section-head {
    max-width: 46rem;
    margin-bottom: clamp(1.6rem, 3vw, 2.4rem);
}

.section-head.is-centered {
    margin-inline: auto;
    text-align: center;
}


/* ==================== 5. LEISTE MIT DEN PROFILEN ==================== */

/* Diese Leiste erscheint ausschliesslich auf der Sprechuebung (/learn) und
   sitzt dort unter dem Kopfbereich. Bewusst sehr flach: eine Zeile, kleine
   Schrift, kaum Hoehe. Auf den uebrigen Seiten fuehren die Profile ueber den
   Fussbereich. */
.topbar {
    background: var(--topbar-bg);
    color: var(--topbar-text);
    border-bottom: 1px solid var(--line);
    font-size: 0.76rem;
    transition: background var(--dur-mid);
}

/* Eine Zeile, die bei Platzmangel seitlich scrollt statt umzubrechen. */
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.1rem;
    padding-block: 0.25rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    white-space: nowrap;
}

.topbar-inner::-webkit-scrollbar { display: none; }

.topbar-label {
    flex-shrink: 0;
    margin-right: 0.3rem;
    color: var(--muted);
}

.topbar-link {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-weight: 550;
    text-decoration: none;
    touch-action: manipulation;
    transition: background var(--dur-fast), color var(--dur-fast);
}

.topbar-link:hover {
    background: var(--surface);
    color: var(--accent-strong);
}

.topbar-link svg {
    width: 0.8rem;
    height: 0.8rem;
}

/* Auf schmalen Schirmen passen vier Namen nicht nebeneinander. Statt sie
   umbrechen zu lassen (die Leiste soll flach bleiben), schrumpfen Schrift und
   Abstaende; der Rest ist seitlich erreichbar. */
@media (max-width: 560px) {
    .topbar { font-size: 0.7rem; }
    .topbar-link { gap: 0.2rem; padding: 0.2rem 0.3rem; }
    .topbar-link svg { width: 0.72rem; height: 0.72rem; }
    .topbar-label { margin-right: 0.2rem; }
}

@media (min-width: 700px) {
    .topbar-inner { justify-content: center; }
}

.topbar-link svg {
    flex-shrink: 0;
    width: 0.95rem;
    height: 0.95rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8px;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==================== 6. KOPFBEREICH & NAVIGATION ==================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-mid), box-shadow var(--dur-mid);
}

.site-header.is-stuck {
    border-bottom-color: var(--line);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.25rem;
}

.brand {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand:hover { color: var(--accent); }

/* KEIN border-radius auf dem Logo: Der blaue Verifikationshaken sitzt unten
   rechts ausserhalb des schwarzen Kreises, bis in die Bildecke hinein. Ein
   Kreisbeschnitt wuerde ihn abschneiden. Das Bild ist bereits freigestellt. */
.brand img {
    width: 2.2rem;
    height: 2.2rem;
}

/* In der dunklen Darstellung waere der schwarze Logokreis unsichtbar. Die
   Umkehr plus Farbtondrehung macht ihn hell und laesst den Haken blau. */
:root[data-theme="dark"] .brand img,
:root[data-theme="dark"] .hero-art img,
:root[data-theme="dark"] .footer-brand img {
    filter: invert(1) hue-rotate(180deg);
}

.nav {
    display: none;
    align-items: center;
    gap: 0.15rem;
}

.nav a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast), background var(--dur-fast);
}

.nav a:hover {
    background: var(--surface-alt);
    color: var(--accent);
}

.nav a[aria-current="page"] {
    background: var(--surface-alt);
    color: var(--accent);
}

.header-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.4rem;
}

.nav-toggle {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--dur-fast), border-color var(--dur-fast);
}

.nav-toggle:hover {
    background: var(--surface-alt);
    border-color: var(--accent);
}

.nav-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9px;
    stroke-linecap: round;
}

/* Aufklappmenue als Overlay: Es legt sich ueber die Seite, statt den Inhalt
   nach unten zu schieben. Schmal und mittig, nicht ueber die volle Breite. */
/* Zentrierung ueber left/right + margin-inline, NICHT ueber transform:
   die Einblend-Animation belegt transform bereits und wuerde eine
   Zentrierung per translateX wieder aufheben. */
.nav-drawer {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    gap: 0.15rem;
    width: min(20rem, calc(100% - 2rem));
    margin-inline: auto;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    animation: menu-in 0.2s var(--ease-out) both;
}

.nav-drawer a {
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 550;
    text-align: center;
    text-decoration: none;
    transition: background var(--dur-fast), color var(--dur-fast);
}

.nav-drawer a:hover,
.nav-drawer a[aria-current="page"] {
    background: var(--surface-alt);
    color: var(--accent);
}

/* Abdunkelung hinter dem offenen Menue — schliesst per Klick.
   WICHTIG: z-index MUSS unter dem des Kopfbereichs (30) liegen. Der Kopf ist
   sticky mit eigenem z-index und bildet damit einen eigenen Stapelkontext;
   das Menue darin kann den Scrim nicht ueberragen, egal wie hoch sein eigener
   z-index ist. Lag der Scrim darueber, war die Seite grau und kein Menuepunkt
   mehr anklickbar. */
.nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: #00000040;
    animation: fade-in var(--dur-fast) both;
}

/* Hamburger wird beim Oeffnen zum Kreuz. */
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-toggle[aria-expanded="true"] {
    background: var(--surface-alt);
    border-color: var(--accent);
    color: var(--accent);
}


/* =============== 7. UMSCHALTER (SPRACHE, DARSTELLUNG) =============== */

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    height: 2.6rem;
    min-width: 2.6rem;
    padding: 0 0.7rem;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.icon-btn:hover:not(:disabled) {
    background: var(--surface-alt);
    border-color: var(--accent);
    color: var(--accent);
}

.icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.icon-btn svg {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Sonne und Mond wechseln sich ab, gesteuert über data-theme. */
.theme-icon-dark { display: none; }

:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark  { display: block; }


/* ============================== 8. BUTTONS ============================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform var(--dur-fast), background var(--dur-fast), color var(--dur-fast),
                border-color var(--dur-fast), box-shadow var(--dur-fast), opacity var(--dur-fast);
}

.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(1px); }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 10px 26px var(--ring);
}

.btn.primary:not(:disabled):hover {
    background: var(--accent-strong);
    color: var(--on-accent);
}

.btn.secondary {
    background: transparent;
    border-color: var(--line);
    color: var(--text);
}

.btn.secondary:not(:disabled):hover {
    background: var(--surface-alt);
    border-color: var(--accent);
    color: var(--accent);
}

.btn.ghost {
    padding: 0.5rem 0.8rem;
    background: none;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 550;
    text-decoration: underline;
}

.btn.ghost:not(:disabled):hover { color: var(--text); }

.btn svg {
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-row.is-centered { justify-content: center; }


/* ============================= 9. AUFTAKT ============================= */

.hero {
    position: relative;
    padding-block: clamp(3rem, 8vw, 5.5rem) clamp(3rem, 7vw, 5rem);
    background: var(--glow);
    overflow: hidden;
}

.hero-inner {
    display: grid;
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: center;
}

.hero-copy { min-width: 0; }

.hero h1 { margin-bottom: 1.1rem; }

.hero .lead {
    max-width: 34rem;
    margin-bottom: 1.9rem;
}

.hero-art {
    justify-self: center;
    width: 100%;
    max-width: 19rem;
}

/* Ebenfalls ohne Kreisbeschnitt — siehe Hinweis beim Kopfbereich. */
.hero-art img {
    width: 100%;
}

.hero-lead-mobile {
    display: none;
}

.frequency-hero {
    background: var(--glow);
}

.frequency-hero::after {
    display: none;
    position: absolute;
    z-index: -1;
    inset: 0;
    background: rgba(5, 14, 24, 0.56);
    content: "";
}

.hero-bg-video {
    display: none;
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.frequency-hero h1,
.frequency-hero .lead {
    color: var(--text);
    text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
    .frequency-hero .hero-bg-video {
        display: none !important;
    }
}

/* Handyansicht: Die Startseite beginnt mit dem kleineren, mittig gesetzten
   Logo. Text und Handlungsbutton folgen darunter ebenfalls zentriert. */
@media (max-width: 699px) {
    .nav-drawer a[href="wissen.html"],
    .nav-drawer a[href="ueber-studioherz.html"] {
        display: none;
    }

    .hero-inner {
        gap: 1.5rem;
        text-align: center;
    }

    .hero-art {
        grid-row: 1;
        max-width: 11rem;
    }

    .home-hero .hero-art {
        max-width: 8.5rem;
    }

    .hero-copy {
        grid-row: 2;
    }

    .hero .lead {
        margin-inline: auto;
    }

    .hero .btn-row {
        justify-content: center;
    }

    .frequency-hero .hero-lead-desktop,
    .frequency-hero .hero-more-link {
        display: none;
    }

    .frequency-hero .hero-lead-mobile {
        display: block;
    }

    .frequency-hero {
        isolation: isolate;
        background: linear-gradient(135deg, #142538, #07111d);
    }

    .frequency-hero::after,
    .frequency-hero .hero-bg-video {
        display: block;
    }

    .frequency-hero .hero-bg-video {
        object-position: center 42%;
    }

    .frequency-hero h1,
    .frequency-hero .lead {
        color: #fff;
        text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
    }

    .frequency-hero .hero-inner {
        position: relative;
        text-align: left;
    }

    .frequency-hero .hero-copy {
        grid-row: 2;
        padding-top: 0;
    }

    .frequency-hero .hero-art {
        position: static;
        grid-row: 1;
        justify-self: start;
        width: 4.25rem;
        max-width: 4.25rem;
    }

    .frequency-hero .hero-art img {
        filter: invert(1) hue-rotate(180deg);
    }

    .frequency-hero .lead {
        margin-inline: 0;
    }

    .frequency-hero .btn-row {
        justify-content: flex-start;
    }
}

.services {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.25rem;
}

/* Die Streaming-Dienste stehen jetzt in einem eigenen Abschnitt weiter unten
   statt im Auftakt — dort sitzen sie mittig unter der Ueberschrift. */
.services.is-centered {
    justify-content: center;
    margin-top: 0;
}

/* Deutlich groesser als zuvor: Das Dienst-Icon traegt die Wiedererkennung,
   der Name steht daneben — die Wortmarken der Dienste sind deshalb auf ihr
   Icon zugeschnitten. */
.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.35rem 0.7rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    touch-action: manipulation;
    transition: transform var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.service-link:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
    color: var(--text);
}

.service-link img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

/* Das Apple-Zeichen ist reines Schwarz und verschwaende auf dunklem Grund. */
:root[data-theme="dark"] .service-link img.is-monochrome,
:root[data-theme="dark"] .service-card-body img.is-monochrome {
    filter: invert(1);
}


/* ======================= 10. ABSCHNITTE & KARTEN ======================= */

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.6rem); }
.grid-2, .grid-3 { grid-template-columns: 1fr; }

.card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 0;
    padding: clamp(1.35rem, 3vw, 1.85rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur-mid), box-shadow var(--dur-mid), border-color var(--dur-mid);
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.card-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.25rem;
}

a.card {
    color: var(--text);
    text-decoration: none;
}

a.card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
    color: var(--text);
}

.card-more {
    margin-top: auto;
    padding-top: 0.4rem;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 650;
}

/* Nummerierte Schrittkarten: die Ziffer traegt, darunter Titel und ein Satz. */
.step {
    gap: 0.55rem;
    text-align: left;
}

.step-num {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.35rem;
    background: var(--accent);
    border-radius: var(--radius-pill);
    color: var(--on-accent);
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.step h3 {
    margin: 0;
    font-size: 1.08rem;
}

.step p {
    font-size: 0.94rem;
    line-height: 1.55;
}


/* ==================== 10a. BAUSTEINE DER PLATTFORM ====================
   studioherz ist mehr als die Musik: Neben Frequenzmusik gibt es
   Geführte Entspannung, Notfallaudios und die Lernchallenge. Die Bausteine
   hier tragen diese Bereiche — sie verwenden ausschliesslich die bereits
   gesetzten Tokens, damit die Erweiterung nicht wie ein Fremdkoerper wirkt. */

/* Fuenf Bereiche in einem Raster, das auf dem Handy einspaltig bleibt,
   dazwischen zweispaltig laeuft und ab 860 px drei Spalten zeigt. */
.grid-5 { grid-template-columns: 1fr; }

/* Ganze Saetze oder Kontaktwege als Schaltflaeche — laenger als ein Button,
   flacher als eine Karte. */
.moment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.moment-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 0.97rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    touch-action: manipulation;
    transition: transform var(--dur-fast), border-color var(--dur-fast),
                box-shadow var(--dur-fast), color var(--dur-fast);
}

.moment-link:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
    color: var(--text);
}

.moment-link::after {
    content: "→";
    color: var(--accent);
    font-weight: 700;
}

/* „Bald verfuegbar": angekuendigte Erweiterung, keine Fehlermeldung. Deshalb
   ruhiges Grau statt Signalfarbe und kein Ausrufezeichen-Ton. */
.badge {
    align-self: flex-start;
    padding: 0.2rem 0.7rem;
    background: var(--surface-alt);
    border-radius: var(--radius-pill);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Karten fuer Inhalte, die es noch nicht gibt: vollstaendig gestaltet, aber
   ohne Anfasser — kein Zeiger, kein Anheben, kein Abspiel-Symbol. */
.card.is-soon {
    background: var(--bg-alt);
    box-shadow: none;
}

.card.is-soon h3 { color: var(--text); }

.card-label {
    margin-top: auto;
    padding-top: 0.4rem;
}

/* Vorbereiteter Bereich mit Hinweis: hebt die Ankuendigung sichtbar hervor,
   ohne laut zu werden. */
.prep-note {
    max-width: 46rem;
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.prep-note h2 {
    font-size: clamp(1.25rem, 2.6vw, 1.6rem);
    margin-bottom: 0.9rem;
}

.prep-note p {
    color: var(--muted);
    margin-bottom: 0.8rem;
}

.prep-note p:last-of-type { margin-bottom: 0; }

.prep-note .btn-row { margin-top: 1.6rem; }

/* Verantwortungshinweis: sichtbar, aber ruhig und nicht alarmistisch. */
.callout.is-soft {
    max-width: 46rem;
    margin-inline: auto;
    background: var(--bg-alt);
    border-left-color: var(--line);
}

.callout.is-soft p {
    color: var(--muted);
    font-size: 0.93rem;
}


/* ============================ 11. PLAYLISTEN ============================ */

.playlist-card {
    padding: 0;
    overflow: hidden;
}

.playlist-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--surface-alt);
}

.playlist-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.25rem 1.35rem 1.45rem;
}

.playlist-body h3 { margin: 0; }

.playlist-freq {
    align-self: flex-start;
    padding: 0.2rem 0.65rem;
    background: var(--surface-alt);
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Etwas schmaler als die volle Textbreite — drei randlose Quadrate
   nebeneinander wirkten zu wuchtig. */
.service-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    max-width: 300px;
    margin-inline: auto;
}

/* Das Cover sitzt mit Abstand in der Karte und ist selbst abgerundet,
   statt bündig an den Kartenrand zu stossen. */
.service-card {
    display: flex;
    flex-direction: column;
    padding: 0.7rem;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
}

.service-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.service-card-body {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 0.55rem 0.4rem;
}

.service-card-body img {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
}

.service-card-body span {
    font-size: 0.95rem;
    font-weight: 650;
}

.service-card-body svg {
    margin-left: auto;
    width: 1.1rem;
    height: 1.1rem;
    color: var(--accent);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9px;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ============================= 12. STIMMEN ============================= */

.quote {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    padding: clamp(1.5rem, 3vw, 2rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.quote blockquote {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.6;
}

.quote figcaption {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.quote-name {
    color: var(--text);
    font-weight: 650;
}

.quote-mark {
    width: 2rem;
    height: 2rem;
    color: var(--accent);
    opacity: 0.5;
}


/* ========================== 13. WISSENSSEITE ========================== */

.prose {
    max-width: var(--container-narrow);
    margin-inline: auto;
}

.prose > * + * { margin-top: 1.1rem; }
.prose h2 { margin-top: clamp(2.75rem, 6vw, 4rem); }
.prose h3 { margin-top: 2rem; }

.prose p,
.prose li {
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.7;
}

.prose strong {
    color: var(--text);
    font-weight: 650;
}

.prose ul,
.prose ol { padding-left: 1.3rem; }

.prose li + li { margin-top: 0.5rem; }

.prose figure {
    margin-top: 2.25rem;
    margin-bottom: 2.25rem;
}

.prose figure img {
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}


/* --- Wissensabschnitte: Text links, Bild rechts --------------------------
   Untereinander auf schmalen Schirmen, ab 820 px nebeneinander. Das haelt
   die Seite deutlich kompakter, als wenn die hochformatigen Illustrationen
   zwischen den Absaetzen stehen. */
.wissen-block {
    display: grid;
    gap: 1.4rem;
    align-items: center;
    margin-top: clamp(2.25rem, 4.5vw, 3.25rem);
}

/* Der erste Block schliesst direkt an den Titelbereich an. Eigene Klasse
   statt :first-of-type — davor steht bereits ein div (der Titelbereich). */
.wissen-block.is-first { margin-top: clamp(1.25rem, 2.5vw, 1.75rem); }

.wissen-text { min-width: 0; }

.wissen-text > * + * { margin-top: 0.9rem; }

.wissen-text h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3.2vw, 1.9rem);
}

.wissen-text p,
.wissen-text li {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.65;
}

.wissen-text ul { padding-left: 1.2rem; }
.wissen-text li + li { margin-top: 0.4rem; }

.wissen-figure {
    margin: 0;
    justify-self: center;
    width: 100%;
    max-width: 340px;
}

/* Alle Illustrationen im gleichen quadratischen Format — sie sind bereits
   als 700x700 zugeschnitten, aspect-ratio haelt den Platz frei (CLS). */
.wissen-figure img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 820px) {
    .wissen-block {
        grid-template-columns: 1.1fr 0.9fr;
        gap: clamp(2rem, 4vw, 3.25rem);
    }

    .wissen-figure { max-width: 320px; }
}

.prose figcaption {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.callout {
    padding: 1.25rem 1.4rem;
    background: var(--surface-alt);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
}

.callout p {
    margin: 0;
    color: var(--text);
}

.freq-table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.freq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.freq-table th,
.freq-table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.freq-table th {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.freq-table td { color: var(--muted); }

.freq-table td:first-child {
    color: var(--text);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.faq {
    display: grid;
    gap: 0.7rem;
}

.faq details {
    padding: 0 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    transition: border-color var(--dur-fast);
}

.faq details[open] { border-color: var(--accent); }

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0;
    font-weight: 650;
    list-style: none;
    cursor: pointer;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "+";
    flex-shrink: 0;
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
    transition: transform var(--dur-fast);
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details > p {
    margin: 0;
    padding-bottom: 1.15rem;
    color: var(--muted);
}


/* =========================== 14. FUSSBEREICH =========================== */

.site-footer {
    padding-block: clamp(2.75rem, 6vw, 4rem) 2rem;
    background: var(--bg-alt);
    border-top: 1px solid var(--line);
    transition: background var(--dur-mid);
}

.footer-top {
    display: grid;
    gap: 2rem;
    padding-bottom: 2.25rem;
}

.footer-brand p {
    max-width: 26rem;
    margin-top: 0.7rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-heading {
    margin-bottom: 0.8rem;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.footer-list {
    display: grid;
    gap: 0.45rem;
    list-style: none;
}

.footer-list a {
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
}

.footer-list a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.footer-legal a,
.footer-legal button {
    padding: 0.25rem 0.2rem;
    background: none;
    border: none;
    color: var(--muted);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.footer-legal a:hover,
.footer-legal button:hover {
    color: var(--accent);
    text-decoration: underline;
}

.footer-sep { opacity: 0.4; }


/* ======================== 15. RECHTSSEITEN & 404 ======================== */

.doc {
    max-width: var(--container-narrow);
    margin-inline: auto;
}

.doc h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.85rem;
    font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.doc h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.doc p,
.doc li {
    margin-bottom: 0.85rem;
    color: var(--muted);
    font-size: 0.97rem;
    line-height: 1.7;
}

.doc strong {
    color: var(--text);
    font-weight: 650;
}

.doc ul {
    margin-bottom: 0.85rem;
    padding-left: 1.25rem;
}

.doc address {
    margin-bottom: 0.85rem;
    color: var(--text);
    font-style: normal;
    line-height: 1.7;
}

.doc code {
    padding: 0.1em 0.4em;
    background: var(--surface-alt);
    border-radius: 0.35rem;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.87em;
}

.doc-table-wrap {
    margin-bottom: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.doc-table th,
.doc-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    line-height: 1.55;
}

.doc-table th {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.doc-table td { color: var(--muted); }

.doc-table td:first-child {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    white-space: nowrap;
}

.doc-note {
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    background: var(--surface-alt);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
}

.doc-note p { margin: 0; }

.doc-updated {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
}

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 60svh;
    text-align: center;
}

.error-code {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}


/* ==================== 16. LERNCHALLENGE: STEUERUNG ==================== */

.learn-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 2.25rem);
    width: min(720px, 100%);
    margin-inline: auto;
    text-align: center;
}

.learn-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.mode-switch {
    position: relative;
    display: flex;
    max-width: 100%;
    padding: 0.25rem;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.mode-switch.is-disabled { opacity: 0.5; }

.mode-thumb {
    position: absolute;
    top: 0.25rem;
    bottom: 0.25rem;
    left: 0.25rem;
    width: calc(50% - 0.25rem);
    background: var(--accent);
    border-radius: var(--radius-pill);
    box-shadow: 0 6px 18px var(--ring);
    transform: translateX(calc(var(--i, 0) * 100%));
    transition: transform var(--dur-mid) var(--ease-out);
}

.mode-option {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.05rem;
    background: none;
    border: none;
    border-radius: var(--radius-pill);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: color var(--dur-fast);
}

.mode-option.is-active { color: var(--on-accent); }
.mode-option:disabled { cursor: not-allowed; }

.mode-emoji {
    font-size: 1rem;
    line-height: 1;
}

.mode-blurb {
    max-width: 42ch;
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Der Kurzclaim des Modus — „Think fast. Speak clearly." bzw. „Learn
   something unexpected." Er wechselt mit dem Modus und bleibt kleiner als
   die Beschreibung darueber. */
.mode-claim {
    margin: 0.35rem 0 0;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

/* Auf schmalen Geraeten (ab iPhone SE abwaerts) passen die beiden Modusnamen
   sonst nicht nebeneinander und die Leiste wird seitlich beschnitten. */
@media (max-width: 420px) {
    .mode-option {
        gap: 0.3rem;
        padding: 0.55rem 0.7rem;
        font-size: 0.82rem;
    }

    .mode-emoji { font-size: 0.9rem; }
}

/* Themenbereich und Zeitauswahl stehen gemeinsam in einer Zeile. */
.learn-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.settings-time-btn {
    min-width: auto;
    padding-inline: 1rem;
    font-size: 0.88rem;
    letter-spacing: 0;
}

.niche-select {
    position: relative;
    z-index: 5;
    width: min(100%, 290px);
}

.niche-trigger {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color var(--dur-fast), background var(--dur-fast);
}

.niche-trigger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.niche-trigger:not(:disabled):hover,
.niche-select.is-open .niche-trigger {
    background: var(--surface-alt);
    border-color: var(--accent);
}

.niche-emoji {
    flex-shrink: 0;
    width: 1.35rem;
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
}

.niche-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.niche-caret {
    width: 0;
    height: 0;
    margin-left: 0.15rem;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--muted);
    transition: transform var(--dur-fast);
}

.niche-select.is-open .niche-caret { transform: rotate(180deg); }

.niche-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    max-height: min(50vh, 360px);
    padding: 0.35rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    animation: menu-in 0.2s var(--ease-out) both;
}

.niche-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: background var(--dur-fast);
}

.niche-option + .niche-option { margin-top: 0.1rem; }

.niche-option:hover { background: var(--surface-alt); }

.niche-option.is-active {
    background: var(--surface-alt);
    color: var(--accent);
}


/* ==================== 17. LERNCHALLENGE: THEMENRAD ==================== */

.reel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: clamp(9rem, 24vw, 13rem);
}

.reel-eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Vor dem ersten Dreh steht dort nur ein Platzhalter — deshalb gedaempft.
   Sobald ein Thema gezogen ist, tritt es in voller Textfarbe hervor.
   Immer einzeilig: JavaScript verkleinert die Schrift so weit, dass auch
   lange Themen in eine Zeile passen (siehe fitPhrase im Skript). */
.reel-phrase {
    max-width: 100%;
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: clamp(2.4rem, 9vw, 4.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
    white-space: nowrap;
}

.reel.is-spinning .reel-phrase {
    color: var(--text);
    opacity: 0.88;
}

/* Sobald ein Thema gezogen ist. Die Landeanimation setzt JavaScript separat
   ueber die Web Animations API. */
.reel.has-topic .reel-phrase {
    color: var(--text);
}

/* Ein Satz unter dem Thema, der sagt, was damit zu tun ist — im Sprechmodus
   ein anderer als im Entdeckmodus. */
.reel-hint {
    max-width: 40ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.87rem;
    text-align: center;
}


/* ====================== 18. LERNCHALLENGE: TIMER ====================== */

.timer-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: fade-in var(--dur-mid) var(--ease-out) both;
}

.timer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.85rem, 2.5vh, 1.5rem);
    width: min(920px, 100%);
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: center;
}

.timer-topic {
    margin: 0;
    color: var(--accent);
    font-size: clamp(0.85rem, 2vw, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.timer-phase {
    margin: 0;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.timer-ring {
    --p: 0;
    display: grid;
    place-items: center;
    width: min(62vw, 50vh, 360px);
    height: min(62vw, 50vh, 360px);
    background:
        radial-gradient(circle at center, var(--bg) 62%, transparent 63%),
        conic-gradient(var(--accent) calc(var(--p) * 1turn), var(--line) 0);
    border-radius: 50%;
    transition: background 0.15s linear;
}

.timer-digits {
    color: var(--text);
    font-size: clamp(3rem, 13vw, 6.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.timer-overlay.is-done .timer-ring { animation: pulse-done 0.8s; }

.timer-status {
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.timer-next {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.timer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.speech-stages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    width: min(100%, 560px);
    list-style: none;
}

.speech-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    min-width: 0;
    padding: 0.75rem 0.6rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--muted);
    font-size: clamp(0.85rem, 2.2vw, 1rem);
    font-weight: 650;
    transition: background var(--dur-mid), border-color var(--dur-mid),
                color var(--dur-mid), transform var(--dur-mid);
}

.speech-stage.is-hit {
    background: var(--surface-alt);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}


/* ================= 19. LERNCHALLENGE: EINSTELLUNGEN ================= */

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 2rem);
    background: color-mix(in srgb, var(--ink-brand) 55%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fade-in var(--dur-mid) var(--ease-out) both;
}

.settings-panel {
    width: min(420px, 100%);
    max-height: 100%;
    padding: 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: left;
}

.settings-panel h2 {
    margin-bottom: 0.3rem;
    font-size: 1.45rem;
}

.settings-blurb {
    margin-bottom: 1.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.duration-field + .duration-field { margin-top: 1.35rem; }

.duration-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.duration-label {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.duration-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.duration-slider {
    width: 100%;
    height: 0.35rem;
    margin: 0;
    appearance: none;
    background: var(--line);
    border-radius: var(--radius-pill);
    outline: none;
    cursor: pointer;
    touch-action: manipulation;
}

.duration-slider::-webkit-slider-runnable-track {
    height: 0.35rem;
    background: var(--line);
    border-radius: var(--radius-pill);
}

.duration-slider::-webkit-slider-thumb {
    appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: -0.4rem;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--ring);
    cursor: pointer;
}

.duration-slider::-moz-range-track {
    height: 0.35rem;
    background: var(--line);
    border-radius: var(--radius-pill);
}

.duration-slider::-moz-range-thumb {
    width: 1.15rem;
    height: 1.15rem;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--ring);
    cursor: pointer;
}

.duration-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.duration-hint,
.settings-note {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.settings-note {
    margin-top: 1.15rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.settings-mute {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.2rem;
    font-size: 0.94rem;
}

.settings-mute input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.settings-mute label { cursor: pointer; }

.settings-done {
    width: 100%;
    margin-top: 1.1rem;
}


/* ========================= 20. COOKIE-BANNER ========================= */

.cookie-banner {
    position: fixed;
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-width: 56rem;
    margin-inline: auto;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    animation: rise var(--dur-mid) var(--ease-out) both;
}

.cookie-banner-copy { min-width: 0; }

.cookie-banner-title {
    margin-bottom: 0.3rem;
    font-size: 1.02rem;
}

.cookie-banner-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.5;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.cookie-banner-actions .btn {
    flex: 1;
    padding: 0.7rem 1.1rem;
    font-size: 0.88rem;
}


/* ========================== 21. HILFSKLASSEN ========================== */

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

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -4rem;
    z-index: 100;
    padding: 0.7rem 1.1rem;
    background: var(--accent);
    border-radius: var(--radius-sm);
    color: var(--on-accent);
    font-weight: 650;
    text-decoration: none;
    transition: top var(--dur-fast);
}

.skip-link:focus {
    top: 0.5rem;
    color: var(--on-accent);
}

.noscript-note {
    display: none;
    max-width: 46ch;
    margin: 2.5rem auto;
    color: var(--muted);
    line-height: 1.6;
    text-align: center;
}

/* Abstandshelfer. Als Klassen und nicht als style-Attribut, weil die strenge
   CSP (style-src 'self', ohne 'unsafe-inline') Attribut-Styles blockiert. */
.mt-lg   { margin-top: 2.5rem; }
.mt-md   { margin-top: 2rem; }
.mt-xl   { margin-top: clamp(3rem, 7vw, 5rem); }
.mb-sm   { margin-bottom: 1.5rem; }
.flush   { margin-inline: 0; }
.subhead { font-size: 1.15rem; }
.bare    { border-top: none; padding-top: 0; }


/* ========================== 22. ANIMATIONEN ========================== */

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse-done {
    0%, 100% { transform: scale(1); }
    40%      { transform: scale(1.05); }
}

@keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Einblenden beim Hereinscrollen — JS setzt is-visible */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}


/* ========================== 23. BREAKPOINTS ========================== */

@media (min-width: 640px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .cookie-banner {
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
    }

    .cookie-banner-actions {
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    .cookie-banner-actions .btn { flex: 0 0 auto; }

    .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
    .footer-top { grid-template-columns: 1.7fr 1fr 1fr 1fr; }
}

@media (min-width: 860px) {
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    /* Fuenf Bereiche auf drei Spalten: drei oben, zwei darunter. Die letzten
       beiden Karten stehen mittig, damit die Reihe nicht angeschnitten wirkt. */
    .grid-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .grid-5 > * { grid-column: span 2; }
    .grid-5 > :nth-child(4) { grid-column: 2 / span 2; }
    .grid-5 > :nth-child(5) { grid-column: 4 / span 2; }

    .service-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 760px;
    }

    .hero-inner { grid-template-columns: 1.25fr 0.75fr; }
}

/* Die Hauptnavigation traegt jetzt fuenf Bereiche, darunter lange Woerter wie
   „Geführte Entspannung". Sie klappt deshalb erst bei 1080 px auf; darunter
   bleibt das Burger-Menue stehen, statt die Leiste zu ueberfuellen. */
@media (min-width: 1080px) {
    .nav { display: flex; }
    .nav-toggle { display: none; }
    .nav-drawer { display: none !important; }
}


/* ================= 24. BARRIEREFREIHEIT & FALLBACKS ================= */

/* Ohne JavaScript: Menü aufgeklappt, Einblendungen sichtbar, Umschalter weg
   (sie könnten nichts bewirken), Hinweis auf der Übungsseite einblenden. */
@media (scripting: none) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .nav-drawer { display: grid !important; }

    .nav-toggle,
    .theme-toggle,
    .lang-toggle { display: none !important; }

    .noscript-note { display: block !important; }

    .learn-stage { display: none !important; }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Der Ring ist Zeitanzeige, keine Zierde — er läuft weiter. */
    .timer-ring { transition: none !important; }
}
