/*
 * The Studio Player - Template "simplex" (Version 5.0.1).
 *
 * Compact card player. Every color comes from --thespl-* CSS custom
 * properties so the Player Builder, Magic Palette and Color Probe can
 * restyle the whole player.
 *
 * V5 design rules (letters fallback - user decision after the raw-page
 * S22 report): long variant names are the ONE width driver that no
 * phone column can afford (four long names need 500-700px). Instead
 * of ellipsis-mangling the labels the pill switch now falls back to
 * single LETTERS (A B C D) whenever the full labels would not fit:
 *   - script.js measures the natural full-label widths (one hidden
 *     span with the pill typography) against the shell container and
 *     sets data-variant-mode="letters" on the player root when they
 *     do not fit - with 24px hysteresis on the way back. ResizeObserver
 *     and document.fonts.ready re-run the check.
 *   - V5.0.1 MONOTONIC SIZE LOGIC (user report): the fit rule applies
 *     at EVERY width, INCLUDING the emergency stack (<=319px). A smaller
 *     screen NEVER falls back to full text - below the fit threshold
 *     the letters STAY (the V5.0.0 "stack always keeps full labels"
 *     special case is removed; it produced the forbidden desktop
 *     fallback below ~335px window width). Inside the stack the letters
 *     keep the same connected segment-switch look (no gaps, no per-
 *     segment rounding). Full labels survive in the stack only for
 *     label sets that still satisfy the one-row-beside-play criterion.
 *   - In letters mode the card FILLS the column (width: 100%) and the
 *     segments stretch to EQUAL sizes - bigger touch targets, classic
 *     segmented-switch look. Pill height (36px), font floor (12px)
 *     and play button (50px) stay untouched; the full label remains
 *     available as native tooltip (desktop) and aria-label (readers).
 *   - The variant line of the text engine (temporary click override,
 *     engine logic UNCHANGED) shows "Name - Description" in letters
 *     mode and only the description in full-text mode: script.js feeds
 *     it through a reversible adapter on the in-memory variant_info
 *     entries (never the server data).
 *
 * V4 design rules (responsive, two-stage adaptive - user decision):
 *   - MEASURING: the template wraps the card in .thespl-simplex-shell,
 *     a container-type: inline-size query container. All responsive
 *     rules below therefore react to the width the player ACTUALLY
 *     gets from its theme column - not to the window width (the old
 *     max-width: 360px media query misjudged every phone: window 360+
 *     while the real column is ~320-340px).
 *   - STAGE 1 (fluid, 320px-400px available width): typography and
 *     horizontal paddings/gaps scale continuously via clamp() + cqw -
 *     pill text 14px -> 12px (never smaller), secondary text 11px ->
 *     10px, pill height and all icon sizes stay CONSTANT. The layout
 *     stays the one-row design (title left, slider + clock right,
 *     circular button left, pills in ONE row). At 400px+ everything is
 *     pixel-identical to V3.1 (clamps cap at the V3.1 values).
 *   - STAGE 2 (emergency stack, below 320px available width): ordered
 *     compact stack - title / play button (original 50px) / variant
 *     pills full row width (may wrap to a second row, ORIGINAL font
 *     sizes: pills 14px, title/clock 11px) / progress slider + clock.
 *     Nothing is cut off, nothing is squeezed.
 *   - HARD FLOORS everywhere: pill font >= 12px, pill height constant
 *     (36px), play button >= 44px touch target.
 *   - LEAK HARDENING: the default template's stylesheet styles
 *     .thespl-player__controls and .thespl-player__variants with
 *     flex-wrap: wrap / justify-content: center / gap / margins, and
 *     .thespl-player__variant with border-radius: 999px - unscoped,
 *     so they hit simplex players whenever both templates load on the
 *     same page (multi-template pages). Every affected property is
 *     therefore set EXPLICITLY here (higher specificity wins).
 *   - HYBRID WIDTH (V3.1, unchanged): width: fit-content + min-width
 *     min(380px, 100%) - the card grows with the pill labels; title,
 *     status and infotext lines never drive the width (contain:
 *     inline-size). Only a capped container shortens a label with an
 *     ellipsis inside its segment.
 *   - FALLBACK: browsers without container query support (pre-2023)
 *     keep the fixed V3.1 sizes and get the old viewport stacking via
 *     @supports not (container-type: inline-size). Fluid declarations
 *     always carry a fixed-value fallback declaration before them.
 *
 * Structure:
 *   .thespl-simplex-shell     query container (available width)
 *   .thespl-simplex__topline  title (left) | range progress | time (right)
 *   .thespl-player__controls  circular play/pause toggle | variant pill switch
 *   .thespl-player__status    text engine line 1 (status)
 *   .thespl-player__infotext  text engine line 2 (track info)
 */

