/* =========================================================================
   Koran-Lesebereich – Premium-Redesign ("Literary Warm", mobile-first)
   Wird NUR auf /koran-Seiten geladen. Nutzt ausschließlich die bestehenden
   Marken-Token (Farben, Cooper/TASA Explorer, Motion) aus style.css.

   Abschnitte: 0 Token · 1 Kopf · 2 Werkzeugleiste · 3 Vers-für-Vers ·
   4 Buchseiten-Modus · 5 Pager · 6 Suren-Drawer · 7 Suche/Verzeichnis ·
   8 Dark Mode · 9 Responsive/Motion
   ========================================================================= */

/* ---- 0. Token ----------------------------------------------------------- */
.page-koran {
    --q-radius:    18px;
    --q-radius-sm: 12px;
    --q-measure:   48rem;   /* gemeinsame Spaltenbreite ALLER Lese-Hauptelemente –
                               Einleitung, Navigation, Fortschritt, Buchseite UND
                               Vers-für-Vers nutzen exakt dieselbe Breite (≈+10 %). */
    --q-border:        color-mix(in srgb, var(--accent) 9%, transparent);
    --q-border-strong: color-mix(in srgb, var(--accent) 16%, transparent);
    --q-paper:      #FFFFFF;   /* Buchseite (hell) */
    --q-paper-edge: #ECECEA;
    --q-ink:        var(--text-strong);
    /* Verstext: würdige Serife (Cooper), skalierbar über --reader-scale */
    --q-verse-size: calc(clamp(1.12rem, 1rem + .5vw, 1.32rem) * var(--reader-scale, 1));
    --q-verse-lh:   1.95;
    /* ----------------------------------------------------------------------
       Buchseiten-Höhe – EINE global einheitliche Höhe für ALLE Seiten.
       --q-page-base ist nur der Referenz-/Tuning-Wert für die Paginierung.
       Die tatsächliche Höhe --q-page-h berechnet reader.js: Es paginiert einmal
       bei Referenzgröße (feste Zuordnung Vers→Seite, schriftgrößen-unabhängig)
       und setzt --q-page-h = Höhe der inhaltsreichsten Seite bei der AKTUELLEN
       Schriftgröße. Diese eine Höhe gilt für jede Seite – keine Seite misst ihren
       eigenen Inhalt; bei Schriftgrößen-Änderung wachsen alle Seiten gemeinsam,
       die Seitenzahlen ändern sich nie. Fallback (vor JS): die Basishöhe.
       ---------------------------------------------------------------------- */
    --q-page-base: 42rem;
}

/* Ruhiger, einheitlicher Seitengrund – kein Hero-Verlauf am Kopf. */
.page-koran {
    background: var(--bg-page);
}
.page-koran #main { background: transparent; }

/* ---- 1. Kopfbereich der Sure -------------------------------------------- */
/* Surenname schlicht auf dem Seitengrund – Farbe trägt allein die Leiste. */
.qreader__head {
    background: transparent;
    border-bottom: 0;
}
.qreader__head-inner {
    /* Sehr kompakter Kopf – die erste Leseseite steht im Vordergrund. */
    padding-block: clamp(1.1rem, 3vw, 1.9rem) clamp(.4rem, 1.2vw, .75rem);
    text-align: center;
}
.qcrumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem;
    margin-bottom: clamp(.7rem, 2vw, 1.1rem);
    color: var(--text-muted);
    font-size: .8rem;
}
.qcrumbs a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.qcrumbs a:hover { color: var(--accent); }
.qcrumbs [aria-current] { color: var(--text-strong); font-weight: 600; }

/* Reihenfolge im Kopf: erst der Suren-Name (H1), darunter die Meta-Zeile. */
/* Lateinisch transliterierter Surentitel – elegant, zentriert. */
.qreader__title {
    margin: 0;
    color: var(--text-strong);
    font-family: var(--font-display-medium);
    font-size: clamp(2rem, 1.5rem + 1.6vw, 3rem);
    line-height: var(--hero-h1-lh);
    letter-spacing: normal;
}
/* Metadaten als eine kompakte Zeile: „Medina • 176 Verse“. */
.qreader__meta {
    margin: clamp(.35rem, 1.2vw, .6rem) 0 0;
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.qreader__meta-dot { color: var(--gold); margin: 0 .18em; }

/* Dezenter Umschalter zum experimentellen Dashboard-Layout (?view=lab). */
.qreader__lab-link {
    display: inline-flex; align-items: center; gap: .35rem;
    margin: .9rem auto 0;
    color: var(--text-muted); font-size: .84rem; font-weight: 600; text-decoration: none;
    transition: color var(--transition);
}
.qreader__lab-link svg { width: .95rem; height: .95rem; transition: transform var(--transition); }
.qreader__lab-link:hover { color: var(--gold); }
.qreader__lab-link:hover svg { transform: translateX(3px); }

/* Einleitung als einklappbare Karte: Vor dem Öffnen ist der gesamte
   Beschreibungstext verborgen – sichtbar ist nur die Schaltfläche
   „Über diese Sure". Beim Öffnen gleitet der Text sanft auf. */
.qintro {
    max-width: var(--q-measure);
    margin: clamp(.55rem, 1.6vw, .95rem) auto 0;
    padding: clamp(.55rem, 1.4vw, .8rem) clamp(1rem, 3vw, 1.5rem);
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    text-align: center;
    transition: background var(--transition);
}
.qintro.is-open { background: color-mix(in srgb, var(--accent) 6%, transparent); padding-bottom: clamp(1rem, 2.5vw, 1.5rem); }

.qintro__toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0 auto;
    padding: .5rem 1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--gold);
    font: inherit;
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background var(--transition);
}
.qintro__toggle:hover { background: color-mix(in srgb, var(--secondary) 10%, transparent); }
.qintro__toggle-ic { display: inline-flex; }
.qintro__toggle-ic svg { width: 1.1rem; height: 1.1rem; }
.qintro__chevron { width: .95rem; height: .95rem; transition: transform .3s var(--ease-out-soft); }
.qintro__toggle[aria-expanded="true"] .qintro__chevron { transform: rotate(180deg); }

/* Körper: per max-height + opacity sanft auf-/zuklappen. Vor dem Öffnen 0 → Text
   vollständig verborgen. max-height großzügig, damit auch lange Beschreibungen passen. */
