/* ============================================================================
   Pathway to Divinity — Devotional Theme

   A single, cohesive aesthetic for the entire application. Parchment cream,
   saffron, muted gold. Cinzel for headings, Cormorant Garamond for body.
   No sans-serif anywhere in the chrome. WCAG AA contrast throughout.
   ============================================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
    /* Palette */
    --c-bg:           #FBF6EC;   /* parchment */
    --c-surface:      #F5EDDC;   /* off-cream card */
    --c-surface-2:    #EFE4CC;   /* deeper card */
    --c-saffron:      #C97B27;   /* primary accent */
    --c-saffron-dk:   #A85F18;   /* hover / pressed */
    --c-gold:         #B8860B;   /* secondary accent */
    --c-gold-soft:    #D9B760;   /* hairline gold */
    --c-ink:          #2E1F12;   /* body text */
    --c-ink-soft:     #4A372A;   /* secondary body */
    --c-muted:        #7A6852;   /* meta / muted */
    --c-sand:         #C9B898;   /* locked, disabled */
    --c-sand-2:       #E6D9BD;   /* hairline border */
    --c-olive:        #6B8E23;   /* success */
    --c-terracotta:   #A0522D;   /* error */
    --c-ink-on-saffron: #FFF8EE; /* text on saffron buttons */

    /* Type */
    --ff-serif:    'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    --ff-display:  'Cinzel', 'Cormorant Garamond', Georgia, serif;
    --fz-base:     18px;
    --fz-meta:     15px;
    --lh-body:     1.78;
    --lh-heading:  1.3;

    /* Geometry */
    --radius:      6px;
    --radius-lg:   10px;
    --shadow-soft: 0 1px 3px rgba(70, 45, 20, 0.08), 0 4px 14px rgba(70, 45, 20, 0.04);
    --shadow-lift: 0 4px 14px rgba(70, 45, 20, 0.14);

    --maxw-read:   720px;
    --maxw-shell:  1200px;
}

/* ---------- 2. Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--ff-serif);
    font-size: var(--fz-base);
    line-height: var(--lh-body);
    color: var(--c-ink);
    background: var(--c-bg);
    /* Faint parchment grain — a very soft layered gradient, never reducing
       contrast against the body text. */
    background-image:
        radial-gradient(ellipse at top left,  rgba(201, 123, 39, 0.04), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(184, 134, 11, 0.05), transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
}

@media (max-width: 640px) {
    body { font-size: 17px; }
}

a {
    color: var(--c-saffron);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 120ms ease, border-color 120ms ease;
}
a:hover,
a:focus-visible {
    color: var(--c-saffron-dk);
    border-bottom-color: currentColor;
}

h1, h2, h3, h4 {
    font-family: var(--ff-display);
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: var(--lh-heading);
    color: var(--c-ink);
    margin: 0 0 0.5em;
}
h1 { font-size: 2.2rem; letter-spacing: 0.12em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

blockquote {
    margin: 1.5em 0;
    padding: 0.75em 1.25em;
    border-left: 3px solid var(--c-saffron);
    font-style: italic;
    color: var(--c-ink-soft);
    background: rgba(201, 123, 39, 0.05);
}

hr {
    border: 0;
    height: 1px;
    margin: 2em auto;
    background: var(--c-sand-2);
    max-width: 320px;
}

img, svg { max-width: 100%; height: auto; }

::selection { background: rgba(201, 123, 39, 0.25); color: var(--c-ink); }

.skip-link {
    position: absolute; left: -9999px; top: -9999px;
    background: var(--c-ink); color: var(--c-bg);
    padding: 8px 14px; border-radius: var(--radius);
}
.skip-link:focus {
    left: 12px; top: 12px; z-index: 10000;
}

/* ---------- 3. Site shell ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(251, 246, 236, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--c-sand-2);
}
.site-header__inner {
    max-width: var(--maxw-shell);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex; align-items: center; gap: 24px;
}
.site-header__thread {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--c-gold) 20%, var(--c-saffron) 50%, var(--c-gold) 80%, transparent 100%);
    opacity: 0.7;
}

.site-brand {
    display: inline-flex; align-items: center; gap: 10px;
    border-bottom: 0;
    font-family: var(--ff-display);
    letter-spacing: 0.14em;
    color: var(--c-ink);
}
.site-brand:hover { color: var(--c-saffron); }
.site-brand__glyph { font-size: 1.6rem; color: var(--c-saffron); }
.site-brand__name { font-size: 1.1rem; }

.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav__link {
    color: var(--c-ink-soft);
    font-size: var(--fz-meta);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid transparent;
}
.site-nav__link:hover,
.site-nav__link.is-active {
    color: var(--c-saffron);
    border-bottom-color: var(--c-saffron);
}

.site-profile { margin-left: 16px; position: relative; }

.profile-menu summary { list-style: none; cursor: pointer; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu__trigger {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    transition: border-color 120ms;
}
.profile-menu__trigger:hover { border-color: var(--c-gold-soft); }
.profile-menu__avatar {
    width: 32px; height: 32px;
    background: var(--c-saffron);
    color: var(--c-ink-on-saffron);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--ff-display);
    font-size: 0.9rem;
}
.profile-menu__name { font-size: var(--fz-meta); }

.profile-menu__panel {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    min-width: 220px;
    padding: 6px 0;
}
.profile-menu__head {
    padding: 10px 16px 12px;
    border-bottom: 1px solid var(--c-sand-2);
}
.profile-menu__fullname { font-weight: 600; color: var(--c-ink); }
.profile-menu__role {
    font-size: 0.85rem; color: var(--c-muted);
    letter-spacing: 0.08em; text-transform: uppercase;
}
.profile-menu__item {
    display: block; padding: 9px 16px;
    color: var(--c-ink-soft); border-bottom: 0;
    font-size: var(--fz-meta);
}
.profile-menu__item:hover { background: var(--c-surface-2); color: var(--c-saffron); }
.profile-menu__item--button {
    width: 100%; text-align: left;
    background: none; border: 0; cursor: pointer;
    font-family: inherit; font-size: inherit;
}
.profile-menu__form { margin: 0; }

.site-main {
    max-width: var(--maxw-shell);
    margin: 0 auto;
    padding: 36px 20px 64px;
}

.site-footer {
    border-top: 1px solid var(--c-sand-2);
    padding: 28px 20px 40px;
    text-align: center;
    color: var(--c-muted);
    font-size: var(--fz-meta);
}
.site-footer__glyph { color: var(--c-saffron); font-size: 1.2rem; }
.site-footer__line { margin: 0 14px; letter-spacing: 0.04em; }
.site-footer__sai { display: block; margin-top: 8px; font-style: italic; }

/* ---------- 4. Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-family: var(--ff-display);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    background: var(--c-saffron);
    color: var(--c-ink-on-saffron);
    border: 1px solid var(--c-saffron);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 140ms ease, transform 80ms ease;
    text-decoration: none;
}
.btn:hover { background: var(--c-saffron-dk); border-color: var(--c-saffron-dk); color: var(--c-ink-on-saffron); border-bottom-color: var(--c-saffron-dk); }
.btn:active { transform: translateY(1px); }
.btn[disabled],
.btn.is-disabled {
    background: var(--c-sand); border-color: var(--c-sand);
    color: var(--c-muted); cursor: not-allowed; opacity: 0.85;
}

.btn-ghost {
    background: transparent;
    color: var(--c-saffron);
    border: 1px solid var(--c-saffron);
}
.btn-ghost:hover { background: rgba(201, 123, 39, 0.08); color: var(--c-saffron-dk); }

.btn-quiet {
    background: transparent;
    color: var(--c-ink-soft);
    border: 1px solid var(--c-sand-2);
}
.btn-quiet:hover { border-color: var(--c-gold-soft); color: var(--c-saffron); }

.btn-block { display: flex; width: 100%; }

/* ---------- 5. Forms ---------- */
.form { max-width: 460px; margin: 0 auto; }
.form-row { margin-bottom: 18px; }
.form-label {
    display: block;
    font-family: var(--ff-display);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--c-ink-soft);
    margin-bottom: 6px;
}
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--ff-serif);
    font-size: 1rem;
    color: var(--c-ink);
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
    transition: border-color 120ms, box-shadow 120ms;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--c-saffron);
    box-shadow: 0 0 0 3px rgba(201, 123, 39, 0.18);
}
.form-hint { font-size: 0.85rem; color: var(--c-muted); margin-top: 4px; }
.form-error {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: rgba(160, 82, 45, 0.08);
    border-left: 3px solid var(--c-terracotta);
    color: var(--c-terracotta);
    border-radius: 4px;
    font-style: italic;
}
.form-success {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: rgba(107, 142, 35, 0.08);
    border-left: 3px solid var(--c-olive);
    color: var(--c-olive);
    border-radius: 4px;
}
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; }
.form-checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; }

