/* ==========================================================================
   Satsang – huisstijl
   Indigo (Krishna's blauw), goudsbloem (marigold) en palmblad (pothi-manuscript).
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter.woff") format("woff");
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: "Noto Serif";
    src: url("../fonts/noto-serif.woff") format("woff");
    font-weight: 100 900;
    font-stretch: 62.5% 100%;
    font-display: swap;
}
@font-face {
    font-family: "Noto Serif Devanagari";
    src: url("../fonts/noto-serif-devanagari.woff") format("woff");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0900-097F, U+1CD0-1CFF, U+200B-200D, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}

:root {
    --indigo: #1f2a5c;
    --indigo-2: #2c3a7a;
    --indigo-ink: #151b3b;
    --marigold: #f2a007;
    --marigold-deep: #c27c00;
    --marigold-soft: #fdf0cf;
    --kumkum: #b3122e;
    --leaf: #ecdcac;
    --leaf-2: #e3cf94;
    --leaf-edge: #b99a52;
    --leaf-ink: #3b2a10;
    --bg: #eef0f7;
    --surface: #ffffff;
    --surface-2: #f6f7fb;
    --ink: #1a1f36;
    --muted: #5b6180;
    --line: #d9dcea;
    --ok: #1d7a4a;
    --ok-bg: #e5f4ec;
    --err: #a3162b;
    --err-bg: #fbe8eb;
    --focus: #2c55d4;
    --radius-s: 6px;
    --radius-m: 12px;
    --radius-l: 20px;
    --shadow: 0 1px 2px rgba(21, 27, 59, .06), 0 6px 20px rgba(21, 27, 59, .06);
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --serif: "Noto Serif", "Noto Serif Devanagari", Georgia, serif;
    --deva: "Noto Serif Devanagari", "Noto Serif", serif;
    --tabbar-h: 64px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --indigo: #8da2ff;
        --indigo-2: #a9b8ff;
        --indigo-ink: #0b0f26;
        --marigold: #f6b52e;
        --marigold-deep: #f6b52e;
        --marigold-soft: #3a2d0c;
        --kumkum: #ff5c76;
        --leaf: #2b2717;
        --leaf-2: #332e1b;
        --leaf-edge: #6e5d2c;
        --leaf-ink: #f1e6c6;
        --bg: #0e1330;
        --surface: #171d40;
        --surface-2: #1d2450;
        --ink: #e8eaf6;
        --muted: #a2a8c8;
        --line: #2c3463;
        --ok: #6fd6a0;
        --ok-bg: #12352a;
        --err: #ff8ea0;
        --err-bg: #3c1520;
        --focus: #8da2ff;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .5em;
    color: var(--ink);
}
h1 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
h1:focus { outline: none; }

p { margin: 0 0 1em; }
a { color: var(--indigo); text-underline-offset: 3px; }
a:hover { color: var(--indigo-2); }
img { max-width: 100%; display: block; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }

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

.deva, [lang="sa"], [lang="hi"] { font-family: var(--deva); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.block { display: block; }
.right { text-align: right; }
.lead { font-size: 1.075rem; color: var(--muted); max-width: 62ch; }
.prose { max-width: 68ch; font-family: var(--serif); font-size: 1.05rem; line-height: 1.75; }
.prose h2 { font-size: 1.25rem; margin-top: 1.4em; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Schil: zijbalk (desktop) + tabbalk (mobiel) ---------- */

.shell { min-height: 100vh; }

.sidebar {
    display: none;
}

.content {
    padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
    max-width: 1100px;
    margin: 0 auto;
}

.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--indigo-ink);
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #aab3dc;
    text-decoration: none;
    font-size: .7rem;
    font-weight: 500;
    position: relative;
}
.tabbar a.active { color: #fff; }
.tabbar a.active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--marigold);
}
.tabbar a.active .icon { color: var(--marigold); }

