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

:root {
    --cream: #f5f0e8;
    --parchment: #e8dfc8;
    --brown-dark: #3b2a1a;
    --brown-mid: #6b4c2a;
    --brown-light: #a07850;
    --green-dark: #2d4a1e;
    --green-mid: #4a7c35;
    --gold: #c8a84b;
    --text: #2a1f14;
    --text-light: #5a4030;
}

body {
    min-height: 100vh;
    background-color: var(--cream);
    background-image:
        radial-gradient(ellipse at 20% 80%, rgba(74, 124, 53, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(107, 76, 42, 0.08) 0%, transparent 50%);
    font-family: 'Georgia', 'Times New Roman', serif;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.container {
    max-width: 680px;
    width: 100%;
    text-align: center;
}

/* Tree illustration */
.crest-illustration {
    margin: 0 auto 1.5rem;
    width: 360px;
}

.crest-illustration img {
    width: 100%;
    height: auto;
    display: block;
}

/* Decorative divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem auto;
    max-width: 320px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--brown-light), transparent);
}

.divider-icon {
    color: var(--gold);
    font-size: 1rem;
    flex-shrink: 0;
}

/* Headings */
.family-name {
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    font-weight: normal;
    letter-spacing: 0.06em;
    color: var(--brown-dark);
    line-height: 1.1;
}

.family-name span {
    display: block;
    font-size: 0.45em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin-bottom: 0.3em;
}

.tagline {
    font-size: 1.05rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.75rem;
    line-height: 1.6;
}

/* Trigger button */
.thought-bubble {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin: 1.8rem auto 2rem;
    padding: 1.1rem 2rem 1rem;
    background: var(--cream);
    border-radius: 10px;
    border: 1.5px solid var(--gold);
    box-shadow: 0 0 0 3px rgba(200,168,75,0.18), 0 4px 18px rgba(107,76,42,0.10);
    cursor: pointer;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    color: var(--brown-dark);
    text-align: center;
    transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
}
.thought-bubble:hover {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(200,168,75,0.32), 0 8px 28px rgba(107,76,42,0.15);
    transform: translateY(-2px);
}
.tb-globe {
    font-size: 1.55rem;
    line-height: 1;
}
.tb-text {
    font-size: 1rem;
    line-height: 1.35;
    color: var(--brown-dark);
    max-width: 18ch;
}
.tb-cue {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    font-style: normal;
    color: var(--brown-light);
    text-transform: uppercase;
    margin-top: 0.15rem;
}

/* Dispersal dialog — fixed-centered across all browsers */
#dispersal-dialog {
    border: none;
    border-radius: 8px;
    padding: 0;
    width: min(720px, 92vw);
    max-height: 86vh;
    overflow: hidden;
    box-shadow: 0 12px 60px rgba(30,18,8,0.32);
    background: var(--cream);
    /* Force true viewport-centre; native UA centering is inconsistent */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}
#dispersal-dialog::backdrop {
    background: rgba(30,18,8,0.52);
    backdrop-filter: blur(3px);
}
.dispersal-inner {
    overflow-y: auto;
    max-height: 86vh;
    padding: 2.5rem 3rem 2.5rem;
    position: relative;
}
.dispersal-close {
    position: absolute;
    top: 1rem;
    right: 1.1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--brown-light);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    z-index: 1;
}
.dispersal-close:hover {
    color: var(--brown-dark);
    background: var(--parchment);
}
.dispersal-article h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    font-weight: normal;
    color: var(--brown-dark);
    letter-spacing: 0.03em;
    margin: 0 0 1.4rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--parchment);
    padding-right: 2.5rem; /* don't run under close button */
}
.dispersal-article p {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.08rem;
    line-height: 1.9;
    color: var(--text);
    margin: 0 0 1.15em;
    text-indent: 1.4em;
}
.dispersal-article p:first-of-type { text-indent: 0; }
.dispersal-article em  { font-style: italic; color: var(--brown-mid); }
.dispersal-article strong { font-weight: 600; color: var(--brown-dark); }

@media (max-width: 600px) {
    .dispersal-inner { padding: 2rem 1.4rem; }
    .dispersal-article h2 { padding-right: 2rem; }
}

/* Etymology section */
.etymology-section {
    margin: 2.5rem auto 0;
    max-width: 680px;
    text-align: left;
}

.etymology-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--parchment);
}

.etym-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.4rem 1.1rem;
    font-family: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brown-light);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.etym-btn:hover {
    color: var(--brown-dark);
}