.qintro__body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .5s var(--ease-out-soft), opacity .4s var(--ease-out-soft);
}
.qintro.is-open .qintro__body { max-height: 50rem; opacity: 1; }
.qintro__text {
    margin: .85rem 0 0;
    color: var(--text-muted);
    font-size: 1.06rem;
    line-height: 1.78;
}
/* Ohne JavaScript: Beschreibung vollständig zeigen, Umschalter ausblenden. */
html:not(.js) .qintro__body { max-height: none; opacity: 1; }
html:not(.js) .qintro__toggle { display: none; }

/* ---- Weiterlesen-Banner -------------------------------------------------
   Schlanke, ruhige Leiste oben im Leser: weicher Grund, Haarlinie, kein
   schwerer Schatten; sanftes Ein-/Ausblenden. Per JS gefüllt/eingeblendet. */
.qresume {
    display: flex;
    align-items: center;
    gap: clamp(.55rem, 1.5vw, .95rem);
    width: min(100%, var(--q-measure));
    margin: 0 auto clamp(1rem, 2.4vw, 1.6rem);
    padding: .7rem .8rem .7rem 1rem;
    border-radius: 16px;
    background: var(--surface-card);   /* weiß, ohne Rahmen/Schatten */
    color: var(--text-default);
    text-align: left; text-decoration: none;
    opacity: 0; transform: translateY(-6px);
    transition: opacity .5s var(--ease-out-soft), transform .5s var(--ease-out-soft),
                background var(--transition);
}
.qresume[hidden] { display: none; }
/* Im Surenverzeichnis: etwas Abstand zur Suchleiste, kein Doppel-Abstand nach unten. */
.qresume--index { margin-top: clamp(.9rem, 2.2vw, 1.3rem); margin-bottom: 0; }
.qresume.is-in { opacity: 1; transform: none; }
.qresume:hover {
    background: color-mix(in srgb, var(--secondary) 16%, var(--surface-card));
}
.qresume:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.qresume__icon {
    flex: none; display: grid; place-items: center;
    width: 2.4rem; height: 2.4rem; border-radius: 50%;
    background: var(--gold);   /* kräftiges Gold-Lesezeichen als Akzent */
    color: #fff;
}
.qresume__icon svg { width: 1.1rem; height: 1.1rem; }
.qresume__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.qresume__label { font-size: .92rem; line-height: 1.25; color: var(--text-muted); }
.qresume__where { color: var(--text-strong); font-weight: 700; }
.qresume__meta { display: flex; align-items: center; gap: .5rem; }
.qresume__meta[hidden] { display: none; }
.qresume__bar {
    flex: none; position: relative;
    width: 4.5rem; height: 4px; border-radius: 999px; overflow: hidden;
    background: color-mix(in srgb, var(--secondary) 14%, transparent);
}
.qresume__bar-fill {
    position: absolute; inset: 0 auto 0 0; width: 0;
    border-radius: 999px; background: var(--gold);
    transition: width .85s var(--ease-out-soft);
}
.qresume__pct { font-size: .76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.qresume__cta {
    flex: none; display: inline-flex; align-items: center; gap: .35rem;
    padding: .45rem .75rem; border-radius: var(--radius-button);
    color: var(--gold); font-weight: 700; font-size: .88rem;
}
.qresume__cta svg { width: 1rem; height: 1rem; transition: transform var(--transition); }
.qresume:hover .qresume__cta svg { transform: translateX(3px); }
@media (max-width: 560px) {
    .qresume__cta-text { display: none; }
    .qresume { padding-right: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
    .qresume { transition: opacity .2s linear; transform: none; }
    .qresume__bar-fill { transition: none; }
}
/* Dunkler Modus: dezent statt weiß. */
html[data-theme="dark"] .qresume {
    background: color-mix(in srgb, #fff 6%, transparent);
    border-color: color-mix(in srgb, #fff 13%, transparent);
}
html[data-theme="dark"] .qresume:hover { background: color-mix(in srgb, var(--secondary) 24%, var(--surface-card)); }
html[data-theme="dark"] .qresume__icon { background: color-mix(in srgb, var(--gold) 24%, transparent); }
html[data-theme="dark"] .qresume__bar { background: color-mix(in srgb, #fff 16%, transparent); }

/* ---- 2. Kontext-Leiste (sticky) ------------------------------------------ */
/* NUR im Vollbild-Lesemodus (.view-lab): Der Website-Header scrollt mit weg, die
   eigene Kontext-/Mobil-Leiste des Readers übernimmt oben. Verzeichnis & Suche
   (ebenfalls .page-koran, aber ohne .view-lab) behalten die globale fixierte Nav. */
.view-lab .site-header { position: static; }

/* Lese-Werkzeugleiste: kompakte, sticky Hauptnavigation – sanftes Glas/Papier,
   kein schwerer Schatten, fühlt sich als Teil des Buches an. */
/* Sticky-Wrapper: transparent, nur ein leichter Frost fürs saubere Scrollen –
   keine Füllfläche; die Steuerung trägt allein über Abstände. */
.qbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: clamp(.25rem, .8vw, .45rem) 0 clamp(.3rem, 1vw, .5rem);
    /* Deckt scrollenden Text sauber ab und verschmilzt mit der Seite. Kein
       backdrop-filter/transform – sonst würde das mobile Sheet (fixed) am Balken
       statt am Viewport verankert. */
    background: var(--bg-page);
}
/* Inner über volle Breite: die Auswahl ist exakt zentriert, die Einstellungen
   liegen absolut rechts und verschieben die Zentrierung NICHT. */
.qbar__inner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: min(calc(100% - (var(--gutter) * 2)), var(--q-measure));
    margin-inline: auto;
}
.qbar__nav-group { display: inline-flex; align-items: center; gap: .35rem; }

/* Vor/Zurück: schlichte Pfeil-Icons – Hover nur als Farbwechsel. */
.qbar__step {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 36px; min-width: 36px; padding: .4rem;
    border: 0; border-radius: 50%;
    background: transparent; color: var(--text-muted);
    cursor: pointer; text-decoration: none;
    transition: color var(--transition), transform var(--transition);
}
.qbar__step:hover { color: var(--text-strong); }
.qbar__step:active { transform: scale(.92); }
.qbar__step svg { width: 1.05rem; height: 1.05rem; flex: none; }
.qbar__step.is-disabled { opacity: .26; pointer-events: none; }

/* Suren-Auswahl: wirkt wie reiner Text mit Dropdown-Pfeil – keine Füllfläche. */
.qbar__select {
    display: inline-flex; align-items: center; gap: .35rem;
    min-height: 36px; padding: .25rem .35rem;
    border: 0; border-radius: 8px;
    background: transparent;
    color: var(--text-strong); font: inherit; cursor: pointer; max-width: 56vw;
    transition: color var(--transition);
}
.qbar__select:hover { color: var(--gold); }
.qbar__select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.qbar__select-name {
    font-family: var(--font-display-medium); font-weight: 500; font-size: 1.08rem; line-height: 1.1;
    color: inherit; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.qbar__select-chevron { flex: none; width: .85rem; height: .85rem; color: var(--text-muted); transition: color var(--transition); }
.qbar__select:hover .qbar__select-chevron { color: var(--gold); }

/* Einstellungen absolut rechts – ändern die zentrierte Auswahl nicht. Vertikal
   per top/bottom + flex zentriert (kein transform → kein fixed-Verankerungs-Trap). */
.qbar__settings { position: absolute; right: 0; top: 0; bottom: 0; display: flex; align-items: center; }

/* Einstellungs-Zahnrad: ebenfalls ohne Füllfläche – Hover nur Farbwechsel. */
.qbar__inner .qbar__gear { color: var(--text-muted); }
.qbar__inner .qbar__gear:hover { background: transparent; color: var(--text-strong); }
.qbar__inner .qbar__gear[aria-expanded="true"] { background: transparent; color: var(--gold); }
.qbar__inner .qbar__gear svg { width: 1.15rem; height: 1.15rem; }

/* Schlanke Ghost-Buttons: kein schwerer Rahmen, dezenter warmer Hover. */
.qbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    min-width: 42px;
    padding: .5rem .7rem;
    border: 0;
    border-radius: var(--q-radius-sm);
    background: transparent;
    color: var(--text-strong);     /* kräftige Icons – im Nachtmodus weiß */
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.qbar__btn:hover { background: var(--bg-inner); color: var(--text-strong); }
.qbar__btn:active { transform: scale(.95); }
.qbar__btn svg { width: 1.2rem; height: 1.2rem; flex: none; }
.qbar__btn--icon { padding: .55rem; border-radius: 50%; }
.qbar__btn--icon.is-disabled { opacity: .28; pointer-events: none; }
/* Suren-Pfeile: kleiner und dezenter, damit der Titel im Fokus bleibt. */
.qbar__prev, .qbar__next { min-height: 36px; min-width: 36px; padding: .4rem; color: var(--text-muted); }
.qbar__prev:hover, .qbar__next:hover { color: var(--text-strong); }
.qbar__prev svg, .qbar__next svg { width: 1.02rem; height: 1.02rem; }

/* „Alle Suren“ liegt jetzt als Pille im Kopf (.qreader__nav). Die sticky Leiste
   blendet beim Scrollen mittig den aktuellen Suren-Namen + Leseposition ein –
   ein Klick öffnet ebenfalls das Verzeichnis. */
.qbar__inner { position: relative; }
/* „Alle Suren“ als reines Icon, direkt neben dem Einstellungen-Zahnrad. */
.qbar__nav { margin-left: auto; }
.qbar__settings { margin-left: 0; }
.qbar__context {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: none;                       /* oben verborgen, nur verdichtet sichtbar */
    align-items: center; gap: .45rem; max-width: 56%;
    padding: .3rem .7rem;
    border: 0; border-radius: 999px; background: transparent;
    font: inherit; cursor: pointer; transition: background var(--transition);
}
.qbar.is-condensed .qbar__context { display: flex; }
.qbar__context:hover { background: var(--bg-inner); }
.qbar__context:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Aktueller Suren-Name + Leseposition */
.qbar__context-current { min-width: 0; text-align: left; line-height: 1.12; }
.qbar__context-name {
    display: block; font-style: normal;
    color: var(--text-strong); font-family: var(--font-display-medium); font-weight: 500; font-size: 1rem;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.qbar__context-meta {
    display: block; white-space: nowrap;
    color: var(--text-muted); font-size: .72rem; font-weight: 600;
    font-variant-numeric: tabular-nums; letter-spacing: .02em;
}

.qbar__context-chevron { width: .85rem; height: .85rem; flex: none; color: var(--gold); transition: transform var(--transition); }
.qbar__context:hover .qbar__context-chevron { transform: translateY(2px); }


/* Theme-Umschalter: Mond im Hellmodus, Sonne im Dunkelmodus */
.qbar__btn--theme .qicon-sun { display: none; }
html[data-theme="dark"] .qbar__btn--theme .qicon-sun { display: block; }
html[data-theme="dark"] .qbar__btn--theme .qicon-moon { display: none; }

/* Segment-Steuerung: Lesemodus */
.qbar__mode {
    display: inline-flex;
    gap: .25rem;
    padding: .3rem;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.qmode {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 38px;
    padding: .45rem 1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.qmode svg { width: 1rem; height: 1rem; }
.qmode:hover { color: var(--text-strong); }
.qmode[aria-pressed="true"] {
    background: var(--gold);
    color: #fff;
}
.qbar__tools { display: inline-flex; gap: .35rem; }

/* Einstellungs-Popover (Zahnrad): bündelt Lesemodus + Ansicht kompakt.
   position: absolute kommt aus der Werkzeugleisten-Regel oben (rechts verankert). */
.qbar__settings { flex: none; }
.qbar__gear[aria-expanded="true"] {
    background: var(--bg-inner);
    color: var(--gold);
    transform: none;
}
.qbar__popover {
    position: absolute;
    top: calc(100% + .6rem);
    right: 0;
    z-index: 41;
    display: grid;
    gap: 1.15rem;
    min-width: 17.5rem;
    padding: 1.1rem 1.15rem 1.2rem;
    background: var(--surface-raised);
    border: 0;
    border-radius: 18px;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--accent) 5%, transparent),
        0 24px 60px -28px rgba(11, 11, 11, .35);
}
.qbar__popover[hidden] { display: none; }
.qbar__popover:not([hidden]) { animation: qpop-in .18s var(--ease-out-soft); }
@keyframes qpop-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
@keyframes qsheet-up {
    from { transform: translateY(100%); }
    to   { transform: none; }
}
.qbar__popover-group { display: grid; gap: .4rem; }
.qbar__popover-label {
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.qbar__popover .qbar__mode { display: flex; width: 100%; }
.qbar__popover .qmode { flex: 1; justify-content: center; padding-inline: .5rem; font-size: .84rem; white-space: nowrap; }
.qbar__popover .qbar__tools { display: flex; width: 100%; }
.qbar__popover .qbar__tools .qbar__btn { flex: 1; }

/* Schriftgröße: große, klare Pillen-Tasten. */
.qbar__tools--font { gap: .5rem; }
.qbar__btn--font {
    flex: 1;
    min-height: 48px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
}
.qbar__btn--font:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text-strong); }
.qbar__btn--font:active { transform: scale(.96); }

/* Darstellung: Theme als breite Schalter-Pille mit Icon + Label. */
.qbar__popover-group--theme .qbar__btn--theme {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .65rem;
    width: 100%;
    min-height: 48px;
    padding: .5rem .95rem;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    color: var(--text-strong);
    font-weight: 600;
}
.qbar__popover-group--theme .qbar__btn--theme:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.qbar__popover-group--theme .qbar__btn--theme svg { width: 1.2rem; height: 1.2rem; color: var(--gold); }
.qbar__btn-label { font-size: .92rem; }

/* Ohne JS: Steuerung ausblenden (Inhalt bleibt voll lesbar). */
html:not(.js) .qbar__settings { display: none; }

/* Lesefortschritt: schmale, abgerundete Linie unter der Pille. */
.qprogress {
    width: min(calc(100% - (var(--gutter) * 2)), var(--q-measure));
    height: 3px;
    margin: .5rem auto 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 16%, transparent);
    overflow: hidden;
}
.qprogress__fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--gold);
    transition: width .25s var(--ease-out-soft);
}

/* ---- 3. Vers-für-Vers-Modus ---------------------------------------------- */
.qreader__stage-inner {
    /* Erste Leseseite beginnt unmittelbar unter der Werkzeugleiste. */
    padding-block: clamp(.5rem, 1.4vw, .95rem) clamp(3rem, 6vw, 4.5rem);
}

/* ---- Sanfte Lese-Sperre (nicht in WordPress angemeldet) ------------------
   NUR der Lesetext wird verwischt und gesperrt – Navigation, Kopf und Werkzeug-
   leiste bleiben sichtbar und bedienbar. Die Lesefläche bleibt als VOLLE Seite
   sichtbar (kein harter Beschnitt – der untere Rand blendet sanft aus); die
   Anmelde-Karte sitzt mittig über dem sichtbaren Seitenbereich. Die senkrechte
   Position der Karte setzt reader.js (zentriert im sichtbaren Teil der Seite). */
.qreader.is-locked .qreader__stage {
    position: relative;
    max-height: min(46rem, 86vh);   /* volle, ruhige Leseseite statt schmalem Streifen */
    overflow: hidden;
}
.qreader.is-locked .qreader__stage-inner {
    filter: blur(5px);
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    /* weiches Ausblenden nach unten statt harter Schnittkante */
    -webkit-mask-image: linear-gradient(to bottom, #000 74%, transparent);
    mask-image: linear-gradient(to bottom, #000 74%, transparent);
    animation: qblur-in .6s var(--ease-out-soft) both;
}
.qlock {
    position: absolute;
    inset: 0;
    z-index: 5;
    /* leichter Schleier: die volle Seite bleibt sichtbar, die Karte hebt sich
       über ihren eigenen Schatten ab. */
    background: linear-gradient(to bottom,
        color-mix(in srgb, var(--bg-page) 18%, transparent),
        color-mix(in srgb, var(--bg-page) 40%, transparent));
    animation: qfade-in .5s var(--ease-out-soft) both;
}
.qlock__card {
    position: absolute;
    left: 50%;
    top: 1.5rem;                    /* Startwert; reader.js zentriert über dem sichtbaren Bereich */
    transform: translateX(-50%);
    width: min(27rem, calc(100vw - 2.5rem));
    display: grid;
    justify-items: center;
    gap: .55rem;
    text-align: center;
    padding: clamp(1.4rem, 2.6vw, 1.9rem) clamp(1.5rem, 4vw, 2.2rem);
    border-radius: 20px;
    background: var(--q-paper, #fff);
    box-shadow:
        0 1px 2px rgba(11, 11, 11, .05),
        0 20px 44px -28px rgba(11, 11, 11, .26);
    animation: qlock-in .5s var(--ease-out-soft) .06s both;
}
.qlock__icon {
    display: grid; place-items: center;
    width: 2.9rem; height: 2.9rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--gold) 13%, transparent);
    color: var(--gold);
}
.qlock__icon svg { width: 1.4rem; height: 1.4rem; }
.qlock__title {
    margin: .1rem 0 0;
    font-family: var(--font-display-medium);
    font-size: clamp(1.32rem, 1.1rem + 1vw, 1.7rem);
    line-height: 1.22;
    color: var(--text-strong);
}
.qlock__text { margin: 0; color: var(--text-muted); font-size: 1rem; line-height: 1.5; }
/* Vorteile: ruhige, zentrierte Reihe mit schlichtem goldenem Häkchen –
   minimal und symmetrisch zum übrigen (zentrierten) Karteninhalt. */
.qlock__list {
    margin: .2rem 0 .4rem;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .5rem;
    text-align: center;
}
.qlock__list li {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: var(--text-default);
    font-size: .96rem;
    line-height: 1.35;
}
.qlock__list li::before {
    content: "✓";
    flex: none;
    color: var(--gold);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1;
}
.qlock__btn { margin-top: .35rem; min-width: 13rem; justify-content: center; }
.qlock__alt { margin: 0; color: var(--text-muted); font-size: .95rem; }
.qlock__alt a { color: var(--gold); font-weight: 600; text-decoration: none; }
.qlock__alt a:hover { text-decoration: underline; }
@keyframes qfade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes qblur-in { from { filter: blur(0); } to { filter: blur(5px); } }
@keyframes qlock-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.98); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@media (max-width: 720px) {
    .qreader.is-locked .qreader__stage { max-height: min(40rem, 82vh); }
    .qlock__card { gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .qreader.is-locked .qreader__stage-inner,
    .qlock,
    .qlock__card { animation: none; }
}

.qflow {
    max-width: var(--q-measure);
    margin-inline: auto;
}
.qflow[hidden] { display: none; }

/* Abschnittsüberschrift: Block ÜBER dem Vers (volle Breite), damit die
   Versnummer mit dem Verstext darunter fluchtet. Moderate Abstände – der
   Vers-zu-Vers-Abstand bleibt im Wesentlichen unverändert. */
.qheading {
    display: block;
    margin: clamp(1.3rem, 3vw, 2rem) 0 .45rem;
    color: var(--accent-soft);
    font-family: var(--font-display-medium);
    font-weight: 500;
    font-size: calc(clamp(1.2rem, 1.05rem + .5vw, 1.5rem) * var(--reader-scale, 1));
    line-height: 1.3;
    break-after: avoid;
    page-break-after: avoid;
}
.qsurah__content > .qheading:first-child { margin-top: .25rem; }

.qayah {
    position: relative;
    display: flex;
    gap: .9rem;
    padding: clamp(.9rem, 2.5vw, 1.15rem) 0;
    border-radius: var(--q-radius-sm);
    transition: background var(--transition);
    /* Anker-Ziele nicht unter Website-Header + Werkzeugleiste verstecken */
    scroll-margin-top: 130px;
}
/* Vers-Nummer: deutlicher, gefüllter Marken-Badge – klar als Versmarke lesbar
   und unverwechselbar mit der kleinen, dezenten Fußnoten-Hochzahl. */
.qayah__num {
    flex: none;
    display: grid;
    place-items: center;
    width: 1.95rem;
    height: 1.95rem;
    margin-top: .2em;
    border-radius: 50%;
    color: var(--text-strong);
    font-size: .8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, var(--gold) 38%, var(--surface-mix));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 60%, transparent);
}
.qayah__body { flex: 1; min-width: 0; }
.qayah__text {
    margin: 0;
    color: var(--q-ink);
    font-family: var(--font-display);
    font-size: var(--q-verse-size);
    line-height: var(--q-verse-lh);
}
.qfn-ref { margin-left: .15em; }
.qfn-ref a {
    color: var(--accent-soft);
    font-family: var(--font-body);
    font-size: .72em;
    font-weight: 700;
    text-decoration: none;
    padding: 0 .15em;
}
.qfn-ref a:hover { text-decoration: underline; }

/* Fußnoten-Referenz im Verstext (aus <fn data-n="N"></fn> erzeugt). */
/* Fußnoten-Marke: kleiner und dezenter als die Vers-Nummer, aber klickbar. */
.footnote-ref { margin-left: .05em; }
.footnote-ref a {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: .62em;
    font-weight: 600;
    text-decoration: none;
    padding: 0 .05em;
}
.footnote-ref a:hover,
.footnote-ref a:focus-visible { color: var(--gold); text-decoration: underline; }
.footnote-ref a:target { background: var(--gold-soft); border-radius: 4px; }

/* Inline-Überschrift, per Zeichenposition in den Verstext eingefügt. */
/* Headings inside the translation (single model). A heading at the very start
   of a verse is its section heading; others sit at their place in the text. */
.qinline-heading {
    display: block;
    font-family: var(--font-display-medium);
    font-weight: 500;
    color: var(--accent-soft);
    font-size: calc(clamp(1.1rem, 1rem + .45vw, 1.38rem) * var(--reader-scale, 1));
    line-height: 1.35;
    margin: 2.1rem 0 .75rem;
    break-after: avoid;
    page-break-after: avoid;
}
/* Section heading at the verse start (right after the sr-only label) — keep it
   snug to the verse it introduces. */
.qayah__text > .sr-only + .qinline-heading { margin-top: .15rem; }

/* Fußnoten-Nummer in der Notenliste + Sprungmarken-Abstand. */
.qfootnote__num { color: var(--gold); font-weight: 700; margin-right: .3em; }
.qfootnote { scroll-margin-top: 5rem; }

/* Sure-Beschreibung im Kopf der Leseseite. */
.qreader__desc {
    max-width: 44rem;
    margin: .95rem auto 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.65;
}

/* Vers-Aktionen: schlichte Icons am rechten Rand, stören den Text nicht */
.qayah { padding-right: 2.7rem; }
.qayah__actions {
    position: absolute;
    top: clamp(.9rem, 2.5vw, 1.15rem);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    opacity: 0;
    transition: opacity var(--transition);
}
.qayah:hover .qayah__actions,
.qayah:focus-within .qayah__actions { opacity: 1; }
@media (hover: none) {
    .qayah__actions { opacity: .6; }
}
.qact {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.qact__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qact svg { width: 1rem; height: 1rem; }
.qact:hover { border-color: var(--q-border-strong); color: var(--accent); background: var(--accent-tint); }
.qact.is-done { border-color: var(--gold); color: var(--accent-soft); }

/* Ziel-Vers (Deep-Link aus Suche): sanfter Gold-Puls */
.qayah:target,
.qayah.is-highlight { background: color-mix(in srgb, var(--gold-soft) 22%, transparent); }
.qayah.is-highlight { animation: qayah-flash 2.4s var(--ease-out-soft) 1; }
@keyframes qayah-flash {
    0%   { background: color-mix(in srgb, var(--gold-soft) 45%, transparent); }
    100% { background: color-mix(in srgb, var(--gold-soft) 22%, transparent); }
}

.qfootnotes {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius);
    background: var(--bg-inner);
    font-size: .92rem;
    color: var(--text-muted);
}
.qfootnotes__title {
    margin: 0 0 .6rem;
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-strong);
}
/* Fußnoten-Liste am Seitenende – gleiche Klasse in Vers-Ansicht UND Buchseiten. */
.page-footnotes { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; line-height: 1.6; }
.page-footnotes li { scroll-margin-top: 130px; }
.page-footnotes li sup { color: var(--gold); font-weight: 700; margin-right: .3em; }
.page-footnotes li:target { background: var(--gold-soft); border-radius: 4px; padding: 0 .25rem; }
.qfootnotes__back { text-decoration: none; color: var(--accent-soft); margin-left: .25em; }
/* Buchseiten: kompakte Noten mit dünner Trennlinie über dem Block. */
.qbook__content .page-footnotes {
    /* Mit der Schriftskala mitwachsen, damit der Inhalt bei jeder Größe linear
       skaliert und die Seiteneinteilung skalen-invariant bleibt (sonst würde
       beim Verkleinern der Inhalt die geschrumpfte Seite überlaufen). */
    margin-top: calc(1rem * var(--reader-scale, 1));
    padding-top: calc(.7rem * var(--reader-scale, 1));
    border-top: 1px solid var(--q-border);
    font-size: calc(.82rem * var(--reader-scale, 1)); gap: .35rem; color: var(--text-muted);
}
/* Vers-für-Vers-Modus: kompakte Fußnoten direkt unter dem jeweiligen Vers. */
.ayah-footnotes {
    margin: .75rem 0 0;
    padding-top: .55rem;
    border-top: 1px solid var(--q-border);
    font-family: var(--font-body);
    font-size: .86rem;
    line-height: 1.55;
    color: var(--text-muted);
}