@media (min-width: 900px) {
    .shell { display: grid; grid-template-columns: 248px 1fr; }
    .tabbar { display: none; }
    .sidebar {
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 22px 14px;
        background: var(--indigo-ink);
        color: #dfe3f7;
    }
    .content { padding: 36px 40px 64px; width: 100%; }
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 22px;
    color: #fff;
    text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--marigold);
    color: #1f2a5c;
    font-family: var(--deva);
    font-size: 1.4rem;
    line-height: 1;
    padding-bottom: 2px;
}
.brand-mark.big { width: 56px; height: 56px; font-size: 2rem; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-account a, .side-account .link-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-s);
    color: #c3c9ea;
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
}
.side-nav a:hover, .side-account a:hover, .side-account .link-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: rgba(242, 160, 7, .14); color: #fff; }
.side-nav a.active .icon { color: var(--marigold); }
.side-account { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.side-account .link-button { width: 100%; }

.icon { flex: none; }

/* ---------- Basiselementen ---------- */

.page { max-width: 980px; margin: 0 auto; }
.page.narrow { max-width: 640px; }
.page.wide { max-width: 1100px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { border-color: var(--indigo); color: var(--ink); }
.btn.primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.primary:hover { background: var(--indigo-2); color: #fff; }
@media (prefers-color-scheme: dark) {
    .btn.primary { color: #0b0f26; }
    .btn.primary:hover { color: #0b0f26; }
}
.btn.ghost { background: transparent; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger-outline { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: transparent; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .85rem; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--indigo);
    cursor: pointer;
}
.link-button.small { font-size: .85rem; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
}
.icon-btn:hover, .icon-btn.active { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.fav-on { color: var(--kumkum); }

.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
    color: var(--muted);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 18px;
    margin: 0 0 18px;
}
.panel > summary { cursor: pointer; list-style: none; }
.panel > summary h2 { display: inline; }
.panel > summary::-webkit-details-marker { display: none; }
.panel[open] > summary { margin-bottom: 14px; }

.empty {
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-m);
    color: var(--muted);
    background: var(--surface);
}
.empty p:last-child { margin: 0; }

.alert { padding: 10px 14px; border-radius: var(--radius-s); margin: 0 0 16px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.error { background: var(--err-bg); color: var(--err); }

.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: .75rem;
    color: var(--muted);
    white-space: nowrap;
}

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-actions { display: flex; gap: 4px; }

.plain-list { list-style: none; padding: 0; margin: 0 0 12px; }
.plain-list > li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain-list > li:last-child { border-bottom: 0; }

.row-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.row-link > span:nth-child(2) { flex: 1; }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    margin: 0 0 18px;
    color: var(--muted);
    max-width: 520px;
}
.search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--ink);
    padding: 11px 0;
    outline: none;
}
.search-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.search-box.big { max-width: 640px; padding-right: 6px; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.segmented button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 6px 16px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.segmented button.on { background: var(--indigo); color: #fff; }
@media (prefers-color-scheme: dark) { .segmented button.on { color: #0b0f26; } }

/* ---------- Formulieren ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; font-weight: 600; color: var(--ink); }
.field small { font-weight: 400; color: var(--muted); }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.field input:not([type="checkbox"]):not([type="file"]), .field textarea, .field select, .verse-editor textarea, .bulk-text, .note-edit textarea {
    font: inherit;
    font-weight: 400;
    font-size: 1rem;
    padding: 10px 12px;
    border-radius: var(--radius-s);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    width: 100%;
}
.field input[type="color"] { padding: 2px; height: 44px; }
.field textarea, .bulk-text { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .bulk-text:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.small-field { max-width: 160px; }
.validation-message { color: var(--err); font-weight: 400; font-size: .85rem; }
.check { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.check input { width: 18px; height: 18px; accent-color: var(--indigo); }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 10px; display: flex; }
.inline-form .field { flex: 1 1 220px; }

/* ---------- Inloggen / registreren ---------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(242, 160, 7, .22), transparent 60%),
        var(--indigo-ink);
}
.auth-panel {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-l);
    padding: 28px 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.auth-panel h1 { font-size: 1.6rem; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.auth-sub { color: var(--muted); font-size: .9rem; }
.auth-switch { margin: 18px 0 0; text-align: center; color: var(--muted); }
.auth-verse { margin: 28px 0 4px; color: var(--marigold); font-size: 1.15rem; text-align: center; }
.auth-verse-nl { color: #b9c0e6; font-size: .85rem; text-align: center; max-width: 420px; }

/* ---------- Het palmblad (pothi): vers-kaart ---------- */

.leaves { display: flex; flex-direction: column; gap: 14px; }

.leaf {
    position: relative;
    display: grid;
    grid-template-columns: 30px 1fr;
    background:
        repeating-linear-gradient(0deg, transparent 0 17px, rgba(120, 90, 30, .05) 17px 18px),
        linear-gradient(180deg, var(--leaf), var(--leaf-2));
    color: var(--leaf-ink);
    border-radius: 14px / 40px;
    border: 1px solid var(--leaf-edge);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .18), 0 1px 0 rgba(0, 0, 0, .04);
    scroll-margin-top: 80px;
    transition: box-shadow .4s;
}
.leaf.flash { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .18), 0 0 0 4px var(--marigold); }
.leaf.skeleton { min-height: 220px; opacity: .6; }

.leaf-holes {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 18px 0;
    border-right: 1px dashed color-mix(in srgb, var(--leaf-edge) 70%, transparent);
}
.leaf-holes span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}
.leaf-body { padding: 14px 18px 16px 16px; min-width: 0; }
.leaf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.leaf-num { display: inline-flex; align-items: baseline; gap: 8px; font-weight: 600; color: var(--marigold-deep); }
.leaf-num .deva-num { font-family: var(--deva); font-size: 1.05rem; }
.leaf-num .latin-num { font-size: .75rem; color: color-mix(in srgb, var(--leaf-ink) 60%, transparent); }
.leaf-actions { display: flex; gap: 2px; margin: -6px -8px -6px 0; }
.leaf-actions .icon-btn { color: var(--leaf-ink); }
.leaf-actions .icon-btn:hover { background: rgba(255, 255, 255, .35); border-color: transparent; }
.leaf-actions .icon-btn.fav-on { color: var(--kumkum); }

.leaf-original {
    font-family: var(--deva);
    font-size: 1.22em;
    line-height: 1.85;
    white-space: pre-line;
    margin: 0 0 .5em;
    color: var(--leaf-ink);
}
.leaf-translit {
    font-family: var(--serif);
    font-style: italic;
    white-space: pre-line;
    color: color-mix(in srgb, var(--leaf-ink) 78%, transparent);
    margin: 0 0 .8em;
    font-size: .95em;
}
.leaf-translation { margin: 0 0 .7em; }
.leaf-translation p { margin: 0; font-family: var(--serif); font-size: 1.03em; line-height: 1.7; }
.leaf-translation p.deva { font-family: var(--deva); line-height: 1.85; }
.lang-tag {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--leaf-ink) 65%, transparent);
    margin-bottom: 2px;
}
.leaf-words { font-size: .88em; margin-top: 6px; }
.leaf-words summary { cursor: pointer; font-weight: 600; color: var(--marigold-deep); }
.leaf-words p { margin: 6px 0 0; line-height: 1.6; }
.leaf-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 14px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--leaf-edge) 50%, transparent);
    font-size: .9rem;
}
.leaf-foot .text-link { color: var(--leaf-ink); }
.verse-ref { font-weight: 600; }

