/* ═══════════════════════════════════════════════════════════════
   IRC Historical Archive — Stylesheet
   Aesthetic: Refined legal archive. Warm parchment tones,
   classical serif typography, quiet institutional authority.
═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --cream:        #f8f5ef;
    --parchment:    #f0ead8;
    --warm-white:   #fdfbf7;
    --navy:         #1a2744;
    --navy-light:   #2d3f6b;
    --gold:         #b8860b;
    --gold-light:   #d4a017;
    --rust:         #8b3a2a;
    --text:         #1c1a16;
    --text-mid:     #3d3a32;
    --text-light:   #6b6457;
    --rule:         #d8d0be;
    --rule-light:   #ebe5d5;
    --shadow:       rgba(26, 39, 68, 0.08);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Source Serif 4', Georgia, serif;
    --font-ui:      'DM Sans', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;

    --max-width: 860px;
    --header-h: 64px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    background: var(--cream);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--navy);
    text-decoration: none;
}
a:hover { color: var(--gold); }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
    background: var(--navy);
    height: var(--header-h);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--gold);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.site-logo {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1.1;
}
.logo-sub {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Header inline search */
.inline-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.search-usc {
    color: rgba(255,255,255,0.6);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
    margin-right: 0.1rem;
}
.search-prefix {
    color: var(--gold-light);
    font-family: var(--font-display);
    font-size: 1.1rem;
    line-height: 1;
}
.search-section,
.search-date {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.search-section::placeholder,
.search-date::-webkit-calendar-picker-indicator { opacity: 0.5; }
.search-section:focus,
.search-date:focus {
    border-color: var(--gold-light);
    background: rgba(255,255,255,0.15);
}
.search-section { width: 90px; }
.search-date    { width: 155px; color-scheme: dark; }
.search-date::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

.search-btn {
    background: var(--gold);
    border: none;
    border-radius: 4px;
    color: var(--navy);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    padding: 0.4rem 0.9rem;
    text-transform: uppercase;
    transition: background 0.2s;
}
.search-btn:hover { background: var(--gold-light); }

/* ── Main ──────────────────────────────────────────────────── */
.site-main {
    flex: 1;
    padding: 3rem 2rem 4rem;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
    background: var(--navy);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 2rem;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
}
.footer-inner a { color: rgba(255,255,255,0.9); }
.footer-inner a:hover { color: var(--gold-light); }
.footer-disclaimer {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: #fff;
    font-weight: 400;
}
.footer-copyright {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
}

/* ══════════════════════════════════════════════════════════════
   HOME PAGE
══════════════════════════════════════════════════════════════ */

.home-wrap {
    max-width: 960px;
    margin: 0 auto;
}

.home-hero {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 4rem;
    align-items: start;
    padding: 2rem 0 4rem;
    border-bottom: 1px solid var(--rule);
}

.home-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 400;
    line-height: 1.15;
    color: var(--navy);
    margin-bottom: 0.3rem;
}
.home-subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
    font-family: var(--font-body);
}
.home-desc {
    font-size: 1rem;
    color: var(--text-mid);
    max-width: 440px;
    line-height: 1.75;
}

/* Home search card */
.home-search-card {
    background: var(--warm-white);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 2rem;
    box-shadow: 0 2px 16px var(--shadow);
}

.home-form { display: flex; flex-direction: column; gap: 1rem; }

.form-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.3rem;
}
.form-hint {
    text-transform: none;
    letter-spacing: 0;
    font-style: italic;
    color: var(--text-light);
    opacity: 0.7;
}

.section-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.section-symbol {
    position: absolute;
    left: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    pointer-events: none;
    line-height: 1;
}
.section-input { padding-left: 1.9rem !important; }

.form-input {
    width: 100%;
    background: var(--cream);
    border: 1px solid var(--rule);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(26,39,68,0.08);
}
.date-input { color-scheme: light; }

.form-submit {
    background: var(--navy);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
    padding: 0.75rem;
    text-transform: uppercase;
    transition: background 0.2s;
    width: 100%;
}
.form-submit:hover { background: var(--navy-light); }

/* Examples */
.home-examples {
    padding: 3rem 0;
    border-bottom: 1px solid var(--rule);
}
.examples-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-mid);
    margin-bottom: 1.25rem;
    font-style: italic;
}
.examples-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.example-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--warm-white);
    border: 1px solid var(--rule);
    border-radius: 3px;
    color: var(--text);
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.example-pill:hover {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}
.pill-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--gold);
}
.example-pill:hover .pill-num { color: var(--gold-light); }

/* About */
.home-about {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    padding: 3rem 0;
}
.about-block h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--navy);
}
.about-block p {
    font-size: 0.875rem;
    color: var(--text-mid);
    line-height: 1.7;
}
.about-block a { color: var(--navy); border-bottom: 1px dotted var(--gold); }
.about-block a:hover { color: var(--gold); }