/* ---- 4. Buchseiten-Modus -------------------------------------------------- */
.qbook[hidden] { display: none; }
.qbook {
    /* Gemeinsame Spaltenbreite (wie Einleitung, Navigation, Fortschritt). */
    max-width: var(--q-measure);
    margin-inline: auto;
}

.qbook__stage {
    position: relative;
    perspective: 2200px;
    outline: none;
    touch-action: pan-y;
}
.qbook__stage:focus-visible { outline: var(--focus-ring); outline-offset: 4px; border-radius: var(--q-radius); }

/* Die Buchseite: schlicht – ruhiges Papier, feine Kante, ein weicher Schatten.
   Etwas höher (v. a. Desktop); feste Höhe je Seite, damit jede gleich wirkt. */
.qbook__page {
    position: relative;
    display: flex;
    flex-direction: column;
    /* KEINE feste/viewport-abhängige Höhe mehr: Die Karte wächst um den festen
       Inhaltsbereich (--q-page-h) plus Kopfzeile und Polster. So bestimmt die
       Schriftgröße – nicht der Inhalt und nicht der Viewport – die Seitenhöhe. */
    padding: clamp(1.6rem, 3.4vw, 2.6rem) clamp(1.7rem, 4vw, 3rem);
    border: 0;
    border-radius: 20px;
    background: var(--q-paper);
    /* Tiefe durch weiche, geschichtete Schatten statt harter Kante. */
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--accent) 4%, transparent),
        0 2px 6px -2px rgba(11, 11, 11, .08),
        0 34px 70px -34px rgba(11, 11, 11, .3);
}
.qbook__running {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.1rem, 3vw, 1.7rem);
    padding-bottom: .7rem;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 6%, transparent);
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .78;
}
.qbook__content {
    /* EINHEITLICHE Seitenhöhe: reader.js misst bei der AKTUELLEN Schriftgröße die
       höchste Seite und setzt --q-page-h. Alle Seiten sind damit exakt gleich hoch,
       der Inhalt passt immer (kein Abschneiden) und die Höhe wächst mit der Schrift.
       Die Seiteneinteilung (Seitenzahl) wird bei Skala 1 fixiert und ändert sich bei
       Schriftgröße NICHT. Der niedrige Split-Schwellwert (reader.js) füllt die Seiten
       gleichmäßig, sodass unten möglichst wenig Leerraum bleibt. */
    flex: none;
    height: var(--q-page-h, var(--q-page-base));
    overflow: hidden;
}
/* Reale Seite: Fußnoten folgen DIREKT auf den Vers-Text (mit Trennlinie) –
   nicht ans Seitenende gedrückt, damit kein Leerraum in der Seitenmitte entsteht. */