.leaf-large { border-radius: 18px / 60px; }
.leaf-large .leaf-body { padding: 20px 24px 20px 20px; }
.leaf-large .leaf-original { font-size: 1.4rem; }
.leaf-large .leaf-translation p { font-size: 1.12rem; }
@media (min-width: 700px) {
    .leaf { grid-template-columns: 40px 1fr; }
    .leaf-large .leaf-body { padding: 28px 36px 24px 28px; }
    .leaf-large .leaf-original { font-size: 1.6rem; }
}

/* ---------- Vandaag ---------- */

.today-head { margin: 4px 0 18px; }
.today-date { margin: 0 0 2px; color: var(--muted); font-weight: 500; text-transform: capitalize; }
.today-verse { margin-bottom: 28px; }
.today-verse h2 { font-size: 1.1rem; }
.today-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.tile h2 { font-size: 1.05rem; }
.cover-dot { width: 12px; height: 18px; border-radius: 2px 4px 4px 2px; display: inline-block; flex: none; vertical-align: middle; }
.festival-mini li { display: flex; align-items: center; gap: 12px; }
.date-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 52px;
    flex: none;
    border-radius: 10px;
    background: var(--marigold-soft);
    color: var(--marigold-deep);
    line-height: 1.05;
}
.date-chip .d { font-size: 1.3rem; font-weight: 700; font-family: var(--serif); }
.date-chip .m { font-size: .72rem; font-weight: 600; }
.word-term { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin: 0; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.word-term .deva { font-size: 1.2rem; color: var(--marigold-deep); font-weight: 500; }
.word-meaning { font-weight: 600; margin: 2px 0 8px; }
.quick-links { display: flex; flex-direction: column; gap: 6px; }
.quick-links a { display: flex; align-items: center; gap: 10px; padding: 8px 0; text-decoration: none; font-weight: 500; color: var(--ink); }
.quick-links .icon { color: var(--marigold-deep); }

/* ---------- Boekenplank ---------- */

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; margin-top: 10px; }
.book { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); }
.book-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 4px 12px 12px 4px;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .25) 0 6px, rgba(255, 255, 255, .08) 6px 8px, transparent 8px),
        radial-gradient(circle at 50% 38%, rgba(242, 160, 7, .28), transparent 55%),
        var(--cover);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px 14px 18px 20px;
    box-shadow: 0 10px 24px rgba(21, 27, 59, .22);
    transition: transform .2s;
}
.book-cover::after {
    content: "";
    position: absolute;
    inset: 10px 10px 10px 16px;
    border: 1px solid rgba(242, 160, 7, .55);
    border-radius: 2px 8px 8px 2px;
    pointer-events: none;
}
.book:hover .book-cover { transform: translateY(-3px); }
.book-spine { display: none; }
.book-deva { font-family: var(--deva); font-size: 1rem; color: var(--marigold); line-height: 1.6; margin-bottom: 8px; }
.book-title { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.book-sub { font-size: .78rem; opacity: .8; margin-top: 8px; }
.book-meta { font-size: .82rem; color: var(--muted); }

/* ---------- Titelpagina en inhoud ---------- */

.title-page {
    text-align: center;
    padding: 34px 18px 28px;
    margin-bottom: 20px;
    border-radius: var(--radius-l);
    background:
        radial-gradient(circle at 50% 0%, rgba(242, 160, 7, .3), transparent 60%),
        var(--cover, var(--indigo));
    color: #fff;
}
.title-page h1 { color: #fff; margin-bottom: .25em; }
.title-deva { font-family: var(--deva); font-size: 1.4rem; color: var(--marigold); margin: 0 0 6px; }
.title-sub { font-family: var(--serif); font-style: italic; margin: 0 0 4px; opacity: .92; }
.title-cat { font-size: .82rem; opacity: .75; margin: 0; }
.intro { margin-bottom: 20px; }
.toc-title { margin-top: 28px; }
.toc { list-style: none; padding: 0; margin: 0 0 18px; border-top: 1px solid var(--line); }
.toc li { border-bottom: 1px solid var(--line); }
.toc a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; text-decoration: none; color: var(--ink); }
.toc a:hover { background: var(--surface); }
.toc a.current .toc-num { background: var(--marigold); color: #1f2a5c; }
.toc-num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: none;
    background: var(--surface);
    border: 1px solid var(--line);
    font-weight: 700;
    font-size: .85rem;
}
.toc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toc-name { font-family: var(--serif); font-weight: 600; }
.toc-sub { font-size: .85rem; color: var(--muted); }
.toc-count { font-size: .8rem; color: var(--muted); }
.source-note { font-size: .8rem; color: var(--muted); max-width: 70ch; margin-top: 24px; }

/* ---------- Lezer ---------- */

.reader { margin: -16px -16px 0; }
@media (min-width: 900px) { .reader { margin: -36px -40px 0; } }
.reader-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    padding-top: calc(8px + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.reader-bar-title { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.2; font-weight: 600; font-size: .95rem; }
.reader-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 500; }
.toggle input { width: 18px; height: 18px; accent-color: var(--indigo); }
.size-picker { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 500; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; min-width: 34px; height: 32px; font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; }
.chip.big1 { font-size: 1rem; }
.chip.big2 { font-size: 1.2rem; }
.chip.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.on { color: #0b0f26; } }

.reader-page { max-width: 760px; margin: 0 auto; padding: 22px 16px 10px; }
.font-s .leaves { font-size: 15px; }
.font-m .leaves { font-size: 17px; }
.font-l .leaves { font-size: 20px; }
.chapter-head { text-align: center; margin: 10px 0 22px; }
.chapter-kicker { color: var(--marigold-deep); font-weight: 600; margin: 0 0 6px; }
.chapter-deva { font-family: var(--deva); font-size: 1.35rem; margin: 0 0 4px; }
.chapter-sub { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 0; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--marigold); margin-top: 14px; }
.ornament span { width: 60px; height: 1px; background: currentColor; opacity: .6; }
.chapter-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 16px; margin-bottom: 18px; }
.chapter-summary summary { cursor: pointer; font-weight: 600; }
.chapter-summary p { margin: 10px 0 0; font-family: var(--serif); line-height: 1.7; }
.chapter-nav { display: flex; justify-content: space-between; gap: 10px; margin: 26px 0 10px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    background: var(--indigo-ink);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: .9rem;
    z-index: 60;
    box-shadow: var(--shadow);
}
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- Goden ---------- */

