/* Shared visual layer. Page-specific layout and interaction rules live in site.css. */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f3f4ef;
  --bg-soft: #f8f9f5;
  --panel: #fffdf8;
  --ink: #203a36;
  --ink-strong: #19352f;
  --muted: #596b65;
  --accent: #28574f;
  --accent-dark: #193f38;
  --accent-strong: #193f38;
  --accent-soft: #e7efec;
  --brass: #a57c41;
  --line: #dce3dc;
  --shadow: 0 3px 12px rgb(32 58 54 / 4%);
  --radius: 10px;
  --font-ui: "Source Sans 3", "Trebuchet MS", sans-serif;
  --font-heading: "Newsreader", "Palatino Linotype", serif;
  --bs-body-font-family: var(--font-ui);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent-dark);
  --bs-code-color: var(--accent);
}

body {
  background: radial-gradient(ellipse at 85% 0, #e6ece4 0, transparent 45%), var(--bg);
  font-family: var(--font-ui);
  font-size: 0.98rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .navbar-brand, .footer-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.025em;
}
h1, .h2 { font-size: clamp(1.65rem, 2.8vw, 2.2rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
a { text-underline-offset: 3px; }
strong { font-weight: 650; }
code { color: var(--accent); font-size: 0.85em; }
::selection { color: #fff; background: var(--accent); }
.container { width: 100%; max-width: 1400px; padding-inline: 24px; }
.site-chrome { min-height: 100vh; display: flex; flex-direction: column; }
.page-shell { flex: 1; padding: 24px 0 28px; }
.site-header { width: 100%; padding: 0; border-top: 3px solid var(--accent); border-bottom: 1px solid var(--line); background: var(--panel); }
.navbar { padding: 0; border: 0; border-radius: 0; background: transparent; backdrop-filter: none; box-shadow: none; }
.navbar > .container { min-height: 80px; padding-block: 2px !important; gap: 18px; }
.navbar-brand.brand-mark { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0; padding: 0; }
.site-logo { display: block; width: 76px; height: 76px; flex-shrink: 0; object-fit: contain; }
.brand-copy { display: grid; gap: 1px; }
.brand-name { font-family: var(--font-heading); font-size: 1.85rem; line-height: 1; letter-spacing: -0.04em; color: var(--ink); }
.brand-kicker { font-family: var(--font-ui); font-size: 0.63rem; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.navbar-nav { gap: 3px !important; }
.nav-link { padding: 7px 10px !important; font-family: var(--font-ui); font-size: 0.92rem; font-weight: 600; border-radius: 6px; }
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark) !important; }
.nav-account { border: 1px solid var(--line); }
.navbar-toggler { padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.navbar-toggler-icon { width: 22px; height: 22px; }
.breadcrumb { margin-bottom: 12px !important; font-size: 0.8rem; }
.breadcrumb a { color: var(--accent); }
.eyebrow, .feature-kicker, .panel-title { margin-bottom: 6px; color: var(--accent); font-size: 0.67rem; letter-spacing: 0.13em; font-weight: 700; }
.text-link { color: var(--accent); font-weight: 650; }
.text-link:hover { color: var(--accent-dark); text-decoration: underline; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus, .nav-link:focus { box-shadow: 0 0 0 3px rgb(40 87 79 / 14%); }
.form-control:focus, .form-select:focus { border-color: var(--accent); }
.form-check-input:checked { border-color: var(--accent); background-color: var(--accent); }

/* Dense controls remain comfortably readable and keyboard accessible. */
.btn-accent, .btn-ghost, .btn-sm.btn-accent, .btn-sm.btn-ghost, .btn.btn-sm {
  min-height: 34px; padding: 6px 13px; border-radius: 6px; font-size: 0.86rem; line-height: 1.2; font-weight: 600; border: 1px solid transparent;
}
.btn.btn-accent { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn.btn-accent:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.btn-ghost { color: var(--ink); border-color: var(--line); background: var(--panel); }
.btn.btn-ghost:hover { color: var(--accent-dark); border-color: #a3b8ab; background: var(--accent-soft); }
.btn.disabled { opacity: 0.48; }
.hero-actions { gap: 7px; margin-top: 12px; }
.form-control, .form-control-lg, .form-select { min-width: 0; min-height: 38px; padding: 7px 11px; border: 1px solid #cbd6cc; border-radius: 6px; font-size: 0.95rem; color: var(--ink); background-color: #fff; }
.form-control::placeholder { color: #6f7c75; }
.form-label, .home-search label { margin-bottom: 5px; font-size: 0.83rem; font-weight: 600; }
.lead { max-width: 80ch; margin: 7px 0 8px; color: var(--muted); font-size: 0.97rem; line-height: 1.45; }
.feature-card, .hero-copy, .hero-panel, .search-form, .search-hero, .person-hero, .ancestor-shell,
.private-hero-copy, .private-hero-panel, .private-metric-card { border-color: var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.feature-card, .hero-copy, .hero-panel, .search-form, .private-hero-copy, .private-hero-panel { padding: 16px 18px; }
.feature-card h2:not(.h5):not(.h6), .login-panel h1.h2 { margin-bottom: 8px; font-size: 1.5rem; }
.search-shell { gap: 16px; }
.search-hero { padding: 16px 20px; margin-bottom: 12px; }
.search-hero > .container, .search-hero > .container-fluid { padding: 0; }
.search-hero h1 { margin-bottom: 5px; }
.search-hero .hero-side-image, .search-hero .hero-lazy-img { width: 170px !important; max-width: 100%; height: 98px; min-height: 0; object-fit: contain; box-shadow: none; }
.search-hero .archive-illustration { width: min(100%, 280px) !important; height: 180px; object-fit: contain; }
.search-hero .lead { max-width: 90ch; }
.search-stat { margin-top: 6px; font-size: 0.83rem; }
.search-stat strong { color: var(--accent); }
.search-hero-results .hero-side-image { display: none; }
.search-hero-results .search-copy { width: 100%; }
.search-hero-results { padding: 0 0 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.search-hero-results .search-stat { margin-bottom: 0; }
.search-input-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.search-input-row > .btn { min-height: 38px; }
.search-filter-row { gap: 8px; margin-top: 8px; font-size: 0.82rem; }
.results-header { align-items: center; }
.results-header h2 { margin-bottom: 2px; font-size: 1.35rem; }
.results-header p { font-size: 0.85rem; }
.register-section { gap: 8px; }
.register-section-header { align-items: center; gap: 8px; }
.register-section-header h2 { font-size: 1.5rem; }
.register-section-header .feature-kicker { margin-bottom: 3px; }

/* Homepage: editorial identity, immediate search, short routes into the archive. */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr); gap: 34px; align-items: center; padding: 22px 0 28px; border-bottom: 1px solid var(--line); }
.home-intro .eyebrow { margin-bottom: 12px; }
.home-intro h1 { margin: 0; font-size: clamp(2.25rem, 3.9vw, 3.8rem); line-height: 1.05; }
.home-intro h1 span { color: var(--accent); }
.home-description { max-width: 62ch; margin: 12px 0 18px; color: var(--muted); font-size: 1rem; }
.home-search { max-width: 610px; }
.home-search label { display: block; }
.home-register-count { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 0; color: var(--muted); font-size: 0.8rem; }
.home-register-count strong { color: var(--accent); }
.home-archive-photo { --archive-frame-ratio: 1.6; min-width: 0; margin: 0; border-radius: 12px; overflow: hidden; background: transparent; }
.home-archive-photo .carousel-inner { aspect-ratio: var(--archive-frame-ratio); }
.home-archive-photo .carousel-item { height: 100%; }
/* Round the fitted image box itself, including photos with space around them. */
.home-archive-photo img { display: block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(100%, calc(100% * var(--photo-ratio) / var(--archive-frame-ratio))); height: auto; border-radius: 12px; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-block: 22px; }
.collection-grid:has(> :nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.collection-card { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 12px; padding: 20px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-decoration: none; transition: border-color 150ms ease, background-color 150ms ease; }
.collection-card:hover { border-color: #a3b8ab; background: #f9fcf7; color: var(--ink); }
.collection-card img { width: 104px; max-width: 100%; height: 80px; object-fit: contain; }
.collection-card h2 { margin-bottom: 5px; font-size: 1.35rem; }
.collection-card p:last-child { margin: 0; font-size: 0.86rem; color: var(--muted); }
.collection-arrow { position: absolute; top: 9px; right: 12px; font-size: 1rem; color: var(--brass); }
.home-about { display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 0.86rem; color: var(--muted); }
.home-about h2 { margin: 0 0 4px; color: var(--ink); font-size: 1.2rem; }
.home-about p { margin: 0; max-width: 77ch; }
.home-about .text-link { flex-shrink: 0; font-size: 0.82rem; }
.visitor-guide { max-width: 95ch; margin: 7px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.4; }
.archive-context { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.archive-context h2 { margin: 0; font-family: var(--font-ui); font-size: 0.83rem; font-weight: 700; letter-spacing: 0; color: var(--accent); }
.archive-context > p { margin: 4px 0 0; color: var(--muted); font-size: 0.83rem; }
.archive-context .parish-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@keyframes archive-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.home-intro { animation: archive-enter 350ms ease both; }
.collection-grid { animation: archive-enter 450ms 70ms ease both; }

/* Optional navigation is collapsed, not discarded or restricted to JavaScript. */
.archive-details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.archive-details summary { width: fit-content; cursor: pointer; color: var(--accent); font-size: 0.83rem; font-weight: 600; }
.archive-details summary::marker { color: var(--brass); }
.archive-details p { max-width: 95ch; margin: 8px 0 0; color: var(--muted); font-size: 0.88rem; }
.parish-list { gap: 6px; margin-top: 9px; }
.parish-pill, .register-section-count { min-height: 27px; padding: 3px 9px; border-radius: 5px; border-color: var(--line); background: var(--bg-soft); color: var(--accent); font-size: 0.77rem; font-weight: 600; white-space: nowrap; }
.parish-link:hover { background: var(--accent-soft); transform: none; }
.tegneby-garden-link-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.tegneby-pill-count { min-width: 20px; min-height: 18px; background: #d5e3dc; font-size: 0.7rem; }
.tegneby-navigation h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--accent); font-family: var(--font-ui); font-size: 0.94rem; font-weight: 650; letter-spacing: 0; }
.tegneby-navigation > .muted-copy { margin: 8px 0 0; font-size: 0.84rem; }
.cemetery-places { width: 100%; max-width: 280px; margin-left: auto; }
.cemetery-places .carousel-item { text-align: center; }
.cemetery-places .archive-illustration { display: block; width: 100% !important; height: 145px; object-fit: contain; }
.cemetery-caption { margin: 2px 0 0; color: var(--accent); font-size: 0.76rem; font-weight: 650; text-align: center; }
.cemetery-controls { display: flex; justify-content: center; gap: 5px; margin-top: 4px; }
.cemetery-controls .btn { min-width: 31px; min-height: 28px; padding: 3px 8px; font-size: 0.73rem; }
.cemetery-controls .carousel-pause { font-size: 0.68rem; }
.parish-summary-grid { gap: 12px; }
.parish-summary-card { padding: 13px 16px; text-align: left; }
.parish-summary-card h2 { font-size: 1.35rem; }
.parish-summary-years { font-size: 1.1rem; white-space: nowrap; }
.parish-summary-count { margin-top: 4px; font-size: 0.83rem; }

/* Tabular research material: names and dates first, secondary detail quieter. */
.result-table-wrap { padding: 0; border-radius: 8px; border-color: var(--line); background: var(--panel); box-shadow: none; }
.result-table { font-size: 0.91rem; color: var(--ink); }
.result-table td, .result-table th { padding: 9px 11px; line-height: 1.3; border-color: var(--line); overflow-wrap: normal; }
.result-table thead th { background: #edf2ec; color: #46605a; font-size: 0.69rem; letter-spacing: 0.06em; font-weight: 700; white-space: nowrap; }
.result-table tbody tr:nth-child(even) > td { background: rgb(232 239 231 / 28%); }
.result-table tbody tr:hover > td { background: #eef4ee; }
.result-table tbody tr:last-child > td { border-bottom: 0; }
.result-table .name-cell { min-width: 9.5rem; }
.result-table .table-date, .result-table .table-short { white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-table .table-date { min-width: 5rem; }
.table-scroll-hint { margin: 0 0 5px; color: var(--muted); font-size: 0.73rem; }
.table-scroll-hint[hidden] { display: none; }
.result-table .table-subline, .result-table .muted-copy { margin-top: 3px; font-size: 0.77rem; }
.table-badge { min-width: 0; min-height: 24px; padding: 3px 7px; border: 1px solid #cbdacf; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 0.66rem; line-height: 1.1; letter-spacing: 0.03em; font-weight: 650; white-space: nowrap; }
.table-badge.neutral, .table-badge.inactive { color: var(--muted); background: var(--bg-soft); border-color: var(--line); }
.table-badge.active { color: #245c3c; border-color: #bed7c6; background: #e8f3e9; }
.table-badge.pending { color: #765419; border-color: #dfd0ab; background: #f6f0df; }
.register-row-actions, .tegneby-row-actions { display: flex; flex-wrap: nowrap; gap: 4px; }
.register-name-stack, .tegneby-name-stack { gap: 3px; }
.church-col-name, .church-col-parent { word-break: normal; overflow-wrap: normal; }
.church-note-preview-truncated { -webkit-line-clamp: 2; }
.note-more-button { margin-top: 4px; }
.register-related-person { margin-top: 7px; padding-top: 7px; border-color: var(--line); }
.private-log-pager, .register-section-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.register-section-pager .btn, .private-log-pager .btn { min-height: 30px; padding: 5px 10px; font-size: 0.76rem; }
.register-section-pager .muted-copy, .private-log-pager .muted-copy { flex: 1; text-align: center; font-size: 0.77rem; }

/* Person pages keep primary facts close to the portrait, rather than below it. */
.person-hero { grid-template-columns: 132px minmax(0, 1fr) auto; padding: 18px; gap: 16px; margin-bottom: 14px; }
.person-portrait img { max-width: 132px; height: auto; aspect-ratio: 1 / 1.15; border-radius: 8px; box-shadow: none; background: var(--accent-soft); }
.person-portrait img.person-portrait-default { object-fit: contain; }
.person-hero-topline { margin-bottom: 10px; }
.person-hero-topline h1 { margin-bottom: 4px; font-size: clamp(1.6rem, 2.5vw, 2rem); }
.person-subtitle { font-size: 0.9rem; }
.person-facts-compact { gap: 9px 18px; }
.fact-label { font-size: 0.66rem; letter-spacing: 0.07em; color: var(--muted); }
.fact-item, .relation-item { gap: 2px; font-size: 0.9rem; }
.person-badges { gap: 5px; }
.person-grid { grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.65fr); gap: 14px; align-items: start; }
.person-grid .feature-card { padding: 14px 16px; }
.person-grid .family-card-empty { min-height: 92px; border-style: dashed; background: transparent; box-shadow: none; }
.family-card-empty h2, .family-card-empty .feature-kicker { color: var(--muted); }
.relation-list { gap: 10px; }
.family-stack, .children-list { gap: 7px; }
.family-group { padding: 11px 12px; border-radius: 7px; background: var(--bg-soft); }
.family-group h3 { font-family: var(--font-ui); font-size: 1rem; font-weight: 650; letter-spacing: 0; }
.family-group-header { margin-bottom: 7px; gap: 8px; }
.family-group-header .fact-label { margin-bottom: 3px; }
.family-meta { font-size: 0.81rem; }
.children-list { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.child-card { padding: 7px 9px; border-radius: 5px; background: var(--panel); gap: 2px; font-size: 0.86rem; }
.child-card span { font-size: 0.78rem; }
.person-note-actions, .family-inline-actions { margin-top: 10px; gap: 6px; }
.person-note-actions .btn { min-height: 30px; padding: 5px 10px; font-size: 0.77rem; }
.media-panel { margin-top: 14px; }
.media-grid { grid-template-columns: repeat(auto-fill, 100px); gap: 8px; }
.media-card, .media-card-button { width: 100px; padding: 4px; border-radius: 6px; background: var(--bg-soft); gap: 3px; }
.media-card img { aspect-ratio: 1; border-radius: 4px; }
.media-copy { font-size: 0.73rem; }
.media-copy:empty { display: none; }
.document-list { gap: 6px; }
.document-link { padding: 8px 10px; border-radius: 6px; background: var(--bg-soft); font-size: 0.84rem; }
.note-modal, .grave-gallery-modal-content, .modal-content { border-radius: 10px; background: var(--panel); border-color: var(--line); }
.note-group { padding: 11px; border-radius: 6px; background: var(--bg-soft); }
.modal-header { padding: 12px 16px; }
.modal-body { padding: 16px; }
.modal-title { font-size: 1.45rem; }
.note-modal-text { font-size: 0.94rem; line-height: 1.5; }
.grave-carousel-frame { border-radius: 8px; border: 0; background: transparent; }
.grave-carousel-indicators [data-bs-target].active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.grave-carousel-control .carousel-control-prev-icon, .grave-carousel-control .carousel-control-next-icon { background-color: var(--accent); }
.grave-gallery-modal-header h2 { font-size: 1.35rem; }
.ancestor-card-inner { border-radius: 5px; box-shadow: 0 2px 5px rgb(32 58 54 / 8%); }
.ancestor-card-male .ancestor-card-inner { background: #e7efec; }
.ancestor-card-female .ancestor-card-inner { background: #f1ebe0; }
.ancestor-card-unknown .ancestor-card-inner, .ancestor-card-placeholder .ancestor-card-inner { background: #edf0ed; }
.ancestor-card-root .ancestor-card-inner { border-color: #a3b8ab; box-shadow: 0 0 0 1px #a3b8ab; }
.ancestor-expand-link { display: grid; place-items: center; width: 24px; height: 24px; color: var(--accent); font-size: 1.1rem; }
.ancestor-lines line { stroke: #6e857c; }
.ancestor-avatar-image-icon { transform: none; object-fit: contain; background: transparent; }
.generation-label { color: var(--accent); font-family: var(--font-ui); font-size: 0.69rem; letter-spacing: 0.06em; }
.tree-header { margin-bottom: 12px; }
.tree-pan-hint { display: none; }

/* Accounts and administration use the same compact visual vocabulary. */
.private-hero { grid-template-columns: 1fr; margin-bottom: 14px; }
.private-hero-copy { min-width: 0; padding: 16px 18px; }
.private-hero-copy h1 { overflow-wrap: anywhere; }
.private-hero-copy h1 { margin-bottom: 5px; font-size: 1.8rem; }
.private-hero-copy .lead { margin: 0; font-size: 0.87rem; }
.private-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.private-metric-card { padding: 12px 14px; }
.private-metric-card h2 { margin-bottom: 3px; font-size: clamp(1.55rem, 2.2vw, 2rem); font-variant-numeric: tabular-nums; }
.private-metric-card p:last-child { font-size: 0.78rem; }
.private-workspace-grid { gap: 12px; margin-bottom: 16px; }
.private-insight-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.private-workspace-card { gap: 4px; }
.private-workspace-card p { font-size: 0.87rem; }
.private-workspace-card .hero-actions { margin-top: 6px; }
.private-insight-list { gap: 5px; }
.private-insight-item { padding: 7px 9px; border-radius: 5px; background: var(--bg-soft); font-size: 0.86rem; }
.admin-filter-card, .account-admin-grid { margin-bottom: 14px; }
.admin-filter-form, .account-editor-form { gap: 10px; }
.admin-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.account-editor-fields, .account-editor-passwords { gap: 10px; }
.admin-filter-grid > *, .account-editor-fields > *, .account-editor-passwords > * { min-width: 0; }
.account-editor-intro { margin: 9px 0 12px; color: var(--muted); font-size: 0.85rem; }
.contact-form, .contact-grid, .login-form { gap: 12px; }
.contact-textarea { min-height: 150px; }
.contact-status { margin-bottom: 12px; padding: 9px 11px; border-radius: 6px; font-size: 0.9rem; }
.contact-status.error:empty { display: none; }
.contact-status.error { color: #853a31; border-color: #e2c6be; background: #fcf0ec; }
.contact-status.success { color: #245c3c; border-color: #bed7c6; background: #e8f3e9; }
.contact-card { max-width: 900px; }
.login-shell { gap: 16px; }
.login-shell.login-centered { display: flex; align-items: start; justify-content: center; min-height: 0; padding-block: 14px; }
.login-centered .login-panel { width: 100%; max-width: 450px; padding: 22px; }
.login-panel .muted-copy { margin: 12px 0 0; font-size: 0.82rem; }
.login-links { gap: 12px; margin-top: 2px; font-size: 0.85rem; }
.login-benefits { gap: 9px; margin-top: 12px; }
.maintenance-modal-header { border-color: var(--line); }
.maintenance-modal-image { max-width: 240px; }
.maintenance-modal-message { font-size: 1.2rem; }
.site-footer { margin-top: auto; padding: 0 0 14px; }
.footer-inner { width: calc(100% - 48px); max-width: 1352px; padding: 12px 0 0; gap: 10px; text-align: left; }
.footer-copy, .footer-meta { font-size: 0.76rem; color: var(--muted); }

@media (min-width: 992px) {
  .church-table-births .church-col-name { width: 12rem; }
  .church-table-births .church-col-parent { width: 12rem; }
  .church-table th, .church-table td { word-break: normal; }
}
@media (max-width: 1199.98px) {
  .nav-link { padding-inline: 7px !important; font-size: 0.85rem; }
  .home-hero { gap: 22px; }
  .collection-card { grid-template-columns: 82px minmax(0, 1fr); gap: 8px; padding: 16px 12px; }
  .collection-card img { width: 82px; height: 64px; }
  .collection-grid:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-about { flex-direction: column; align-items: start; gap: 6px; }
}
@media (max-width: 991.98px) {
  .container { padding-inline: 18px; }
  .navbar > .container { min-height: 80px; flex-wrap: wrap; gap: 12px; }
  .navbar-collapse { width: 100%; border-top: 1px solid var(--line); padding-block: 8px; }
  .navbar-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px !important; }
  .nav-link { width: 100%; text-align: center; padding: 9px 5px !important; font-size: 0.88rem; }
  .nav-item form { display: block !important; }
  .page-shell { padding-top: 18px; }
  .home-hero { grid-template-columns: minmax(0, 1.4fr) minmax(200px, 0.8fr); gap: 18px; padding-top: 10px; }
  .home-intro h1 { font-size: 2.35rem; }
  .home-search .btn { font-size: 0.8rem; padding-inline: 10px; }
  .collection-grid { gap: 10px; }
  .collection-card { grid-template-columns: 1fr; }
  .collection-card img { display: none; }
  .collection-card h2 { font-size: 1.25rem; }
  .private-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .private-workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .private-insight-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .private-insight-grid .feature-card { padding: 12px; }
  .private-insight-grid h2 { font-size: 1.2rem !important; }
  .person-hero { grid-template-columns: 110px minmax(0, 1fr) auto; grid-template-areas: "portrait copy badges" "portrait copy ."; }
  .person-portrait img { max-width: 110px; }
  .person-facts-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .person-grid { grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1.3fr); }
  .children-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parish-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-admin-grid { grid-template-columns: 1fr; }
  .account-editor-fields, .account-editor-passwords { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { width: calc(100% - 36px); }
}
@media (max-width: 767.98px) {
  .page-shell { padding-top: 14px; padding-bottom: 20px; }
  .home-hero { grid-template-columns: 1fr; padding: 8px 0 20px; }
  .home-archive-photo { display: none; }
  .home-intro h1 { font-size: clamp(1.8rem, 7.4vw, 2.8rem); }
  .home-description { margin: 10px 0 14px; font-size: 0.94rem; }
  .collection-grid, .collection-grid:has(> :nth-child(4)) { grid-template-columns: 1fr; gap: 8px; margin-block: 15px; }
  .collection-card { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 15px; }
  .collection-card .feature-kicker { margin-bottom: 3px; font-size: 0.6rem; }
  .collection-card h2 { margin-bottom: 3px; }
  .collection-card p:last-child { font-size: 0.82rem; }
  .home-about { font-size: 0.81rem; }
  .home-about .text-link { flex-shrink: 1; }
  .search-hero { padding: 13px 15px; }
  .search-hero-results { padding: 0 0 9px; }
  .search-hero .lead { font-size: 0.89rem; line-height: 1.35; }
  .search-hero .hero-side-image { display: none; }
  .cemetery-places { display: none; }
  .visitor-guide { font-size: 0.8rem; }
  .archive-context .parish-list { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, max-content); grid-auto-columns: max-content; justify-content: start; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; padding: 1px 2px 7px; scrollbar-width: thin; }
  .tegneby-navigation .tegneby-garden-list { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, max-content); grid-auto-columns: max-content; justify-content: start; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; padding: 1px 2px 7px; scrollbar-width: thin; }
  .search-hero .search-stat { font-size: 0.79rem; }
  .search-hero h1 { font-size: 1.55rem; }
  .feature-card, .search-form, .hero-copy, .hero-panel { padding: 13px 15px; }
  .hero-actions > .btn { padding-inline: 10px; font-size: 0.8rem; }
  .search-shell { gap: 12px; }
  .form-control, .form-control-lg, .form-select { font-size: 16px; min-height: 40px; }
  .search-input-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .search-input-row .btn { min-height: 40px; }
  .home-search .btn { max-width: 105px; font-size: 0.79rem; }
  .result-table { font-size: 0.85rem; min-width: 600px; }
  .church-table, .tegneby-table { min-width: 920px; }
  .parish-book-table { min-width: 0; font-size: 0.81rem; }
  .parish-summary-card { padding: 11px 9px; }
  .parish-summary-years { font-size: 0.85rem; }
  .parish-summary-count { font-size: 0.72rem; }
  .result-table td, .result-table th { padding: 8px 9px; }
  .result-table thead th { font-size: 0.65rem; }
  .result-table .table-subline, .result-table .muted-copy { font-size: 0.74rem; }
  .result-table .name-cell, .church-table .church-col-name { min-width: 9rem; }
  .church-table .church-col-parent { min-width: 10rem; }
  .church-table .church-col-place { min-width: 8rem; }
  .genealogy-table .name-cell, .grave-table .name-cell { width: 10rem; max-width: 10rem; }
  .register-row-actions .table-badge { min-width: 0; min-height: 25px; padding: 4px 6px; font-size: 0.64rem; }
  .church-table .church-col-name .text-link, .church-table .church-col-name > .register-name-stack > span,
  .church-table .church-col-name .register-related-person .text-link, .church-table .church-col-name .register-related-person > span { white-space: normal; overflow: visible; text-overflow: clip; }
  .table-date, .table-short { white-space: nowrap; }
  .result-table-wrap { position: relative; border-radius: 7px; }
  .register-section-header h2 { font-size: 1.3rem; }
  .register-section-count { font-size: 0.69rem; padding-inline: 7px; }
  .register-section-pager .btn, .private-log-pager .btn { min-height: 30px; padding: 5px 8px; font-size: 0.73rem; }
  .register-section-pager .muted-copy, .private-log-pager .muted-copy { font-size: 0.71rem; line-height: 1.2; }
  .person-hero { grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: 97px 1fr; grid-template-areas: "portrait copy" "badges copy"; gap: 8px 12px; padding: 13px; }
  .person-portrait img { max-width: 84px; border-radius: 6px; }
  .person-hero-badges { justify-self: start; justify-content: flex-start; align-self: start; margin: 0; gap: 4px; }
  .person-hero-badges .table-badge { font-size: 0.6rem; max-width: 84px; }
  .person-hero-topline h1 { font-size: 1.4rem; }
  .person-hero-topline { margin-bottom: 8px; }
  .person-hero-topline .eyebrow { font-size: 0.59rem; }
  .person-subtitle { font-size: 0.8rem; }
  .person-facts-compact { grid-template-columns: 1fr; gap: 7px; }
  .fact-item { font-size: 0.83rem; }
  .person-note-actions { gap: 5px; }
  .person-note-actions .btn { padding: 5px 7px; font-size: 0.71rem; }
  .person-grid { grid-template-columns: 1fr; gap: 10px; }
  .tree-header { align-items: start; gap: 8px; }
  .tree-header .lead { display: block; margin: 4px 0; font-size: 0.79rem; }
  .tree-header h1 { font-size: 1.5rem; margin-bottom: 0; }
  .tree-actions .btn { white-space: nowrap; min-height: 30px; padding: 5px 8px; font-size: 0.73rem; }
  .tree-pan-hint { display: block; margin: 0 0 7px; color: var(--muted); font-size: 0.75rem; }
  .ancestor-scroll { height: clamp(300px, 60svh, 530px); overflow: auto; overscroll-behavior: contain; }
  .person-grid .feature-card { padding: 12px 14px; }
  .relation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .family-group-header { flex-wrap: wrap; }
  .family-meta { text-align: left; }
  .children-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .private-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .private-metric-card { padding: 11px 12px; }
  .private-metric-card h2 { font-size: 1.5rem; }
  .private-metric-card .feature-kicker { font-size: 0.59rem; }
  .private-metric-card p:last-child { font-size: 0.75rem; }
  .private-workspace-grid, .private-insight-grid { grid-template-columns: 1fr; gap: 10px; }
  .private-hero-copy h1 { font-size: 1.55rem; }
  .admin-filter-grid, .account-editor-fields, .account-editor-passwords { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .admin-filter-grid label, .account-editor-form label { font-size: 0.8rem; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro .lead { font-size: 0.9rem; }
  .login-intro h1 { font-size: 1.5rem; }
  .login-centered .login-panel { padding: 18px; }
  .login-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 4px; padding-top: 10px; }
  .footer-meta { justify-content: start; text-align: left; }
  .footer-copy, .footer-meta { font-size: 0.71rem; }
}
@media (max-width: 359.98px) {
  .container { padding-inline: 12px; }
  .navbar > .container { min-height: 68px; }
  .site-logo { width: 64px; height: 64px; }
  .brand-kicker { font-size: 0.56rem; }
  .brand-name { font-size: 1.65rem; }
  .home-intro h1 { font-size: 1.65rem; }
  .person-hero { grid-template-columns: 68px minmax(0, 1fr); grid-template-rows: 79px 1fr; gap: 7px 9px; padding: 11px; }
  .person-portrait img { max-width: 68px; }
  .person-hero-topline h1 { font-size: 1.25rem; }
  .children-list { grid-template-columns: 1fr; }
  .parish-summary-grid { gap: 6px; }
  .parish-summary-card { padding: 10px; }
  .parish-summary-years { font-size: 0.79rem; }
  .footer-inner { width: calc(100% - 24px); }
}
@media (max-width: 991.98px) and (max-height: 600px) and (orientation: landscape) {
  .navbar > .container { min-height: 56px; padding-block: 2px !important; }
  .site-logo { width: 52px; height: 52px; }
  .page-shell { padding-top: 12px; }
  .search-hero .hero-side-image { display: none; }
  .search-hero h1 { font-size: 1.55rem; }
  .search-hero .lead { font-size: 0.88rem; }
  .result-table { font-size: 0.83rem; }
  .church-table, .tegneby-table { min-width: 1000px; }
  .result-table td, .result-table th { padding: 7px 9px; }
  .result-table thead th { font-size: 0.65rem; }
  .home-hero { grid-template-columns: 1fr; padding-top: 6px; gap: 0; }
  .home-archive-photo { display: none; }
  .home-intro h1 { font-size: 2rem; }
  .home-description { margin-block: 8px 10px; font-size: 0.92rem; }
}
@media (prefers-reduced-motion: reduce) {
  .home-intro, .collection-grid { animation: none; }
  .collection-card { transition: none; }
  .carousel-item { transition: none; }
}