#qbook-content { display: flex; flex-direction: column; }
/* Buchsatz: fortlaufender, gesetzter Text wie im gedruckten Buch */
.qbook__para {
    /* Etwas dichterer Satz (engerer Zeilenabstand + kleinerer Absatzabstand),
       damit mehr Text pro Buchseite passt – weiterhin gut lesbar. */
    margin: 0 0 .62em;
    color: var(--q-ink);
    font-family: var(--font-display);
    font-size: var(--q-verse-size);
    line-height: 1.64;
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
}
.qbook__para:last-child { margin-bottom: 0; }
/* Kapitel-Zwischentitel im Buchsatz: zentriert, mit Luft zum Text. */
.qbook__content .qinline-heading {
    text-align: center;
    color: var(--gold);
    margin: 1.5em 0 .8em;
}
.qbook__para:first-child .qinline-heading:first-child { margin-top: 0; }
/* Buch-Versmarke: kleines, gefülltes Gold-Pill – klar als Versnummer erkennbar
   und nicht mit einer Fußnoten-Hochzahl verwechselbar. */
.qbook__vnum {
    margin: 0 .36em 0 0;
    padding: .06em .45em;
    border-radius: 999px;
    color: var(--text-strong);
    background: color-mix(in srgb, var(--gold) 26%, transparent);
    font-family: var(--font-body);
    font-size: .72em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    vertical-align: .14em;
    line-height: 1;
}
/* Fußnoten-Marken im Buchsatz: klein, dezent, deutlich anders als die Versmarke. */
.qbook__verse .qfn-ref a,
.qbook__verse .qfn-ref span,
.qbook__content .footnote-ref a,
.qbook__content .footnote-ref span {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: .6em;
    font-weight: 600;
    text-decoration: none;
}
/* Überschriften: zentrierte Kapitel-Zwischentitel */
.qbook__content .qheading {
    justify-content: center;
    text-align: center;
    margin: 1.15em 0 .65em;
}
.qbook__content .qheading:first-child { margin-top: 0; }
.qbook__content .qfootnotes { margin-top: 1rem; padding: .9rem 1rem; font-size: .85rem; }
.qbook__content .qfootnotes__back { display: none; }
/* Seitenzahlen wurden entfernt – die Buchseite bleibt ablenkungsfrei. */