/* --------------------------------------------------------------- Shell */

/*
 * Mess-Wrapper: reiner Block ohne eigenes Aussehen. Er macht die fuer
 * den Player VERFUEGBARE Breite (Theme-Spalte) als Container-Query-
 * Kontext messbar. Die Karte darin behaelt ihr eigenes Hybrid-Mass
 * (fit-content) - der Wrapper misst nur, er gestaltet nicht.
 */
.thespl-simplex-shell {
        display: block;
        width: 100%;
        max-width: 100%;
        container-type: inline-size;
}

/* --------------------------------------------------------------- Root */

.thespl-player[data-template-slug="simplex"] {
        position: relative;
        box-sizing: border-box;
        /* HYBRID-Breite: kompakte Basis 380px, waechst mit den Pill-Labels,
         * wird nie breiter als der umgebende Container. */
        width: fit-content;
        min-width: min(380px, 100%);
        max-width: 100%;
        /* STUFE 1: horizontales Card-Padding atmet 16px -> 12px mit der
         * verfuegbaren Breite (400px -> 320px); vertikal bleibt es fix. */
        padding: 14px 16px 16px;
        padding: 14px clamp(12px, calc(5cqw - 4px), 16px) 16px;
        background: var(--thespl-bg, #ffffff);
        color: var(--thespl-text, #24273a);
        border: 1px solid var(--thespl-panel-br, rgba(36, 39, 58, 0.12));
        border-radius: 18px;
        font-family: inherit;
        line-height: 1.2;
        overflow: hidden;
}

.thespl-player[data-template-slug="simplex"] *,
.thespl-player[data-template-slug="simplex"] *::before,
.thespl-player[data-template-slug="simplex"] *::after {
        box-sizing: border-box;
}

/* Das Audio-Element bleibt unsichtbar. */
.thespl-player[data-template-slug="simplex"] .thespl-player__audio {
        display: none;
}

/* Debug-/Hinweis-Meldung des Render-Kontexts. */
.thespl-player[data-template-slug="simplex"] .thespl-player__notice {
        margin: 0 0 8px;
        font-size: 11px;
        font-size: clamp(10px, calc(1.25cqw + 6px), 11px);
        line-height: 1.35;
        contain: inline-size;
}

/* ----------------------------------------------------------- Topline */

.thespl-player[data-template-slug="simplex"] .thespl-simplex__topline {
        display: flex;
        /* Hartung gegen unscoped Regeln des Default-Templates
         * (flex-wrap: wrap wuerde die Zeile auf Handys stapeln). */
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        gap: clamp(8px, calc(5cqw - 8px), 12px);
        margin: 0 0 12px;
        /* Die Titelzeile treibt die Kartenbreite NIE (auch sehr lange
         * Titel vergroessern die Karte nicht) - nur die Pills duerfen. */
        contain: inline-size;
}

/* Playlist-Metadaten-Titel - Text kommt serverseitig aus dem Titelfeld
 * der Playlist-Metadaten; der Player-Core schreibt denselben Wert ueber
 * das offizielle data-thespl-title-Attribut selbst hinein. */
.thespl-player[data-template-slug="simplex"] .thespl-player__title {
        /* Linksbuendig, fuellt den Platz links der Uhr mit und waechst
         * mit der Karte mit (Basis 0 -> treibt die Breite nie selbst). */
        flex: 2 1 0;
        min-width: 0;
        max-width: 100%;
        font-size: 11px;
        font-size: clamp(10px, calc(1.25cqw + 6px), 11px);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
}

.thespl-player[data-template-slug="simplex"] .thespl-simplex__time {
        flex: 0 0 auto;
        font-size: 11px;
        font-size: clamp(10px, calc(1.25cqw + 6px), 11px);
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
}

/* ------------------------------------------------- Fortschritts-Slider */

.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress {
        --thespl-simplex-progress: 0%;
        -webkit-appearance: none;
        appearance: none;
        /* Der Slider laeuft rechtsbuendig neben der Uhr und waechst
         * mit der Kartenbreite mit (Basis 0 -> treibt sie nie selbst). */
        flex: 1 1 0;
        min-width: 90px;
        width: auto;
        height: 14px;
        margin: 0;
        background: transparent;
        cursor: pointer;
}

.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress::-webkit-slider-runnable-track {
        height: 7px;
        border-radius: 99px;
        background: linear-gradient(
                to right,
                var(--thespl-accent, #078fe8) 0,
                var(--thespl-accent, #078fe8) var(--thespl-simplex-progress),
                var(--thespl-waveform, #e3e4e8) var(--thespl-simplex-progress),
                var(--thespl-waveform, #e3e4e8) 100%
        );
}

.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 13px;
        height: 13px;
        margin-top: -3px;
        border: 2px solid var(--thespl-bg, #ffffff);
        border-radius: 50%;
        background: var(--thespl-accent, #078fe8);
        opacity: 0;
}

.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress::-moz-range-track {
        height: 7px;
        border-radius: 99px;
        background: var(--thespl-waveform, #e3e4e8);
}

.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress::-moz-range-progress {
        height: 7px;
        border-radius: 99px;
        background: var(--thespl-accent, #078fe8);
}

.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress::-moz-range-thumb {
        width: 11px;
        height: 11px;
        border: 2px solid var(--thespl-bg, #ffffff);
        border-radius: 50%;
        background: var(--thespl-accent, #078fe8);
        opacity: 0;
}

/* Griff erscheint bei Hover ueber den Player bzw. Fokus. */
.thespl-player[data-template-slug="simplex"]:hover .thespl-simplex__progress::-webkit-slider-thumb,
.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress:focus::-webkit-slider-thumb {
        opacity: 1;
}

.thespl-player[data-template-slug="simplex"]:hover .thespl-simplex__progress::-moz-range-thumb,
.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress:focus::-moz-range-thumb {
        opacity: 1;
}

/* --------------------------------------------------------- Steuerung */

/*
 * Versteckte Legacy-Transport-Buttons (.thespl-player__btn--play/--pause/--stop).
 * Der Player-Core verdrahtet diese Selektoren bedingungslos und erst danach
 * die Instanz-API + Zeit-Ereignisse - ohne die Platzhalter wuerde der Core
 * vorzeitig abbrechen. Sichtbar ist ausschliesslich der runde Toggle.
 */
.thespl-player[data-template-slug="simplex"] .thespl-simplex__legacy {
        display: none !important;
}

.thespl-player[data-template-slug="simplex"] .thespl-player__controls {
        display: flex;
        /* Hartung gegen das Default-Template (dort: flex-wrap: wrap,
         * justify-content: center, gap: 8px, margin-bottom: 12px - unscoped
         * auch auf Multi-Template-Seiten aktiv). Genau DAS Bild "Play-Button
         * ueberhalb der Pills" kam daher. Hier: alles explizit, Zeile bleibt
         * Zeile, Button bleibt links, kein Aussenabstand. */
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin: 0;
        align-items: center;
        gap: 16px;
        gap: clamp(10px, calc(7.5cqw - 14px), 16px);
}

/*
 * Runder Play/Pause-Toggle (Klick: Play/Pause, Doppelklick: Stop/Reset).
 * Transport wird vom Template-script.js an die Player-API gebunden.
 * Groesse konstant 50px (Touch-Boden 44px nie unterschritten); nur im
 * Legacy-Fallback (Browser ohne Container Queries) gilt 44px.
 * Hinweis zum Doppelklick-Stop: ausschliesslich ueber das native
 * title-Attribut (siehe player.php) - hier gibt es KEIN zusaetzliches
 * CSS-Tooltip mehr.
 */
.thespl-player[data-template-slug="simplex"] .thespl-player__btn--toggle.thespl-simplex__play {
        -webkit-appearance: none;
        appearance: none;
        flex: 0 0 auto;
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        display: grid;
        place-items: center;
        overflow: hidden;
        background: var(--thespl-accent, #078fe8);
        color: var(--thespl-accent-text, #ffffff);
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
}

/* Icon-Basis: beide SVGs liegen zentriert im Button. */
.thespl-player[data-template-slug="simplex"] .thespl-simplex__play svg.thespl-simplex__icon {
        grid-area: 1 / 1;
        width: 24px;
        height: 24px;
        margin: 0;
        padding: 0;
        fill: currentColor;
}

/*
 * Icon-Umschaltung ueber data-state am Button.
 * WICHTIG: alle drei Regeln liegen spezifitaetsmaessig ueber der
 * Icon-Basisregel (zusaetzliche Klasse bzw. Attribut), damit niemals
 * beide Symbole gleichzeitig sichtbar sind.
 */
.thespl-player[data-template-slug="simplex"] .thespl-simplex__play svg.thespl-simplex__icon--pause {
        display: none;
}

.thespl-player[data-template-slug="simplex"] .thespl-simplex__play[data-state="pause"] svg.thespl-simplex__icon--play {
        display: none;
}

.thespl-player[data-template-slug="simplex"] .thespl-simplex__play[data-state="pause"] svg.thespl-simplex__icon--pause {
        display: block;
}

/* Fehlerfall: Play-Button abdimmen. */
.thespl-player[data-template-slug="simplex"].thespl-simplex--error .thespl-simplex__play {
        opacity: 0.55;
}

/* ---------------------------------------------------- Varianten-Pille */

/*
 * HYBRIDER Pill-Schalter - EINE Zeile, inhaltsbasierte Segmente.
 * Der Schalter fuellt die Reihe neben dem runden Button (klassische
 * Schiebeschalter-Anmutung bei kurzen Labels) UND traegt die volle
 * Labelbreite in die Kartenbreite: laengere Pill-Texte vergroessern
 * den Spieler. Erst wenn der umgebende Container den Spieler kappt,
 * kuerzt ein Segment sein Label mit Ellipsis - nie eine zweite Zeile.
 * Hartung gegen das Default-Template (dort: flex-wrap: wrap,
 * justify-content: center, gap: 8px, margin: 8px 0 12px - unscoped):
 * alles explizit, Segmente bleiben eine lueckenlose Zeile.
 */
.thespl-player[data-template-slug="simplex"] .thespl-player__variants {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin: 0;
        gap: 0;
        align-items: stretch;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        border-radius: 20px;
        overflow: hidden;
        isolation: isolate;
        background: var(--thespl-chip-bg, #f2f3f5);
}

.thespl-player[data-template-slug="simplex"] .thespl-player__variant {
        -webkit-appearance: none;
        appearance: none;
        display: grid;
        place-items: center;
        /* Segment = eigene Labelbreite + gleicher Anteil des
         * Ueberschusses: kurze Labels teilen sich die Reihe wie ein
         * Schiebeschalter, lange Labels vergroessern Karte und Schalter
         * (Hybrid). min-width: 0 laesst das Segment NUR im Extremfall
         * (vom Container gekappter Spieler) mit Ellipsis schrumpfen. */
        flex: 1 1 auto;
        min-width: 0;
        min-height: 36px;
        padding: 7px 10px;
        /* STUFE 1: horizontales Segment-Padding atmet 10px -> 8px;
         * die Hoehe (36px) bleibt konstant. */
        padding: 7px clamp(8px, 2.5cqw, 10px);
        border: 0;
        border-radius: 0;
        outline: 0;
        background: transparent;
        color: var(--thespl-muted, rgba(36, 39, 58, 0.7));
        font: inherit;
        /* STUFE 1: fluide Typografie 14px -> 12px mit der VERFUEGBAREN
         * Breite (nicht Fensterbreite!). Fester Fallback zuerst, damit
         * aeltere Browser ohne cqw-Unterstuetzung 14px behalten. */
        font-size: 14px;
        font-size: clamp(12px, calc(2.5cqw + 4px), 14px);
        /* KONSTANTES Gewicht (auch im aktiven Segment): ein wechselndes
         * 500->700 wuerde die Textbreite und damit die Pill-Positionen
         * beim Aktivieren verschieben. Das aktive Segment hebt sich
         * ausschliesslich ueber Hintergrund/Farbe/Schatten ab - die
         * Buttons stehen dadurch absolut unbeweglich fest. */
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-tap-highlight-color: transparent;
}

.thespl-player[data-template-slug="simplex"] .thespl-player__variant[aria-selected="true"] {
        position: relative;
        z-index: 1;
        border-radius: 19px;
        background: var(--thespl-button-active-bg, #ffffff);
        color: var(--thespl-button-active-text, #24273a);
        box-shadow:
                inset 0 0 0 1px var(--thespl-chip-br, #d7d9de),
                inset 0 1px 2px rgba(0, 0, 0, 0.1),
                0 1px 2px rgba(0, 0, 0, 0.06);
}

/*
 * Label-Span innerhalb des Segments: ein echtes Element (kein anonymer
 * Grid-Item-Text) - nur darauf greift die Ellipsis des festen Segments
 * zuverlaessig. Passt das Label, ist der Span nur so breit wie sein Text
 * (zentriert); im Extremfall kuerzt er mit "..." innerhalb des Segments.
 */
.thespl-player[data-template-slug="simplex"] .thespl-player__variant .thespl-simplex__source-label {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
}

/* ------------------------------------------ V5: Kuerzel-Modus (A/B/C/D) */

/*
 * Kuerzel-Modus: script.js setzt data-variant-mode="letters" am Root,
 * sobald die VOLLEN Label die verfuegbare Spaltenbreite sprengen
 * (gemessen am Shell-Container, 24px Hysterese auf dem Rueckweg).
 * Die Karte fuellt dann die Spalte, und die Segmente strecken sich
 * auf GLEICHE Groesse - klassischer Segment-Schalter mit groesseren
 * Touch-Zielen. Pill-Hoehe 36px und Schrift-Boden 12px bleiben
 * unangetastet; alle Basisregeln (Fluid-Typografie, Leak-Haertung,
 * kein Umbrechen) bleiben in Kraft, nur die Breitenbasis der Karte
 * wechselt von fit-content (waechst mit den Labels) auf 100%
 * (fuellt die Spalte, Segmente teilen den Platz).
 */
.thespl-player[data-template-slug="simplex"][data-variant-mode="letters"] {
        width: 100%;
        min-width: min(240px, 100%);
}

/*
 * Verstecktes Mess-Element (ein Span je Player, angelegt von script.js
 * am Root - ueberlebt erneutes Pill-Rendern und liegt ausserhalb des
 * Pill-Schalters, damit weder die Engine noch der eigene Click-Handler
 * ihn je zu Gesicht bekommen). Es traegt dieselbe Typografie-Regel wie
 * die Pills (Gewicht 600, dieselbe fluide clamp()-Schrift) und misst so
 * die NATUERLICHE Textbreite der VOLLSTaendigen Labels: die Basis der
 * Fit-Entscheidung kommt damit immer vom Volltext-Aussenzustand, nie
 * vom Kuerzel-Zustand selbst - dasselbe Prinzip wie bei der
 * Hybrid-Breite (die Skala darf nicht aus dem eigenen Layout stammen).
 * Absolut positioniert und unsichtbar: kein Flex-/Grid-Kind (auch
 * nicht im Notstapel), kein Platzbedarf, nicht anvisierbar.
 */
.thespl-player[data-template-slug="simplex"] .thespl-simplex__measure {
        position: absolute;
        top: 0;
        left: 0;
        margin: 0;
        padding: 0;
        border: 0;
        visibility: hidden;
        white-space: nowrap;
        pointer-events: none;
        font-family: inherit;
        font-weight: 600;
        line-height: 1;
        font-size: 14px;
        font-size: clamp(12px, calc(2.5cqw + 4px), 14px);
}

/* -------------------------------------------------- Text-Engine-Zeilen */

/* Zeile 1: Statuszeile (UI.renderStatus) - fuellt die Breite,
 * treibt die Kartenbreite aber nie (contain). */
.thespl-player[data-template-slug="simplex"] .thespl-player__status {
        margin: 8px 0 0;
        padding: 7px 0 0;
        border-top: 1px solid transparent;
        font-size: 11px;
        font-size: clamp(10px, calc(1.25cqw + 6px), 11px);
        line-height: 1.35;
        height: auto;
        min-height: 0;
        text-align: left;
        white-space: normal;
        color: var(--thespl-text, #24273a);
        contain: inline-size;
}

/* Trennlinie erst zeigen, wenn die Engine Text gesetzt hat
 * (Klasse wird vom Template-script.js aus dem Store-Zustand abgeleitet). */
.thespl-player[data-template-slug="simplex"].thespl-simplex--has-status .thespl-player__status {
        border-top-color: var(--thespl-panel-br, rgba(36, 39, 58, 0.12));
}

/* Zeile 2: Infotext (UI.bindInfotext) - dezente zweite Zeile im selben
 * Block; als Lauftext breit, aber die Kartenbreite treibend nie (contain).
 * opacity: 1 explizit contra unscoped 0.85 des Default-Templates. */
.thespl-player[data-template-slug="simplex"] .thespl-player__infotext {
        display: block;
        width: 100%;
        margin: 4px 0 0;
        font-size: 11px;
        font-size: clamp(10px, calc(1.25cqw + 6px), 11px);
        line-height: 1.35;
        opacity: 1;
        color: var(--thespl-muted, rgba(36, 39, 58, 0.7));
        text-align: left;
        overflow: hidden;
        contain: inline-size;
}

.thespl-player[data-template-slug="simplex"] .thespl-player__infotext .thespl-infotext-text {
        display: inline-block;
        max-width: 100%;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
}

.thespl-player[data-template-slug="simplex"] .thespl-player__infotext .thespl-infotext-link,
.thespl-player[data-template-slug="simplex"] .thespl-player__infotext .thespl-infotext-tail {
        white-space: nowrap;
}

.thespl-player[data-template-slug="simplex"] .thespl-player__infotext .thespl-infotext-link,
.thespl-player[data-template-slug="simplex"] .thespl-player__infotext .thespl-infotext-link:visited,
.thespl-player[data-template-slug="simplex"] .thespl-player__infotext .thespl-infotext-link:hover,
.thespl-player[data-template-slug="simplex"] .thespl-player__infotext .thespl-infotext-link:focus {
        color: inherit;
        text-decoration: underline;
}

/* -------------------------------------------------- Fokus-Sichtbarkeit */

.thespl-player[data-template-slug="simplex"] .thespl-simplex__play:focus-visible,
.thespl-player[data-template-slug="simplex"] .thespl-simplex__progress:focus-visible {
        outline: 3px solid var(--thespl-accent, #078fe8);
        outline-offset: 3px;
}

.thespl-player[data-template-slug="simplex"] .thespl-player__variant:focus-visible {
        outline: 2px solid var(--thespl-accent, #078fe8);
        outline-offset: 2px;
}

/* -------------------------------------------- Anzeige-Utility-Klassen */

.thespl-player[data-template-slug="simplex"].thespl-hide-playlist .thespl-player__playlist {
        display: none;
}

.thespl-player[data-template-slug="simplex"].thespl-hide-audio-info .thespl-player__audio-info {
        display: none;
}

/* ------------------------------------------------- STUFE 2: Notstapel */

/*
 * Extremfall (verfuegbare Breite < 320px, z. B. sehr schmale
 * Theme-Spalten oder Browser-Zoom): geordneter Kompakt-Stapel mit
 * ORIGINAL Schriftgroessen (Pills 14px, Titel/Uhr 11px) -
 *
 *     Titel (volle Breite, linksbuendig)
 *     runder Play-Button (Originalgroesse 50px, links)
 *     Varianten-Pills (volle Zeilenbreite)
 *     Fortschritts-Slider + Uhr (rechtsbuendig)
 *     Status-/Infotext (wie immer)
 *
 * V5.0.1: Der Stapel ist NUR LAYOUT. Der Pill-TEXT folgt weiterhin
 * der EINEN monotonen Fit-Regel aus script.js (dort steht der Grund:
 * ein schmalerer Screen darf NIE auf Volltext zurueckschalten).
 * Kuerzel-Modus bleibt im Stapel aktiv und sieht hier genauso aus wie
 * ausserhalb (lueckenloser Segment-Schalter, gleiche Segmentgroessen);
 * volle Label mit ordentlichem Umbrechen (2+1) gibt es im Stapel nur
 * fuer kurze Label-Saetze, die auch neben dem Play-Button passen
 * wuerden. Technik unveraendert: die Karte wird zum Grid mit benannten
 * Bereichen; Topline und Controls werden per display: contents
 * "transparent", sodass ihre Kinder direkt in die Bereiche gelegt
 * werden koennen - reines CSS, DOM und Tab-Reihenfolge bleiben
 * unberuehrt. Die Karte ist in dieser Zone ohnehin auf Spaltenbreite
 * gekappt (min-width / max-width 100%), daher ist das entfallene
 * contain auf der Topline hier folgenlos.
 */
@container (max-width: 319px) {
        .thespl-player[data-template-slug="simplex"] {
                display: grid;
                grid-template-columns: minmax(0, 1fr) max-content;
                grid-template-areas:
                        "notice notice"
                        "title title"
                        "play play"
                        "pills pills"
                        "seek clock";
                gap: 0;
                padding: 12px;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-simplex__topline {
                display: contents;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-player__controls {
                display: contents;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-player__notice {
                grid-area: notice;
                margin: 0 0 8px;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-player__title {
                grid-area: title;
                flex: none;
                min-width: 0;
                max-width: 100%;
                margin: 0 0 8px;
                /* Originalgroesse statt Fluidtheek: im Stapel ist genug Platz. */
                font-size: 11px;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-player__btn--toggle.thespl-simplex__play {
                grid-area: play;
                justify-self: start;
                margin: 0 0 10px;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-player__variants {
                grid-area: pills;
                flex-wrap: wrap;
                justify-content: flex-start;
                gap: 6px;
                margin: 0 0 10px;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-player__variant {
                /* Volltext-Modus im Stapel (nur bei passenden kurzen
                 * Label-Saetzen): jedes Segment waechst mit seinem Text,
                 * passt die Zeile nicht, bricht der Schalter ORDENTLICH
                 * um (2+1, darunter volle Breite). Hoehe bleibt 36px. */
                flex: 1 1 auto;
                min-width: 0;
                min-height: 36px;
                padding: 8px 12px;
                border-radius: 12px;
                font-size: 14px;
        }

        /* V5.0.1: Kuerzel-Modus gilt AUCH im Notstapel (monotone
         * Groessenlogik - kein Desktop-Rueckfall bei schmalen Screens).
         * Optik wie ausserhalb des Stapels: lueckenloser Segment-Schalter
         * (kein Gap, keine Einzelrundung), Segmente teilen die volle
         * Zeilenbreite in GLEICHE Teile. Die Stapel-eigenen Werte fuer
         * Padding (8/12px) und Schrift (feste 14px) bleiben erhalten.
         */
        .thespl-player[data-template-slug="simplex"][data-variant-mode="letters"] .thespl-player__variants {
                flex-wrap: nowrap;
                justify-content: flex-start;
                gap: 0;
        }

        .thespl-player[data-template-slug="simplex"][data-variant-mode="letters"] .thespl-player__variant {
                border-radius: 0;
        }

        .thespl-player[data-template-slug="simplex"][data-variant-mode="letters"] .thespl-player__variant[aria-selected="true"] {
                border-radius: 19px;
        }

        /* V5.0.1: Der Mess-Span des script.js misst die Label-Breite mit
         * der Typografie, die die Pills HIER wirklich haben (feste 14px
         * statt der fluide-kleineren Werte) - die Fit-Entscheidung bleibt
         * so auch im Stapel massgenau statt optimistisch. */
        .thespl-player[data-template-slug="simplex"] .thespl-simplex__measure {
                font-size: 14px;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-simplex__progress {
                grid-area: seek;
                flex: none;
                min-width: 0;
                width: auto;
                height: 14px;
                margin: 0;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-simplex__time {
                grid-area: clock;
                flex: none;
                justify-self: end;
                white-space: nowrap;
                font-size: 11px;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-player__status {
                grid-column: 1 / -1;
                margin: 8px 0 0;
                font-size: 11px;
        }

        .thespl-player[data-template-slug="simplex"] .thespl-player__infotext {
                grid-column: 1 / -1;
                font-size: 11px;
        }
}

/* ---------------------------------------------- Legacy-Fallback (alt) */

/*
 * Browser OHNE Container-Query-Unterstuetzung (vor 2023): feste
 * V3.1-Groessen plus die alte viewport-basierte Stapelung. Moderne
 * Browser ignorieren diesen Block komplett (@supports greift nicht).
 */
@supports not (container-type: inline-size) {
        @media (max-width: 360px) {
                .thespl-player[data-template-slug="simplex"] {
                        padding: 13px;
                }

                /* Sehr schmale Fenster: Topline stapeln - Titel volle Breite
                 * (linksbuendig), Slider darunter, Uhr bleibt rechtsbuendig. */
                .thespl-player[data-template-slug="simplex"] .thespl-simplex__topline {
                        flex-direction: column;
                        align-items: stretch;
                        gap: 8px;
                }

                .thespl-player[data-template-slug="simplex"] .thespl-player__title {
                        flex: 0 0 auto;
                }

                .thespl-player[data-template-slug="simplex"] .thespl-simplex__progress {
                        flex: 0 0 auto;
                        min-width: 0;
                        width: 100%;
                }

                .thespl-player[data-template-slug="simplex"] .thespl-simplex__time {
                        align-self: flex-end;
                }

                .thespl-player[data-template-slug="simplex"] .thespl-player__controls {
                        gap: 10px;
                }

                .thespl-player[data-template-slug="simplex"] .thespl-player__btn--toggle.thespl-simplex__play {
                        width: 44px;
                        height: 44px;
                        min-width: 44px;
                        min-height: 44px;
                }

                .thespl-player[data-template-slug="simplex"] .thespl-simplex__play svg.thespl-simplex__icon {
                        width: 20px;
                        height: 20px;
                }

                .thespl-player[data-template-slug="simplex"] .thespl-player__variant {
                        padding-left: 6px;
                        padding-right: 6px;
                }
        }
}