.etym-btn--active {
    color: var(--brown-dark);
    border-bottom-color: var(--gold);
}

.etym-body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.97rem;
    line-height: 1.85;
    color: var(--text);
}

.etym-body p {
    margin: 0 0 1.1em;
    text-indent: 1.4em;
}

.etym-body p:first-child {
    text-indent: 0;
}

.etym-body em {
    font-style: italic;
    color: var(--brown-mid);
}

.etym-body--hidden {
    display: none;
}

/* Card */
.card {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--parchment);
    border-radius: 4px;
    padding: 2rem 2.5rem;
    margin: 2rem 0;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 20px rgba(59, 42, 26, 0.07);
}

.card p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-light);
}

.card p + p {
    margin-top: 0.75rem;
}

.card a {
    color: var(--brown-light);
    text-decoration: underline;
    text-decoration-color: rgba(160,120,80,0.4);
    text-underline-offset: 2px;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.card a:hover {
    color: var(--gold);
    text-decoration-color: var(--gold);
}

/* Lock badge */
.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--green-dark);
    color: #e8f0e0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.45rem 1rem;
    border-radius: 2rem;
    margin-top: 1.5rem;
}

.lock-badge svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* Footer */
footer {
    margin-top: 2.5rem;
    font-size: 0.78rem;
    color: var(--brown-light);
    letter-spacing: 0.04em;
    opacity: 0.7;
}

@media (max-width: 480px) {
    .card {
        padding: 1.5rem;
    }
}

/* ── Login page extras ───────────────────────────────────────────────────── */

.login-label {
    display: block;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin-bottom: 0.5rem;
}

.login-input {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--parchment);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: rgba(255,255,255,0.7);
    color: var(--text);
    margin-bottom: 1rem;
    transition: border-color 0.15s;
}
.login-input:focus {
    outline: none;
    border-color: var(--brown-light);
}

.login-btn {
    width: 100%;
    padding: 0.7rem 1.5rem;
    background: var(--green-dark);
    color: #e8f0e0;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.15s;
}
.login-btn:hover { background: var(--green-mid); }