/* Umblätter-Blatt (von reader.js erzeugt): liegt exakt über der Seite */
.qbook__leaf {
    position: absolute;
    inset: 0;
    z-index: 2;
    transform-origin: left center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity;
    pointer-events: none;
}
.qbook__leaf .qbook__page {
    height: 100%;
    /* Während des Blätterns hebt sich das Blatt mit Tiefe ab. */
    box-shadow: 0 30px 60px -26px rgba(11, 11, 11, .5);
}
.qbook__leaf::after {
    /* Weicher Licht-/Schattenverlauf am Buchrücken – Tiefe statt flacher Slide. */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg,
        rgba(11, 11, 11, .18) 0%,
        rgba(11, 11, 11, .05) 18%,
        transparent 44%);
    opacity: 0;
    transition: opacity .2s linear;
}
.qbook__stage.is-turning .qbook__leaf::after { opacity: 1; }

.qbook__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: clamp(2rem, 5vw, 3.5rem);   /* Abstand der Zurück/Weiter-Tasten zum Footer */
}
/* Leichte, randlose Pillen: dezenter Hintergrund, der mit der Seite verschmilzt –
   keine Erhebung, kein Schatten. Hover ändert nur die Hintergrundtönung. */
.qbook__turn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 40px;
    padding: .5rem 1.25rem;
    border: 0;
    border-radius: var(--radius-button);
    background: color-mix(in srgb, var(--accent) 4%, transparent);
    color: var(--text-strong);
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.qbook__turn svg { width: 1rem; height: 1rem; }
.qbook__turn:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.qbook__turn:active { transform: scale(.97); }
.qbook__turn[disabled] { opacity: .3; pointer-events: none; }
/* "Vorherige/Nächste Sure": gleiche Pille, dezent in Gold akzentuiert. */
.qbook__turn.is-surah-link { color: var(--secondary); background: color-mix(in srgb, var(--secondary) 9%, transparent); }
.qbook__turn.is-surah-link:hover { background: color-mix(in srgb, var(--secondary) 14%, transparent); }