/* ---------- 6. Cards ---------- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-soft);
}
.card--centered { max-width: 520px; margin: 32px auto; }

/* ---------- 7. Auth pages ---------- */
.auth-wrap {
    max-width: 520px;
    margin: 24px auto;
    padding: 36px 38px;
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}
.auth-wrap h1 {
    text-align: center;
    margin-bottom: 6px;
}
.auth-wrap__sub {
    text-align: center;
    color: var(--c-muted);
    font-style: italic;
    margin-bottom: 28px;
}
.auth-wrap__ornament {
    text-align: center; margin: 18px auto 22px;
    color: var(--c-saffron); font-size: 1.4rem; letter-spacing: 0.4em;
}
.auth-wrap__foot {
    margin-top: 22px;
    text-align: center;
    color: var(--c-muted);
    font-size: var(--fz-meta);
}

/* ---------- 8. Dashboard ---------- */
.dash-greeting {
    margin: 8px 0 26px;
    display: flex; flex-wrap: wrap; align-items: flex-end;
    justify-content: space-between; gap: 16px;
}
.dash-greeting h1 {
    margin: 0;
    font-size: 2.1rem;
    letter-spacing: 0.1em;
}
.dash-greeting p { color: var(--c-muted); margin: 4px 0 0; font-style: italic; }

.dash-summary {
    display: grid;
    grid-template-columns: 220px 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}
@media (max-width: 880px) {
    .dash-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .dash-summary { grid-template-columns: 1fr; }
}

.dash-ring {
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-soft);
}
.dash-ring__svg { width: 130px; height: 130px; }
.dash-ring__label {
    font-family: var(--ff-display);
    letter-spacing: 0.08em;
    color: var(--c-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}
.dash-stat {
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-soft);
}
.dash-stat__label {
    font-family: var(--ff-display);
    font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 8px;
}
.dash-stat__value {
    font-family: var(--ff-display);
    font-size: 2rem; color: var(--c-saffron);
}
.dash-stat__sub { color: var(--c-muted); font-style: italic; font-size: 0.92rem; }

.dash-continue {
    margin: 4px 0 36px;
    padding: 22px 26px;
    background: linear-gradient(135deg, rgba(201, 123, 39, 0.08), rgba(184, 134, 11, 0.06));
    border: 1px solid var(--c-gold-soft);
    border-radius: var(--radius-lg);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 18px;
}
.dash-continue__meta { font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-muted); }
.dash-continue__title { font-family: var(--ff-display); font-size: 1.35rem; color: var(--c-ink); margin-top: 4px; letter-spacing: 0.06em; }
.dash-continue__excerpt { color: var(--c-ink-soft); font-style: italic; margin-top: 6px; }

.chapter-grid-heading {
    display: flex; align-items: center; gap: 16px;
    margin: 32px 0 18px;
}
.chapter-grid-heading h2 { margin: 0; }
.chapter-grid-heading::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--c-gold-soft), transparent);
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
@media (max-width: 980px) {
    .chapter-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .chapter-grid { grid-template-columns: 1fr; }
}

.chapter-card {
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius-lg);
    padding: 20px 22px 22px;
    display: flex; flex-direction: column; gap: 10px;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
    box-shadow: var(--shadow-soft);
    position: relative;
    color: var(--c-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--c-sand-2);
}
.chapter-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
    border-color: var(--c-gold-soft);
    color: var(--c-ink);
    border-bottom-color: var(--c-gold-soft);
}

.chapter-card__head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.chapter-card__num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--c-surface-2);
    border: 1px solid var(--c-gold-soft);
    color: var(--c-gold);
    font-family: var(--ff-display);
    font-size: 0.95rem;
}
.chapter-card__status {
    font-family: var(--ff-display);
    font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--c-sand-2);
    color: var(--c-muted); background: var(--c-bg);
}
.chapter-card__title {
    font-family: var(--ff-display);
    font-size: 1.1rem; line-height: 1.35;
    color: var(--c-ink);
    letter-spacing: 0.04em;
}
.chapter-card__desc { color: var(--c-ink-soft); font-style: italic; font-size: 0.95rem; }
.chapter-card__meta {
    margin-top: auto;
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 0.85rem; color: var(--c-muted);
    padding-top: 12px; border-top: 1px dashed var(--c-sand-2);
}
.chapter-card__meta span::before { content: '•'; margin-right: 6px; color: var(--c-gold-soft); }
.chapter-card__meta span:first-child::before { content: ''; margin: 0; }

/* Status variants */
.chapter-card.is-locked {
    background: repeating-linear-gradient(135deg, var(--c-surface), var(--c-surface) 10px, var(--c-surface-2) 10px, var(--c-surface-2) 11px);
    color: var(--c-muted);
    cursor: not-allowed;
    pointer-events: none;
}
.chapter-card.is-locked .chapter-card__num { background: var(--c-sand); color: var(--c-bg); border-color: var(--c-sand); }
.chapter-card.is-locked .chapter-card__status { color: var(--c-sand); }
.chapter-card.is-locked .chapter-card__title { color: var(--c-muted); }

.chapter-card.is-available { border-color: var(--c-saffron); }
.chapter-card.is-available .chapter-card__status { color: var(--c-saffron); border-color: var(--c-saffron); }

.chapter-card.is-inprogress { border-color: var(--c-gold-soft); }
.chapter-card.is-inprogress .chapter-card__status { color: var(--c-gold); border-color: var(--c-gold-soft); background: rgba(184, 134, 11, 0.08); }

.chapter-card.is-completed,
.chapter-card.is-mastered { border-color: var(--c-olive); }
.chapter-card.is-completed .chapter-card__status,
.chapter-card.is-mastered .chapter-card__status { color: var(--c-olive); border-color: var(--c-olive); background: rgba(107, 142, 35, 0.08); }
.chapter-card.is-mastered .chapter-card__num { background: var(--c-gold); color: var(--c-bg); border-color: var(--c-gold); }
.chapter-card__star {
    position: absolute; top: 14px; right: 14px;
    color: var(--c-gold); font-size: 1.1rem;
}

.chapter-card__lock {
    position: absolute; top: 14px; right: 14px;
    color: var(--c-sand); font-size: 1.05rem;
}

/* ---------- 9. Chapter reader ---------- */
.reader-progressbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    z-index: 60;
    pointer-events: none;
}
.reader-progressbar__fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--c-gold) 0%, var(--c-saffron) 100%);
    transition: width 120ms linear;
}

.chapter-hero {
    text-align: center;
    margin: 16px 0 28px;
    max-width: var(--maxw-read);
    margin-left: auto; margin-right: auto;
}
.chapter-hero__eyebrow {
    font-family: var(--ff-display);
    color: var(--c-gold);
    letter-spacing: 0.3em; font-size: 0.85rem;
    text-transform: uppercase;
}
.chapter-hero__title {
    font-family: var(--ff-display);
    font-size: 2.4rem;
    letter-spacing: 0.1em;
    margin: 8px 0 6px;
    color: var(--c-ink);
}
.chapter-hero__subtitle {
    font-style: italic; color: var(--c-muted);
    font-size: 1.1rem;
}
.chapter-hero__rule {
    margin: 18px auto 0;
    width: 220px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--c-gold) 50%, transparent);
    opacity: 0.7;
}