/* ══════════════════════════════════════════════════════════════
   SECTION PAGE
══════════════════════════════════════════════════════════════ */

.section-wrap {
    max-width: 1080px;
    margin: 0 auto;
}

/* Keep header and nav constrained to text column width */
.sec-header,
.version-nav,
.diff-toggle-bar {
    max-width: 820px;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 1.75rem;
    letter-spacing: 0.03em;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--gold); }
.bc-sep { margin: 0 0.4rem; opacity: 0.5; }

/* Section header */
.sec-header {
    border-bottom: 2px solid var(--navy);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Version navigation */
.version-nav {
    margin-bottom: 1.5rem;
}
.version-nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0;
}

.version-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.5rem 0.9rem;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
    min-width: 180px;
    background: var(--warm-white);
    color: var(--text);
}
.version-btn:hover:not(.disabled) {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}
.version-btn.disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}
.next-btn { justify-content: flex-end; text-align: right; }

.btn-arrow {
    font-size: 1.1rem;
    color: var(--gold);
    flex-shrink: 0;
    line-height: 1;
}
.version-btn:hover:not(.disabled) .btn-arrow { color: var(--gold-light); }

.btn-label { display: flex; flex-direction: column; line-height: 1.3; }
.btn-direction {
    font-size: 0.72rem;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
    font-weight: 500;
}
.btn-date { font-size: 0.82rem; font-family: var(--font-ui); font-weight: 400; }

.version-position {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}
.version-pos-text {
    font-size: 0.82rem;
    font-family: var(--font-ui);
    color: var(--text-light);
    white-space: nowrap;
}
.version-position strong { font-weight: 600; color: var(--navy); }

/* Timeline */
.timeline-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3px;
    padding: 0;
}
.timeline-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rule);
    border: 1px solid var(--rule);
    display: block;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.timeline-pip:hover {
    background: var(--navy-light);
    transform: scale(1.3);
}
.timeline-pip.active {
    background: var(--gold);
    border-color: var(--gold);
    transform: scale(1.3);
}

/* ── Two-column layout ──────────────────────────────────────── */
.section-body-cols {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 2.5rem;
    align-items: start;
}

/* Sidebar */
.section-sidebar { position: sticky; top: calc(var(--header-h) + 1.5rem); }

.sidebar-card {
    background: var(--warm-white);
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--rule-light);
}
.sidebar-item:last-child { border-bottom: none; }

.sidebar-label {
    font-size: 0.68rem;
    font-family: var(--font-ui);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}
.sidebar-value {
    font-size: 0.87rem;
    font-family: var(--font-ui);
    color: var(--text);
    line-height: 1.4;
}
.sidebar-current {
    color: var(--gold);
    font-style: italic;
}
.sidebar-link {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sidebar-link:hover { color: var(--gold); }

/* Pre-1994 coverage warning */
.coverage-warning {
    background: #fff3f3;
    border: 1.5px solid #c0392b;
    border-radius: 4px;
    color: #c0392b;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    line-height: 1.5;
    padding: 0.75rem 1.1rem;
    margin-bottom: 1.5rem;
    max-width: 820px;
}
.sidebar-note {
    font-size: 0.72rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.2rem;
}

/* ── Statutory text ─────────────────────────────────────────── */
.statute-body {
    background: var(--warm-white);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 2.5rem 3rem;
    margin-bottom: 1.5rem;
    font-size: 0.975rem;
    line-height: 1.85;
}

.sec-heading {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--rule-light);
}

.sec-row {
    margin-top: 0.9rem;
    line-height: 1.75;
}

.sec-label {
    font-weight: 400;
    color: var(--text-mid);
    margin-right: 0.3rem;
}

.sec-subhead {
    font-style: italic;
    color: var(--text-mid);
    margin-right: 0.35rem;
}

.sec-body-text {
    color: var(--text);
}

.sec-continuation {
    color: var(--text);
    margin-top: 0.3rem;
}

.sec-text {
    color: var(--text);
    margin-top: 0.3rem;
}

/* Indentation levels */
.indent-0 { padding-left: 0; }
.indent-1 { padding-left: 2rem; }
.indent-2 { padding-left: 4rem; }
.indent-3 { padding-left: 6rem; }
.indent-4 { padding-left: 8rem; }
.indent-5 { padding-left: 10rem; }

/* Source credit */
.source-credit {
    font-size: 0.78rem;
    color: var(--text-light);
    font-style: italic;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--rule);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Prospective amendment notes */
