/* ==========================================================================
   Geschichten-Nest – Ruhiges, gemütliches Lesegefühl (Mobile First)
   100 % lokale System-Schriften, aufbauend auf shared/theme.css
   ========================================================================== */

:root {
    --gn-forest: #166534;
    --gn-forest-deep: #14532d;
    --gn-forest-soft: #e5f3ea;
    --gn-forest-border: rgba(22, 101, 52, 0.22);

    --gn-paper-bg: #f6f1e6;
    --gn-page-bg: #fdfaf3;
    --gn-page-ink: #2b2118;
    --gn-page-muted: #66584b;
    --gn-page-border: rgba(74, 53, 32, 0.14);
    --gn-note-bg: #faf3e1;
    --gn-word-bg: rgba(22, 101, 52, 0.09);
    --gn-word-underline: rgba(22, 101, 52, 0.55);

    --gn-font-story: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
    --gn-story-size: 1.14rem;
}

body.gn-body[data-paper="moss"] {
    --gn-paper-bg: #e6efe8;
    --gn-page-bg: #f4faf5;
    --gn-page-ink: #1b2e22;
    --gn-page-muted: #4a6353;
    --gn-page-border: rgba(22, 101, 52, 0.18);
    --gn-note-bg: #e9f5ec;
    --gn-word-bg: rgba(22, 101, 52, 0.11);
}

body.gn-body[data-paper="dusk"] {
    --gn-paper-bg: #171d19;
    --gn-page-bg: #202723;
    --gn-page-ink: #ece6d8;
    --gn-page-muted: #b8b2a3;
    --gn-page-border: rgba(236, 230, 216, 0.14);
    --gn-note-bg: #29322c;
    --gn-word-bg: rgba(134, 239, 172, 0.14);
    --gn-word-underline: rgba(134, 239, 172, 0.65);
}

body.gn-body[data-font="small"] {
    --gn-story-size: 1.02rem;
}

body.gn-body[data-font="medium"] {
    --gn-story-size: 1.15rem;
}

body.gn-body[data-font="large"] {
    --gn-story-size: 1.32rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.gn-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--le-font-sans);
    background: var(--gn-paper-bg);
    color: var(--le-ink);
    padding-bottom: env(safe-area-inset-bottom, 20px);
    transition: background-color 0.25s ease;
}

/* --------------------------------------------------------------------------
   TOPBAR
   -------------------------------------------------------------------------- */
.gn-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(253, 250, 243, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--le-border);
    padding: 10px 16px;
}

body.gn-body[data-paper="dusk"] .gn-topbar {
    background: rgba(23, 29, 25, 0.92);
    color: #ece6d8;
    border-bottom-color: rgba(236, 230, 216, 0.12);
}

.gn-topbar-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gn-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.gn-brand-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gn-brand-title {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.2;
    font-weight: 800;
}

.gn-brand-sub {
    margin: 0;
    font-size: 0.78rem;
    color: var(--le-ink-muted);
}

body.gn-body[data-paper="dusk"] .gn-brand-sub {
    color: #b8b2a3;
}

.gn-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   MAIN CONTAINER
   -------------------------------------------------------------------------- */
.gn-main {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 16px 48px;
}

/* --------------------------------------------------------------------------
   ANSICHT 1: NEST / REGAL
   -------------------------------------------------------------------------- */
.gn-welcome-banner {
    background: linear-gradient(135deg, #fdfaf3 0%, #edf7f0 100%);
    border: 1px solid var(--gn-forest-border);
    border-radius: var(--le-radius-lg);
    padding: 22px;
    box-shadow: var(--le-shadow-sm);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.gn-welcome-copy {
    max-width: 600px;
}

.gn-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--gn-forest-soft);
    color: var(--gn-forest-deep);
    font-size: 0.78rem;
    font-weight: 700;
}

.gn-welcome-title {
    margin: 10px 0 6px;
    font-size: clamp(1.32rem, 3vw, 1.72rem);
    line-height: 1.25;
    color: var(--le-ink);
}

.gn-welcome-desc {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.55;
    color: var(--le-ink-muted);
}