.chapter-body {
    max-width: var(--maxw-read);
    margin: 0 auto;
    font-size: 1.075rem;
    line-height: 1.85;
    color: var(--c-ink);
}
.chapter-body p { margin: 0 0 1.15em; }
.chapter-body p.dropcap::first-letter {
    font-family: var(--ff-display);
    font-size: 4.2rem;
    float: left;
    line-height: 0.9;
    padding: 6px 12px 0 0;
    color: var(--c-saffron);
}

.chapter-body h2 {
    font-family: var(--ff-display);
    font-size: 1.5rem;
    color: var(--c-gold);
    letter-spacing: 0.08em;
    margin: 1.8em 0 0.6em;
    text-align: center;
}
.chapter-body h3 {
    font-family: var(--ff-display);
    font-size: 1.15rem;
    color: var(--c-saffron);
    letter-spacing: 0.06em;
    margin: 1.6em 0 0.4em;
}

/* Pull-quote — a recurring element since Baba's discourses are quoted often */
.chapter-body .discourse,
.chapter-body blockquote.discourse {
    margin: 1.8em -8px;
    padding: 22px 28px;
    background: var(--c-surface);
    border: 1px solid var(--c-gold-soft);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--c-saffron);
    position: relative;
    font-style: italic;
    color: var(--c-ink-soft);
    font-size: 1.08rem;
    line-height: 1.7;
    box-shadow: var(--shadow-soft);
}
.chapter-body .discourse::before {
    content: '\201C';
    position: absolute;
    top: -10px; left: 18px;
    font-family: var(--ff-display);
    font-size: 3rem;
    color: var(--c-saffron);
    background: var(--c-bg);
    padding: 0 8px;
    line-height: 1;
}
.chapter-body .discourse__attr {
    display: block;
    margin-top: 12px;
    font-style: normal;
    font-family: var(--ff-display);
    letter-spacing: 0.06em;
    color: var(--c-muted);
    font-size: 0.85rem;
    text-align: right;
}

/* Sloka / Sanskrit verse boxes */
.chapter-body .sloka {
    margin: 1.8em auto;
    max-width: 600px;
    padding: 22px 26px;
    background: linear-gradient(180deg, rgba(184, 134, 11, 0.06), rgba(201, 123, 39, 0.04));
    border: 1px solid var(--c-gold-soft);
    border-radius: var(--radius-lg);
    text-align: center;
}
.chapter-body .sloka__sanskrit {
    font-family: var(--ff-display);
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    color: var(--c-ink);
    margin-bottom: 12px;
    line-height: 1.6;
}
.chapter-body .sloka__meaning {
    font-style: italic;
    color: var(--c-ink-soft);
    margin: 0;
}

/* Mantra / declaration block — for "One Caste, One Religion..." style */
.chapter-body .declaration {
    margin: 1.8em auto;
    max-width: 560px;
    padding: 24px 28px;
    text-align: center;
    background: var(--c-surface-2);
    border: 1px solid var(--c-gold-soft);
    border-radius: var(--radius-lg);
    font-family: var(--ff-display);
    font-size: 1.1rem;
    line-height: 1.8;
    letter-spacing: 0.06em;
    color: var(--c-ink);
}
.chapter-body .declaration strong { color: var(--c-saffron); font-weight: 600; }

/* Ornament dividers */
.chapter-body .ornament {
    display: block;
    text-align: center;
    margin: 2.5em auto;
    color: var(--c-gold);
    font-size: 1.3rem;
    letter-spacing: 0.6em;
    opacity: 0.8;
}
.chapter-body .ornament::before { content: '\\273F \\00A0 \\2756 \\00A0 \\273F'; }

/* Timeline list — for chapter 2 (landmark events) */
.chapter-body .timeline {
    margin: 1.5em 0;
    list-style: none;
    padding: 0;
    border-left: 2px solid var(--c-gold-soft);
}
.chapter-body .timeline > li {
    position: relative;
    margin: 0 0 18px;
    padding: 4px 0 4px 28px;
}
.chapter-body .timeline > li::before {
    content: '';
    position: absolute;
    left: -7px; top: 12px;
    width: 12px; height: 12px;
    background: var(--c-saffron);
    border: 2px solid var(--c-bg);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--c-saffron);
}
.chapter-body .timeline__date {
    display: block;
    font-family: var(--ff-display);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: var(--c-saffron);
    margin-bottom: 2px;
}
.chapter-body .timeline__body { color: var(--c-ink-soft); }

/* Callout box for principles / lists / directives */
.chapter-body .callout {
    margin: 1.6em 0;
    padding: 20px 24px;
    background: var(--c-surface);
    border: 1px dashed var(--c-gold-soft);
    border-radius: var(--radius);
}
.chapter-body .callout__title {
    font-family: var(--ff-display);
    color: var(--c-saffron);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.chapter-body .callout ol,
.chapter-body .callout ul { padding-left: 22px; }
.chapter-body .callout li { margin-bottom: 8px; color: var(--c-ink-soft); }

/* Name list — for 108 names */
.chapter-body .name-list {
    counter-reset: name;
    list-style: none;
    padding: 0;
    margin: 1.5em 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 720px) {
    .chapter-body .name-list { grid-template-columns: 1fr 1fr; }
}
.chapter-body .name-list > li {
    counter-increment: name;
    position: relative;
    padding: 10px 14px 10px 42px;
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
    font-size: 0.95rem;
}
.chapter-body .name-list > li::before {
    content: counter(name);
    position: absolute;
    left: 10px; top: 10px;
    width: 24px; height: 24px;
    background: var(--c-saffron);
    color: var(--c-ink-on-saffron);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--ff-display);
    font-size: 0.75rem;
}
.chapter-body .name-list .om-name {
    display: block;
    font-family: var(--ff-display);
    color: var(--c-gold);
    letter-spacing: 0.06em;
}
.chapter-body .name-list .meaning {
    display: block; color: var(--c-ink-soft);
    font-style: italic;
    margin-top: 2px;
}

/* Chapter footer / next */
.chapter-footer-actions {
    max-width: var(--maxw-read);
    margin: 36px auto 0;
    display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.chapter-back { color: var(--c-muted); border-bottom: 0; font-size: 0.95rem; }
.chapter-back:hover { color: var(--c-saffron); }

/* Resume toast */
.resume-toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    background: var(--c-surface);
    border: 1px solid var(--c-gold-soft);
    color: var(--c-ink-soft);
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: var(--shadow-lift);
    font-size: 0.92rem;
    font-style: italic;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
    z-index: 70;
}
.resume-toast.is-visible { opacity: 1; }