.prospective-notes {
    border-left: 3px solid var(--gold);
    color: var(--text-mid);
    margin: -0.5rem 0 2rem;
    padding: 0.2rem 1rem 0.2rem 1rem;
}
.prospective-notes-label {
    color: var(--gold);
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    margin-bottom: 0.55rem;
    text-transform: uppercase;
}
.prospective-note + .prospective-note {
    border-top: 1px solid var(--rule-light);
    margin-top: 0.8rem;
    padding-top: 0.8rem;
}
.prospective-note-heading {
    color: var(--navy);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.25rem;
}
.prospective-note-text {
    font-size: 0.82rem;
    line-height: 1.65;
}

/* Version history */
.version-history {
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}
.history-toggle {
    width: 100%;
    background: var(--parchment);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-ui);
    font-size: 0.84rem;
    color: var(--text-mid);
    padding: 0.75rem 1.25rem;
    text-align: left;
    letter-spacing: 0.01em;
    transition: background 0.2s;
}
.history-toggle:hover { background: var(--rule-light); }
.toggle-arrow { font-size: 0.9rem; }

.history-list { border-top: 1px solid var(--rule); }
.history-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    border-bottom: 1px solid var(--rule-light);
    font-size: 0.82rem;
    color: var(--text-mid);
    text-decoration: none;
    transition: background 0.15s;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--cream); color: var(--navy); }
.history-current {
    background: var(--parchment);
    font-weight: 400;
    color: var(--navy);
}
.history-date { color: var(--text); font-weight: 400; flex-shrink: 0; }
.history-range { color: var(--text-light); font-size: 0.78rem; flex: 1; }
.history-law {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--gold);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   NOT FOUND PAGE
══════════════════════════════════════════════════════════════ */

.notfound-wrap {
    max-width: 500px;
    margin: 4rem auto;
    text-align: center;
}
.notfound-card {
    background: var(--warm-white);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 3rem 2.5rem;
}
.nf-code {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    color: var(--rule);
    margin-bottom: 1rem;
    line-height: 1;
}
.nf-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--navy);
    margin-bottom: 1rem;
}
.nf-desc {
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}
.nf-btn {
    display: inline-block;
    background: var(--navy);
    border-radius: 4px;
    color: #fff;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    margin-top: 1rem;
    padding: 0.6rem 1.4rem;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s;
}
.nf-btn:hover { background: var(--navy-light); color: #fff; }
.nf-home {
    display: block;
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: var(--text-light);
    text-decoration: none;
}
.nf-home:hover { color: var(--gold); }

/* Multiple active lineages */
.choice-wrap {
    max-width: 640px;
    margin: 4rem auto;
}
.choice-header {
    border-bottom: 2px solid var(--navy);
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
}
.choice-code {
    font-family: var(--font-display);
    font-size: 2.6rem;
    color: var(--rule);
    line-height: 1;
    margin-bottom: 0.8rem;
}
.choice-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--navy);
    margin-bottom: 0.5rem;
}
.choice-desc {
    font-size: 0.92rem;
    color: var(--text-mid);
    line-height: 1.6;
}
.choice-list {
    display: grid;
    gap: 0.75rem;
}
.choice-item {
    display: block;
    background: var(--warm-white);
    border: 1px solid var(--rule);
    border-radius: 4px;
    color: var(--text);
    padding: 1rem 1.1rem;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.choice-item:hover {
    background: var(--cream);
    border-color: var(--navy);
    color: var(--navy);
}
.choice-section-number {
    display: block;
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1.15;
    color: var(--navy);
    margin-bottom: 0.45rem;
}
.choice-section-heading {
    display: block;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text);
    margin-bottom: 0.7rem;
}
.choice-meta {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-light);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */

@media (max-width: 800px) {
    .home-hero { grid-template-columns: 1fr; gap: 2rem; }
    .home-about { grid-template-columns: 1fr; gap: 1.5rem; }
    .header-search { display: none; }
    .statute-body { padding: 1.5rem; }
    .section-body-cols { grid-template-columns: 1fr; }
    .section-sidebar { position: static; }
    .version-nav-inner { flex-wrap: wrap; }
    .version-btn { min-width: 140px; }
}

/* ══════════════════════════════════════════════════════════════
   REDLINE / DIFF
══════════════════════════════════════════════════════════════ */

