:root {
    --bg: #f6f1e8;
    --bg-strong: #efe4d1;
    --panel: rgba(255, 251, 245, 0.92);
    --panel-strong: #fffaf2;
    --text: #2f2418;
    --muted: #78644f;
    --line: rgba(84, 59, 34, 0.14);
    --accent: #a74624;
    --accent-strong: #7d2f15;
    --accent-soft: #f2cfb0;
    --shadow: 0 18px 40px rgba(70, 38, 13, 0.12);
    --radius: 24px;
    --radius-sm: 16px;
    --max-width: 1180px;
    --font-ui: "Trebuchet MS", "Segoe UI", sans-serif;
    --font-reading: Georgia, "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 32%),
        radial-gradient(circle at bottom right, rgba(167, 70, 36, 0.12), transparent 28%),
        linear-gradient(180deg, #f7f0e5 0%, #ead7ba 100%);
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    width: min(100%, var(--max-width));
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.hero {
    display: grid;
    gap: 18px;
    padding: 28px;
    border-radius: calc(var(--radius) + 8px);
    background:
        linear-gradient(135deg, rgba(122, 59, 28, 0.95), rgba(56, 28, 14, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
    color: #fff7ef;
    box-shadow: var(--shadow);
}

.hero h1,
.panel h2,
.chapter-toolbar__title h2 {
    margin: 0;
    font-family: var(--font-reading);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.7rem);
    line-height: 0.96;
}

.hero__lead {
    max-width: 56ch;
    margin: 10px 0 0;
    color: rgba(255, 247, 239, 0.82);
    font-size: 1.02rem;
    line-height: 1.55;
}

.hero__badge {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero__badge span,
.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 246, 236, 0.14);
    border: 1px solid rgba(255, 246, 236, 0.18);
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.layout {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.panel--sticky {
    padding: 20px;
}

.panel--content {
    padding: 18px;
}

.panel__header p,
.chapter-meta,
.status,
.eyebrow {
    color: var(--muted);
}

.panel__header h2 {
    font-size: 1.4rem;
}

.panel__header p {
    margin: 6px 0 0;
    line-height: 1.5;
}

.stack {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 0.92rem;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid rgba(120, 100, 79, 0.22);
    border-radius: 14px;
    background: var(--panel-strong);
    color: var(--text);
}

.field input:focus,
.field select:focus {
    outline: 2px solid rgba(167, 70, 36, 0.18);
    border-color: rgba(167, 70, 36, 0.5);
}

.button {
    min-height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: 14px;
    background: #e9ddcc;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.button--primary {
    background: linear-gradient(180deg, #be5a31 0%, #a74624 100%);
    color: #fff8f2;
}

.button--ghost {
    background: transparent;
    border: 1px solid var(--line);
}

.divider {
    height: 1px;
    margin: 18px 0;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.status {
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: rgba(167, 70, 36, 0.08);
}

.view {
    display: none;
}

.view.is-active {
    display: block;
    animation: fade-in 0.26s ease;
}

.chapter-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.chapter-toolbar--search {
    grid-template-columns: 1fr;
}

.chapter-toolbar__title {
    text-align: center;
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.74rem;
    font-weight: 700;
}

.chapter-meta {
    margin: 16px 0 8px;
    line-height: 1.5;
}

.verses,
.results {
    display: grid;
    gap: 12px;
}

.verse,
.result {
    padding: 15px 16px;
    border-radius: 18px;
    background: rgba(255, 252, 247, 0.96);
    border: 1px solid rgba(120, 100, 79, 0.16);
}

.verse__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.88rem;
    font-weight: 700;
    vertical-align: top;
}

.verse__text,
.result__text {
    font-family: var(--font-reading);
    font-size: 1.07rem;
    line-height: 1.85;
}

.result__ref {
    margin: 0 0 10px;
    color: var(--accent-strong);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.inline-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.empty {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 250, 242, 0.95);
    border: 1px dashed rgba(120, 100, 79, 0.3);
    color: var(--muted);
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 920px) {
    .layout {
        grid-template-columns: 340px minmax(0, 1fr);
        align-items: start;
    }

    .panel--sticky {
        position: sticky;
        top: 18px;
    }
}

@media (max-width: 680px) {
    .app-shell {
        padding: 12px 12px 36px;
    }

    .hero,
    .panel--sticky,
    .panel--content {
        padding: 16px;
        border-radius: 20px;
    }

    .chapter-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .chapter-toolbar__title {
        grid-column: 1 / -1;
        order: -1;
    }

    .button {
        min-height: 46px;
    }
}