/* ---------- 10. Reflection (quiz) widget ---------- */
.reflection {
    max-width: var(--maxw-read);
    margin: 48px auto 0;
    padding: 28px 32px 32px;
    background: var(--c-surface);
    border: 1px solid var(--c-gold-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}
.reflection__title {
    text-align: center;
    font-family: var(--ff-display);
    color: var(--c-saffron);
    letter-spacing: 0.12em;
    margin: 0 0 6px;
}
.reflection__sub {
    text-align: center;
    color: var(--c-muted);
    font-style: italic;
    margin-bottom: 18px;
}
.reflection__ornament {
    text-align: center;
    color: var(--c-gold);
    letter-spacing: 0.4em;
    margin-bottom: 18px;
}
.reflection__lockmsg {
    text-align: center;
    color: var(--c-muted);
    font-style: italic;
    padding: 14px;
}

.q-card {
    margin-bottom: 22px;
    padding: 20px 22px;
    background: var(--c-bg);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
}
.q-card__num {
    font-family: var(--ff-display);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    color: var(--c-gold);
    text-transform: uppercase;
}
.q-card__prompt {
    margin: 6px 0 16px;
    font-size: 1.1rem;
    color: var(--c-ink);
    line-height: 1.5;
}
.q-options { display: flex; flex-direction: column; gap: 8px; }
.q-option {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px;
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 120ms, background 120ms;
}
.q-option:hover { border-color: var(--c-gold-soft); }
.q-option input { margin-top: 4px; accent-color: var(--c-saffron); }
.q-option.is-selected { border-color: var(--c-saffron); background: rgba(201, 123, 39, 0.06); }
.q-option.is-correct { border-color: var(--c-olive); background: rgba(107, 142, 35, 0.08); }
.q-option.is-wrong { border-color: var(--c-terracotta); background: rgba(160, 82, 45, 0.08); }

.q-fill {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--ff-serif);
    font-size: 1rem;
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
}
.q-fill:focus { outline: none; border-color: var(--c-saffron); box-shadow: 0 0 0 3px rgba(201, 123, 39, 0.18); }

.q-feedback {
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 0.92rem;
    border-radius: var(--radius);
}
.q-feedback.is-ok { background: rgba(107, 142, 35, 0.08); color: var(--c-olive); }
.q-feedback.is-no { background: rgba(160, 82, 45, 0.08); color: var(--c-terracotta); }
.q-feedback__correct { font-family: var(--ff-display); letter-spacing: 0.04em; }

.reflection__result {
    margin-top: 8px;
    text-align: center;
    padding: 22px;
    border-radius: var(--radius-lg);
    background: var(--c-surface-2);
    border: 1px solid var(--c-gold-soft);
}
.reflection__result-score {
    font-family: var(--ff-display);
    font-size: 2.4rem;
    color: var(--c-saffron);
    letter-spacing: 0.08em;
}
.reflection__result-percent {
    font-family: var(--ff-display);
    color: var(--c-gold);
    letter-spacing: 0.08em;
}
.reflection__result-line {
    font-style: italic;
    color: var(--c-ink-soft);
    margin: 12px 0 0;
}

.reflection__actions {
    margin-top: 18px;
    display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}

/* ---------- 11. Progress page ---------- */
.progress-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 20px;
}
.progress-table th,
.progress-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--c-sand-2);
    font-size: 0.95rem;
}
.progress-table th {
    font-family: var(--ff-display);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-muted);
    background: var(--c-surface-2);
}
.progress-table tr:last-child td { border-bottom: 0; }

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.78rem;
    border-radius: 999px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--ff-display);
    border: 1px solid var(--c-sand-2);
    color: var(--c-muted);
    background: var(--c-bg);
}
.status-pill.is-locked      { color: var(--c-sand);       border-color: var(--c-sand); }
.status-pill.is-unlocked    { color: var(--c-saffron);    border-color: var(--c-saffron); }
.status-pill.is-inprogress  { color: var(--c-gold);       border-color: var(--c-gold-soft); }
.status-pill.is-completed   { color: var(--c-olive);      border-color: var(--c-olive); }
.status-pill.is-mastered    { color: var(--c-gold);       border-color: var(--c-gold); background: rgba(184, 134, 11, 0.08); }

/* ---------- 12. Admin / Mentor tables ---------- */
.console-section { margin-bottom: 36px; }
.console-section h2 {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 12px;
}
.console-section h2::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--c-gold-soft), transparent);
}
.console-tabs {
    display: flex; gap: 4px;
    border-bottom: 1px solid var(--c-sand-2);
    margin-bottom: 22px;
}
.console-tabs__link {
    padding: 10px 16px;
    color: var(--c-muted);
    font-family: var(--ff-display);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
}
.console-tabs__link.is-active,
.console-tabs__link:hover {
    color: var(--c-saffron);
    border-bottom-color: var(--c-saffron);
}
.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--c-muted);
    font-style: italic;
}

/* ---------- 13. Misc utilities ---------- */
.center { text-align: center; }
.muted { color: var(--c-muted); }
.italic { font-style: italic; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 3px;
    background: var(--c-surface-2);
    color: var(--c-muted);
    font-family: var(--ff-display);
}
.badge--pending { color: var(--c-saffron); }
.badge--active { color: var(--c-olive); }
.badge--suspended { color: var(--c-terracotta); }

/* ---------- 14. Print ---------- */
@media print {
    .site-header, .site-footer, .reflection, .reader-progressbar { display: none !important; }
    body { background: white; }
    .chapter-body { max-width: none; }
}

/* =====================================================================
   CHAPTER PAGINATION — append to app.css
   ===================================================================== */

/* The chapter is rendered inside .chapter-shell.
   Layout: thin top bar + dot indicator + scrollable content + bottom nav. */

.chapter-shell {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ----- Top bar with Back button + chapter title ----- */
.chapter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--c-sand-2);
    margin-bottom: 24px;
}
.chapter-bar__back {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ff-display);
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    color: var(--c-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius);
    transition: color 200ms, background 200ms;
}
.chapter-bar__back:hover {
    color: var(--c-saffron);
    background: var(--c-sand);
}
.chapter-bar__title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    overflow: hidden;
}
.chapter-bar__eyebrow {
    font-family: var(--ff-display);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-gold);
}
.chapter-bar__name {
    font-family: var(--ff-display);
    font-size: 1rem;
    color: var(--c-ink);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chapter-bar__spacer {
    width: 48px;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .chapter-bar__back-label { display: none; }
    .chapter-bar__spacer { width: 0; }
    .chapter-bar__name { font-size: 0.92rem; }
}

/* ----- Dot indicator ----- */
.chapter-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 0 0 28px;
    padding: 4px 0;
}
.chapter-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--c-sand-2);
    background: var(--c-surface);
    color: var(--c-muted);
    font-family: var(--ff-display);
    font-size: 0.74rem;
    text-decoration: none;
    transition: border-color 200ms, color 200ms, transform 200ms, background 200ms;
}
.chapter-dot:hover {
    border-color: var(--c-saffron);
    color: var(--c-saffron);
    transform: translateY(-1px);
}
.chapter-dot.is-current {
    background: var(--c-saffron);
    border-color: var(--c-saffron);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(201, 123, 39, 0.18);
}
.chapter-dot--reflect {
    margin-left: 6px;
    border-style: dashed;
    font-size: 0.95rem;
}
.chapter-dot--reflect.is-current {
    background: var(--c-gold);
    border-color: var(--c-gold);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.22);
}
.chapter-dot--reflect.is-locked {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.chapter-dot__num {
    line-height: 1;
}

@media (max-width: 640px) {
    .chapter-dot { width: 26px; height: 26px; font-size: 0.7rem; }
}

/* ----- Page content ----- */
.chapter-page {
    animation: chapter-page-in 500ms ease-out both;
}
@keyframes chapter-page-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .chapter-page { animation: none; }
}

.chapter-page__head {
    text-align: center;
    margin: 8px auto 32px;
}
.chapter-page__eyebrow {
    font-family: var(--ff-display);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin: 0 0 8px;
}
.chapter-page__title {
    font-family: var(--ff-display);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--c-ink);
    letter-spacing: 0.06em;
    margin: 0 0 6px;
}
.chapter-page__subtitle {
    font-style: italic;
    color: var(--c-muted);
    font-size: 1rem;
    margin: 0;
}

.chapter-page__body {
    /* Content lives here. Each chapter's body_html supplies its own
       internal styling. */
}