/* Toggle bar */
.diff-toggle-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.diff-toggle-label {
    font-size: 0.72rem;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
    white-space: nowrap;
}
.diff-toggle-btns {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.diff-toggle-btn {
    border: 1px solid var(--rule);
    border-radius: 3px;
    color: var(--text-mid);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    background: var(--warm-white);
    white-space: nowrap;
}
.diff-toggle-btn:hover:not(.disabled):not(.active) {
    border-color: var(--navy);
    color: var(--navy);
}
.diff-toggle-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.diff-toggle-btn.disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* Diff header banner */
.diff-header {
    background: var(--parchment);
    border: 1px solid var(--rule);
    border-radius: 4px 4px 0 0;
    border-bottom: none;
    padding: 0.6rem 1.25rem;
    font-size: 0.82rem;
    color: var(--text-mid);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.diff-header strong { color: var(--text); }

/* Diff legend */
.diff-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
}
.diff-legend-sample {
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
}

/* Inline diff markup */
.diff-ins {
    color: #1a5fb4;
    text-decoration: underline;
    text-decoration-color: #1a5fb4;
    text-underline-offset: 2px;
    font-weight: 600;
}
.diff-del {
    color: #c0392b;
    text-decoration: line-through;
    text-decoration-color: #c0392b;
    font-weight: 600;
}

/* Unavailable message */
.diff-unavailable {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.9rem;
    padding: 1rem 0;
}
/* ── Full-text search page ─────────────────────────────────────────── */

.search-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.search-title {
    font-family: var(--font-ui);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1.2rem;
}

.search-form {
    margin-bottom: 2rem;
}

.search-input-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.search-text-input {
    flex: 1;
    font-family: var(--font-ui);
    font-size: 1rem;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--rule);
    border-radius: 4px;
    color: var(--ink);
    background: #fff;
    outline: none;
}
.search-text-input:focus {
    border-color: var(--navy);
}

.search-submit-btn {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.search-submit-btn:hover { background: var(--gold); }

.search-hint {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
}
.search-hint code {
    font-family: var(--font-mono, monospace);
    background: #f0f0f0;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

.search-meta {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.2rem;
}

.search-error {
    background: #fff3f3;
    border: 1.5px solid #c0392b;
    border-radius: 4px;
    color: #c0392b;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.search-result {
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    background: #fff;
}
.search-result:hover {
    border-color: var(--navy);
}

.sr-section-num {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.sr-section-num a {
    color: var(--navy);
    text-decoration: none;
}
.sr-section-num a:hover { color: var(--gold); }

.sr-heading {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sr-snippet {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink);
}
.sr-snippet mark {
    background: #fff3b0;
    color: inherit;
    padding: 0 0.1em;
    border-radius: 2px;
}

/* Header search link */
.header-fts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.3rem;
    border-radius: 4px;
    transition: color 0.15s;
    flex-shrink: 0;
}
.header-fts-btn:hover { color: var(--gold); }

/* Full-text search panel on index page */
.fts-search-panel {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
}

.fts-search-heading {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.75rem;
}

.fts-search-form {
    width: 100%;
}

.fts-search-row {
    display: flex;
    gap: 0.6rem;
}

.fts-search-input {
    flex: 1;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--rule);
    border-radius: 4px;
    color: var(--ink);
    background: #fff;
    outline: none;
}
.fts-search-input:focus {
    border-color: var(--navy);
}

.fts-search-btn {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.fts-search-btn:hover { background: var(--gold); }

/* ── Footer feedback link ──────────────────────────────────────────── */

.footer-links {
    margin: 0.5rem 0;
}
.footer-link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.footer-link:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* ── Feedback page ─────────────────────────────────────────────────── */

.feedback-wrap {
    max-width: 620px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.feedback-card {
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 2rem 2rem 2.5rem;
}

.feedback-title {
    font-family: var(--font-ui);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.75rem;
}

.feedback-desc {
    font-family: var(--font-ui);
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feedback-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.feedback-label {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.feedback-hint {
    font-weight: 400;
    color: var(--muted);
    margin-left: 0.3rem;
}

.feedback-required {
    color: #c0392b;
    margin-left: 0.2rem;
}

.feedback-textarea,
.feedback-input {
    font-family: var(--font-ui);
    font-size: 0.92rem;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--rule);
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}
.feedback-textarea:focus,
.feedback-input:focus {
    border-color: var(--navy);
}
.feedback-textarea {
    resize: vertical;
    min-height: 120px;
}

.feedback-ref-note {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
}
.feedback-ref-url {
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    word-break: break-all;
}

.feedback-submit {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-start;
    transition: background 0.15s;
}
.feedback-submit:hover { background: var(--gold); }

.feedback-success {
    background: #f0faf0;
    border: 1.5px solid #27ae60;
    border-radius: 4px;
    padding: 1rem 1.2rem;
    color: #1e7e34;
    font-family: var(--font-ui);
    font-size: 0.92rem;
    margin-bottom: 1.2rem;
}

.feedback-error {
    background: #fff3f3;
    border: 1.5px solid #c0392b;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    color: #c0392b;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

/* Home page search alternative link */
.home-search-alt {
    margin-top: 1rem;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}
.home-search-alt-label {
    color: rgba(255,255,255,0.7);
    margin-right: 0.4rem;
}
.home-search-alt-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.5);
}
.home-search-alt-link:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
}