.gn-nest-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gn-stat-pill {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--gn-forest-border);
    border-radius: var(--le-radius-md);
    padding: 10px 14px;
    min-width: 92px;
    text-align: center;
}

.gn-stat-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gn-forest);
    font-family: var(--le-font-mono);
}

.gn-stat-label {
    font-size: 0.76rem;
    color: var(--le-ink-muted);
    font-weight: 600;
}

/* Filter */
.gn-filter-bar {
    margin-top: 16px;
    background: var(--le-surface);
    border: 1px solid var(--le-border);
    border-radius: var(--le-radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--le-shadow-sm);
}

.gn-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gn-filter-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--le-ink-muted);
    min-width: 78px;
}

.gn-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.gn-pill {
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--le-border);
    background: var(--le-surface-alt);
    color: var(--le-ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}

.gn-pill:active {
    transform: scale(0.98);
}

.gn-pill.active {
    background: var(--gn-forest);
    border-color: var(--gn-forest);
    color: #ffffff;
}

/* Geschichten-Regal (Book Library mit 3D-Flip-Covern) */
.gn-shelf-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 22px 18px;
}

.gn-book-slot {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gn-book-flip-btn {
    position: relative;
    width: 100%;
    height: 368px;
    padding: 0;
    border: none;
    background: transparent;
    perspective: 1200px;
    cursor: pointer;
    text-align: left;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.gn-book-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gn-book-flip-btn.is-flipped .gn-book-flip-inner {
    transform: rotateY(180deg);
}

.gn-book-face {
    position: absolute;
    inset: 0;
    border-radius: 6px 16px 16px 6px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow:
        0 12px 26px rgba(43, 33, 24, 0.16),
        0 2px 6px rgba(43, 33, 24, 0.10);
}

/* Vorderseite: Hardcover-Buch */
.gn-book-front {
    transform: rotateY(0deg);
    background: var(--story-accent, #166534);
    color: #fdfaf3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gn-book-front::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18px;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.32) 0%,
        rgba(255, 255, 255, 0.18) 38%,
        rgba(0, 0, 0, 0.22) 68%,
        rgba(0, 0, 0, 0) 100%
    );
}

.gn-cover-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gn-cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.2));
}

.gn-cover-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(15, 20, 17, 0.36) 0%,
        rgba(15, 20, 17, 0.04) 38%,
        rgba(15, 20, 17, 0.42) 66%,
        rgba(12, 16, 14, 0.90) 100%
    );
}

.gn-cover-top {
    position: relative;
    z-index: 4;
    padding: 12px 12px 0 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.gn-cover-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(20, 24, 21, 0.64);
    backdrop-filter: blur(4px);
    color: #fdfaf3;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.gn-cover-right-pills {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.gn-cover-done-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #166534;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.gn-flip-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(253, 250, 243, 0.92);
    color: #2b2118;
    font-size: 0.73rem;
    font-weight: 800;
}

.gn-cover-bottom {
    position: relative;
    z-index: 4;
    padding: 16px 16px 16px 24px;
}

.gn-cover-title {
    margin: 0;
    font-family: var(--gn-font-story);
    font-size: 1.24rem;
    line-height: 1.25;
    color: #fdfaf3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.gn-cover-sub {
    margin: 5px 0 0;
    font-size: 0.82rem;
    line-height: 1.38;
    color: rgba(253, 250, 243, 0.88);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* Rückseite: Klappentext & alle Buch-Infos */
.gn-book-back {
    transform: rotateY(180deg);
    border-radius: 16px 6px 6px 16px;
    background: #fdfaf3;
    color: var(--le-ink);
    border: 1px solid var(--le-border-strong);
    padding: 16px 22px 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.gn-book-back::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 14px;
    pointer-events: none;
    background: linear-gradient(
        270deg,
        rgba(74, 53, 32, 0.14) 0%,
        rgba(74, 53, 32, 0.04) 55%,
        rgba(74, 53, 32, 0) 100%
    );
}

.gn-back-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.gn-back-kicker {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gn-forest);
}

.gn-back-title {
    margin: 0;
    font-family: var(--gn-font-story);
    font-size: 1.06rem;
    line-height: 1.28;
    color: var(--le-ink);
}