/* ----- Bottom Previous/Next nav ----- */
.chapter-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 64px auto 32px;
    padding: 24px 0 0;
    border-top: 1px solid var(--c-sand-2);
}
.chapter-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--c-surface);
    color: var(--c-ink);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
    text-decoration: none;
    font-family: var(--ff-display);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    transition: border-color 200ms, color 200ms, background 200ms, transform 150ms;
    min-width: 110px;
    justify-content: center;
}
.chapter-nav__btn:hover {
    border-color: var(--c-saffron);
    color: var(--c-saffron);
    transform: translateY(-1px);
}
.chapter-nav__btn--next {
    background: var(--c-saffron);
    color: #fff;
    border-color: var(--c-saffron);
}
.chapter-nav__btn--next:hover {
    background: var(--c-saffron-deep, #B66A1F);
    color: #fff;
    border-color: var(--c-saffron-deep, #B66A1F);
}
.chapter-nav__btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}
.chapter-nav__center {
    flex: 1;
    text-align: center;
}
.chapter-nav__page-label {
    font-family: var(--ff-display);
    color: var(--c-muted);
    font-size: 0.86rem;
    letter-spacing: 0.1em;
}

@media (max-width: 640px) {
    .chapter-nav { margin-top: 48px; gap: 8px; }
    .chapter-nav__btn { padding: 10px 14px; font-size: 0.82rem; min-width: 90px; }
    .chapter-nav__page-label { font-size: 0.78rem; }
}

/* ----- Reflection widget container ----- */
.reflection-widget {
    margin: 16px auto 32px;
    padding: 32px 28px;
    background: var(--c-surface);
    border: 1px solid var(--c-gold-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-width: 720px;
}
.reflection-widget__loading {
    padding: 40px 0;
}
@media (max-width: 640px) {
    .reflection-widget { padding: 24px 18px; }
}


/* =====================================================================
   CHAPTER PAGINATION — append to app.css
   ===================================================================== */

/* The chapter is rendered inside .chapter-shell.
   Layout: thin top bar + dot indicator + scrollable content + bottom nav. */

.chapter-shell {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ----- Top bar with Back button + chapter title ----- */
.chapter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--c-sand-2);
    margin-bottom: 24px;
}
.chapter-bar__back {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ff-display);
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    color: var(--c-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius);
    transition: color 200ms, background 200ms;
}
.chapter-bar__back:hover {
    color: var(--c-saffron);
    background: var(--c-sand);
}
.chapter-bar__title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    overflow: hidden;
}
.chapter-bar__eyebrow {
    font-family: var(--ff-display);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-gold);
}
.chapter-bar__name {
    font-family: var(--ff-display);
    font-size: 1rem;
    color: var(--c-ink);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chapter-bar__spacer {
    width: 48px;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .chapter-bar__back-label { display: none; }
    .chapter-bar__spacer { width: 0; }
    .chapter-bar__name { font-size: 0.92rem; }
}

/* ----- Dot indicator ----- */
.chapter-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 0 0 28px;
    padding: 4px 0;
}
.chapter-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--c-sand-2);
    background: var(--c-surface);
    color: var(--c-muted);
    font-family: var(--ff-display);
    font-size: 0.74rem;
    text-decoration: none;
    transition: border-color 200ms, color 200ms, transform 200ms, background 200ms;
}
.chapter-dot:hover {
    border-color: var(--c-saffron);
    color: var(--c-saffron);
    transform: translateY(-1px);
}
.chapter-dot.is-current {
    background: var(--c-saffron);
    border-color: var(--c-saffron);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(201, 123, 39, 0.18);
}
.chapter-dot--reflect {
    margin-left: 6px;
    border-style: dashed;
    font-size: 0.95rem;
}
.chapter-dot--reflect.is-current {
    background: var(--c-gold);
    border-color: var(--c-gold);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.22);
}
.chapter-dot--reflect.is-locked {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.chapter-dot__num {
    line-height: 1;
}

@media (max-width: 640px) {
    .chapter-dot { width: 26px; height: 26px; font-size: 0.7rem; }
}

/* ----- Page content ----- */
.chapter-page {
    animation: chapter-page-in 500ms ease-out both;
}
@keyframes chapter-page-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .chapter-page { animation: none; }
}

.chapter-page__head {
    text-align: center;
    margin: 8px auto 32px;
}
.chapter-page__eyebrow {
    font-family: var(--ff-display);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin: 0 0 8px;
}
.chapter-page__title {
    font-family: var(--ff-display);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--c-ink);
    letter-spacing: 0.06em;
    margin: 0 0 6px;
}
.chapter-page__subtitle {
    font-style: italic;
    color: var(--c-muted);
    font-size: 1rem;
    margin: 0;
}

.chapter-page__body {
    /* Content lives here. Each chapter's body_html supplies its own
       internal styling. */
}

