:root {
    --bg: #13070d;
    --bg-2: #1e0c15;
    --fg: #f8edf1;
    --muted: #dcbcc6;
    --accent: #f3a6b7;
    --card: #241019;
    --card-2: #2f1520;
    --card-border: rgba(255, 255, 255, 0.06);
    --radius: 18px;
    --shadow: 0 14px 30px rgba(0, 0, 0, .35);
    --ring: rgba(243, 166, 183, .45);
    --nav-h: 78px;
}

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

body {
    margin: 0;
    -webkit-text-size-adjust: 100%;
    font-family: "Roboto", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
    background:
        radial-gradient(680px 520px at 50% -80px, var(--bg-2), transparent 60%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    color: var(--fg);
    min-height: 100vh;
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem;
}

h1,
h2,
h3 {
    font-family: "Merriweather", "DM Serif Text", Georgia, serif;
    font-weight: 700;
    letter-spacing: 0.2px;
}

p {
    margin: 0 0 .85rem;
}

.hero {
    padding: 1.5rem 1.1rem .5rem;
    text-align: center;
}

.hero h1 {
    margin: .1rem 0 .35rem;
    font-size: clamp(1.75rem, 6.5vw, 2.4rem);
    line-height: 1.1;
}

.hero-sub {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: .4rem;
}

.hero-date {
    color: #fbe2ea;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: .72rem;
    color: var(--muted);
    margin: 0 0 .4rem;
}

.panels {
    padding: 0 1rem calc(var(--nav-h) + 1.2rem);
    display: flex;
    flex-direction: column;
    gap: .9rem;
    max-width: 760px;
    margin: 0 auto;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

.card {
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    padding: 1rem 1rem 1.2rem;
}

.card h2 {
    margin: .1rem 0 .5rem;
    font-size: 1.25rem;
}

.card-split {
    display: grid;
    gap: 1rem;
}

.panel[data-panel="scriptures"] .card .eyebrow,
.panel[data-panel="scriptures"] .card h2 {
    text-align: center;
    display: block;
}

.panel[data-panel="scriptures"] .section-img {
    margin-left: auto;
    margin-right: auto;
}

.list-card ul,
.bullets,
.scripture-list {
    margin: 0;
    padding-left: 1rem;
    line-height: 1.6;
}

.bullets li {
    margin: .35rem 0;
}

.scripture-list {
    list-style-position: inside;
}

.section-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 16px;
    background: #3a1520;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    margin: .25rem 0 .85rem;
}

.section-img.tight {
    margin-top: 1rem;
}

.section-img.history-image {
    aspect-ratio: auto;
}

.media-shell {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
}

.media-shell iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.chip-stack {
    display: grid;
    gap: .45rem;
}

a.verse {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .42rem .9rem;
    min-height: 44px;
    border-radius: 999px;
    font-weight: 760;
    line-height: 1.15;
    background: rgba(243, 166, 183, .18);
    border: 1px solid rgba(243, 166, 183, .5);
    color: var(--fg);
    box-shadow: inset 0 -1px 0 rgba(243, 166, 183, .18);
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}

@media (hover: hover) and (pointer: fine) {
    a.verse:hover {
        transform: translateY(-1px);
        background: rgba(243, 166, 183, .24);
        border-color: rgba(243, 166, 183, .7);
    }
}

a.verse:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

a.verse svg {
    width: 15px;
    height: 15px;
    opacity: .8;
}

.note {
    color: var(--muted);
    font-size: .95rem;
    margin-top: .3rem;
}

.note.small {
    font-size: .85rem;
}

.inline-link {
    color: var(--fg);
    border-bottom: 1px solid rgba(243, 166, 183, .55);
    text-decoration: none;
}

.inline-link:hover,
.inline-link:focus-visible {
    border-bottom-color: rgba(243, 166, 183, .9);
    outline: none;
}

.qa-form {
    display: grid;
    gap: .6rem;
    justify-items: stretch;
}

.input,
.textarea {
    width: 100%;
    padding: .9rem;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: #371522;
    color: var(--fg);
    font: inherit;
}

.textarea {
    min-height: 130px;
    resize: vertical;
}

.check {
    display: flex;
    gap: .5rem;
    align-items: center;
    opacity: .9;
}

.honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.btn,
.pill {
    font: inherit;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    color: var(--fg);
    background: #361521;
    padding: .65rem 1.05rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.btn.primary,
.pill {
    background: var(--accent);
    color: #1a0b10;
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(243, 166, 183, .32);
    font-weight: 700;
}

.pill.ghost {
    background: transparent;
    color: var(--fg);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: none;
}

.btn:active,
.pill:active {
    transform: translateY(1px);
}

.teacher-cta {
    margin-top: 1rem;
    display: grid;
    gap: .3rem;
    justify-items: start;
}

.admin-shell {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
}

.admin-topbar {
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-login {
    display: grid;
    gap: .7rem;
}

.admin-login h2 {
    margin: 0;
}

footer {
    text-align: center;
    padding: 1.2rem 1rem calc(var(--nav-h) + .6rem);
    color: var(--muted);
    font-size: .95rem;
}

/* Bottom navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    background: rgba(18, 8, 12, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    z-index: 30;
}

.nav-btn {
    border: none;
    background: none;
    color: var(--muted);
    font: inherit;
    position: relative;
    display: grid;
    gap: .1rem;
    place-items: center;
    padding: .35rem .25rem .2rem;
    position: relative;
}

.nav-btn .icon {
    font-size: 1.2rem;
}

.nav-btn .label {
    font-size: .85rem;
}

.pill[data-open-feed],
.teacher-cta .pill {
    position: relative;
    padding-right: 1.4rem;
}

.nav-btn.active {
    color: #fff;
}

.nav-btn.active::after {
    content: "";
    width: 28px;
    height: 3px;
    border-radius: 99px;
    background: var(--accent);
    position: absolute;
    bottom: 6px;
}

.badge {
    position: absolute;
    top: 6px;
    right: 18px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ff4b6b;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
}

.badge.show {
    display: inline-flex;
}

.badge.dot {
    width: 12px;
    min-width: 12px;
    height: 12px;
    padding: 0;
    right: 8px;
    top: 8px;
}

/* Live sheet */
.qa-sheet-wrapper {
    position: fixed;
    inset: 0;
    display: grid;
    justify-items: center;
    align-items: end;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 60;
}

.qa-sheet-wrapper[aria-hidden="false"] {
    pointer-events: auto;
    opacity: 1;
}

.sheet-open {
    overflow: hidden;
}

.qa-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 5, 8, 0.6);
    border: none;
    padding: 0;
}

.qa-sheet {
    position: relative;
    width: min(720px, 100%);
    max-height: 82vh;
    background: linear-gradient(180deg, #1f0d16, #250f1a);
    border-radius: 16px 16px 0 0;
    padding: .6rem 1rem 1.1rem;
    border: 1px solid var(--card-border);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
    transform: translateY(16px);
    transition: transform .2s ease;
}

.qa-sheet-wrapper[aria-hidden="false"] .qa-sheet {
    transform: translateY(0);
}

.qa-sheet__handle {
    width: 44px;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto .6rem;
}

.qa-sheet__header {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: flex-start;
}

.icon-btn {
    background: #2f1520;
    color: var(--fg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: .4rem .65rem;
    cursor: pointer;
}

.qa-sheet__controls {
    display: flex;
    gap: .6rem;
    align-items: center;
    margin: .7rem 0 .5rem;
    flex-wrap: wrap;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
}

.toggle input {
    width: 18px;
    height: 18px;
}

.qa-feed {
    display: grid;
    gap: .5rem;
    max-height: 58vh;
    overflow-y: auto;
    padding-right: .35rem;
}

.qa-card {
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: .75rem .85rem;
    background: #2a121c;
}

.qa-card .meta {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    align-items: baseline;
    color: var(--muted);
    font-size: .9rem;
}

.qa-card .question {
    margin: .4rem 0 0;
    white-space: pre-wrap;
    line-height: 1.5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Scripture list links */
.scripture-list a {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid rgba(243, 166, 183, .35);
    padding-bottom: 1px;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.scripture-list a:visited {
    color: var(--fg);
}

@media (hover:hover) and (pointer:fine) {
    .scripture-list a:hover {
        border-bottom-color: rgba(243, 166, 183, .8);
        background: rgba(243, 166, 183, .10);
        border-radius: 4px;
    }
}

.scripture-list a:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
    border-bottom-color: transparent;
}

.scripture-list a::after {
    content: "↗";
    font-size: .85em;
    opacity: .7;
    margin-left: .35rem;
}

/* Modal */
.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 14, .6);
    backdrop-filter: blur(6px);
    display: none;
    place-items: center;
    z-index: 80;
}

.backdrop[aria-hidden="false"] {
    display: grid;
}

.modal {
    background: linear-gradient(180deg, var(--card), var(--card-2));
    color: var(--fg);
    width: min(640px, 92vw);
    border-radius: 18px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, .45);
    border: 1px solid var(--card-border);
}

.modal header {
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
}

.modal header h3 {
    margin: 0;
    font-size: 1.02rem;
}

.modal .content {
    padding: .85rem 1rem;
    font-size: 1rem;
    white-space: pre-wrap;
}

.modal .actions {
    display: flex;
    gap: .6rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: .75rem 1rem 1rem;
    border-top: 1px solid var(--card-border);
}

.modal [hidden] {
    display: none !important;
}

.modal .actions .btn {
    text-align: center;
}

.btn {
    white-space: nowrap;
}

/* Small tweaks */
@media (max-width: 360px) {
    body {
        font-size: 16px;
    }
}

@media (min-width: 620px) {
    body {
        font-size: 18px;
    }

    .card-split {
        grid-template-columns: 1.15fr .95fr;
    }
}

/* Print */
@media print {
    body {
        background: #fff;
        color: #000;
    }

    .bottom-nav,
    .qa-sheet-wrapper,
    .backdrop {
        display: none !important;
    }

    .panels {
        padding-bottom: 0;
    }

    .card {
        box-shadow: none;
        background: #fff;
        color: #000;
        border: 1px solid #ddd;
    }

    .section-img,
    a.verse svg {
        display: none;
    }

    a.verse {
        text-decoration: underline;
        background: transparent;
        border: none;
        padding: 0;
        font-weight: 700;
        color: #000;
    }

    footer {
        color: #444;
        padding-bottom: 1rem;
    }
}