.deity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.deity-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.deity-img {
    display: block;
    aspect-ratio: 4 / 5;
    border-radius: 999px 999px var(--radius-m) var(--radius-m);
    overflow: hidden;
    background: linear-gradient(180deg, var(--marigold-soft), var(--surface));
    border: 1px solid var(--line);
}
.deity-img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .3s; }
.deity-card:hover .deity-img img { transform: scale(1.04); }
.deity-initial {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-family: var(--deva);
    font-size: 2.4rem;
    color: var(--marigold-deep);
}
.deity-initial.big { font-size: 4rem; min-height: 280px; }
.deity-text { padding: 8px 2px 0; display: flex; flex-direction: column; }
.deity-name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.deity-epithet { font-size: .82rem; color: var(--muted); line-height: 1.35; }

.deity-hero { display: grid; gap: 22px; margin-bottom: 22px; }
@media (min-width: 760px) { .deity-hero { grid-template-columns: 300px 1fr; align-items: start; } }
.deity-portrait { margin: 0; }
.deity-portrait img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    object-position: top center;
    border-radius: 999px 999px var(--radius-l) var(--radius-l);
    border: 4px solid var(--marigold-soft);
}
.deity-portrait .deity-initial { border-radius: 999px 999px var(--radius-l) var(--radius-l); background: var(--marigold-soft); }
.deity-portrait figcaption { font-size: .75rem; color: var(--muted); margin-top: 6px; text-align: center; }
.deity-portrait figcaption a { color: var(--muted); }
.mantra {
    margin-top: 16px;
    padding: 14px 18px;
    border-left: 4px solid var(--marigold);
    background: var(--marigold-soft);
    border-radius: 0 var(--radius-m) var(--radius-m) 0;
}
.mantra-deva { font-family: var(--deva); font-size: 1.35rem; margin: 0; color: var(--ink); }
.mantra-latin { font-family: var(--serif); font-style: italic; margin: 2px 0 0; color: var(--muted); }