/* ----- Bottom Previous/Next nav ----- */
.chapter-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 64px auto 32px;
    padding: 24px 0 0;
    border-top: 1px solid var(--c-sand-2);
}
.chapter-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--c-surface);
    color: var(--c-ink);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
    text-decoration: none;
    font-family: var(--ff-display);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    transition: border-color 200ms, color 200ms, background 200ms, transform 150ms;
    min-width: 110px;
    justify-content: center;
}
.chapter-nav__btn:hover {
    border-color: var(--c-saffron);
    color: var(--c-saffron);
    transform: translateY(-1px);
}
.chapter-nav__btn--next {
    background: var(--c-saffron);
    color: #fff;
    border-color: var(--c-saffron);
}
.chapter-nav__btn--next:hover {
    background: var(--c-saffron-deep, #B66A1F);
    color: #fff;
    border-color: var(--c-saffron-deep, #B66A1F);
}
.chapter-nav__btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}
.chapter-nav__center {
    flex: 1;
    text-align: center;
}
.chapter-nav__page-label {
    font-family: var(--ff-display);
    color: var(--c-muted);
    font-size: 0.86rem;
    letter-spacing: 0.1em;
}

@media (max-width: 640px) {
    .chapter-nav { margin-top: 48px; gap: 8px; }
    .chapter-nav__btn { padding: 10px 14px; font-size: 0.82rem; min-width: 90px; }
    .chapter-nav__page-label { font-size: 0.78rem; }
}

/* ----- Reflection widget container ----- */
.reflection-widget {
    margin: 16px auto 32px;
    padding: 32px 28px;
    background: var(--c-surface);
    border: 1px solid var(--c-gold-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    max-width: 720px;
}
.reflection-widget__loading {
    padding: 40px 0;
}
@media (max-width: 640px) {
    .reflection-widget { padding: 24px 18px; }
}

/* ============================================================================
   THEME SYSTEM — append to app.css
   ============================================================================
   Each theme is a complete override of the design tokens. The user's choice is
   applied via <body data-theme="..."> in header.php, so the swap happens
   server-side with no flash of unstyled content.

   Themes available:
     parchment   - default (cream, saffron, gold)
     twilight    - dark mode (deep blue, warm gold)
     sandalwood  - warm beige with sage accents
     reading     - high-contrast, sharper for sustained reading sessions
   ============================================================================ */


/* -----------------------------------------------------------------
   THEME — Parchment (default — same as :root, listed for explicitness)
   ----------------------------------------------------------------- */
[data-theme="parchment"] {
    --c-bg:           #FBF6EC;
    --c-surface:      #F5EDDC;
    --c-surface-2:    #EFE4CC;
    --c-saffron:      #C97B27;
    --c-saffron-dk:   #A85F18;
    --c-gold:         #B8860B;
    --c-gold-soft:    #D9B760;
    --c-ink:          #2E1F12;
    --c-ink-soft:     #4A372A;
    --c-muted:        #7A6852;
    --c-sand:         #C9B898;
    --c-sand-2:       #E6D9BD;
    --c-olive:        #6B8E23;
    --c-terracotta:   #A0522D;
    --c-ink-on-saffron: #FFF8EE;

    /* Status colours — distinct per state */
    --c-status-locked:     #B5A98A;   /* faded sand-grey */
    --c-status-available:  #C97B27;   /* saffron */
    --c-status-inprogress: #4A6FA5;   /* muted indigo */
    --c-status-completed:  #6B8E23;   /* olive green */
    --c-status-mastered:   #B8860B;   /* deep gold */
}


/* -----------------------------------------------------------------
   THEME — Twilight (dark mode)
   ----------------------------------------------------------------- */
[data-theme="twilight"] {
    --c-bg:           #1A1A28;   /* deep indigo-black */
    --c-surface:      #232336;
    --c-surface-2:    #2D2D44;
    --c-saffron:      #E89A4D;   /* warmer saffron for contrast on dark */
    --c-saffron-dk:   #C97B27;
    --c-gold:         #D9B760;   /* brighter gold */
    --c-gold-soft:    #7A6F4A;
    --c-ink:          #E8E4D5;   /* warm off-white */
    --c-ink-soft:     #C8C0A8;
    --c-muted:        #8A8270;
    --c-sand:         #4A4A60;
    --c-sand-2:       #383852;
    --c-olive:        #94B860;
    --c-terracotta:   #D67857;
    --c-ink-on-saffron: #1A1A28;

    /* Status colours — adjusted for dark background contrast */
    --c-status-locked:     #5A5A70;
    --c-status-available:  #E89A4D;
    --c-status-inprogress: #7B9DD6;
    --c-status-completed:  #94B860;
    --c-status-mastered:   #D9B760;

    /* Shadow tweaks for dark — use lighter alpha */
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 4px 14px rgba(0, 0, 0, 0.5);
}


/* -----------------------------------------------------------------
   THEME — Sandalwood (warm beige with sage accents)
   ----------------------------------------------------------------- */
[data-theme="sandalwood"] {
    --c-bg:           #F4EBD8;   /* slightly warmer than parchment */
    --c-surface:      #ECE0C5;
    --c-surface-2:    #E0D2B0;
    --c-saffron:      #B8623E;   /* deeper, more terracotta-leaning */
    --c-saffron-dk:   #944A2C;
    --c-gold:         #9F8A4A;   /* duller, more bronze gold */
    --c-gold-soft:    #C7B583;
    --c-ink:          #2A2418;
    --c-ink-soft:     #463E2A;
    --c-muted:        #6E6248;
    --c-sand:         #BFAE85;
    --c-sand-2:       #D7C9A8;
    --c-olive:        #5E7A30;   /* sage tilt */
    --c-terracotta:   #A65A33;
    --c-ink-on-saffron: #FFF6E8;

    /* Status colours — sage and bronze */
    --c-status-locked:     #A89978;
    --c-status-available:  #B8623E;
    --c-status-inprogress: #6B7F8C;   /* dusty blue-grey */
    --c-status-completed:  #5E7A30;   /* sage */
    --c-status-mastered:   #9F8A4A;   /* bronze */
}


/* -----------------------------------------------------------------
   THEME — Reading (high-contrast for sustained reading sessions)
   ----------------------------------------------------------------- */
[data-theme="reading"] {
    --c-bg:           #FAF6EE;   /* very light cream */
    --c-surface:      #FFFFFF;   /* pure white cards for max contrast */
    --c-surface-2:    #F5F0E2;
    --c-saffron:      #A8580F;   /* deeper, more readable */
    --c-saffron-dk:   #8A4708;
    --c-gold:         #8A6B0A;   /* deeper */
    --c-gold-soft:    #BFA050;
    --c-ink:          #1A1208;   /* near-black */
    --c-ink-soft:     #2E1F12;
    --c-muted:        #5A4A36;   /* darker muted for legibility */
    --c-sand:         #A89878;
    --c-sand-2:       #D8C9A8;
    --c-olive:        #4F6F1A;
    --c-terracotta:   #8A3F1F;
    --c-ink-on-saffron: #FFFFFF;

    /* Status colours — deepened for max contrast */
    --c-status-locked:     #8A7C5E;
    --c-status-available:  #A8580F;
    --c-status-inprogress: #2F4F87;   /* darker indigo */
    --c-status-completed:  #4F6F1A;
    --c-status-mastered:   #8A6B0A;
}


/* ============================================================================
   STATUS BADGES — Distinct colours per status (uses tokens above)
   ============================================================================
   These override the existing single-colour badge rules. Each status now
   has its own colour, all derived from the theme's --c-status-* tokens.
   ============================================================================ */

/* Dashboard chapter card status pill */
.chapter-card__status {
    color: var(--c-muted);
    border: 1px solid var(--c-sand-2);
    background: transparent;
    border-radius: 999px;
    padding: 4px 14px;
    font-family: var(--ff-display);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: color 200ms, border-color 200ms, background 200ms;
}

.chapter-card.is-locked .chapter-card__status {
    color: var(--c-status-locked);
    border-color: var(--c-status-locked);
    background: rgba(181, 169, 138, 0.08);
}
.chapter-card.is-available .chapter-card__status {
    color: var(--c-status-available);
    border-color: var(--c-status-available);
    background: rgba(201, 123, 39, 0.08);
}
.chapter-card.is-inprogress .chapter-card__status {
    color: var(--c-status-inprogress);
    border-color: var(--c-status-inprogress);
    background: rgba(74, 111, 165, 0.08);
}
.chapter-card.is-completed .chapter-card__status {
    color: var(--c-status-completed);
    border-color: var(--c-status-completed);
    background: rgba(107, 142, 35, 0.08);
}
.chapter-card.is-mastered .chapter-card__status {
    color: var(--c-status-mastered);
    border-color: var(--c-status-mastered);
    background: rgba(184, 134, 11, 0.12);
}

/* Card border tints by status */
.chapter-card.is-locked      { border-color: var(--c-sand-2); }
.chapter-card.is-available   { border-color: var(--c-status-available); }
.chapter-card.is-inprogress  { border-color: var(--c-status-inprogress); }
.chapter-card.is-completed   { border-color: var(--c-status-completed); }
.chapter-card.is-mastered    { border-color: var(--c-status-mastered); }

/* Chapter number badge — completed/mastered get filled colour */
.chapter-card.is-completed .chapter-card__num {
    background: var(--c-status-completed);
    color: var(--c-bg);
    border-color: var(--c-status-completed);
}
.chapter-card.is-mastered .chapter-card__num {
    background: var(--c-status-mastered);
    color: var(--c-bg);
    border-color: var(--c-status-mastered);
}

/* Status pill (used elsewhere — admin, progress page) */
.status-pill.is-locked     { color: var(--c-status-locked);     border-color: var(--c-status-locked); }
.status-pill.is-unlocked,
.status-pill.is-available  { color: var(--c-status-available);  border-color: var(--c-status-available); }
.status-pill.is-inprogress { color: var(--c-status-inprogress); border-color: var(--c-status-inprogress); }
.status-pill.is-completed  { color: var(--c-status-completed);  border-color: var(--c-status-completed); }
.status-pill.is-mastered   {
    color: var(--c-status-mastered);
    border-color: var(--c-status-mastered);
    background: rgba(184, 134, 11, 0.08);
}


/* ============================================================================
   THEME PICKER (on profile page)
   ============================================================================ */

.theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 0 8px;
}

.theme-picker__option {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 2px solid var(--c-sand-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--c-surface);
    transition: border-color 200ms, transform 150ms, box-shadow 200ms;
    position: relative;
}
.theme-picker__option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}
.theme-picker__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.theme-picker__option:has(input:checked),
.theme-picker__option.is-current {
    border-color: var(--c-saffron);
    box-shadow: 0 0 0 3px rgba(201, 123, 39, 0.18);
}

.theme-picker__swatch {
    height: 90px;
    display: flex;
    align-items: stretch;
    position: relative;
}
.theme-picker__swatch > div {
    flex: 1;
}
.theme-picker__sw-bg     { background: var(--swatch-bg); }
.theme-picker__sw-surface { background: var(--swatch-surface); border-left: 1px solid rgba(0,0,0,0.04); }
.theme-picker__sw-saffron { background: var(--swatch-saffron); max-width: 28px; }
.theme-picker__sw-gold    { background: var(--swatch-gold); max-width: 14px; }