/* ---- 5. Vorherige / nächste Sure ----------------------------------------- */

/* ---- 6. Suren-Drawer (Dialog) --------------------------------------------- */
.qnav { position: fixed; inset: 0; z-index: 90; }
.qnav[hidden] { display: none; }
.qnav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 11, 11, .42);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .25s var(--ease-out-soft);
}
.qnav.is-open .qnav__backdrop { opacity: 1; }
.qnav__panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--surface-raised);
    box-shadow: var(--shadow-lg);
    /* Mobil: Bottom-Sheet */
    left: 0; right: 0; bottom: 0;
    max-height: min(82vh, 40rem);
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
    transition: transform .32s var(--ease-out-soft);
}
.qnav.is-open .qnav__panel { transform: translateY(0); }
.qnav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem .6rem;
}
.qnav__title {
    margin: 0;
    font-size: 1.3rem;
}
.qnav__close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--q-border);
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}
.qnav__close svg { width: 1.05rem; height: 1.05rem; }
.qnav__close:hover { border-color: var(--q-border-strong); color: var(--accent); }
.qnav__search { padding: .25rem 1.25rem .85rem; border-bottom: 1px solid var(--q-border); }
.qnav__list {
    list-style: none;
    margin: 0;
    padding: .75rem 1rem 1.25rem;
    overflow-y: auto;
    display: grid;
    gap: .25rem;
    overscroll-behavior: contain;
}
.qnav__item {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .6rem .7rem;
    border-radius: var(--q-radius-sm);
    text-decoration: none;
    color: var(--text-default);
    transition: background var(--transition), color var(--transition);
}
.qnav__item:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); color: var(--accent); }
.qnav__item.is-active { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.qnav__num {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
    border-radius: 50%;
    background: color-mix(in srgb, var(--gold-soft) 14%, transparent);
    color: var(--text-strong);
    font-size: .76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.qnav__item.is-active .qnav__num { background: var(--accent); border-color: var(--accent); color: #fff; }
.qnav__meta { display: grid; line-height: 1.3; min-width: 0; }
.qnav__meta strong { font-weight: 600; font-size: .95rem; }
.qnav__meta small { color: var(--text-muted); font-size: .76rem; }

/* ---- 7. Suche & Surenverzeichnis ----------------------------------------- */
.qsearch {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .35rem .3rem 1.05rem;
    background: var(--surface-card);
    border: 0;
    border-radius: 999px;
    transition: background var(--transition);
}
.qsearch:focus-within { background: var(--surface-card); }
.qsearch__icon {
    flex: none;
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}
.qsearch input[type="search"] {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: .5rem .25rem;
    border: 0;
    background: transparent;
    color: var(--text-strong);
    font: inherit;
    font-size: .98rem;
}
.qsearch input[type="search"]:focus { outline: none; }
.qsearch__submit {
    min-height: 38px;
    padding: .5rem 1.05rem;
    border: 0;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}
.qsearch__submit:hover { background: color-mix(in srgb, var(--gold) 86%, #000); }

.qsearch-page__form { max-width: 34rem; margin-top: 1.1rem; }
.qsearch-page__count { margin-top: 1rem; color: var(--text-muted); font-size: .9rem; }
.qresults {
    list-style: none;
    margin: 1.4rem 0 0;
    padding: 0;
    display: grid;
    gap: .8rem;
    max-width: 46rem;
}
.qresult {
    padding: 1.05rem 1.2rem;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius);
    background: var(--bg-inner);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.qresult:hover { border-color: var(--q-border-strong); transform: translateY(-2px); }
.qresult__ref {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .4rem;
    color: var(--text-strong);
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
}
.qresult__ref:hover { color: var(--accent); }
.qresult__num {
    display: inline-grid;
    place-items: center;
    padding: .2rem .5rem;
    border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold-soft) 14%, transparent);
    font-size: .74rem;
    font-variant-numeric: tabular-nums;
}
.qresult__excerpt { margin: 0; color: var(--text-default); font-size: .95rem; line-height: 1.6; }

/* Surenverzeichnis (/koran): zentrierter Premium-Kopf + Kartenraster */
.qindex__head {
    /* Der Titel sitzt jetzt im Gold-Band darüber – daher kein Hero-Oberabstand,
       die Suche rückt direkt unter das Band. */
    padding: 0 0 var(--hero-pad-bottom);
    text-align: center;
}
.qindex__head-inner { display: grid; justify-items: center; }
.qindex__title {
    margin: 0;
    font-family: var(--font-display-medium);
    font-size: var(--hero-h1-size);
    line-height: var(--hero-h1-lh);
    letter-spacing: normal;
    color: var(--text-strong);
}
.qindex__search { width: min(100%, 30rem); margin: 0 auto; }

.qindex__body { padding-block: clamp(1.8rem, 4vw, 3rem) clamp(3rem, 6vw, 4.5rem); }

/* Weiterlesen-Karte (per JS eingeblendet) */
/* Bibliothek: ruhige hellgraue Karten, der erste Vers als Leseprobe.
   Keine Schatten, keine Rahmen – nur Fläche, Typografie und Abstand. */
.qlib {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: .8rem;
}
@media (min-width: 640px)  { .qlib { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .qlib { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.qlib__card {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1.15rem 1.3rem;
    background: var(--surface-card);
    border-radius: 16px;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
}
/* Hover: helles, frostig-weißes Highlight + dezenter Lift (kein Rand, kein Schatten). */
.qlib__card:hover { background: color-mix(in srgb, var(--secondary) 16%, var(--surface-card)); }

/* Achtzackiger Stern (Rub al-Hizb) als dezentes Nummern-Badge –
   zwei gedrehte Quadrate, passend zur Bildmarke. */
.qlib__badge {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    color: var(--gold);
    font-size: .8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.qlib__badge::before,
.qlib__badge::after {
    content: "";
    position: absolute;
    inset: 14%;
    border: 1.5px solid color-mix(in srgb, var(--gold) 70%, transparent);
    border-radius: 5px;
}
.qlib__badge::after { transform: rotate(45deg); }

.qlib__names { display: grid; gap: .15rem; min-width: 0; }
.qlib__name {
    overflow: hidden;
    color: var(--text-strong);
    font-family: var(--font-display-medium);
    font-weight: 500;
    font-size: 1.12rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qlib__trans {
    overflow: hidden;
    color: var(--text-muted);
    font-size: .85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qlib__facts {
    margin-left: auto;
    flex: none;
    display: grid;
    gap: .15rem;
    justify-items: end;
    text-align: right;
}
.qlib__verses { color: var(--text-strong); font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.qlib__place { color: var(--text-muted); font-size: .78rem; }

/* ---- 8. Dark Mode (Lese-Nachtmodus) ---------------------------------------- */
/* Reader-eigene --q-* Farb-/Flächen-Token auf die theme-fähigen Token mappen,
   damit Buchpapier, Kante und Haarlinien zur einheitlichen Dunkel-Palette passen.
   Größen-/Maß-Token (--q-radius, --q-measure, …) bleiben unangetastet. */
html[data-theme="dark"] .page-koran {
    --q-paper:      var(--surface-card);    /* L1 – Buchseite/Karte */
    --q-paper-edge: var(--surface-raised);  /* L2 – Seitenkanten-Stapel */
    --q-border:        var(--surface-line);
    --q-border-strong: var(--border);
}
html[data-theme="dark"] .qmode[aria-pressed="true"] { background: var(--text-strong); color: #0B0B0B; }
html[data-theme="dark"] .qbook__page {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, .4),
        0 24px 48px -28px rgba(0, 0, 0, .8),
        4px 0 0 -1px var(--q-paper-edge),
        7px 0 0 -2px var(--surface-sunken),
        10px 0 0 -3px var(--q-paper-edge);
}
html[data-theme="dark"] .qayah__num,
html[data-theme="dark"] .qnav__num {
    background: rgba(216, 210, 161, .1);
    border-color: rgba(216, 210, 161, .35);
}
html[data-theme="dark"] .qayah:target,
html[data-theme="dark"] .qayah.is-highlight { background: rgba(216, 210, 161, .1); }
html[data-theme="dark"] .qsearch__submit { color: #0B0B0B; }
html[data-theme="dark"] .qnav__backdrop { background: rgba(0, 0, 0, .6); }
/* Globale Dark-Tokens definieren --bg-inner/--bg-card nicht um – betroffene
   Flächen hier explizit abdunkeln. */
html[data-theme="dark"] .qlib__card { background: var(--surface-card); }
html[data-theme="dark"] .qlib__card:hover { background: color-mix(in srgb, var(--secondary) 24%, var(--surface-card)); }
html[data-theme="dark"] .qlib__card:hover,
html[data-theme="dark"] .qlib__name { color: var(--text-strong); }
html[data-theme="dark"] .qsearch { background: var(--surface-card); }
html[data-theme="dark"] .qsearch:focus-within { background: var(--surface-raised); }
html[data-theme="dark"] .qnav__item:hover,
html[data-theme="dark"] .qnav__item.is-active { background: rgba(249, 246, 241, .1); color: var(--text-strong); }
/* Akzente: im Dunkelmodus auf den (dort rostfarbenen) --accent wechseln,
   damit Überschriften & Fußnotenzeichen warm bleiben. */
html[data-theme="dark"] .qheading,
html[data-theme="dark"] .qinline-heading { color: var(--accent); }
html[data-theme="dark"] .qfn-ref a { color: rgba(255, 255, 255, .82); }

/* ---- 9. Responsive & Motion ------------------------------------------------ */
@media (min-width: 960px) {
    /* Drawer als Seitenpanel von links */
    .qnav__panel {
        left: 0; top: 0; bottom: 0; right: auto;
        width: min(24rem, 88vw);
        max-height: none;
        border-radius: 0 22px 22px 0;
        transform: translateX(-100%);
    }
    .qnav.is-open .qnav__panel { transform: translateX(0); }
}

@media (max-width: 720px) {
    /* Schmalere Spalte → kompaktere Buchseite (Basis kleiner, skaliert weiter
       mit der Schriftgröße). Innerhalb eines Geräts bleibt die Seiteneinteilung
       schriftgrößen-stabil; zwischen Geräten unterscheidet sie sich – wie bei
       verschiedenen Druckauflagen. */
    .page-koran { --q-page-base: 34rem; }
    /* Bibliothek: einspaltig */
    .qlib { grid-template-columns: 1fr; }
    .qreader__head-inner { padding-block: clamp(1rem, 4vw, 1.6rem) .55rem; }
    .qcrumbs { margin-bottom: .45rem; }
    .qreader__eyebrow { margin-bottom: .25rem; }
    /* Eine kompakte Zeile: ‹ Titel › ⚙ */
    .qbar__inner { flex-wrap: nowrap; gap: .4rem; padding-block: .45rem; }
    /* Einstellungen bleiben absolut rechts; das Panel öffnet als Bottom-Sheet
       (fixed am Viewport – funktioniert, da der Balken kein filter/transform hat). */
    .qbar__popover {
        position: fixed;
        left: 0; right: 0; bottom: 0; top: auto;
        min-width: 0;
        max-height: 82vh;
        overflow-y: auto;
        padding: 1.15rem 1.15rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
        gap: 1.1rem;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -14px 44px -18px rgba(11, 11, 11, .45);
        z-index: 60;
    }
    .qbar__popover:not([hidden]) { animation: qsheet-up .28s var(--ease-out-soft); }
    .qbar__popover .qmode { min-height: 48px; font-size: .92rem; }
    .qbar__popover .qbar__tools .qbar__btn { min-height: 48px; }
    .qbar__context { flex: 1 1 auto; justify-content: center; margin-inline: 0; min-width: 0; overflow: hidden; }
    .qbar__context-current, .qbar__context-switch { min-width: 0; max-width: 100%; }
    .qbar__next { margin-right: 0; }
    .qbook__turn-label { display: none; }
    .qbook__turn { min-width: 56px; min-height: 52px; justify-content: center; }
    .qbook__controls { gap: .6rem; }
    .qbook__turn.is-surah-link .qbook__turn-label { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
    .qayah.is-highlight { animation: none; }
    .qnav__backdrop, .qnav__panel { transition: none; }
}