.facts-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    overflow: hidden;
    margin: 0 0 26px;
}
.facts-table > div { background: var(--surface); padding: 12px 16px; }
.facts-table dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.facts-table dd { margin: 2px 0 0; }

.story { border-bottom: 1px solid var(--line); padding: 4px 0; max-width: 70ch; }
.story summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.08rem; padding: 10px 0; }
.story p { font-family: var(--serif); line-height: 1.75; }
.fact-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 26px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; border-top: 4px solid var(--marigold); }
.fact h3 { font-size: 1rem; }
.fact p { margin: 0; font-size: .95rem; }
.deity-page section { margin-bottom: 18px; }

/* ---------- Mandirs ---------- */

.map-wrap { position: relative; margin-bottom: 14px; }
.map {
    height: 52vh;
    min-height: 300px;
    max-height: 560px;
    border-radius: var(--radius-m);
    border: 1px solid var(--line);
    background: var(--surface-2);
    z-index: 0;
}
.map-error { position: absolute; inset: auto 12px 12px 12px; background: var(--surface); padding: 10px 14px; border-radius: var(--radius-s); box-shadow: var(--shadow); margin: 0; }
.map-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.map-tools .search-box { margin: 0; flex: 1 1 260px; }
.pin-icon span {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--marigold);
    border: 3px solid #1f2a5c;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.leaflet-popup-content { font-family: var(--sans); font-size: .9rem; }