.gn-back-teaser {
    margin: 0;
    font-size: 0.87rem;
    line-height: 1.48;
    color: var(--le-ink-muted);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gn-back-info-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gn-back-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--le-bg-soft);
    color: var(--le-ink);
    border: 1px solid var(--le-border);
}

.gn-back-pill.is-forest {
    background: var(--gn-forest-soft);
    color: var(--gn-forest-deep);
    border-color: var(--gn-forest-border);
}

.gn-back-foot {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--le-ink-soft);
    border-top: 1px dashed var(--le-border);
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gn-open-btn {
    min-height: 46px;
    width: 100%;
    border: none;
    border-radius: var(--le-radius-sm);
    background: var(--gn-forest);
    color: #ffffff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--le-shadow-sm);
    transition: background-color 0.16s ease, transform 0.12s ease;
}

.gn-open-btn:active {
    transform: scale(0.985);
}

/* --------------------------------------------------------------------------
   ANSICHT 2: LESE-MODUS (BUCHSEITE)
   -------------------------------------------------------------------------- */
.gn-reader-view {
    max-width: 780px;
    margin: 0 auto;
}

.gn-reader-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.gn-comfort-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.gn-tool-btn {
    min-height: 44px;
    padding: 8px 14px;
    border-radius: var(--le-radius-sm);
    border: 1px solid var(--gn-page-border);
    background: var(--gn-page-bg);
    color: var(--gn-page-ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: var(--le-shadow-sm);
}

.gn-glossary-btn {
    background: var(--gn-forest);
    border-color: var(--gn-forest);
    color: #ffffff;
}

.gn-glossary-count {
    background: rgba(255, 255, 255, 0.22);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-family: var(--le-font-mono);
}

.gn-segmented {
    display: inline-flex;
    background: var(--gn-page-bg);
    border: 1px solid var(--gn-page-border);
    border-radius: var(--le-radius-sm);
    padding: 3px;
    gap: 2px;
    box-shadow: var(--le-shadow-sm);
}

.gn-seg-btn {
    min-width: 40px;
    min-height: 38px;
    padding: 6px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--gn-page-ink);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.gn-seg-btn.active {
    background: var(--gn-forest-soft);
    color: var(--gn-forest-deep);
}

body.gn-body[data-paper="dusk"] .gn-seg-btn.active {
    background: #2f5e41;
    color: #ecfdf5;
}

.gn-bookmark-track {
    height: 5px;
    width: 100%;
    border-radius: 999px;
    background: rgba(22, 101, 52, 0.12);
    overflow: hidden;
    margin-bottom: 14px;
}

.gn-bookmark-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #166534, #22c55e);
    border-radius: 999px;
    transition: width 0.2s ease;
}

/* Buchseite */
.gn-book-page {
    background: var(--gn-page-bg);
    color: var(--gn-page-ink);
    border: 1px solid var(--gn-page-border);
    border-radius: var(--le-radius-lg);
    padding: clamp(22px, 4.5vw, 48px) clamp(18px, 5vw, 54px);
    box-shadow:
        0 14px 36px rgba(43, 33, 24, 0.08),
        inset 10px 0 22px -16px rgba(43, 33, 24, 0.14);
    transition: background-color 0.25s ease, color 0.25s ease;
}

.gn-book-header {
    border-bottom: 1px solid var(--gn-page-border);
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.gn-book-title {
    margin: 0;
    font-family: var(--gn-font-story);
    font-size: clamp(1.5rem, 3.8vw, 2.05rem);
    line-height: 1.24;
    font-weight: 700;
}

.gn-book-subtitle {
    margin: 6px 0 0;
    font-size: 1rem;
    color: var(--gn-page-muted);
    font-style: italic;
    font-family: var(--gn-font-story);
}

.gn-intro-note {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--le-radius-sm);
    background: var(--gn-note-bg);
    border-left: 4px solid var(--gn-forest);
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--gn-page-muted);
}

/* Lesetext */
.gn-book-content {
    max-width: 64ch;
    margin: 0 auto;
}

.gn-paragraph {
    margin: 0 0 1.35em;
    font-family: var(--gn-font-story);
    font-size: var(--gn-story-size);
    line-height: 1.85;
}

