:root {
    --navy: #071a34;
    --blue: #102b4b;
    --gold: #d3b477;
    --paper: #f7f2e8;
    --ink: #182638;
    --font: 21px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--navy);
    color: white;
    font-family: Arial, sans-serif;
    line-height: 1.65;
}

header, footer {
    text-align: center;
    padding: 30px 15px;
    border-bottom: 1px solid var(--gold);
}

.brand {
    color: var(--gold);
    font-size: clamp(20px, 4vw, 32px);
    letter-spacing: 2px;
    font-weight: bold;
}

h1 {
    color: var(--gold);
    font-size: clamp(32px, 6vw, 54px);
    margin: 5px;
}

h2, a, label {
    color: var(--gold);
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

nav, .toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

main {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.hero {
    text-align: center;
    padding: 25px;
}

.hero-icon {
    font-size: 55px;
}

.panel {
    background: var(--blue);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #d3b47755;
    border-radius: 12px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

label {
    font-weight: bold;
}

select {
    display: block;
    width: 100%;
    background: var(--navy);
    color: white;
    border: 1px solid #7890a8;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0 15px;
    font: inherit;
}

button {
    background: var(--gold);
    color: var(--navy);
    border: 0;
    border-radius: 8px;
    min-height: 44px;
    padding: 10px 15px;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.12);
}

button:disabled {
    opacity: .45;
    cursor: default;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid #e8ad44;
    outline-offset: 3px;
}

#reader {
    background: var(--paper);
    color: var(--ink);
    padding: clamp(16px, 4vw, 35px);
    border-radius: 14px;
    margin-bottom: 20px;
}

#reader h2 {
    color: #80602c;
    text-align: center;
}

.verse-row {
    padding: 15px 0;
    border-bottom: 1px solid #cdbfa9;
}

.verse-number {
    font-weight: bold;
    color: #80602c;
    margin-bottom: 6px;
}

.verse-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.verse-content.parallel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.verse-text {
    font-family: Georgia, serif;
    font-size: var(--font);
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.verse-edition {
    font-size: 13px;
    font-weight: bold;
    color: #80602c;
    margin-bottom: 8px;
}

.library-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #ffffff22;
}

.available {
    color: #a4e0b0;
}

.pending {
    color: #e4c78e;
}

#status {
    color: var(--gold);
}

body.dark #reader {
    background: #0d1b2b;
    color: #e9e4d9;
}

body.dark #reader h2,
body.dark .verse-number,
body.dark .verse-edition {
    color: var(--gold);
}

body.dark .verse-row {
    border-color: #304052;
}

@media (max-width: 650px) {
    main {
        padding: 12px;
    }

    .grid,
    .verse-content.parallel {
        grid-template-columns: 1fr;
    }

    .toolbar button {
        flex: 1 1 auto;
    }
}

@media print {
    header, footer, .hero, .panel {
        display: none !important;
    }

    body, #reader, body.dark #reader {
        background: white;
        color: black;
    }

    #reader h2,
    .verse-number,
    .verse-edition {
        color: black !important;
    }
}