.pop-links { margin-top: 6px; }

.mandir-list { list-style: none; padding: 0; margin: 10px 0 0; border-top: 1px solid var(--line); }
.mandir-list > li { border-bottom: 1px solid var(--line); }
.mandir-list > li.selected { background: var(--surface); }
.mandir-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    background: none;
    border: 0;
    font: inherit;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.mandir-main { display: flex; flex-direction: column; min-width: 0; }
.mandir-name { font-weight: 600; }
.mandir-addr { font-size: .87rem; color: var(--muted); }
.mandir-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.km { font-size: .8rem; font-weight: 600; color: var(--marigold-deep); }
.mandir-detail { padding: 0 8px 14px; }

/* ---------- Feestdagen ---------- */

.festival-list { list-style: none; padding: 0; margin: 0; }
.month-group { margin-bottom: 18px; }
.month-title { font-size: 1rem; color: var(--muted); font-family: var(--sans); font-weight: 600; text-transform: capitalize; padding-bottom: 6px; border-bottom: 2px solid var(--marigold); display: inline-block; }
.festival { display: flex; gap: 14px; align-items: flex-start; }
.festival.now .date-chip { background: var(--marigold); color: #1f2a5c; }
.festival-body { flex: 1; min-width: 0; }
.festival-body h3 { margin-bottom: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.festival-body h3 .deva { font-size: .9rem; font-weight: 400; }
.festival-body p { margin: 0 0 6px; }
.festival-body .when { font-size: .85rem; font-weight: 600; color: var(--marigold-deep); }

/* ---------- Woordenlijst ---------- */

.glossary { margin: 0; }
.gl-letter { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--marigold-deep); margin: 18px 0 4px; }
.gl-item { padding: 10px 0; border-bottom: 1px solid var(--line); max-width: 70ch; }
.gl-item dt { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.gl-item dt .deva { font-weight: 400; color: var(--muted); }
.gl-item dd { margin: 2px 0 0; }
.gl-item dd p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Favorieten ---------- */

.note-edit { width: 100%; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.note { font-family: var(--serif); font-style: italic; margin: 0; }

/* ---------- Quiz ---------- */

.quiz-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; }
.quiz-progress { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.quiz-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.quiz-bar span { display: block; height: 100%; background: var(--marigold); transition: width .3s; }
.quiz-q { font-size: 1.3rem; margin-bottom: 16px; }
.quiz-options { display: grid; gap: 10px; }
.quiz-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-m);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.quiz-option:hover:not([disabled]) { border-color: var(--indigo); }
.quiz-option.right { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.quiz-option.wrong { border-color: var(--err); background: var(--err-bg); color: var(--err); }
.quiz-option.dim { opacity: .55; }
.quiz-option[disabled] { cursor: default; }
.quiz-feedback { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.quiz-feedback p { margin: 0; }
.quiz-end { text-align: center; padding: 30px 10px; }
.score-big { font-family: var(--serif); font-size: 4rem; font-weight: 600; margin: 0; color: var(--marigold-deep); line-height: 1; }
.score-big span { font-size: 1.2rem; color: var(--muted); }

/* ---------- Zoeken ---------- */

.verse-hits a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.hit-text { color: var(--muted); font-family: var(--serif); font-size: .95rem; }

/* ---------- Meer ---------- */

.more-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 18px; }
.more-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.more-list a:last-child { border-bottom: 0; }
.more-list a .icon { color: var(--marigold-deep); }
.more-list span { display: flex; flex-direction: column; }
.more-list small { color: var(--muted); }
.logout-form { margin-bottom: 18px; }
.install-tip { font-size: .87rem; color: var(--muted); }

/* ---------- Beheer ---------- */

.admin-nav { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.admin-nav a { padding: 8px 12px; white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; margin-bottom: -5px; }
.admin-nav a.active { color: var(--ink); border-color: var(--marigold); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; text-decoration: none; color: var(--muted); font-size: .85rem; display: flex; flex-direction: column; }
.stat .n { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--ink); line-height: 1.1; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; font-size: .93rem; }
.admin-table th { text-align: left; font-size: .8rem; color: var(--muted); padding: 10px 12px; background: var(--surface-2); }
.admin-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table tr.past td { opacity: .55; }
@media (max-width: 640px) {
    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
    .admin-table tr { border-top: 1px solid var(--line); padding: 8px 0; }
    .admin-table td { border: 0; padding: 3px 12px; text-align: left; }
}

.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.confirm-q { font-weight: 600; color: var(--err); font-size: .9rem; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 30%, var(--line)); }

.verse-admin-list { list-style: none; padding: 0; margin: 12px 0 0; }
.verse-admin-list > li { border-top: 1px solid var(--line); }
.verse-admin-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 4px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.verse-admin-row:hover { background: var(--surface-2); }
.verse-admin-row .num { width: 34px; flex: none; font-weight: 700; color: var(--marigold-deep); }
.verse-admin-row .preview { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; overflow: hidden; }
.verse-admin-row .preview span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.have { display: flex; gap: 3px; flex: none; }
.have span { font-size: .65rem; font-weight: 700; padding: 2px 4px; border-radius: 4px; background: var(--surface-2); color: var(--muted); opacity: .5; }
.have span.on { background: var(--ok-bg); color: var(--ok); opacity: 1; }
.verse-editor, .story-editor, .bulk { display: flex; flex-direction: column; gap: 12px; padding: 16px; margin: 10px 0; border: 2px solid var(--marigold); border-radius: var(--radius-m); background: var(--surface); }
.verse-editor-head { display: flex; align-items: flex-end; gap: 14px; }
.verse-editor textarea.deva, .field textarea.deva { font-family: var(--deva); }

.admin-deity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.admin-deity { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); color: var(--ink); text-decoration: none; }
.admin-deity img, .admin-deity .deity-initial { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; font-size: 1.4rem; background: var(--marigold-soft); }
.image-editor { display: grid; gap: 18px; }
@media (min-width: 700px) { .image-editor { grid-template-columns: 180px 1fr; } }
.image-preview img, .image-preview .deity-initial { width: 180px; height: 220px; object-fit: cover; object-position: top; border-radius: 90px 90px 12px 12px; background: var(--marigold-soft); }
.image-preview .deity-initial.big { min-height: 0; }
.image-actions { display: flex; flex-direction: column; gap: 14px; }
.story-admin-list { list-style: none; padding: 0; margin: 10px 0 0; }
.story-admin-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.story-admin-list li strong { flex: 1; min-width: 160px; }
.geo-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

/* ---------- Foutmelding van Blazor ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1000;
    padding: 12px 16px;
    background: var(--err);
    color: #fff;
    text-align: center;
}
#blazor-error-ui a { color: #fff; font-weight: 700; margin-left: 8px; }

/* ---------- Grote geschriften: inhoud per groep, soort vers ---------- */

.toc-group { border-top: 1px solid var(--line); }
.toc-group:last-of-type { border-bottom: 1px solid var(--line); }
.toc-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 4px;
    cursor: pointer;
    list-style: none;
}
.toc-group > summary::-webkit-details-marker { display: none; }
.toc-group > summary::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: none;
    border-right: 2px solid var(--marigold-deep);
    border-bottom: 2px solid var(--marigold-deep);
    transform: rotate(-45deg);
    transition: transform .2s;
    margin-right: 4px;
}
.toc-group[open] > summary::before { transform: rotate(45deg); }
.toc-group-name { flex: 1; font-family: var(--serif); font-weight: 600; font-size: 1.08rem; }
.toc-group .toc { border-top: 0; margin: 0 0 8px 18px; }
.toc-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.leaf-kind {
    font-family: var(--deva);
    font-size: .78rem;
    font-weight: 500;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .35);
    color: var(--leaf-ink);
}

.import-list { list-style: none; padding: 0; margin: 0; }
.import-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.import-list li > div { flex: 1 1 260px; }