.gn-paragraph.is-opening::first-letter {
    float: left;
    font-size: 3.1em;
    line-height: 0.85;
    padding-right: 10px;
    padding-top: 4px;
    font-weight: 700;
    color: var(--gn-forest);
}

body.gn-body[data-paper="dusk"] .gn-paragraph.is-opening::first-letter {
    color: #86efac;
}

/* Antippbare Wörter im Text */
.gn-word {
    display: inline;
    padding: 2px 5px;
    margin: 0 1px;
    border: none;
    border-radius: 6px;
    background: var(--gn-word-bg);
    border-bottom: 2px dotted var(--gn-word-underline);
    color: inherit;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
    transition: background-color 0.16s ease, transform 0.12s ease;
}

.gn-word:active {
    transform: scale(0.97);
}

.gn-word.is-discovered {
    background: rgba(217, 119, 6, 0.12);
    border-bottom-style: solid;
    border-bottom-color: rgba(217, 119, 6, 0.55);
}

body.gn-body[data-paper="dusk"] .gn-word.is-discovered {
    background: rgba(251, 191, 36, 0.16);
}

/* Zettel / Brief-Block */
.gn-story-note {
    margin: 1.5em 0;
    padding: 18px 20px;
    background: var(--gn-note-bg);
    border: 1px dashed var(--gn-page-border);
    border-radius: var(--le-radius-md);
    box-shadow: 0 4px 14px rgba(43, 33, 24, 0.05);
}

.gn-story-note-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gn-page-muted);
    margin-bottom: 6px;
}

.gn-story-note-text {
    margin: 0;
    font-family: var(--gn-font-story);
    font-size: calc(var(--gn-story-size) * 0.98);
    line-height: 1.75;
    font-style: italic;
}

/* Interaktives Entdecker-Element (Lupe / Aufklapp-Moment) */
.gn-discovery-card {
    margin: 1.6em 0;
    padding: 16px 18px;
    border-radius: var(--le-radius-md);
    border: 1px solid var(--gn-forest-border);
    background: var(--gn-note-bg);
}

.gn-discovery-btn {
    width: 100%;
    min-height: 48px;
    padding: 11px 16px;
    border-radius: var(--le-radius-sm);
    border: 1px solid var(--gn-forest);
    background: var(--gn-forest-soft);
    color: var(--gn-forest-deep);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: left;
}

body.gn-body[data-paper="dusk"] .gn-discovery-btn {
    background: #234731;
    color: #dcfce7;
    border-color: #4ade80;
}

.gn-discovery-reveal {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--gn-page-border);
}

.gn-discovery-reveal-title {
    margin: 0 0 6px;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--gn-forest);
}

body.gn-body[data-paper="dusk"] .gn-discovery-reveal-title {
    color: #86efac;
}

.gn-discovery-reveal-text {
    margin: 0;
    font-family: var(--gn-font-story);
    font-size: calc(var(--gn-story-size) * 0.97);
    line-height: 1.8;
}

/* Kapitel-Auswahl & Seiten-Navigation */
.gn-chapter-bar {
    background: var(--gn-page-bg);
    border: 1px solid var(--gn-page-border);
    border-radius: var(--le-radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--le-shadow-sm);
}

.gn-chapter-bar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gn-chapter-bar-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--gn-page-muted);
    letter-spacing: 0.02em;
}

.gn-chapter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.gn-chapter-pill {
    min-height: 44px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--gn-page-border);
    background: var(--gn-note-bg);
    color: var(--gn-page-ink);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gn-chapter-pill.active {
    background: var(--gn-forest);
    border-color: var(--gn-forest);
    color: #ffffff;
}

.gn-chapter-pill-pages {
    font-size: 0.74rem;
    opacity: 0.8;
    font-weight: 600;
}

.gn-chapter-heading {
    max-width: 64ch;
    margin: 0 auto 20px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--gn-page-border);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gn-chapter-heading-title {
    margin: 0;
    font-family: var(--gn-font-story);
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--gn-forest);
}

body.gn-body[data-paper="dusk"] .gn-chapter-heading-title {
    color: #86efac;
}

.gn-chapter-page-counter {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gn-page-muted);
}