.theme-picker__option[data-theme="parchment"]   { --swatch-bg: #FBF6EC; --swatch-surface: #F5EDDC; --swatch-saffron: #C97B27; --swatch-gold: #B8860B; }
.theme-picker__option[data-theme="twilight"]    { --swatch-bg: #1A1A28; --swatch-surface: #232336; --swatch-saffron: #E89A4D; --swatch-gold: #D9B760; }
.theme-picker__option[data-theme="sandalwood"]  { --swatch-bg: #F4EBD8; --swatch-surface: #ECE0C5; --swatch-saffron: #B8623E; --swatch-gold: #9F8A4A; }
.theme-picker__option[data-theme="reading"]     { --swatch-bg: #FAF6EE; --swatch-surface: #FFFFFF; --swatch-saffron: #A8580F; --swatch-gold: #8A6B0A; }

.theme-picker__label {
    padding: 14px 16px;
    text-align: center;
}
.theme-picker__name {
    display: block;
    font-family: var(--ff-display);
    color: var(--c-ink);
    letter-spacing: 0.1em;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.theme-picker__desc {
    display: block;
    font-style: italic;
    color: var(--c-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.theme-picker__current-mark {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--c-saffron);
    color: var(--c-ink-on-saffron);
    border-radius: 999px;
    padding: 2px 10px;
    font-family: var(--ff-display);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .theme-picker { grid-template-columns: 1fr 1fr; gap: 12px; }
    .theme-picker__swatch { height: 70px; }
}
/* ============================================================================
   THEME — Legible  (NEW)
   ============================================================================
   A fifth theme designed for the highest readability: WCAG AAA contrast on
   every text pair, the Lora typeface (designed for screen reading) instead
   of Cormorant, a larger base font size, and bigger touch targets.

   Best for:
     - Long reading sessions
     - Older readers or anyone with reduced vision
     - Reading in low light, fatigue, or on cheap screens
     - Anyone who finds the decorative serif themes hard on the eyes

   This block is purely additive. It overrides the design tokens only when
   <body data-theme="legible">. All other themes remain untouched.

   APPEND this block to the very end of public/assets/css/app.css.
   ============================================================================ */

/* The Lora font (and Inter for UI) are loaded ONLY when this theme is in use.
   We do this via @import inside a scoped block so the network cost is only
   paid by readers who choose this theme. */
[data-theme="legible"] {

    /* ---- Palette (every text pair AAA on this background) ---- */
    --c-bg:           #FFFCF5;   /* even brighter cream than parchment */
    --c-surface:      #FFFFFF;   /* pure white card for max contrast */
    --c-surface-2:    #F5EDDC;
    --c-saffron:      #6F3500;   /* deeper saffron — AAA on bg (9.4:1) */
    --c-saffron-dk:   #4F2400;
    --c-gold:         #4A3608;   /* deep bronze-gold — AAA (11.3:1) */
    --c-gold-soft:    #B89548;
    --c-ink:          #0A0604;   /* near-black — AAA (19.7:1) */
    --c-ink-soft:     #1A1208;
    --c-muted:        #3D3120;   /* deep enough for AAA on cream (12.4:1) */
    --c-sand:         #998B6B;
    --c-sand-2:       #D4C49E;
    --c-olive:        #3D5A0A;
    --c-terracotta:   #702E0F;
    --c-ink-on-saffron: #FFFFFF;

    /* Status colours — every one clears AAA */
    --c-status-locked:     #5A4E32;
    --c-status-available:  #6F3500;
    --c-status-inprogress: #1F3A6F;
    --c-status-completed:  #3D5A0A;
    --c-status-mastered:   #4A3608;

    /* ---- Typography ---- */
    /* Lora is the chief change — humanist serif designed for screen reading.
       Cinzel remains for hero titles (used at large sizes, where it works).
       Fallbacks are robust on every OS. */
    --ff-serif:    'Lora', 'Source Serif Pro', 'Georgia', 'Iowan Old Style', serif;
    --ff-display:  'Cinzel', 'Lora', 'Georgia', serif;

    /* Larger base, tighter line-height than the decorative themes.
       Lora is a denser font than Cormorant so 1.65 reads better than 1.78. */
    --fz-base:     19px;
    --fz-meta:     16px;
    --lh-body:     1.65;
    --lh-heading:  1.25;
}

/* Load Lora when this theme is active. Browsers ignore the import if no
   element with data-theme=legible exists — but to be safe, we import
   unconditionally at the top of this section, scoped by media. Network
   cost is one extra woff2 file (~30 KB) only when needed. */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* ---- Component overrides scoped to Legible theme ---- */

/* Larger body text by default */
[data-theme="legible"] body {
    font-size: var(--fz-base);
    line-height: var(--lh-body);
}

/* Reading column — slightly wider to compensate for the larger font */
[data-theme="legible"] .reading-column,
[data-theme="legible"] .c1-prose,
[data-theme="legible"] .c2-prose,
[data-theme="legible"] .c3-prose {
    max-width: 740px;
}

/* All paragraphs inside the chapter — explicit size + line-height */
[data-theme="legible"] .c1-prose p,
[data-theme="legible"] .c2-prose p,
[data-theme="legible"] .c3-prose p {
    font-size: 1.12rem;        /* ~21px relative to 19px base */
    line-height: 1.75;
    color: var(--c-ink-soft);
}

/* Discourse / quote boxes — keep emphasis but sharper */
[data-theme="legible"] .c1-discourse,
[data-theme="legible"] .c2-discourse,
[data-theme="legible"] .c3-discourse {
    font-size: 1.08rem;
    line-height: 1.7;
}

/* Drop caps — Lora's drop cap reads better at this size */
[data-theme="legible"] .c1-prose p.lead::first-letter,
[data-theme="legible"] .c2-prose p.lead::first-letter,
[data-theme="legible"] .c3-prose p.lead::first-letter {
    font-size: 3.8rem;          /* smaller than Cormorant's 4.4 — Lora needs less */
    line-height: 0.95;
    padding: 8px 12px 0 0;
}

/* Italic muted text — make it slightly less italic, more readable */
[data-theme="legible"] em,
[data-theme="legible"] i,
[data-theme="legible"] .italic {
    font-style: italic;
    font-weight: 500;           /* a touch heavier — Lora italic at 400 can look thin */
}

/* Headings — use Cinzel for hero only, Lora for everything else */
[data-theme="legible"] h2,
[data-theme="legible"] h3,
[data-theme="legible"] h4,
[data-theme="legible"] .c1-h2,
[data-theme="legible"] .c2-h2,
[data-theme="legible"] .c3-h2 {
    font-family: var(--ff-serif);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

/* Hero titles still use Cinzel (your preference) */
[data-theme="legible"] .c1-hero__title,
[data-theme="legible"] .c2-hero__title,
[data-theme="legible"] .c3-hero__title,
[data-theme="legible"] .site-brand__name {
    font-family: var(--ff-display);
}

/* Status badges — brighter background fills for clearer state */
[data-theme="legible"] .chapter-card__status,
[data-theme="legible"] .status-pill {
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 6px 16px;
}

/* Larger touch targets — 48px minimum on Legible */
[data-theme="legible"] .btn,
[data-theme="legible"] .form-input,
[data-theme="legible"] .form-label,
[data-theme="legible"] .site-nav__link,
[data-theme="legible"] .profile-menu__trigger,
[data-theme="legible"] .pager__btn,
[data-theme="legible"] .chapter-card {
    min-height: 48px;
}

[data-theme="legible"] .btn {
    padding: 14px 28px;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

[data-theme="legible"] .form-input {
    font-size: 1.05rem;
    padding: 14px 16px;
}

[data-theme="legible"] .form-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Chapter cards — clearer separation, slightly larger */
[data-theme="legible"] .chapter-card {
    padding: 24px;
}
[data-theme="legible"] .chapter-card__title {
    font-family: var(--ff-serif);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}
[data-theme="legible"] .chapter-card__desc {
    font-size: 0.98rem;
    line-height: 1.55;
}

/* Site nav — clearer */
[data-theme="legible"] .site-nav__link {
    font-family: var(--ff-serif);
    font-size: 1rem;
    font-weight: 500;
    padding: 10px 16px;
}

/* Theme picker labels — the swatch description should be more legible */
[data-theme="legible"] .theme-picker__name {
    font-family: var(--ff-serif);
    font-weight: 600;
    letter-spacing: 0.02em;
}
[data-theme="legible"] .theme-picker__desc {
    font-style: normal;
    font-weight: 400;
}

/* Reflection / quiz interface — make everything bigger */
[data-theme="legible"] .quiz-question {
    font-size: 1.12rem;
    line-height: 1.65;
    font-weight: 500;
}
[data-theme="legible"] .quiz-option {
    font-size: 1.05rem;
    line-height: 1.55;
    padding: 14px 18px;
    min-height: 56px;
}

/* Responsive overrides — extra care for small screens with Legible */
@media (max-width: 480px) {
    [data-theme="legible"] {
        --fz-base: 18px;          /* tiny step down on smallest screens */
    }
    [data-theme="legible"] .btn {
        padding: 12px 22px;
        font-size: 1rem;
        width: 100%;              /* full-width buttons on phone */
    }
    [data-theme="legible"] .chapter-card {
        padding: 18px;
    }
    [data-theme="legible"] .c1-prose p,
    [data-theme="legible"] .c2-prose p,
    [data-theme="legible"] .c3-prose p {
        font-size: 1.08rem;
        line-height: 1.7;
    }
}

/* ===== Legible-theme swatch for the picker =====
   Defined here so the picker shows a preview of the actual colours. */
.theme-picker__option[data-theme="legible"] {
    --swatch-bg: #FFFCF5;
    --swatch-surface: #FFFFFF;
    --swatch-saffron: #6F3500;
    --swatch-gold: #4A3608;
}

/* ============================================================================
   MOBILE-RESPONSIVE HEADER  (append to app.css)
   ============================================================================
   Fixes the cramped mobile header:
     - Brand wordmark no longer wraps; hides below 480px (Om glyph remains)
     - Horizontal nav becomes a hamburger menu below 768px
     - Profile-menu name hides on mobile; just the avatar circle remains
     - Header inner padding tightens on small screens

   The desktop layout (≥769px) is unchanged. Everything below is overrides
   triggered only at the relevant breakpoints.
   ============================================================================ */


/* ===== Brand: prevent wrapping at any breakpoint ===== */
.site-brand {
    flex-shrink: 0;             /* never let other items squeeze the brand */
    min-width: 0;               /* but allow it to truncate if absolutely needed */
}
.site-brand__name {
    white-space: nowrap;        /* "Pathway to Divinity" stays on one line */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none;
}


/* ============================================================================
   HAMBURGER MENU  (mobile only — hidden on desktop)
   ============================================================================ */
.site-burger {
    display: none;              /* hidden by default; shown via media query */
    position: relative;
    margin-right: 4px;
}

.site-burger summary {
    list-style: none;
    cursor: pointer;
}
.site-burger summary::-webkit-details-marker { display: none; }

.site-burger__trigger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
    transition: border-color 120ms, background 120ms;
}
.site-burger__trigger:hover,
.site-burger[open] .site-burger__trigger {
    border-color: var(--c-saffron);
    background: var(--c-surface-2);
}

.site-burger__bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--c-ink-soft);
    border-radius: 1px;
    transition: transform 200ms, opacity 200ms;
}

/* Optional X-effect when open */
.site-burger[open] .site-burger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.site-burger[open] .site-burger__bar:nth-child(2) {
    opacity: 0;
}
.site-burger[open] .site-burger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-burger__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--c-surface);
    border: 1px solid var(--c-sand-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 8px 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
}

.site-burger__link {
    display: block;
    padding: 12px 20px;
    color: var(--c-ink-soft);
    font-family: var(--ff-serif);
    font-size: 1rem;
    letter-spacing: 0.04em;
    border-bottom: 0;
    transition: background 120ms, color 120ms;
    min-height: 44px;           /* touch target */
}
.site-burger__link:hover {
    background: var(--c-surface-2);
    color: var(--c-saffron);
}

.site-burger__link--button {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.site-burger__rule {
    height: 1px;
    margin: 6px 12px;
    background: var(--c-sand-2);
}

.site-burger__form {
    margin: 0;
}


/* ============================================================================
   MOBILE BREAKPOINT  (≤ 768px)
   ============================================================================ */
@media (max-width: 768px) {

    /* Header takes less horizontal padding */
    .site-header__inner {
        padding: 10px 14px;
        gap: 12px;
    }

    /* Show hamburger */
    .site-burger {
        display: inline-block;
    }

    /* Hide desktop horizontal nav */
    .site-nav {
        display: none;
    }

    /* Brand: still visible, but tighter */
    .site-brand {
        gap: 8px;
        flex: 1 1 auto;
        min-width: 0;             /* allow truncation */
    }
    .site-brand__glyph {
        font-size: 1.4rem;
    }
    .site-brand__name {
        font-size: 0.95rem;
        letter-spacing: 0.1em;
    }

    /* Profile menu: hide the name, just show the avatar circle */
    .profile-menu__name {
        display: none;
    }
    .profile-menu__trigger {
        padding: 3px;
        gap: 0;
    }
    .profile-menu__avatar {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    /* Profile panel: position relative to right edge of header */
    .profile-menu__panel {
        right: 0;
        min-width: 200px;
    }

    /* Tighten the site-profile spacing */
    .site-profile {
        margin-left: 0;
    }
}


/* ============================================================================
   SMALL MOBILE BREAKPOINT  (≤ 480px)
   ============================================================================ */
@media (max-width: 480px) {

    /* Drop the wordmark entirely — only the Om glyph remains
       (it's iconic enough; saves precious horizontal space) */
    .site-brand__name {
        display: none;
    }

    .site-brand__glyph {
        font-size: 1.6rem;
    }

    /* Even tighter header padding */
    .site-header__inner {
        padding: 8px 12px;
        gap: 10px;
    }

    /* Hamburger panel can be a bit wider, since it's the main nav now */
    .site-burger__panel {
        min-width: 200px;
    }
}


/* ============================================================================
   VERY SMALL MOBILE  (≤ 360px)  — extra safety for the worst case
   ============================================================================ */
@media (max-width: 360px) {
    .site-header__inner {
        padding: 6px 10px;
        gap: 8px;
    }
    .site-burger__trigger {
        width: 40px;
        height: 40px;
    }
    .profile-menu__avatar {
        width: 34px;
        height: 34px;
    }
}

/* ============================================================
   Registration form additions — required field markers + captcha
   Append to app.css
   ============================================================ */

/* Required-field asterisk on labels */
.form-req {
    color: var(--c-saffron);
    font-weight: 600;
    margin-left: 4px;
    font-size: 1.05em;
    line-height: 1;
}

/* Captcha row: prompt + input on one line */
.form-captcha__row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.form-captcha__prompt {
    font-family: var(--ff-display);
    font-size: 1.3rem;
    color: var(--c-saffron);
    letter-spacing: 0.04em;
    padding: 10px 18px;
    background: var(--c-surface);
    border: 1px dashed var(--c-gold-soft);
    border-radius: var(--radius-lg);
    user-select: none;
    /* Slight visual differentiation so it cannot be confused with an input */
    box-shadow: inset 0 0 12px rgba(184, 134, 11, 0.05);
    white-space: nowrap;
}

.form-captcha__input {
    /* Narrower than other inputs — only a small number is expected */
    max-width: 100px;
    text-align: center;
    font-family: var(--ff-display);
    font-size: 1.15rem;
    letter-spacing: 0.06em;
}

@media (max-width: 480px) {
    .form-captcha__prompt { font-size: 1.15rem; padding: 8px 14px; }
    .form-captcha__input  { font-size: 1.05rem; }
}