.login-error {
    background: #fdf0ef;
    border: 1px solid #e4aba7;
    color: #8b2020;
    padding: 0.6rem 0.85rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* ── App shell ───────────────────────────────────────────────────────────── */

body.app-page {
    min-height: 100vh;
    display: block;
    background: #f8f4ee;
    padding: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: var(--text);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--brown-dark);
    padding: 0 1.5rem;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-brand {
    color: #e8d8c0;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.site-brand:hover { color: #fff; }

.app-nav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.app-nav a {
    color: #c8b898;
    text-decoration: none;
    font-size: 0.82rem;
    padding: 0.3rem 0.65rem;
    border-radius: 3px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.04em;
    transition: color 0.12s, background 0.12s;
}
.app-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.app-nav .nav-logout { border: 1px solid rgba(200,184,152,0.3); }

.app-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.app-footer {
    border-top: 1px solid var(--parchment);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.78rem;
    color: var(--brown-light);
    opacity: 0.7;
}

/* ── Common page elements ────────────────────────────────────────────────── */

.page-header {
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--parchment);
    padding-bottom: 1rem;
}
.page-title {
    font-size: 1.8rem;
    font-weight: normal;
    color: var(--brown-dark);
    letter-spacing: 0.03em;
}
.page-sub {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    font-style: italic;
}

.breadcrumb {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}
.breadcrumb a { color: var(--brown-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.3em; }

.section-title {
    font-size: 0.78rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin-bottom: 0.75rem;
}
.sub-section-title {
    font-size: 0.75rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
    margin: 1rem 0 0.5rem;
}

.info-section {
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--parchment);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 3px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.btn-outline {
    border: 1px solid var(--brown-light);
    color: var(--brown-mid);
    background: transparent;
}
.btn-outline:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

a.person-link {
    color: var(--green-dark);
    text-decoration: none;
    font-weight: 500;
}
a.person-link:hover { text-decoration: underline; color: var(--green-mid); }

.dates { font-size: 0.82rem; color: var(--text-light); margin-left: 0.35em; }
.error { color: #8b2020; padding: 1rem; background: #fdf0ef; border-radius: 4px; }

/* ── Browse / tree.php ───────────────────────────────────────────────────── */

.search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.search-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--parchment);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    width: 260px;
    max-width: 100%;
}
.search-input:focus { outline: none; border-color: var(--brown-light); }
.search-btn {
    padding: 0.5rem 1rem;
    background: var(--green-dark);
    color: #e8f0e0;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
}
.search-btn:hover { background: var(--green-mid); }
.search-clear { font-size: 0.82rem; color: var(--text-light); text-decoration: none; padding: 0.3rem; }
.search-clear:hover { color: var(--brown-dark); }
.sort-label { font-size: 0.78rem; color: var(--text-light); margin-left: 0.5rem; }
.sort-link { font-size: 0.82rem; color: var(--brown-mid); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 3px; }
.sort-link.active { background: var(--parchment); font-weight: 600; }
.results-count { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.75rem; font-style: italic; }
.no-results { color: var(--text-light); padding: 2rem 0; text-align: center; font-style: italic; }

.people-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
    border: 1px solid var(--parchment);
    border-radius: 4px;
    overflow: hidden;
}
.people-table thead th {
    background: var(--brown-dark);
    color: #e8d8c0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.6rem 0.85rem;
    text-align: left;
}
.people-table tbody tr:nth-child(even) { background: #faf7f2; }
.people-table tbody tr:hover { background: #f0eadf; }
.people-table td { padding: 0.55rem 0.85rem; border-bottom: 1px solid #f0eadf; }
.people-table .surname { font-variant: small-caps; }
.year-cell { color: var(--text-light); font-size: 0.85rem; white-space: nowrap; }
.place-cell { color: var(--text-light); font-size: 0.85rem; }

.sex-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    padding: 0.1em 0.4em;
    border-radius: 2px;
    margin-left: 0.3em;
    vertical-align: middle;
    text-transform: uppercase;
}
.sex-m { background: #d8e8f0; color: #1a4a6b; }
.sex-f { background: #f0d8e8; color: #6b1a4a; }

/* ── Person profile ──────────────────────────────────────────────────────── */

.person-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.person-name {
    font-size: 2rem;
    font-weight: normal;
    color: var(--brown-dark);
    letter-spacing: 0.03em;
}
.person-surname { font-variant: small-caps; }
.person-meta {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-top: 0.3rem;
    font-style: italic;
}
.life-dates { font-style: normal; font-weight: 500; }
.person-actions { display: flex; gap: 0.5rem; flex-shrink: 0; padding-top: 0.25rem; }
.person-body { display: flex; flex-direction: column; gap: 1rem; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table th {
    text-align: left;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 500;
    width: 100px;
    padding: 0.4rem 0.5rem 0.4rem 0;
    vertical-align: top;
}
.info-table td { padding: 0.4rem 0.5rem 0.4rem 0; font-size: 0.92rem; }
.info-table tr + tr th,
.info-table tr + tr td { border-top: 1px solid var(--parchment); }

.family-grid { display: grid; grid-template-columns: 90px 1fr; gap: 0.4rem 0.5rem; align-items: baseline; }
.family-role {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    padding-top: 0.15rem;
}
.sibling-list { display: flex; flex-direction: column; gap: 0.2rem; }

.marr-detail { font-size: 0.88rem; color: var(--text-light); font-style: italic; margin-bottom: 0.5rem; }
.child-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.child-list li { font-size: 0.92rem; }
.birth-place { font-size: 0.82rem; color: var(--text-light); }

.sources-section .source-list {
    list-style: none;
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.6;
    word-break: break-word;
}
.source-list li + li { margin-top: 0.25rem; }

/* ── Pedigree chart ──────────────────────────────────────────────────────── */

.pedigree-wrap { overflow-x: auto; }

.pedigree-chart {
    display: flex;
    gap: 0;
    min-height: 660px;
    min-width: 680px;
}

.pedigree-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-right: 1px solid var(--parchment);
}
.pedigree-col:last-child { border-right: none; }

.pedigree-col-label {
    text-align: center;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin-bottom: 0.5rem;
}

.pedigree-slot {
    border: 1px solid var(--parchment);
    border-radius: 4px;
    padding: 0.5rem 0.6rem;
    text-align: center;
    background: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
}
.pedigree-slot.sex-m { border-left: 3px solid #6aadce; }
.pedigree-slot.sex-f { border-left: 3px solid #ce6aad; }
.pedigree-slot.empty {
    opacity: 0.35;
    background: transparent;
    border-style: dashed;
    color: var(--text-light);
    font-size: 0.75rem;
}

.pedigree-name { color: var(--green-dark); text-decoration: none; font-size: 0.82rem; display: block; }
.pedigree-name:hover { text-decoration: underline; }
.pedigree-name strong { font-variant: small-caps; display: block; }
.pedigree-dates { font-size: 0.72rem; color: var(--text-light); }
.pedigree-place { font-size: 0.7rem; color: var(--brown-light); }
.pedigree-unknown { font-size: 0.75rem; color: var(--text-light); }
.pedigree-note { font-size: 0.78rem; color: var(--text-light); margin-top: 1rem; font-style: italic; }
.pedigree-note a { color: var(--brown-mid); }

/* ── Descendants ─────────────────────────────────────────────────────────── */

.desc-tree, .desc-children {
    list-style: none;
    padding-left: 1.5rem;
}
.desc-tree { padding-left: 0; }

.desc-person {
    margin: 0.4rem 0;
    font-size: 0.92rem;
    position: relative;
    padding-left: 1rem;
}
.desc-person::before {
    content: '\2514';
    position: absolute;
    left: 0;
    color: var(--brown-light);
    font-size: 0.8rem;
}
.desc-tree > .desc-person::before { content: ''; }

.desc-times { color: var(--gold); font-size: 0.85rem; margin: 0 0.2em; }
a.desc-spouse { color: var(--text-light); font-weight: normal; }
a.desc-spouse:hover { color: var(--green-dark); }

/* ── Statistics ──────────────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-wide { grid-column: 1 / -1; }

.stat-card {
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--parchment);
    border-radius: 4px;
    padding: 1.25rem 1rem;
    text-align: center;
}
.stat-number {
    font-size: 2rem;
    font-weight: normal;
    color: var(--brown-dark);
    line-height: 1;
}
.stat-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: 0.4rem;
}
.stat-label a { color: var(--green-dark); }

.stats-columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.freq-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.freq-table th {
    text-align: left;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--parchment);
}
.freq-table td { padding: 0.3rem 0; border-bottom: 1px solid #f0eadf; }
.freq-table td:last-child { text-align: right; color: var(--text-light); }
.freq-table a { color: var(--green-dark); text-decoration: none; }
.freq-table a:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .app-main { padding: 1rem 1rem 3rem; }
    .person-header { flex-direction: column; }
    .person-name { font-size: 1.5rem; }
    .pedigree-chart { min-width: 560px; min-height: 500px; }
    .stats-columns { grid-template-columns: 1fr; }
}

/* ── SVG animations ──────────────────────────────────────────────────────── */

@keyframes dashIn {
    to { stroke-dashoffset: 0; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Header brand tree icon ──────────────────────────────────────────────── */

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-tree { flex-shrink: 0; }

/* ── Person heraldic shield ──────────────────────────────────────────────── */

.person-shield {
    flex-shrink: 0;
    align-self: flex-start;
}

/* ── Branch icon before section titles ──────────────────────────────────── */

.branch-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.4em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 13V5M7 9 L3 5M7 7 L11 3' stroke='%23a07850' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.75;
}

/* ── Stats decade chart ──────────────────────────────────────────────────── */

.chart-section { overflow: hidden; }

.decade-chart {
    display: block;
    max-width: 100%;
}

.decade-bar {
    transition: opacity 0.15s;
}
.decade-bar:hover { opacity: 0.8; }

/* ── Homepage floating name animation ───────────────────────────────────── */

#name-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

#name-canvas span {
    position: absolute;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: var(--brown-dark);
    white-space: nowrap;
    line-height: 1.5;
    opacity: 0;
    user-select: none;
    letter-spacing: 0.01em;
}

@keyframes nameFloat {
    0%   { opacity: 0;                  transform: translateY(calc(var(--rise, 24px) * .6));   }
    18%  { opacity: var(--peak, .12);   transform: translateY(calc(var(--rise, 24px) * .25));  }
    78%  { opacity: var(--peak, .12);   transform: translateY(0);                              }
    100% { opacity: 0;                  transform: translateY(calc(var(--rise, 24px) * -.4));  }
}

/* container sits above the canvas */
.container { position: relative; z-index: 1; }

/* ── Pedigree SVG overlay ────────────────────────────────────────────────── */

.pedigree-svg { z-index: 1; }

/* slots sit above the SVG layer */
.pedigree-slot { position: relative; z-index: 2; }

/* ── Family overview (5-column chart on person page) ────────────────────── */

.fov-chart {
    position: relative;
    display: flex;
    gap: 1rem;
    align-items: stretch;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.fov-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: space-around;
    flex: 1;
    min-width: 120px;
    position: relative;
    z-index: 2;
}

.fov-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.45rem 0.55rem;
    border-radius: 4px;
    border-left: 3px solid var(--gold);
    background: var(--parchment);
    text-decoration: none;
    color: var(--brown-dark);
    font-size: 0.78rem;
    line-height: 1.35;
    min-height: 52px;
    transition: background 0.15s, border-color 0.15s;
}

.fov-slot:hover {
    background: #ede3cc;
    border-left-color: var(--brown-dark);
}

.fov-slot.sex-m { border-left-color: #5b8db8; }
.fov-slot.sex-f { border-left-color: #b85b8d; }
.fov-slot.sex-m:hover { border-left-color: #3a6a9a; }
.fov-slot.sex-f:hover { border-left-color: #943a72; }

.fov-self {
    border: 2px solid var(--gold);
    border-left-width: 3px;
    background: #f5ecd0;
    font-weight: 600;
}

.fov-empty {
    background: transparent;
    border: 1px dashed var(--parchment-border, #c8b48a);
    border-left: 1px dashed var(--parchment-border, #c8b48a);
    opacity: 0.4;
    pointer-events: none;
    min-height: 52px;
}

.fov-name {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.78rem;
    color: var(--brown-dark);
}

.fov-dates {
    display: block;
    font-size: 0.68rem;
    color: var(--brown-light);
    margin-top: 0.1rem;
}

.fov-svg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* ── Family Browser ─────────────────────────────────────────────────────── */

.fb-browser {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 0.5rem 2rem;
    overflow-x: auto;
}

.fb-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.fb-middle {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.fb-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.fb-group-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.fb-siblings { align-items: flex-end; }
.fb-spouses  { align-items: flex-start; }

.fb-siblings .fb-card,
.fb-spouses  .fb-card { width: 88px; }

.fb-self-anchor { flex-shrink: 0; }

.fb-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 0.45rem 0.3rem 0.5rem;
    border-radius: 8px;
    width: 98px;
    transition: background 0.15s;
    position: relative;
    z-index: 2;
}

.fb-card:hover { background: rgba(178, 148, 89, 0.12); }

.fb-card--self { width: 120px; }

.fb-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold);
    margin-bottom: 0.3rem;
    flex-shrink: 0;
    background: var(--parchment);
}

.fb-card--self .fb-photo {
    width: 80px;
    height: 80px;
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(200, 168, 75, 0.2);
}

.fb-card.sex-m .fb-photo { border-color: #5b8db8; }
.fb-card.sex-f .fb-photo { border-color: #b85b8d; }
.fb-card--self.sex-m .fb-photo { box-shadow: 0 0 0 4px rgba(91, 141, 184, 0.2); }
.fb-card--self.sex-f .fb-photo { box-shadow: 0 0 0 4px rgba(184, 91, 141, 0.2); }

.fb-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fb-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.4rem;
    color: var(--gold);
    opacity: 0.55;
}

.fb-card--self .fb-initial {
    font-size: 1.9rem;
    opacity: 0.75;
}

.fb-role {
    font-size: 0.57rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 0.1rem;
}

.fb-name {
    font-size: 0.69rem;
    font-family: Georgia, 'Times New Roman', serif;
    text-align: center;
    color: var(--brown-dark);
    line-height: 1.3;
    word-break: break-word;
}

.fb-card--self .fb-name {
    font-size: 0.82rem;
    font-weight: 600;
}

.fb-dates {
    font-size: 0.62rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.15rem;
    line-height: 1.3;
}

.fb-more {
    font-size: 0.66rem;
    color: var(--text-light);
    font-style: italic;
    padding: 0.3rem 0.2rem;
    align-self: center;
}

.fb-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

@media (max-width: 480px) {
    .fb-middle { gap: 0.75rem; }
    .fb-card { width: 82px; }
    .fb-card--self { width: 100px; }
    .fb-siblings .fb-card,
    .fb-spouses  .fb-card { width: 76px; }
    .fb-photo { width: 44px; height: 44px; }
    .fb-card--self .fb-photo { width: 64px; height: 64px; }
    .fb-name { font-size: 0.62rem; }
    .fb-card--self .fb-name { font-size: 0.72rem; }
}

/* ── Login page ──────────────────────────────────────────────────────────── */

.login-label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin-bottom: 0.3rem;
    margin-top: 1.1rem;
}
.login-label:first-of-type { margin-top: 0; }

.login-input {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #c4b08a;
    border-radius: 4px;
    background: #fdf7ee;
    color: var(--brown-dark);
    font-size: 0.92rem;
    box-sizing: border-box;
}
.login-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200,168,75,0.2); }

.login-btn {
    display: block;
    width: 100%;
    margin-top: 1.4rem;
    padding: 0.65rem;
    background: var(--gold);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.15s;
}
.login-btn:hover { background: #b0943a; }

.login-error {
    background: #fbe9e7;
    color: #b00;
    border-left: 3px solid #b00;
    padding: 0.5rem 0.75rem;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ── Admin / edit pages ──────────────────────────────────────────────────── */

.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #c8b48a;
}

.admin-tab {
    padding: 0.4rem 1rem;
    text-decoration: none;
    color: var(--brown-light);
    font-size: 0.85rem;
    border-radius: 4px 4px 0 0;
    letter-spacing: 0.04em;
}
.admin-tab:hover  { background: var(--parchment); color: var(--brown-dark); }
.admin-tab.active { background: var(--cream); color: var(--brown-dark); font-weight: 600; border: 1px solid #c8b48a; border-bottom: 1px solid var(--cream); margin-bottom: -1px; }

.req-card {
    background: var(--parchment);
    border: 1px solid #c8b48a;
    border-radius: 6px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

.req-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.req-person-link { font-size: 0.75rem; color: var(--brown-light); }
.req-meta { font-size: 0.8rem; color: var(--brown-light); margin-left: auto; }
.req-summary { font-style: italic; font-size: 0.85rem; color: var(--brown-light); margin: 0.4rem 0 0.8rem; }

.diff-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-bottom: 0.75rem; }
.diff-table th { text-align: left; padding: 0.25rem 0.5rem; background: #e8dcc4; font-weight: 600; }
.diff-table td { padding: 0.25rem 0.5rem; border-top: 1px solid #d8c8a8; vertical-align: top; }
.diff-old { color: #8a4040; text-decoration: line-through; }
.diff-new { color: #2d6b2d; font-weight: 500; }

.req-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.review-note { flex: 1; min-width: 200px; padding: 0.4rem 0.6rem; border: 1px solid #c4b08a; border-radius: 4px; font-size: 0.85rem; background: #fdf7ee; color: var(--brown-dark); }

.status-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; }
.status-pending  { background: #fff3cd; color: #856404; }
.status-approved { background: #d4edda; color: #155724; }
.status-rejected { background: #f8d7da; color: #721c24; }

.role-badge { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 3px; font-size: 0.72rem; letter-spacing: 0.04em; }
.role-member    { background: #e2e8f0; color: #334155; }
.role-superuser { background: #fef3c7; color: #92400e; }

.admin-create-user { margin-top: 2rem; }

.edit-form { max-width: 620px; }

.edit-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
    align-items: start;
    margin-bottom: 0.6rem;
}

.edit-label {
    padding-top: 0.55rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brown-light);
}

.edit-input {
    padding: 0.5rem 0.65rem;
    border: 1px solid #c4b08a;
    border-radius: 4px;
    background: #fdf7ee;
    color: var(--brown-dark);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}
.edit-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200,168,75,0.2); }
textarea.edit-input { resize: vertical; line-height: 1.5; }
select.edit-input   { cursor: pointer; }

.edit-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; align-items: center; }

.edit-person-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--parchment);
    border: 1px solid #c8b48a;
    border-radius: 6px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.5rem;
}
.edit-person-banner strong { display: block; font-family: Georgia, serif; }
.edit-person-banner .dates { font-size: 0.82rem; color: var(--brown-light); }

/* ── Shared buttons ──────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.btn-primary  { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-primary:hover { background: #b0943a; border-color: #b0943a; }
.btn-outline  { background: transparent; color: var(--brown-dark); border-color: #c4b08a; }
.btn-outline:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-danger   { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #a93226; }
.btn-sm       { padding: 0.25rem 0.6rem; font-size: 0.78rem; }
.btn-home-active { border-color: var(--gold); color: var(--gold); }

/* ── Notices ─────────────────────────────────────────────────────────────── */

.notice {
    padding: 0.6rem 0.9rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}
.notice-ok   { background: #d4edda; color: #155724; border-left: 3px solid #28a745; }
.notice-warn { background: #fff3cd; color: #856404; border-left: 3px solid #ffc107; }

/* ── Nav additions ───────────────────────────────────────────────────────── */

.pending-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    border-radius: 10px;
    padding: 0 0.4em;
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 0.2em;
    line-height: 1.5;
}

.nav-admin { font-weight: 600; }
.nav-user  { color: var(--brown-light); font-size: 0.82rem; padding: 0 0.25rem; text-decoration: none; }
.nav-user:hover { color: var(--brown-dark); text-decoration: underline; }

/* ── Language switcher (in header) ──────────────────────────────────────── */

.lang-switcher {
    display: flex;
    gap: 2px;
    align-items: center;
}

.lang-btn {
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--brown-light);
    text-decoration: none;
    border: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.lang-btn:hover  { color: var(--brown-dark); }
.lang-btn.active { color: var(--brown-dark); border-color: #c4b08a; background: var(--parchment); }

/* ── Login page language selector ────────────────────────────────────────── */

.login-lang-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0 0.4rem;
    font-size: 0.82rem;
    color: var(--brown-light);
}

.login-lang-label {
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.login-lang-opt {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    color: var(--brown-dark);
}

.muted { color: var(--brown-light); font-style: italic; }

/* ── Person picker (admin create-user) ───────────────────────────────────── */

.person-picker { position: relative; }

.person-picker-results {
    position: absolute;
    top: calc(100% + 2px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #c4b08a;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
}

.picker-item {
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--brown-dark);
    border-bottom: 1px solid #f0e8d8;
}
.picker-item:last-child { border-bottom: none; }
.picker-item:hover { background: var(--parchment); }

.person-picker-chosen {
    margin-top: 0.35rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.picker-chosen-name { color: var(--brown-dark); }

.picker-clear {
    background: none;
    border: none;
    color: var(--brown-light);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.2rem;
}
.picker-clear:hover { color: #c04040; }

/* ── Relationship path ───────────────────────────────────────────────────── */

.rel-path {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0;
}

.rel-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rel-step + .rel-step::before {
    content: '';
    display: block;
}

.rel-arrow {
    color: var(--gold);
    font-size: 0.75rem;
    opacity: 0.7;
    transform: rotate(-90deg);
    display: inline-block;
    margin: 0 0.1rem;
}

.rel-label {
    font-size: 0.72rem;
    color: var(--brown-light);
    letter-spacing: 0.03em;
    font-style: italic;
    margin-right: 0.1rem;
}

.rel-name {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    text-decoration: none;
    color: var(--brown-dark);
    font-size: 0.88rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.rel-name:hover    { background: var(--parchment); border-color: #c8b48a; }
.rel-name .dates   { font-size: 0.72rem; color: var(--brown-light); }

.rel-self { border-color: #c8b48a; background: var(--parchment); font-weight: 600; }
.rel-home { border-color: var(--gold); color: var(--gold); font-weight: 600; }

.rel-path-section { margin-top: 1rem; }

.div-detail {
    font-size: 0.85rem;
    color: var(--brown-light);
    margin: 0.1rem 0 0.4rem;
    font-style: italic;
}
.div-detail::before { content: '⚮ '; }

.marr-edit-link { margin: 0.3rem 0 0.6rem; }
.edit-link-small {
    font-size: 0.78rem;
    color: var(--brown-light);
    text-decoration: none;
    letter-spacing: 0.02em;
}
.edit-link-small:hover { color: var(--brown-dark); text-decoration: underline; }

.page-header { margin-bottom: 1.5rem; }
.page-title  { font-family: Georgia, serif; font-size: 1.4rem; color: var(--brown-dark); margin: 0 0 0.3rem; }
.page-sub    { color: var(--brown-light); font-size: 0.88rem; margin: 0; }

/* ── Life summary ─────────────────────────────────────────────────────────── */

.life-summary-details { margin-top: 2rem; }

.life-summary-toggle {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--brown-dark);
    padding: 0.5rem 0;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.life-summary-toggle::-webkit-details-marker { display: none; }
.life-summary-toggle::before { content: '▶'; font-size: 0.65em; color: var(--gold); }
.life-summary-details[open] .life-summary-toggle::before { content: '▼'; }

.life-summary-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}
@media (max-width: 680px) { .life-summary-columns { grid-template-columns: 1fr; } }

.life-summary-pane {
    background: var(--parchment);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bio-text {
    font-size: 0.93rem;
    line-height: 1.7;
    white-space: pre-wrap;
    color: var(--text);
}

.bio-textarea {
    width: 100%;
    font-size: 0.91rem;
    line-height: 1.65;
    resize: vertical;
    font-family: inherit;
}

.bio-edit-form { margin-top: 0; }

/* Person portrait photo */
.person-photo {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--gold);
    display: block;
}

/* Media thumbnail grid (view mode) */
.media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.media-thumb {
    width: 110px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
}
.media-thumb--portrait { outline: 2px solid var(--gold); border-radius: 6px; padding: 3px; }
.media-thumb-link {
    display: block;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--parchment);
    position: relative;
}
.media-thumb-link img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s; }
.media-thumb-link:hover img { opacity: .85; }
.media-badge {
    position: absolute;
    bottom: 4px; left: 4px;
    background: var(--gold);
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: .03em;
    pointer-events: none;
}
.media-caption {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.3;
    margin: 0;
}

/* Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 900;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.lightbox-overlay.lightbox-open { display: flex; }
.lightbox-inner {
    max-width: min(90vw, 900px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0,0,0,.6);
    object-fit: contain;
}
.lightbox-caption {
    color: rgba(255,255,255,.75);
    font-size: 0.875rem;
    text-align: center;
    margin: 0;
}

.life-summary-lang {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--gold);
}

.life-summary-text {
    font-size: 0.91rem;
    line-height: 1.7;
    color: var(--text);
    flex: 1;
}
.life-summary-text p { margin: 0 0 0.7em; }
.life-summary-text p:last-child { margin-bottom: 0; }

/* ── Featured persons (index page) ─────────────────────────────────────────── */
.featured-section {
    margin: 0 auto 2rem;
    max-width: 340px;
    text-align: center;
}
.featured-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin: 0 0 0.75rem;
}
.featured-card {
    display: block;
    text-decoration: none;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(160,120,80,0.3);
    border-radius: 10px;
    padding: 1.75rem 1.5rem 1.5rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    color: inherit;
    box-shadow: 0 2px 12px rgba(60,40,20,0.07);
}
.featured-card:hover {
    border-color: var(--gold);
    background: rgba(255,255,255,0.75);
    box-shadow: 0 4px 20px rgba(60,40,20,0.12);
}
.featured-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto 1.1rem;
    overflow: hidden;
    border: 2px solid var(--gold);
    background: var(--parchment);
    display: flex;
    align-items: center;
    justify-content: center;
}
.featured-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.featured-initial {
    font-family: Georgia, serif;
    font-size: 2.8rem;
    color: var(--gold);
    line-height: 1;
}
.featured-name {
    font-family: Georgia, serif;
    font-size: 1.35rem;
    color: var(--brown-dark);
    margin-bottom: 0.2rem;
}
.featured-surname {
    font-variant: small-caps;
}
.featured-dates {
    font-size: 0.82rem;
    color: var(--brown-light);
    margin-bottom: 0.9rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}
.featured-bio {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-light);
    margin-bottom: 1.1rem;
    font-style: italic;
    text-align: left;
}
.featured-link {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--brown-light);
}
.featured-card:hover .featured-link { color: var(--gold); }

/* ── Anniversary / this week (index page) ───────────────────────────────────── */
.anniversary-section {
    margin: 0 auto 2rem;
    max-width: 480px;
    text-align: center;
}
.anniversary-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin: 0 0 0.75rem;
}
.anniversary-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.anniversary-row {
    display: grid;
    grid-template-columns: 1.2rem 3.2rem 1fr auto auto;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.45);
    border: 1px solid rgba(160,120,80,0.18);
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    text-align: left;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.82rem;
    transition: background 0.15s, border-color 0.15s;
}
.anniversary-row:hover {
    background: rgba(255,255,255,0.7);
    border-color: rgba(160,120,80,0.35);
}
.anniversary-today {
    background: rgba(200,168,75,0.1);
    border-color: rgba(200,168,75,0.4);
}
.anniversary-icon {
    color: var(--gold);
    font-size: 0.75rem;
    text-align: center;
}
.anniversary-date {
    color: var(--brown-light);
    font-size: 0.78rem;
    white-space: nowrap;
    font-weight: 500;
}
.anniversary-name {
    color: var(--brown-dark);
    font-weight: 500;
    font-family: Georgia, serif;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.anniversary-meta {
    color: var(--text-light);
    font-size: 0.75rem;
    white-space: nowrap;
}
.anniversary-when {
    font-size: 0.72rem;
    color: var(--brown-light);
    white-space: nowrap;
    font-style: italic;
}
.anniversary-today .anniversary-when {
    color: var(--gold);
    font-weight: 600;
    font-style: normal;
}

/* ── Active/toggled button state ────────────────────────────────────────────── */
.btn-active {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}