.gn-page-nav {
    max-width: 64ch;
    margin: 26px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--gn-page-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gn-page-btn {
    min-height: 46px;
    padding: 9px 16px;
    border-radius: var(--le-radius-sm);
    border: 1px solid var(--gn-page-border);
    background: var(--gn-note-bg);
    color: var(--gn-page-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gn-page-btn.is-primary {
    background: var(--gn-forest);
    border-color: var(--gn-forest);
    color: #ffffff;
}

.gn-page-btn:disabled {
    opacity: 0.42;
    cursor: default;
}

.gn-page-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gn-page-dot {
    min-width: 38px;
    min-height: 38px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--gn-page-border);
    background: transparent;
    color: var(--gn-page-muted);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.gn-page-dot.active {
    background: var(--gn-forest-soft);
    border-color: var(--gn-forest);
    color: var(--gn-forest-deep);
}

body.gn-body[data-paper="dusk"] .gn-page-dot.active {
    background: #234731;
    border-color: #4ade80;
    color: #dcfce7;
}

/* Buch-Ausklang */
.gn-book-outro {
    max-width: 64ch;
    margin: 28px auto 0;
    padding-top: 22px;
    border-top: 1px solid var(--gn-page-border);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gn-outro-note {
    margin: 0;
    font-size: 0.88rem;
    color: var(--gn-page-muted);
    line-height: 1.5;
}

.gn-outro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gn-finish-btn {
    min-height: 48px;
    padding: 11px 20px;
    border-radius: var(--le-radius-sm);
    border: none;
    background: var(--gn-forest);
    color: #ffffff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gn-finish-btn.is-finished {
    background: var(--gn-forest-soft);
    color: var(--gn-forest-deep);
    border: 1px solid var(--gn-forest-border);
}

.gn-secondary-btn {
    min-height: 48px;
    padding: 11px 16px;
    border-radius: var(--le-radius-sm);
    border: 1px solid var(--gn-page-border);
    background: transparent;
    color: var(--gn-page-ink);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.gn-reward-toast {
    padding: 11px 14px;
    border-radius: var(--le-radius-sm);
    background: #fef3c7;
    color: #78350f;
    border: 1px solid rgba(217, 119, 6, 0.35);
    font-size: 0.9rem;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   WORT-ERKLÄRUNGS-SHEET & NACHSCHLAGEWERK-DRAWER
   -------------------------------------------------------------------------- */
.gn-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(20, 24, 21, 0.38);
    backdrop-filter: blur(2px);
}

.gn-word-sheet {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 24px));
    max-height: 82vh;
    overflow-y: auto;
    z-index: 100;
    background: var(--le-surface);
    color: var(--le-ink);
    border: 1px solid var(--gn-forest-border);
    border-radius: var(--le-radius-lg);
    padding: 14px 20px 20px;
    box-shadow: 0 20px 48px rgba(20, 24, 21, 0.24);
}

body.gn-body[data-paper="dusk"] .gn-word-sheet,
body.gn-body[data-paper="dusk"] .gn-glossary-drawer {
    background: #232b26;
    color: #ece6d8;
    border-color: rgba(236, 230, 216, 0.16);
}

body.gn-body[data-paper="dusk"] .gn-word-title,
body.gn-body[data-paper="dusk"] .gn-drawer-title {
    color: #f4efe4;
}

body.gn-body[data-paper="dusk"] .gn-word-example-box,
body.gn-body[data-paper="dusk"] .gn-glossary-item,
body.gn-body[data-paper="dusk"] .gn-drawer-controls,
body.gn-body[data-paper="dusk"] .gn-search-input,
body.gn-body[data-paper="dusk"] .gn-icon-close {
    background: #2b352f;
    color: #ece6d8;
    border-color: rgba(236, 230, 216, 0.16);
}

body.gn-body[data-paper="dusk"] .gn-word-tip-box {
    background: #332e22;
    border-color: rgba(251, 191, 36, 0.28);
    color: #fde68a;
}

body.gn-body[data-paper="dusk"] .gn-glossary-item.is-discovered {
    background: #25362b;
    border-left-color: #4ade80;
}

body.gn-body[data-paper="dusk"] .gn-box-label,
body.gn-body[data-paper="dusk"] .gn-glossary-item-sub,
body.gn-body[data-paper="dusk"] .gn-glossary-item-example {
    color: #b8b2a3;
}

.gn-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--le-border-strong);
    margin: 0 auto 12px;
}

.gn-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.gn-word-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.gn-word-pos,
.gn-word-syllables {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--gn-forest-soft);
    color: var(--gn-forest-deep);
}

.gn-word-syllables {
    background: var(--le-bg-soft);
    color: var(--le-ink-muted);
}

.gn-word-title {
    margin: 0;
    font-family: var(--gn-font-story);
    font-size: 1.45rem;
    color: var(--le-ink);
}

.gn-icon-close {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--le-border);
    background: var(--le-surface-alt);
    color: var(--le-ink);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.gn-word-body {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gn-word-meaning {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.55;
}

.gn-word-example-box,
.gn-word-tip-box {
    padding: 11px 13px;
    border-radius: var(--le-radius-sm);
    background: var(--le-surface-alt);
    border: 1px solid var(--le-border);
}

.gn-word-tip-box {
    background: #fef9ea;
    border-color: rgba(217, 119, 6, 0.25);
}

.gn-box-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--le-ink-soft);
    margin-bottom: 4px;
}

.gn-word-example-box p,
.gn-word-tip-box p {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.5;
}

.gn-sheet-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--le-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.gn-discovered-note {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gn-forest);
}

.gn-text-link-btn {
    min-height: 40px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--gn-forest);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

/* Nachschlagewerk Drawer */
.gn-glossary-drawer {
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(460px, calc(100vw - 24px));
    z-index: 105;
    background: var(--le-surface);
    color: var(--le-ink);
    border: 1px solid var(--le-border);
    border-radius: var(--le-radius-lg);
    box-shadow: 0 24px 56px rgba(20, 24, 21, 0.26);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gn-drawer-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--le-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.gn-drawer-title {
    margin: 6px 0 0;
    font-size: 1.18rem;
}

.gn-drawer-controls {
    padding: 12px 18px;
    border-bottom: 1px solid var(--le-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: var(--le-surface-alt);
}

.gn-search-input {
    flex: 1;
    min-width: 150px;
    min-height: 42px;
    padding: 8px 12px;
    border-radius: var(--le-radius-sm);
    border: 1px solid var(--le-border-strong);
    background: var(--le-surface);
    color: var(--le-ink);
    font: inherit;
    font-size: 0.92rem;
}

.gn-glossary-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gn-glossary-item {
    padding: 14px;
    border-radius: var(--le-radius-md);
    border: 1px solid var(--le-border);
    background: var(--le-surface);
}

.gn-glossary-item.is-discovered {
    border-left: 4px solid var(--gn-forest);
    background: #f8fcf9;
}

.gn-glossary-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.gn-glossary-item-word {
    font-family: var(--gn-font-story);
    font-size: 1.12rem;
    font-weight: 700;
}

.gn-glossary-item-status {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--le-ink-soft);
}

.gn-glossary-item.is-discovered .gn-glossary-item-status {
    color: var(--gn-forest);
}

.gn-glossary-item-sub {
    font-size: 0.78rem;
    color: var(--le-ink-soft);
    margin: 3px 0 7px;
}

.gn-glossary-item-meaning {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.gn-glossary-item-example {
    margin: 7px 0 0;
    font-size: 0.85rem;
    color: var(--le-ink-muted);
    font-style: italic;
}

.gn-empty-state {
    padding: 28px 18px;
    text-align: center;
    border-radius: var(--le-radius-md);
    border: 1px dashed var(--le-border-strong);
    background: var(--le-surface);
    color: var(--le-ink-muted);
}

@media (max-width: 640px) {
    .gn-main {
        padding: 14px 12px 40px;
    }

    .gn-welcome-banner {
        padding: 16px;
    }

    .gn-reader-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .gn-comfort-controls {
        justify-content: space-between;
    }

    .gn-glossary-drawer {
        top: auto;
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        height: 82vh;
    }

    .gn-word-sheet {
        bottom: 8px;
        width: calc(100vw - 16px);
    }
}
