:root {
    --ink: #2d2926;
    --muted: #746b66;
    --paper: #f5f1ec;
    --surface: #fffdfb;
    --line: #ded4cc;
    --brown: #6d4a3f;
    --brown-dark: #51352d;
    --brown-soft: #eee6e1;
    --brown-pale: #f6f1ed;
    /* Særfarverne nedenfor er reserveret til slægtsgrafik. */
    --blue: #61a9df;
    --blue-soft: #e8f3fb;
    --rose: #ef969b;
    --rose-soft: #fdecee;
    --green: #7aa374;
    --green-soft: #edf5e9;
    --amber: #d59a55;
    --amber-soft: #fff2df;
    --shadow: 0 18px 50px rgba(61, 42, 34, .10);
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
a { color: var(--brown); text-decoration-thickness: 1px; text-underline-offset: .18em; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.5rem, 2vw, 2rem); line-height: 1.12; letter-spacing: -.02em; margin-bottom: .75rem; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.2rem, 1.4vw, 1.5rem); line-height: 1.16; letter-spacing: -.015em; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.eyebrow { display: block; color: var(--brown); font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .8rem; }
.lede { max-width: 750px; color: var(--muted); font-size: 1.1rem; line-height: 1.65; }

.topbar {
    position: sticky; top: 0; z-index: 10; min-height: 72px; padding: 0 clamp(1rem, 4vw, 4rem);
    display: flex; align-items: center; gap: 2rem; color: white; background: var(--brown-dark);
    box-shadow: 0 4px 18px rgba(52, 34, 28, .18);
}
.brand { display: flex; align-items: center; gap: .7rem; color: white; font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; background: #f0d7c8; color: var(--brown-dark); font-family: Georgia, serif; font-weight: 800; }
.brand-mark--large { width: 48px; height: 48px; font-size: 1.35rem; }
.main-nav { display: flex; align-self: stretch; align-items: stretch; gap: .25rem; }
.main-nav a, .main-nav .nav-disabled { display: flex; align-items: center; padding: 0 .85rem; color: rgba(255,255,255,.72); font-size: .9rem; text-decoration: none; border-bottom: 3px solid transparent; }
.main-nav a:hover, .main-nav a.is-active { color: white; border-bottom-color: #f0b3a8; }
.nav-disabled { opacity: .5; cursor: default; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: .7rem; font-size: .82rem; }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.text-button { border: 0; background: transparent; color: rgba(255,255,255,.72); cursor: pointer; padding: .35rem; }
.text-button:hover { color: white; }

.content-shell { width: min(1800px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 3rem; }
.hero-row, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.hero-row h1, .page-heading h1 { margin-bottom: .75rem; }
.status-pill { display: inline-flex; align-items: center; gap: .55rem; border: 1px solid var(--line); border-radius: 999px; padding: .55rem .85rem; background: rgba(255,255,255,.65); color: var(--muted); font-size: .78rem; }
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: var(--brown); box-shadow: 0 0 0 4px rgba(109,74,63,.12); }

.workspace { min-height: calc(100vh - 8rem); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(76,53,45,.08); }
.workspace-toolbar { min-height: 72px; display: flex; align-items: center; gap: 1.25rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: #fff; }
.workspace-title { min-width: 210px; }
.workspace-title .eyebrow { margin-bottom: .18rem; font-size: .62rem; }
.workspace-title h1 { margin: 0; font-family: inherit; font-size: 1.15rem; line-height: 1.2; letter-spacing: -.01em; }
.workspace-tabs { display: flex; align-items: center; gap: .2rem; padding: .2rem; border: 1px solid var(--line); border-radius: 999px; background: var(--brown-pale); }
.workspace-tabs a, .workspace-tabs span { padding: .45rem .75rem; border-radius: 999px; color: var(--muted); font-size: .83rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.workspace-tabs a:hover { color: var(--brown-dark); background: #fff; }
.workspace-tabs .is-active { color: #fff; background: var(--brown); }
.workspace-tabs span[aria-disabled="true"] { opacity: .58; }
.workspace-toolbar .status-pill { margin-left: auto; }
.workspace-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 12.5rem); }
.workspace-sidebar { padding: 1.35rem 1.2rem; border-right: 1px solid var(--line); background: var(--brown-pale); }
.workspace-sidebar-heading p { margin: .45rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.workspace-counts { margin: 1.2rem 0 0; }
.workspace-counts div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .68rem .1rem; border-bottom: 1px solid rgba(109,74,63,.12); }
.workspace-counts dt { color: var(--muted); font-size: .84rem; font-weight: 650; }
.workspace-counts dd { margin: 0; color: var(--brown-dark); font-size: .95rem; font-weight: 800; }
.workspace-canvas { min-width: 0; display: grid; grid-template-columns: minmax(260px,.72fr) minmax(360px,1.28fr); align-items: center; gap: clamp(2rem,5vw,5.5rem); padding: clamp(2rem,4.5vw,5rem); background: #fff; }
.workspace-empty-graphic { display: grid; place-items: center; }
.workspace-empty-graphic .empty-visual { width: min(100%,330px); margin: 0; }
.workspace-empty-copy { max-width: 650px; }
.workspace-empty-copy h2 { margin: .4rem 0 .85rem; font-size: clamp(1.4rem,1.8vw,1.85rem); }
.workspace-empty-copy p { max-width: 62ch; margin: 0 0 1.3rem; color: var(--muted); font-size: .96rem; line-height: 1.65; }
.workspace-content { grid-column: 1 / -1; align-self: start; width: 100%; }
.section-heading--compact { margin-bottom: 1.15rem; }

.metric-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .8rem; margin-bottom: 3rem; }
.metric-card { min-height: 126px; padding: 1.25rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 24px rgba(61,42,34,.04); }
.metric-card span { color: var(--muted); font-size: .77rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { font-family: Georgia, serif; font-size: 2.25rem; font-weight: 500; }
.metric-card--personer { background: #f1eae6; }
.metric-card--familier { background: #f4eeea; }
.metric-card--begivenheder { background: #eee5df; }
.metric-card--steder { background: #f6f1ed; }

.empty-state { min-height: 390px; display: grid; grid-template-columns: minmax(280px, .8fr) 1.2fr; align-items: center; gap: clamp(2rem, 7vw, 7rem); padding: clamp(2rem, 6vw, 5rem); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.empty-state p { max-width: 700px; color: var(--muted); line-height: 1.75; }
.empty-visual { position: relative; aspect-ratio: 1; max-width: 360px; width: 100%; margin: auto; border: 2px solid #e7d8cf; border-radius: 50%; background: radial-gradient(circle, #f5eae3 0 19%, transparent 19.5% 34%, #eaf3e7 34.5% 49%, transparent 49.5% 64%, #e9f2f8 64.5% 79%, transparent 79.5%); }
.empty-visual::before, .empty-visual::after { content: ""; position: absolute; inset: 50% 0 auto; border-top: 2px solid white; transform-origin: center; }
.empty-visual::after { transform: rotate(90deg); }
.node { position: absolute; width: 18px; height: 18px; border: 4px solid white; border-radius: 50%; box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.node--one { background: var(--blue); top: 16%; left: 47%; }
.node--two { background: var(--rose); top: 47%; right: 13%; }
.node--three { background: var(--green); bottom: 13%; left: 47%; }
.node--four { background: var(--amber); top: 47%; left: 13%; }

.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 48px; padding: .8rem 1rem; border: 0; border-radius: 8px; color: white; background: var(--brown); font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brown-dark); }
.button--disabled { opacity: .62; cursor: default; }
.button--disabled:hover { background: var(--brown); }

.auth-body { background: #eae1d8; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: radial-gradient(circle at 12% 10%, rgba(255,255,255,.8), transparent 34%), linear-gradient(135deg, #f2ece6, #dfd1c5); }
.login-card { width: min(1040px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border-radius: 26px; background: white; box-shadow: 0 35px 90px rgba(66,42,32,.2); }
.login-intro { position: relative; padding: clamp(3rem, 7vw, 6rem); color: white; background: var(--brown-dark); overflow: hidden; }
.login-intro::after { content: ""; position: absolute; width: 420px; height: 420px; right: -220px; bottom: -210px; border: 70px solid rgba(255,255,255,.05); border-radius: 50%; }
.login-intro .eyebrow { color: #f1c9bb; }
.login-intro h1 { max-width: 550px; font-size: clamp(2.35rem, 4vw, 4rem); }
.login-intro p { max-width: 450px; color: rgba(255,255,255,.72); font-size: 1.05rem; line-height: 1.7; }
.generation-rings { position: absolute; right: 3rem; bottom: 2rem; width: 200px; height: 200px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.generation-rings span { position: absolute; inset: 18%; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.generation-rings span:nth-child(2) { inset: 35%; }
.generation-rings span:nth-child(3) { inset: 45%; background: #e9cfc2; }
.generation-rings strong { position: relative; z-index: 1; color: var(--brown-dark); font-family: Georgia, serif; }
.login-form-panel { padding: clamp(2.5rem, 6vw, 5.5rem); display: flex; flex-direction: column; justify-content: center; }
.login-form-panel h2 { margin: 1.5rem 0 .5rem; }
.form-stack { display: grid; gap: 1rem; margin-top: 2rem; }
.form-stack label { display: grid; gap: .45rem; color: #564f4b; font-size: .85rem; font-weight: 700; }
.form-stack input, .form-stack select, .search-form input { width: 100%; min-height: 48px; padding: .75rem .9rem; border: 1px solid #cfc6bf; border-radius: 8px; color: var(--ink); background: #fff; outline: none; }
.form-stack input:focus, .search-form input:focus { border-color: var(--brown); box-shadow: 0 0 0 3px rgba(118,82,71,.12); }
.alert { padding: .8rem 1rem; border-left: 4px solid #ba4c4c; background: #fff0f0; color: #7d2929; font-size: .9rem; }
.privacy-note { margin: 2rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.auth-links { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; margin-top: 1.25rem; font-size: .85rem; }
.standalone { width: min(620px, 100%); }

.search-form { display: flex; gap: .5rem; width: min(420px, 100%); }
.search-form button { border: 0; border-radius: 8px; padding: 0 1.2rem; color: white; background: var(--brown); cursor: pointer; }
.table-card { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 10px 30px rgba(61,42,34,.05); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem 1.25rem; border-bottom: 1px solid #eee8e2; text-align: left; }
th { color: var(--muted); background: #fbfaf8; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.clickable-row { cursor: pointer; transition: background .12s ease; }
.clickable-row:hover, .clickable-row:focus, .clickable-row:focus-within { outline: 0; background: #efedeb; }
.clickable-row:focus { box-shadow: inset 3px 0 0 var(--brown); }
.row-primary-link { display: block; color: inherit; text-decoration: none; }
.row-chevron { width: 52px; color: transparent; font-size: 1.45rem; text-align: center; transition: color .12s ease, transform .12s ease; }
.clickable-row:hover .row-chevron, .clickable-row:focus .row-chevron, .clickable-row:focus-within .row-chevron { color: #8f8985; transform: translateX(3px); }
.simple-empty { padding: 5rem 2rem; border: 1px dashed #cfc3b9; border-radius: 18px; text-align: center; background: rgba(255,255,255,.52); }

.section-block { margin-top: 3rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.section-heading h2 { margin-bottom: 0; }
.person-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.person-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; text-decoration: none; }
.person-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(61,42,34,.08); }
.person-card small { display: block; margin-top: .25rem; color: var(--muted); }
.person-avatar, .portrait-placeholder { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-family: Georgia, serif; color: var(--brown-dark); background: var(--brown-soft); }
.person-avatar { width: 52px; height: 52px; font-size: 1.2rem; }
.person-avatar--f, .portrait-placeholder--f { background: #f3ebe6; }

.person-hero { display: flex; align-items: center; gap: 2rem; margin-bottom: 3rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.portrait-placeholder { width: 116px; height: 116px; font-size: 3rem; border: 5px solid white; box-shadow: 0 10px 35px rgba(61,42,34,.12); }
.person-hero h1 { font-size: clamp(1.6rem, 2.4vw, 2.3rem); }
.proband-form { margin-top: 1rem; }
.button--quiet { min-height: 38px; padding: .55rem .8rem; color: var(--brown-dark); border: 1px solid var(--line); background: #fff; font-size: .8rem; }
.button--quiet:hover { background: var(--brown-pale); }
.proband-badge { display: inline-flex; margin-top: .85rem; padding: .36rem .62rem; border-radius: 999px; color: var(--brown-dark); background: var(--brown-soft); font-size: .72rem; font-weight: 750; }
.detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1.25rem; }
.detail-panel { padding: clamp(1.5rem, 3vw, 2.5rem); border: 1px solid var(--line); border-radius: 18px; background: white; }
.timeline-list { list-style: none; margin: 0; padding: 0; }
.timeline-list li { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 1rem; padding: 0 0 1.6rem; }
.timeline-list li::before { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; border-left: 1px solid #d8cec6; }
.timeline-list li:last-child::before { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 17px; height: 17px; margin-top: 2px; border: 4px solid var(--brown-soft); border-radius: 50%; background: var(--brown); }
.timeline-list small { display: block; margin-top: .3rem; color: var(--muted); }
.timeline-list p { margin: .7rem 0 0; line-height: 1.6; }
.note-card { padding: 1.2rem; border-left: 4px solid var(--brown); border-radius: 0 10px 10px 0; background: var(--brown-pale); }
.note-card + .note-card { margin-top: 1rem; }
.note-card > span { color: var(--brown); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.note-card h3 { margin: .5rem 0; }
.note-card p { margin: .7rem 0 0; line-height: 1.7; white-space: normal; }
.person-breadcrumb { min-height: 24px; display: flex; align-items: center; gap: .55rem; margin: -12px 0 10px; color: #8a8581; font-size: .7rem; }
.person-breadcrumb a { color: #77716d; text-decoration: none; }
.person-summary { min-height: 138px; display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; padding: 8px 8px 20px; border-bottom: 1px solid #e4dfdc; }
.person-summary-copy { min-width: 0; }
.person-summary h1 { margin: 0 0 .45rem; font-family: inherit; font-size: 1.48rem; font-weight: 650; letter-spacing: -.015em; }
.person-summary p { margin: 0; color: #77716d; font-size: .78rem; }
.person-summary .source-revision, .record-heading .source-revision { display: flex; align-items: center; gap: .3rem; margin-top: .38rem; color: #938b86; font-size: .64rem; }
.source-revision span { color: #7a5143; font-size: .76rem; }
.person-summary-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: 1.05rem; }
.person-summary-actions a, .person-summary-actions button, .person-proband-label { min-height: 32px; display: inline-flex; align-items: center; padding: 0 .72rem; border: 1px solid #cfc9c5; border-radius: 18px; color: #675049; background: #fff; font: inherit; font-size: .68rem; text-decoration: none; cursor: pointer; }
.person-summary-actions a:hover, .person-summary-actions button:hover { color: var(--brown-dark); background: #f1edeb; }
.person-summary-actions form { margin: 0; }
.person-proband-label { border-color: #ddcfca; background: #eee6e1; cursor: default; }
.person-summary-portrait { width: 112px; height: 112px; flex: 0 0 112px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: var(--brown-dark); background: #e9e5e2; font-family: Georgia,serif; font-size: 2.3rem; }
.person-summary-portrait--f { background: #f0e7e4; }
.person-summary-portrait img { width: 100%; height: 100%; object-fit: cover; }
.person-workspace { height: calc(100vh - 280px); min-height: 510px; display: grid; grid-template-columns: minmax(440px,1.1fr) minmax(390px,.9fr); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid #ddd8d4; background: #ddd8d4; }
.person-scroll-panel { min-width: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: #fff; }
.person-panel-section { padding: 1.35rem 1.55rem 1.6rem; border-bottom: 1px solid #e8e3df; }
.person-panel-section:last-child { border-bottom: 0; }
.person-panel-section h2 { margin: 0 0 1rem; font-family: inherit; font-size: .92rem; font-weight: 750; }
.person-panel-section > h3 { margin: 1rem 0 .35rem; color: #77716d; font-size: .68rem; font-weight: 700; }
.relation-heading { min-height: 34px; display: flex; align-items: center; gap: .7rem; margin: .8rem 0 .15rem; }
.relation-heading h3 { margin: 0; color: #77716d; font-size: .68rem; font-weight: 700; }
.relation-family-button { min-height: 28px; display: inline-flex; align-items: center; gap: .35rem; padding: 0 .62rem; border: 1px solid #cfc9c5; border-radius: 16px; color: #675049; background: #fff; font-size: .64rem; font-weight: 650; text-decoration: none; }
.relation-family-button:hover { color: var(--brown-dark); background: #f1edeb; }
.relation-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .12rem 1.5rem; }
.relation-list a { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr) 14px; align-items: center; gap: .55rem; min-height: 48px; padding: .3rem .4rem; color: #413d3a; text-decoration: none; }
.relation-list a:hover { background: #efedeb; }
.relation-list strong, .relation-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relation-list strong { font-size: .73rem; font-weight: 550; }
.relation-list small { margin-top: .12rem; color: #8a8581; font-size: .64rem; }
.relation-list a > span:last-child { color: #aaa5a1; font-size: 1.1rem; }
.relation-avatar { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border: 2px solid #63b1e8; border-radius: 50%; color: #655d58; background: #e8e4e1; font-size: .68rem; font-weight: 750; }
.relation-avatar--f { border-color: #ef9a9f; }
.relation-avatar img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.person-event-list li { padding-bottom: 1.15rem; }
.person-event-list strong { font-size: .75rem; }
.person-event-list small { font-size: .67rem; }
.person-event-list p { margin-top: .45rem; color: #625c58; font-size: .72rem; line-height: 1.5; }
.person-scroll-panel .note-card { padding: .9rem 1rem; border-left-width: 3px; border-radius: 0 5px 5px 0; }
.person-scroll-panel .note-card h3 { font-family: inherit; font-size: .78rem; }
.person-scroll-panel .note-card p { font-size: .73rem; line-height: 1.55; }
.person-media-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: .9rem; }
.person-media-card { min-width: 0; overflow: hidden; border: 1px solid #e1dcda; border-radius: 5px; background: #fff; }
.person-media-preview { display: block; color: #4d4845; background: #eeeae7; text-decoration: none; }
.person-media-preview img, .person-media-preview > span { width: 100%; aspect-ratio: 1; display: grid; place-items: center; object-fit: cover; background: #eeeae7; }
.person-media-copy { padding: .6rem .68rem .7rem; }
.person-media-copy > strong { display: block; overflow: hidden; color: #4d4845; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.person-media-caption { display: block; margin-top: .48rem; padding-top: .48rem; border-top: 1px solid #ece7e4; color: #514b47; text-decoration: none; }
.person-media-caption:hover p { color: var(--brown-dark); }
.person-media-caption span { display: block; margin-bottom: .22rem; color: var(--brown); font-size: .55rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.person-media-caption p { margin: 0; font-size: .67rem; line-height: 1.45; }
.media-library { min-height: calc(100vh - 175px); }
.media-toolbar { min-height: 52px; display: flex; align-items: center; gap: 1rem; padding: 0 0 14px; color: #77716d; font-size: .7rem; }
.media-toolbar label { width: min(380px,35vw); }
.media-toolbar input { width: 100%; min-height: 36px; padding: .45rem .7rem; border: 1px solid #cec8c4; border-radius: 5px; color: var(--ink); background: #fff; }
.media-view-switch { display: flex; }
.media-view-switch button { width: 34px; height: 34px; border: 1px solid #cfc9c5; color: #88827e; background: #fff; cursor: pointer; }
.media-view-switch button + button { border-left: 0; }
.media-view-switch button.is-active { color: var(--brown-dark); background: #ebe7e4; }
.media-grid { display: grid; grid-template-columns: repeat(5,minmax(150px,1fr)); gap: 3rem clamp(1.5rem,3vw,3.5rem); padding: 1.5rem 0 4rem; }
.media-tile { min-width: 0; color: #423e3b; text-decoration: none; }
.media-preview { width: 100%; aspect-ratio: 1.08; display: grid; place-items: center; overflow: hidden; border-radius: 4px; background: #eeeae7; }
.media-preview img { width: 100%; height: 100%; object-fit: contain; background: #f4f2f0; }
.media-preview > span { color: #8e8884; font-size: 2rem; }
.media-tile-copy { display: block; padding-top: .55rem; }
.media-tile-copy strong, .media-tile-copy small, .media-tile-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tile-copy strong { font-size: .74rem; }
.media-tile-copy small, .media-tile-copy > span { margin-top: .18rem; color: #827c78; font-size: .63rem; }
.media-grid.is-list { display: block; padding-top: .5rem; }
.media-grid.is-list .media-tile { min-height: 58px; display: grid; grid-template-columns: 54px minmax(0,1fr); align-items: center; gap: .8rem; padding: .3rem .5rem; border-bottom: 1px solid #e9e5e2; }
.media-grid.is-list .media-tile:hover { background: #efedeb; }
.media-grid.is-list .media-preview { width: 50px; height: 50px; aspect-ratio: auto; }
.media-grid.is-list .media-tile-copy { padding: 0; }
.media-empty { min-height: 320px; display: grid; place-content: center; justify-items: center; color: #77716d; text-align: center; }
.media-empty h2 { font-family: inherit; font-size: 1rem; }
.media-empty p { max-width: 540px; font-size: .78rem; line-height: 1.5; }
[data-media-viewer-item] { cursor: zoom-in; }
body.media-viewer-open { overflow: hidden; }
.media-viewer { position: fixed; z-index: 1000; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: grid; grid-template: minmax(0,1fr) auto / minmax(64px,1fr) minmax(0,calc(100vw - 160px)) minmax(64px,1fr); color: #f4f4f4; background: rgba(4,4,4,.985); animation: media-viewer-in .18s ease-out; }
.media-viewer[hidden] { display: none; }
.media-viewer-stage { position: relative; grid-row: 1; grid-column: 2; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 46px 0 20px; }
.media-viewer-stage img { width: auto; height: auto; max-width: 100%; max-height: 100%; display: block; object-fit: contain; box-shadow: 0 12px 50px rgba(0,0,0,.3); }
.media-viewer-loading, .media-viewer-error { margin: 0; color: #aaa; font-size: .8rem; }
.media-viewer-close, .media-viewer-nav { position: absolute; z-index: 2; display: grid; place-items: center; border: 0; border-radius: 50%; color: #bdbdbd; background: rgba(24,24,24,.72); font: inherit; cursor: pointer; }
.media-viewer-close:hover, .media-viewer-close:focus-visible, .media-viewer-nav:hover, .media-viewer-nav:focus-visible { color: #fff; background: rgba(58,58,58,.92); outline: 2px solid rgba(255,255,255,.55); outline-offset: 2px; }
.media-viewer-close { top: 18px; right: 22px; width: 46px; height: 46px; font-size: 2rem; font-weight: 250; line-height: 1; }
.media-viewer-nav { top: 50%; width: 52px; height: 52px; font-size: 2.6rem; font-weight: 250; transform: translateY(-50%); }
.media-viewer-nav--previous { left: 22px; }
.media-viewer-nav--next { right: 22px; }
.media-viewer-caption { grid-row: 2; grid-column: 1 / -1; min-height: 82px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 1.25rem; padding: 13px clamp(24px,5vw,86px) 17px; background: linear-gradient(0deg,rgba(0,0,0,.96),rgba(0,0,0,.68)); }
.media-viewer-caption > div { min-width: 0; }
.media-viewer-caption strong, .media-viewer-caption p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-viewer-caption strong { font-size: .88rem; }
.media-viewer-caption p { margin: .3rem 0 0; color: #bdbdbd; font-size: .72rem; }
.media-viewer-position { color: #aaa; font-size: .7rem; font-variant-numeric: tabular-nums; }
.media-viewer-detail { min-height: 34px; display: inline-flex; align-items: center; padding: 0 .8rem; border: 1px solid #777; border-radius: 18px; color: #ddd; font-size: .7rem; text-decoration: none; }
.media-viewer-detail:hover, .media-viewer-detail:focus-visible { color: #fff; border-color: #bbb; outline: none; background: #292929; }
@keyframes media-viewer-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 720px) {
    .media-viewer { grid-template-columns: 44px minmax(0,1fr) 44px; }
    .media-viewer-stage { padding-top: 62px; }
    .media-viewer-close { top: 10px; right: 10px; }
    .media-viewer-nav { width: 40px; height: 40px; background: rgba(24,24,24,.5); }
    .media-viewer-nav--previous { left: 3px; }
    .media-viewer-nav--next { right: 3px; }
    .media-viewer-caption { grid-template-columns: minmax(0,1fr) auto; gap: .7rem; padding: 11px 14px 14px; }
    .media-viewer-detail { grid-column: 1 / -1; width: max-content; }
}
@media (prefers-reduced-motion: reduce) { .media-viewer { animation: none; } }
.object-list { max-width: 1100px; }
.object-list > a, .bookmark-row { min-height: 62px; border-bottom: 1px solid #e7e3e0; }
.object-list > a, .bookmark-row > a { display: grid; grid-template-columns: 40px minmax(0,1fr) auto 18px; align-items: center; gap: .8rem; padding: .45rem .7rem; color: #3f3b38; text-decoration: none; }
.object-list > a:hover, .bookmark-row:hover { background: #efedeb; }
.object-list strong, .object-list small { display: block; }
.object-list strong { font-size: .78rem; font-weight: 550; }
.object-list small, .object-list time { margin-top: .14rem; color: #837d79; font-size: .67rem; }
.object-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #aaa5a1; }
.bookmark-row { display: grid; grid-template-columns: minmax(0,1fr) 44px; }
.bookmark-row > a { grid-template-columns: 40px minmax(0,1fr) 18px; }
.bookmark-row form { margin: 0; }
.bookmark-row button { width: 40px; height: 40px; border: 0; border-radius: 50%; color: #8a8581; background: transparent; font-size: 1.1rem; cursor: pointer; }
.bookmark-row button:hover { color: #6d4a3f; background: #e5dfdb; }
.admin-grid { display: grid; grid-template-columns: minmax(300px, .7fr) 1.3fr; gap: 1.25rem; align-items: start; }
.account-settings-grid { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; }
.account-settings-grid > .detail-panel { min-width: 0; }
.account-settings-grid .muted, .account-settings-grid .field-help { font-size: .68rem; line-height: 1.45; }
.credential-card { margin-bottom: 1.25rem; padding: 1.25rem 1.5rem; border: 1px solid #d8c9c0; border-radius: 14px; background: var(--brown-pale); }
.credential-card p { color: var(--muted); }
.credential-card dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin-bottom: 0; }
.credential-card dt { color: var(--muted); }
.credential-card dd { margin: 0; overflow-wrap: anywhere; }
.access-role-panel { position: relative; margin: 0; }
.access-role-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.access-role-heading h2 { margin-bottom: 0; }
.access-role-intro { margin: .65rem 0 .9rem; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.access-role-form { max-width: none; display: grid; grid-template-columns: 1fr; gap: .6rem; }
.access-role-form .button { width: max-content; min-height: 38px; }
.access-role-help { position: relative; flex: 0 0 auto; }
.access-role-help summary { width: 27px; height: 27px; display: grid; place-items: center; list-style: none; border: 1px solid var(--line); border-radius: 50%; color: var(--brown); background: #fff; font-size: .75rem; font-weight: 800; cursor: pointer; }
.access-role-help summary::-webkit-details-marker { display: none; }
.access-role-help summary:hover, .access-role-help[open] summary { color: #fff; border-color: var(--brown); background: var(--brown); }
.access-role-popover { position: absolute; z-index: 30; top: 35px; right: 0; width: min(330px,calc(100vw - 40px)); padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 14px 36px rgba(66,49,42,.18); }
.access-role-popover > strong { font-size: .72rem; }
.access-role-popover dl { margin: .65rem 0 0; }
.access-role-popover dl div { padding: .5rem 0; border-top: 1px solid #eee8e2; }
.access-role-popover dt { font-size: .68rem; font-weight: 750; }
.access-role-popover dd { margin: .12rem 0 0; color: var(--muted); font-size: .62rem; line-height: 1.4; }
.user-list { display: grid; }
.user-list article { display: flex; align-items: center; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid #eee8e2; }
.user-list article:last-child { border-bottom: 0; }
.user-list small { display: block; margin-top: .25rem; color: var(--muted); }
.admin-user-list .admin-user-card { display: block; padding: 1rem 0 1.15rem; }
.admin-user-summary { min-width: 0; display: flex; align-items: center; gap: .9rem; }
.admin-user-copy { min-width: 0; flex: 1 1 auto; }
.admin-user-copy strong, .admin-user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-person-link-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 1rem; margin: .9rem 0 0 48px; padding: .8rem 1rem; border: 1px solid #e5dfdb; border-radius: 9px; background: #faf8f6; }
.admin-person-link-state > span { display: block; margin-bottom: .25rem; color: var(--brown); font-size: .58rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.admin-person-link-state > strong, .admin-person-link-state a strong { display: block; color: var(--ink); font-size: .74rem; }
.admin-person-link-state a { color: inherit; text-decoration: none; }
.admin-person-link-state a:hover strong { color: var(--brown); }
.admin-person-link-state small { font-size: .62rem; line-height: 1.4; white-space: normal; }
.admin-person-link-editor { position: relative; justify-self: end; }
.admin-person-link-editor[open] { width: 100%; grid-column: 1 / -1; justify-self: stretch; }
.admin-person-link-editor > summary { min-height: 32px; display: inline-flex; align-items: center; padding: 0 .65rem; list-style: none; border: 1px solid #cfc6bf; border-radius: 17px; color: var(--brown); background: #fff; font-size: .66rem; font-weight: 700; cursor: pointer; }
.admin-person-link-editor > summary::-webkit-details-marker { display: none; }
.admin-person-link-editor[open] > summary { color: #fff; border-color: var(--brown); background: var(--brown); }
.admin-person-link-form { width: 100%; max-width: 700px; display: grid; grid-template-columns: minmax(300px,1fr) auto; align-items: end; gap: .7rem; margin-top: .75rem; }
.admin-person-link-form .proband-combobox { min-width: 0; }
.admin-person-link-form .proband-search-control input { min-height: 40px; padding-top: .55rem; padding-bottom: .55rem; }
.admin-person-link-form .button { min-height: 40px; }
.admin-person-link-form .button:disabled { opacity: .48; cursor: default; }
.admin-person-unlink-form { margin: .55rem 0 0; text-align: right; }
.admin-person-unlink-form button { color: #9a3d3d; font-size: .64rem; }
.account-state { margin-left: auto; padding: .35rem .55rem; border-radius: 999px; color: var(--brown-dark); background: var(--brown-soft); font-size: .72rem; }
.inline-admin-form { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.inline-admin-form select { min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.text-button--dark { color: var(--brown); white-space: nowrap; }
.text-button--dark:hover { color: var(--brown-dark); }
.admin-login-heading .button { flex: 0 0 auto; text-decoration: none; }
.login-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; margin-bottom: 1rem; }
.login-summary article { min-height: 90px; display: grid; align-content: center; gap: .2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.login-summary strong { color: var(--brown-dark); font-family: Georgia,"Times New Roman",serif; font-size: 1.7rem; }
.login-summary span { color: var(--muted); font-size: .76rem; }
.admin-login-filters { display: flex; align-items: end; gap: .7rem; margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--brown-pale); }
.admin-login-filters label { min-width: 180px; display: grid; gap: .3rem; color: var(--muted); font-size: .7rem; font-weight: 700; }
.admin-login-filters label:nth-child(2) { min-width: 310px; }
.admin-login-filters select { min-height: 38px; padding: 0 .65rem; border: 1px solid #cfc6bf; border-radius: 6px; color: var(--ink); background: #fff; }
.admin-login-filters .button { min-height: 38px; }
.admin-login-filters > a { margin: 0 .25rem .6rem; font-size: .74rem; }
.admin-login-table { border-radius: 10px; box-shadow: none; }
.admin-login-table th, .admin-login-table td { padding: .72rem 1rem; font-size: .72rem; }
.admin-login-table td strong, .admin-login-table td small { display: block; }
.admin-login-table td small { margin-top: .15rem; color: var(--muted); font-size: .64rem; }
.admin-login-table code { color: #706a66; font-size: .68rem; letter-spacing: .08em; }
.login-result { display: inline-flex; padding: .25rem .48rem; border-radius: 999px; font-size: .66rem; font-weight: 750; }
.login-result--success { color: #35603a; background: #e7f2e7; }
.login-result--failed { color: #8a3333; background: #f8e3e3; }
.admin-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-top: 1rem; color: var(--muted); font-size: .72rem; }
.admin-pagination > :last-child { justify-self: end; }
.admin-login-total { margin: .8rem 0 0; color: var(--muted); font-size: .7rem; text-align: right; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: 1rem; }
.recovery-grid code, .secret-key { padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 7px; background: white; overflow-wrap: anywhere; }
.secret-key { display: block; margin: 1rem 0; font-size: 1rem; letter-spacing: .08em; }
.mfa-qr { width: 260px; max-width: 100%; margin: 1.25rem auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.mfa-qr img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.mfa-manual { margin: .5rem 0 1rem; }
.mfa-manual summary { color: var(--brown); cursor: pointer; }
.field-help { color: var(--muted); font-size: .82rem; line-height: 1.5; }

@media (max-width: 1050px) {
    .metric-grid { grid-template-columns: repeat(4, 1fr); }
    .person-grid { grid-template-columns: repeat(2, 1fr); }
    .account-settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .user-name { display: none; }
    .workspace-toolbar { flex-wrap: wrap; }
    .workspace-toolbar .status-pill { margin-left: 0; }
    .workspace-body { grid-template-columns: 200px minmax(0, 1fr); }
    .workspace-canvas { grid-template-columns: minmax(220px,.65fr) minmax(320px,1.35fr); padding: 2.5rem; }
    .admin-user-summary { flex-wrap: wrap; }
    .admin-user-summary .inline-admin-form { margin-left: 48px; }
}

@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; gap: .5rem 1rem; padding: .7rem 1rem; }
    .main-nav { order: 3; width: 100%; min-height: 42px; overflow-x: auto; }
    .main-nav a, .main-nav .nav-disabled { padding: 0 .65rem; white-space: nowrap; }
    .user-menu { margin-left: auto; }
    .content-shell { width: min(100% - 1.25rem, 1440px); padding-top: 2rem; }
    .hero-row, .page-heading { align-items: stretch; flex-direction: column; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .empty-state, .login-card, .detail-grid, .admin-grid { grid-template-columns: 1fr; }
    .login-intro { min-height: 400px; }
    .person-grid { grid-template-columns: 1fr; }
    .search-form { width: 100%; }
    .workspace { min-height: 0; border-radius: 12px; }
    .workspace-toolbar { align-items: flex-start; gap: .75rem; }
    .workspace-title { min-width: 100%; }
    .workspace-tabs { max-width: 100%; overflow-x: auto; }
    .workspace-toolbar .status-pill { display: none; }
    .workspace-body { grid-template-columns: 1fr; min-height: 0; }
    .workspace-sidebar { padding: 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
    .workspace-sidebar-heading p { display: none; }
    .workspace-counts { display: grid; grid-template-columns: repeat(4,1fr); gap: .4rem; margin-top: .75rem; }
    .workspace-counts div { display: grid; justify-items: start; gap: .15rem; padding: .45rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
    .workspace-canvas { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 1.25rem; }
    .workspace-empty-graphic .empty-visual { width: min(70vw,260px); }
    .admin-person-link-row { grid-template-columns: 1fr; margin-left: 0; }
    .admin-person-link-form { width: 100%; grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .metric-card { min-height: 105px; }
    .login-card { border-radius: 16px; }
    .login-intro, .login-form-panel { padding: 2rem; }
    .person-hero { align-items: flex-start; }
    .portrait-placeholder { width: 80px; height: 80px; font-size: 2rem; }
    .workspace-counts { grid-template-columns: repeat(2,1fr); }
    .workspace-tabs a, .workspace-tabs span { padding: .4rem .58rem; font-size: .76rem; }
}

/* Desktoparbejdsflade: Gramps-inspireret og bevidst bred. */
.app-body { min-width: 1180px; background: #fff; }
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 182px minmax(998px,1fr); background: #fff; }
.app-sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; border-right: 1px solid #e5e1de; background: #fff; }
.sidebar-home, .sidebar-nav a, .sidebar-nav .nav-disabled { min-height: 39px; display: flex; align-items: center; gap: .7rem; padding: 0 13px; color: #4f4b48; font-size: .86rem; text-decoration: none; }
.sidebar-home { min-height: 52px; }
.sidebar-home:hover, .sidebar-nav a:hover { color: var(--brown-dark); background: var(--brown-pale); }
.sidebar-home.is-active, .sidebar-nav a.is-active { color: var(--brown-dark); font-weight: 700; background: #f3eeeb; box-shadow: inset 3px 0 0 var(--brown); }
.sidebar-nav .nav-disabled { opacity: .58; cursor: default; }
.nav-icon { width: 18px; flex: 0 0 18px; display: inline-grid; place-items: center; color: #9d9996; font-size: 1rem; line-height: 1; }
.sidebar-home.is-active .nav-icon, .sidebar-nav a.is-active .nav-icon { color: var(--brown); }
.sidebar-separator { display: block; height: 1px; margin: 8px 13px; background: #e6e2df; }
.app-frame { min-width: 0; }
.app-body .topbar { position: sticky; top: 0; z-index: 10; min-height: 52px; height: 52px; padding: 0 20px; flex-wrap: nowrap; gap: 1.25rem; box-shadow: none; background: var(--brown); }
.app-body .menu-mark { color: rgba(255,255,255,.9); font-size: 1rem; }
.app-body .brand { font-size: .88rem; }
.topbar-actions { position: relative; margin-left: auto; display: flex; align-items: stretch; height: 52px; gap: .18rem; }
.topbar-icon-button, .account-menu summary { width: 42px; height: 52px; display: grid; place-items: center; border: 0; color: #fff; background: transparent; font-size: 1.75rem; line-height: 1; text-decoration: none; cursor: pointer; }
.topbar-icon-button:hover, .account-menu summary:hover, .account-menu[open] summary { background: rgba(255,255,255,.1); }
.topbar-icon-button.is-active { background: rgba(255,255,255,.14); box-shadow: inset 0 -3px 0 #d7afa2; }
.topbar-icon-button:disabled { color: rgba(255,255,255,.72); cursor: default; }
.topbar-icon-button:disabled:hover { background: transparent; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-symbol { width: 27px; height: 27px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: var(--brown); background: #fff; font-size: .72rem; font-weight: 800; }
.account-dropdown { position: absolute; z-index: 40; top: 52px; right: -45px; width: 286px; padding: 12px 0 0; border: 1px solid #d3ceca; border-radius: 5px; color: var(--ink); background: #fff; box-shadow: 0 4px 12px rgba(42,35,32,.24); }
.account-menu-item { min-height: 62px; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: .65rem; padding: 10px 24px; color: #292624; font-size: 1rem; line-height: 1.25; text-decoration: none; }
.account-menu-item > span, .account-logout button > span { color: #aaa7a4; font-size: 1.35rem; text-align: center; }
a.account-menu-item:hover, .account-menu-item.is-active { color: var(--brown-dark); background: var(--brown-pale); }
.account-menu-item.is-disabled { color: #8d8884; cursor: default; }
.account-logout { margin-top: 8px; border-top: 1px solid #cfcac6; }
.account-logout button { width: 100%; min-height: 70px; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: .65rem; padding: 10px 24px; border: 0; color: #c52e2e; background: #fff; font: inherit; font-size: 1rem; text-align: left; cursor: pointer; }
.account-logout button > span { color: #c52e2e; }
.account-logout button:hover { background: #fff7f7; }
.app-body .content-shell { width: auto; max-width: none; margin: 0; padding: 38px 34px 80px; background: #fff; }

.dashboard-grid { width: 100%; display: grid; grid-template-columns: minmax(620px,1fr) 280px; gap: clamp(60px,8vw,150px); align-items: start; }
.dashboard-main { min-width: 0; }
.dashboard-aside { min-width: 0; }
.dashboard-section { margin: 0 0 42px; }
.dashboard-section h1, .dashboard-section h2 { margin: 0 0 20px; font-family: inherit; font-size: .93rem; line-height: 1.3; letter-spacing: 0; font-weight: 750; }
.proband-row, .activity-row { min-height: 48px; display: flex; align-items: center; gap: .9rem; color: var(--ink); text-decoration: none; }
.proband-row { max-width: 950px; }
.proband-row:hover strong, a.activity-row:hover strong { color: var(--brown); }
.proband-row .person-avatar { width: 36px; height: 36px; font-family: inherit; font-size: .74rem; font-weight: 750; }
.proband-row strong, .activity-row strong { display: block; font-size: .87rem; font-weight: 500; }
.proband-row small, .activity-row small { display: block; margin-top: .16rem; color: #8a8581; font-size: .73rem; line-height: 1.35; }
.proband-row--empty { color: var(--muted); }
.activity-list { display: grid; gap: .18rem; }
.activity-row { width: fit-content; max-width: 100%; min-height: 50px; }
.activity-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #b8b3af; font-size: 1rem; }
.activity-icon--text { font-size: .56rem; font-weight: 800; letter-spacing: .02em; }
.dashboard-empty { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.statistics-list { width: 230px; margin: 0; }
.statistics-list div { display: grid; grid-template-columns: 42px 1fr; align-items: baseline; gap: .9rem; padding: .38rem 0; }
.statistics-list dt { color: var(--muted); font-size: .75rem; }
.statistics-list dd { margin: 0; color: #4d4946; font-size: .9rem; text-align: right; }

.compact-heading { display: flex; align-items: end; justify-content: space-between; gap: 3rem; margin: 0 0 28px; }
.compact-heading h1 { margin: .2rem 0 0; font-family: inherit; font-size: 1.35rem; line-height: 1.25; }
.compact-heading p { max-width: 650px; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }

.search-page { width: min(1500px,100%); margin: 0 auto; }
.search-heading { margin-bottom: 22px; }
.global-search-form { width: 100%; }
.global-search-control { position: relative; display: block; }
.global-search-label { position: absolute; z-index: 2; left: 22px; top: -7px; padding: 0 .35rem; color: var(--brown); background: #fff; font-size: .65rem; font-weight: 750; }
.global-search-icon { position: absolute; left: 20px; top: 50%; color: #807873; font-size: 1.3rem; transform: translateY(-50%); pointer-events: none; }
.global-search-control input { width: 100%; height: 54px; padding: 0 64px 0 54px; border: 2px solid #b58d80; border-radius: 28px; color: var(--ink); background: #fff; font: inherit; font-size: .95rem; outline: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.global-search-control input::placeholder { color: #aaa29d; }
.global-search-control input:focus { border-color: var(--brown); box-shadow: 0 0 0 4px rgba(109,74,63,.1); }
.global-search-control button { position: absolute; right: 5px; top: 5px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--brown); background: transparent; font-size: 1.35rem; cursor: pointer; }
.global-search-control button:hover, .global-search-control button:focus-visible { outline: 0; background: var(--brown-pale); }
.search-type-filters { display: flex; flex-wrap: wrap; gap: .45rem; margin: 20px 0 18px; }
.search-type-filters a { min-height: 34px; display: inline-flex; align-items: center; gap: .42rem; padding: 0 .72rem; border: 1px solid transparent; border-radius: 6px; color: #675e59; font-size: .7rem; font-weight: 650; text-decoration: none; }
.search-type-filters a:hover { border-color: #d8cec8; background: #faf7f5; }
.search-type-filters a.is-active { color: #4c332c; background: #d7b1a4; }
.search-type-filters a span { color: var(--brown); font-size: .86rem; }
.search-result-summary { min-height: 28px; padding: 0 4px; color: #706863; font-size: .76rem; }
.search-result-summary strong { color: var(--ink); font-size: .86rem; }
.search-results { max-height: calc(100vh - 350px); min-height: 250px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid #e8e3df; scrollbar-gutter: stable; }
.search-result { min-height: 66px; display: grid; grid-template-columns: 44px minmax(0,1fr) minmax(100px,150px) 20px; align-items: center; gap: .85rem; padding: .55rem .7rem; border-bottom: 1px solid #ece8e5; color: #403b38; text-decoration: none; transition: background .12s ease, box-shadow .12s ease; }
.search-result:hover, .search-result:focus-visible { outline: 0; background: #f3efec; box-shadow: inset 3px 0 0 var(--brown); }
.search-result-avatar { width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border: 1px solid #d8d1cc; border-radius: 50%; color: #695e58; background: #eeeae7; font-size: .9rem; }
.search-result-avatar--person { border-color: #83bde5; }
.search-result-avatar--media { border-radius: 7px; }
.search-result-avatar img { width: 100%; height: 100%; object-fit: cover; }
.search-result-copy { min-width: 0; }
.search-result-copy strong, .search-result-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy strong { font-size: .78rem; font-weight: 680; }
.search-result-copy small { margin-top: .22rem; color: #817a75; font-size: .68rem; }
.search-result-kind { color: #918984; font-size: .65rem; text-align: right; }
.search-result-arrow { color: #9a928d; font-size: 1.25rem; transition: transform .12s ease; }
.search-result:hover .search-result-arrow { transform: translateX(3px); }
.search-empty-state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem; color: #817a75; text-align: center; }
.search-empty-state > span { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: .85rem; border-radius: 50%; color: var(--brown); background: var(--brown-pale); font-size: 1.5rem; }
.search-empty-state strong { color: #4b4541; font-size: .9rem; }
.search-empty-state p { max-width: 520px; margin: .45rem 0 0; font-size: .74rem; line-height: 1.55; }
.search-pagination { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 1.4rem; color: #99918c; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.search-pagination a { color: var(--brown); text-decoration: none; }
.search-pagination strong { min-width: 76px; color: #625b57; text-align: center; }
@media (max-width: 700px) {
    .search-heading p { display: none; }
    .global-search-control input { font-size: .82rem; }
    .search-type-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; }
    .search-type-filters a { flex: 0 0 auto; }
    .search-results { max-height: calc(100vh - 330px); }
    .search-result { grid-template-columns: 42px minmax(0,1fr) 16px; }
    .search-result-kind { display: none; }
}

.list-tabs { display: flex; gap: 1.7rem; overflow-x: auto; margin: 0 0 20px; border-bottom: 1px solid #ded9d5; white-space: nowrap; }
.list-tabs a { position: relative; padding: .7rem 0 .9rem; color: #69635f; font-size: .76rem; text-decoration: none; }
.list-tabs a:hover { color: var(--brown-dark); }
.list-tabs a.is-active { color: var(--brown); font-weight: 700; }
.list-tabs a.is-active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brown); }
.list-toolbar { display: flex; align-items: center; gap: .55rem; margin-bottom: 16px; color: #837d79; font-size: .7rem; }
.list-toolbar label { width: min(420px,50vw); }
.list-toolbar input { width: 100%; min-height: 36px; padding: .45rem .7rem; border: 1px solid #cec8c4; border-radius: 5px; background: #fff; }
.list-toolbar button { min-height: 36px; padding: 0 .9rem; border: 1px solid #bdb6b1; border-radius: 18px; color: var(--brown); background: #fff; cursor: pointer; }
.list-toolbar span { margin-left: auto; }
.registry-table { max-height: calc(100vh - 265px); overflow: auto; border-radius: 4px; box-shadow: none; }
.registry-table th { position: sticky; z-index: 1; top: 0; }
.registry-table th, .registry-table td { padding: .72rem 1rem; font-size: .72rem; }
.registry-table td small { display: block; margin-top: .15rem; color: #8a8581; font-size: .64rem; }
.registry-excerpt { max-width: 650px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-breadcrumb { display: flex; gap: .5rem; margin: -8px 0 18px; color: #8a8581; font-size: .7rem; }
.record-breadcrumb a { color: #77716d; text-decoration: none; }
.record-heading { padding-bottom: 22px; border-bottom: 1px solid #e1dcda; }
.record-heading h1 { margin: .3rem 0; font-family: inherit; font-size: 1.55rem; }
.record-heading p { margin: 0; color: #8a8581; font-size: .7rem; }
.record-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin-top: 20px; border: 1px solid #ded9d5; background: #ded9d5; }
.record-grid--note { grid-template-columns: minmax(320px,.8fr) minmax(420px,1.2fr); }
.record-panel { min-width: 0; padding: 1.35rem 1.55rem; background: #fff; }
.record-grid + .record-panel, .record-heading + .record-panel { margin-top: 20px; border: 1px solid #ded9d5; }
.record-panel h2 { margin: 0 0 1rem; font-family: inherit; font-size: .92rem; }
.record-kind { display: inline-block; margin-bottom: .65rem; color: var(--brown); font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.record-prose { color: #514c48; font-size: .8rem; line-height: 1.7; }
.record-metadata { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: .7rem 1rem; margin: 0; font-size: .75rem; }
.record-metadata dt { color: #8a8581; }
.record-metadata dd { margin: 0; }
.record-metadata a { color: var(--brown); }
.record-link-list a { display: grid; grid-template-columns: 36px minmax(0,1fr) 14px; align-items: center; gap: .65rem; min-height: 52px; padding: .25rem .35rem; color: #413d3a; text-decoration: none; }
.record-link-list a:hover, .record-event:hover { background: #efedeb; }
.record-link-list strong, .record-link-list small { display: block; }
.record-link-list strong { font-size: .75rem; }
.record-link-list small { margin-top: .15rem; color: #8a8581; font-size: .65rem; }
.record-event { display: block; padding: .65rem .5rem; border-bottom: 1px solid #ebe7e4; color: #413d3a; text-decoration: none; }
.record-event strong, .record-event small { display: block; }
.record-event strong { font-size: .76rem; }
.record-event small { margin-top: .2rem; color: #8a8581; font-size: .66rem; }
.record-media-stage a { display: block; color: #5d5753; text-decoration: none; }
.record-media-stage img { display: block; width: min(100%,720px); max-height: 62vh; object-fit: contain; object-position: left center; background: #f1efed; }
.record-media-placeholder { width: min(100%,720px); min-height: 220px; display: grid; place-items: center; color: #8e8884; background: #f1efed; font-size: 3rem; }
.record-media-stage small { display: block; margin-top: .5rem; color: #817b77; font-size: .68rem; }
.record-media-stage .record-prose { margin-top: 1.2rem; }
@media (max-width: 900px) { .record-grid, .record-grid--note { grid-template-columns: 1fr; } .list-tabs { gap: 1rem; } }

.tree-workspace, .timeline-workspace { position: relative; min-height: calc(100vh - 155px); overflow: hidden; border: 1px solid #e2ddda; background: #fbfaf9; }
.tree-chart-tabs { display: flex; padding: 18px 28px 0; background: #fff; }
.tree-chart-tabs button { min-height: 38px; display: inline-flex; align-items: center; gap: .42rem; padding: 0 1rem; border: 1px solid #aaa39e; border-right-width: 0; color: #77716d; background: #fff; font: inherit; font-size: .74rem; cursor: pointer; }
.tree-chart-tabs button:first-child { border-radius: 20px 0 0 20px; }
.tree-chart-tabs button:last-child { border-right-width: 1px; border-radius: 0 20px 20px 0; }
.tree-chart-tabs button:hover { color: var(--brown-dark); background: #faf8f7; }
.tree-chart-tabs button.is-active { color: var(--brown-dark); background: #eee8e4; box-shadow: inset 0 0 0 1px rgba(118,82,71,.12); }
.tree-chart-tabs button span { font-size: .95rem; }
.tree-commandbar { min-height: 58px; display: flex; align-items: center; gap: .2rem; padding: 8px 30px; background: #fff; }
.tree-commandbar button, .chart-controls button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #9b9793; background: transparent; font: inherit; font-size: 1.22rem; font-weight: 650; cursor: pointer; }
.tree-commandbar button:hover, .chart-controls button:hover { color: var(--brown); background: #eee9e6; }
.tree-commandbar button:disabled { opacity: .35; cursor: default; }
.tree-command-divider { height: 26px; margin: 0 .35rem; border-left: 1px solid #d9d4d0; }
.tree-settings-backdrop { position: absolute; z-index: 40; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(24,22,21,.38); backdrop-filter: blur(2px); }
.tree-settings-backdrop[hidden] { display: none; }
.tree-settings-dialog { width: min(560px,calc(100vw - 48px)); padding: 1.7rem 2rem 1.25rem; border: 1px solid #d4ceca; border-radius: 18px; color: #433e3a; background: #f8f6f4; box-shadow: 0 22px 70px rgba(36,31,28,.28); }
.tree-settings-dialog h2 { margin: 0 0 1rem; font-family: inherit; font-size: 1rem; }
.tree-settings-row { min-height: 58px; display: grid; grid-template-columns: minmax(210px,1fr) minmax(170px,.8fr); align-items: center; gap: 1.25rem; }
.tree-settings-row[hidden] { display: none; }
.tree-settings-row label { color: #625c58; font-size: .78rem; }
.tree-settings-row input, .tree-settings-row select { width: 100%; min-height: 44px; padding: .55rem .7rem; border: 0; border-bottom: 2px solid #b79184; border-radius: 4px 4px 0 0; color: #403b38; background: #ebe8e6; font: inherit; font-size: .78rem; outline: none; }
.tree-settings-row input:focus, .tree-settings-row select:focus { border-bottom-color: var(--brown-dark); background: #e5e1de; }
.tree-settings-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; }
.tree-settings-actions button { min-height: 38px; padding: 0 .8rem; border: 0; border-radius: 4px; color: var(--brown); background: transparent; font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.tree-settings-actions button:hover, .tree-settings-actions button:focus-visible { outline: 0; background: #e9e4e1; }
@media (max-width: 620px) { .tree-settings-row { grid-template-columns: 1fr; gap: .35rem; padding: .5rem 0; } }
.tree-selected-person { position: absolute; z-index: 4; top: 126px; left: 30px; min-height: 50px; display: grid; grid-template-columns: 46px minmax(150px,auto) auto; align-items: center; gap: .75rem; padding: .25rem .4rem; border-radius: 8px; background: rgba(251,250,249,.9); backdrop-filter: blur(5px); }
.tree-selected-avatar { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid #76b8e6; border-radius: 50%; color: #6d625d; background: #ddd9d6; font-size: .78rem; font-weight: 750; }
.tree-selected-avatar--f { border-color: #d9aaa5; }
.tree-selected-person strong, .tree-selected-person small { display: block; }
.tree-selected-person > span:nth-child(2) { min-width: 0; }
.tree-selected-person strong { max-width: 280px; overflow: hidden; font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.tree-selected-person small { max-width: 280px; margin-top: .14rem; overflow: hidden; color: #89837f; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.tree-selected-person a { margin-left: .35rem; color: var(--brown); font-size: .7rem; }
.tree-relative-menu { position: absolute; z-index: 12; width: 310px; max-height: 370px; overflow: auto; padding: .65rem 0; border: 1px solid #d8d3cf; border-radius: 7px; color: #373330; background: #fff; box-shadow: 0 10px 28px rgba(43,37,33,.22); }
.tree-relative-menu[hidden] { display: none; }
.tree-relative-menu > strong { display: block; padding: .35rem 1rem .55rem; color: #77716d; font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.tree-relative-menu button { width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: .7rem; padding: .58rem 1rem; border: 0; color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.tree-relative-menu button:hover, .tree-relative-menu button:focus-visible { outline: 0; background: #f1eeec; }
.tree-relative-menu button b, .tree-relative-menu button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-relative-menu button b { font-size: .78rem; font-weight: 650; }
.tree-relative-menu button small { margin-top: .14rem; color: #817b77; font-size: .65rem; }
.tree-relative-avatar { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid #5ab0ec; border-radius: 50%; color: #5e5752; background: #e7e3e0; font-size: .72rem; font-weight: 750; }
.tree-relative-avatar--f { border-color: #ef9a9f; }
.tree-viewport { width: 100%; height: calc(100vh - 270px); min-height: 590px; overflow: hidden; border-top: 1px solid #ece8e5; background: #fff; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.tree-viewport:active { cursor: grabbing; }
.tree-viewport:focus-visible, .timeline-viewport:focus-visible { outline: 2px solid var(--brown); outline-offset: -2px; }
.tree-viewport svg, .timeline-viewport svg { display: block; width: 100%; height: 100%; -webkit-user-select: none; user-select: none; }
.tree-viewport svg * { -webkit-user-select: none; user-select: none; }
.tree-viewport [data-tree-nodes] [role="button"],
.tree-viewport [data-tree-nodes] [role="button"]:focus,
.tree-viewport [data-tree-nodes] [role="button"]:focus-visible { outline: none !important; }
.tree-viewport .fan-segment { transition: filter .14s ease; }
.tree-viewport [data-tree-fan] [role="button"]:hover .fan-segment,
.tree-viewport [data-tree-fan] [role="button"]:focus-visible .fan-segment { filter: brightness(.95) saturate(1.08); }
.tree-viewport [data-tree-fan] [role="button"],
.tree-viewport [data-tree-fan] [role="button"]:focus,
.tree-viewport [data-tree-fan] [role="button"]:focus-visible { outline: none !important; }
.chart-controls { position: absolute; z-index: 6; right: 14px; bottom: 16px; display: grid; padding: .3rem; border: 1px solid #ddd8d4; border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 3px 10px rgba(43,37,33,.1); }
.chart-help { position: absolute; z-index: 5; left: 50%; bottom: 18px; padding: .4rem .8rem; border-radius: 18px; color: #716b67; background: rgba(239,235,232,.9); font-size: .66rem; transform: translateX(-50%); pointer-events: none; }
.chart-zoom-status { position: absolute; z-index: 5; right: 68px; bottom: 23px; min-width: 42px; color: #88827e; font-size: .65rem; text-align: right; pointer-events: none; }
.pedigree-fallback { min-height: 600px; padding: 50px; overflow: auto; }
.pedigree-tree, .pedigree-tree ul { position: relative; display: flex; align-items: center; gap: 42px; min-width: max-content; margin: 0; padding: 0; list-style: none; }
.pedigree-tree ul { flex-direction: column; align-items: flex-start; gap: 18px; padding-left: 44px; }
.pedigree-tree li { position: relative; display: flex; align-items: center; }
.pedigree-tree li > ul::before { content: ""; position: absolute; left: 0; top: 50%; width: 44px; border-top: 1px solid #bbb5b1; }
.pedigree-tree li > ul > li::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; border-top: 1px solid #bbb5b1; }
.pedigree-tree li > ul > li:first-child::after { content: ""; position: absolute; left: -22px; top: 50%; bottom: -9px; border-left: 1px solid #bbb5b1; }
.pedigree-tree li > ul > li:last-child::after { content: ""; position: absolute; left: -22px; top: -9px; bottom: 50%; border-left: 1px solid #bbb5b1; }
.pedigree-person { width: 190px; min-height: 66px; display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-left: 4px solid #a9c7dd; border-radius: 6px; color: #3f3b38; background: #ebeae9; box-shadow: 0 2px 7px rgba(45,39,35,.08); text-decoration: none; }
.pedigree-person:hover { color: var(--brown-dark); background: #f2efed; box-shadow: 0 5px 14px rgba(45,39,35,.14); }
.pedigree-person--f { border-left-color: #d7aaa4; }
.pedigree-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; color: #6f625c; background: #fff; font-size: .78rem; font-weight: 750; }
.pedigree-person strong { display: block; max-width: 124px; overflow: hidden; font-size: .76rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pedigree-person small { display: block; max-width: 124px; margin-top: .22rem; overflow: hidden; color: #77716d; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }

.history-timeline { position: relative; width: min(1100px,100%); padding: 4px 0 40px; }
.history-timeline::before { content: ""; position: absolute; left: 168px; top: 0; bottom: 0; border-left: 1px solid #cbc5c1; }
.history-event { position: relative; display: grid; grid-template-columns: 145px 18px minmax(0,1fr); gap: 14px; padding: 0 0 26px; }
.history-event time { padding-top: 3px; color: #77716d; font-size: .75rem; text-align: right; }
.history-marker { position: relative; z-index: 1; width: 11px; height: 11px; margin: 4px auto 0; border: 3px solid #eee8e4; border-radius: 50%; background: var(--brown); }
.history-event strong { display: inline-block; margin-right: .65rem; font-size: .86rem; }
.history-people { color: #5f5955; font-size: .8rem; }
.history-event small { display: block; margin-top: .26rem; color: #8a8581; font-size: .72rem; }
.history-event p { max-width: 780px; margin: .5rem 0 0; color: #615b57; font-size: .8rem; line-height: 1.55; }
.timeline-summary-bar { min-height: 46px; display: flex; align-items: center; gap: 1.3rem; padding: 0 22px; border-bottom: 1px solid #e8e3df; color: #77716d; background: #fff; font-size: .7rem; }
.timeline-summary-bar [data-timeline-range] { margin-left: auto; color: var(--brown-dark); font-weight: 700; }
.timeline-contextbar { position: absolute; z-index: 10; top: 68px; left: 38px; display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; width: min(650px,calc(100% - 150px)); }
.timeline-filter-button, .timeline-person-chip, .timeline-scope-tabs { border: 1px solid #aaa39e; border-radius: 999px; background: rgba(255,255,255,.96); box-shadow: 0 2px 8px rgba(43,37,33,.04); }
.timeline-filter-button { min-height: 36px; display: inline-flex; align-items: center; gap: .45rem; padding: 0 .9rem; color: var(--brown); font: inherit; font-size: .72rem; font-weight: 650; cursor: pointer; }
.timeline-filter-button:hover, .timeline-filter-button[aria-expanded="true"] { background: #f1ece9; }
.timeline-filter-button span { font-size: .62rem; transform: rotate(180deg); }
.timeline-person-chip { min-height: 36px; display: inline-flex; align-items: center; overflow: hidden; border-color: #b9978b; background: #c7a297; }
.timeline-person-chip[hidden] { display: none; }
.timeline-person-chip button { min-height: 34px; padding: 0 .18rem 0 .85rem; border: 0; color: #49342d; background: transparent; font: inherit; font-size: .72rem; cursor: pointer; }
.timeline-person-chip button:last-child { padding: 0 .72rem 0 .55rem; font-size: 1rem; font-weight: 300; }
.timeline-person-chip button:hover { color: #1f1714; }
.timeline-context-break { flex-basis: 100%; height: 0; }
.timeline-scope-tabs { width: max-content; display: flex; overflow: hidden; box-shadow: none; }
.timeline-scope-tabs button { min-height: 34px; padding: 0 .95rem; border: 0; border-right: 1px solid #aaa39e; color: #765247; background: transparent; font: inherit; font-size: .71rem; cursor: pointer; }
.timeline-scope-tabs button:last-child { border-right: 0; }
.timeline-scope-tabs button:hover { background: #f5f1ef; }
.timeline-scope-tabs button.is-active { color: #46322c; background: #c7a297; }
.timeline-scope-tabs button:disabled { opacity: .42; cursor: default; }
.timeline-filter-menu { position: absolute; z-index: 2; top: 44px; left: 0; width: 340px; max-height: min(560px,calc(100vh - 250px)); overflow: auto; padding: .85rem; border: 1px solid #d4ceca; border-radius: 8px; color: #4b4541; background: #fff; box-shadow: 0 12px 32px rgba(43,37,33,.18); }
.timeline-filter-menu[hidden] { display: none; }
.timeline-filter-menu section + section { margin-top: .9rem; padding-top: .85rem; border-top: 1px solid #ebe7e4; }
.timeline-filter-menu section > label:first-child, .timeline-filter-menu section > strong { display: block; margin: 0 0 .5rem; color: #716a66; font-size: .67rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.timeline-filter-menu input[type="search"] { width: 100%; min-height: 38px; padding: .5rem .65rem; border: 1px solid #c9c2bd; border-radius: 5px; color: var(--ink); background: #fff; font: inherit; font-size: .76rem; }
.timeline-filter-menu [data-timeline-person-results] { max-height: 210px; margin-top: .35rem; overflow: auto; }
.timeline-person-option { width: 100%; padding: .48rem .55rem; overflow: hidden; border: 0; border-radius: 4px; color: #4b4541; background: transparent; font: inherit; font-size: .74rem; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.timeline-person-option:hover, .timeline-person-option:focus-visible { outline: 0; background: #f0ece9; }
.timeline-filter-menu section:last-child label { display: flex; align-items: center; gap: .5rem; padding: .24rem .2rem; font-size: .72rem; }
.timeline-filter-menu input[type="checkbox"] { accent-color: var(--brown); }
.timeline-viewport { width: 100%; height: calc(100vh - 325px); min-height: 480px; overflow: hidden; background: #fff; cursor: grab; touch-action: none; }
.timeline-viewport:active { cursor: grabbing; }
.timeline-detail { position: absolute; z-index: 5; left: 22px; bottom: 22px; width: min(360px,calc(100% - 120px)); min-height: 108px; padding: 1rem 1.15rem; border: 1px solid #ded8d4; border-radius: 7px; background: rgba(255,255,255,.95); box-shadow: 0 5px 18px rgba(54,45,40,.1); backdrop-filter: blur(6px); }
.timeline-detail h2 { margin: .3rem 0 .25rem; font-family: inherit; font-size: .9rem; }
.timeline-detail p { margin: .25rem 0 0; color: #6f6965; font-size: .72rem; line-height: 1.45; }
.timeline-detail dl { display: grid; grid-template-columns: 64px 1fr; gap: .25rem .65rem; margin: .65rem 0 0; font-size: .68rem; }
.timeline-detail dt { color: #918a86; }
.timeline-detail dd { margin: 0; color: #4e4946; }
.proband-picker form { width: min(720px,100%); display: grid; grid-template-columns: minmax(360px,1fr) auto; align-items: end; gap: .75rem; margin: 1.4rem auto 0; text-align: left; }
.proband-combobox { position: relative; min-width: 0; }
.proband-combobox > label { display: block; margin-bottom: .45rem; color: var(--muted); font-size: .74rem; font-weight: 750; }
.proband-search-control { position: relative; }
.proband-search-control > span { position: absolute; left: .85rem; top: 50%; color: #8e8884; font-size: 1.15rem; transform: translateY(-50%); pointer-events: none; }
.proband-search-control input { width: 100%; min-height: 48px; padding: .72rem 1rem .72rem 2.5rem; border: 1px solid #bfb6b0; border-radius: 7px; color: var(--ink); background: #fff; font: inherit; outline: none; }
.proband-search-control input:focus { border-color: var(--brown); box-shadow: 0 0 0 3px rgba(118,82,71,.12); }
.proband-results { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 350px; overflow-y: auto; padding: .35rem 0; border: 1px solid #cfc8c3; border-radius: 7px; background: #fff; box-shadow: 0 12px 30px rgba(52,42,37,.18); }
.proband-results[hidden] { display: none; }
.proband-option { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: .7rem; padding: .62rem .85rem; border: 0; color: var(--ink); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.proband-option:hover, .proband-option.is-active { background: var(--brown-pale); }
.proband-option[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--brown); }
.proband-option-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #5e5550; background: #ece7e3; font-size: .72rem; font-weight: 750; }
.proband-option-avatar--f { background: #f1e7e3; }
.proband-option-copy { min-width: 0; }
.proband-option strong { display: block; overflow: hidden; font-size: .84rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.proband-option small { display: block; margin-top: .18rem; overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.proband-no-results { margin: 0; padding: 1rem; color: var(--muted); font-size: .82rem; text-align: center; }
.proband-search-status { min-height: 18px; margin: .4rem 0 0; color: var(--muted); font-size: .7rem; }
.proband-picker form > .button { align-self: start; margin-top: 1.55rem; }
.proband-picker .button:disabled { opacity: .48; cursor: default; }
.proband-noscript { grid-column: 1 / -1; margin: .5rem 0 0; color: var(--muted); font-size: .8rem; }

.history-heading { margin-bottom: 1.25rem; }
.version-history { overflow: hidden; border: 1px solid #ded7d2; border-radius: 12px; background: #fff; }
.version-history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; padding: 1.4rem 1.6rem 1.25rem; border-bottom: 1px solid #e9e4e0; }
.version-history-header .eyebrow { margin-bottom: .35rem; font-size: .6rem; }
.version-history-header h2 { margin: 0; font-family: inherit; font-size: 1rem; }
.version-history-header p { max-width: 760px; margin: .55rem 0 0; color: #7e7772; font-size: .7rem; line-height: 1.55; }
.version-branch-badge { min-height: 30px; display: inline-flex; align-items: center; gap: .45rem; padding: 0 .7rem; border: 1px solid #cfc5bf; border-radius: 16px; color: #5e514b; background: #f6f1ed; font-size: .67rem; font-weight: 700; white-space: nowrap; }
.version-branch-badge span { width: 8px; height: 8px; border-radius: 50%; background: var(--brown); box-shadow: 0 0 0 3px rgba(109,74,63,.12); }
.version-history-empty { min-height: 180px; display: grid; place-content: center; justify-items: center; padding: 2rem; color: #8a837e; text-align: center; }
.version-history-empty strong { color: #4d4743; font-size: .86rem; }
.version-history-empty span { margin-top: .4rem; font-size: .7rem; }
.version-graph { display: grid; grid-template-columns: 142px minmax(0,1fr); min-height: 290px; background: #fbfaf9; }
.version-branch-label { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 1.4rem; border-right: 1px solid #e4ded9; color: #544a45; background: #f5f0ec; }
.version-branch-label > span { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: .55rem; border-radius: 50%; color: #fff; background: var(--brown); font-size: .68rem; }
.version-branch-label strong { font-size: .75rem; }
.version-branch-label small { margin-top: .18rem; color: #928a85; font-size: .62rem; }
.version-track { position: relative; display: flex; align-items: center; gap: 2.5rem; overflow-x: auto; padding: 2rem 3rem; }
.version-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid #a99f98; }
.version-node { position: relative; z-index: 1; flex: 0 0 350px; padding-left: 24px; }
.version-node-marker { position: absolute; left: -8px; top: 50%; width: 18px; height: 18px; border: 4px solid #fbfaf9; border-radius: 50%; background: #8a7d76; box-shadow: 0 0 0 2px #8a7d76; transform: translateY(-50%); }
.version-node.is-current .version-node-marker { background: var(--brown); box-shadow: 0 0 0 2px var(--brown), 0 0 0 7px rgba(109,74,63,.12); }
.version-card { min-height: 220px; display: block; padding: 1.05rem 1.15rem; border: 1px solid #d9d1cb; border-radius: 9px; color: inherit; background: #fff; box-shadow: 0 8px 24px rgba(55,45,40,.06); text-decoration: none; transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.version-card:hover, .version-card:focus-visible { border-color: #9e7d70; outline: 0; box-shadow: 0 11px 30px rgba(74,49,40,.14); transform: translateY(-2px); }
.version-node.is-current .version-card { border-color: #9e7d70; box-shadow: 0 9px 28px rgba(74,49,40,.11); }
.version-node.is-selected .version-card { box-shadow: 0 0 0 3px rgba(109,74,63,.18), 0 10px 28px rgba(74,49,40,.12); }
.version-node.is-selected .version-node-marker { background: #fff; box-shadow: 0 0 0 3px var(--brown), 0 0 0 8px rgba(109,74,63,.14); }
.version-card-topline { display: flex; align-items: center; justify-content: space-between; gap: .8rem; color: #8b837e; font-size: .6rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.version-card-topline strong { padding: .25rem .48rem; border-radius: 10px; color: #fff; background: var(--brown); font-size: .56rem; letter-spacing: .04em; }
.version-card h3 { margin: .7rem 0 .8rem; font-family: inherit; font-size: .88rem; }
.version-card dl { display: grid; gap: .48rem; margin: 0; }
.version-card dl div { display: grid; grid-template-columns: 118px minmax(0,1fr); gap: .7rem; }
.version-card dt { color: #938b86; font-size: .62rem; }
.version-card dd { margin: 0; overflow-wrap: anywhere; color: #4d4743; font-size: .66rem; font-weight: 620; }
.version-card dd small { color: #958d88; font-size: .58rem; font-weight: 500; }
.version-card p { margin: .85rem 0 .3rem; color: #625a55; font-size: .64rem; }
.version-card > small { display: block; overflow: hidden; color: #99918c; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.version-card-action { display: flex; align-items: center; justify-content: flex-end; gap: .3rem; margin-top: .75rem; color: var(--brown); font-size: .6rem; font-weight: 750; }
.version-future { position: relative; z-index: 1; flex: 0 0 150px; display: grid; justify-items: center; gap: .45rem; color: #9a928d; }
.version-future > span { width: 30px; height: 30px; display: grid; place-items: center; border: 2px dashed #bdb5af; border-radius: 50%; background: #fbfaf9; font-size: 1rem; }
.version-future small { font-size: .6rem; text-align: center; }
.history-visits .section-heading { align-items: end; margin-bottom: .75rem; }
.history-visits .section-heading .eyebrow { margin-bottom: .3rem; font-size: .6rem; }
.history-visits .section-heading p { margin: 0; color: #89827d; font-size: .68rem; }
.version-change-history { margin-top: 1.5rem; overflow: hidden; border: 1px solid #ded7d2; border-radius: 12px; background: #fff; scroll-margin-top: 1rem; }
.version-change-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; padding: 1.4rem 1.6rem; border-bottom: 1px solid #e9e4e0; }
.version-change-header h2 { margin: .3rem 0 0; font-family: inherit; font-size: 1rem; }
.version-change-header p { max-width: 790px; margin: .55rem 0 0; color: #7e7772; font-size: .69rem; line-height: 1.55; }
.version-change-header > strong { flex: 0 0 auto; padding: .38rem .65rem; border-radius: 14px; color: #675049; background: #f3eeeb; font-size: .63rem; }
.version-change-empty { min-height: 150px; display: grid; place-content: center; justify-items: center; padding: 2rem; color: #8a837e; text-align: center; }
.version-change-empty strong { color: #4d4743; font-size: .82rem; }
.version-change-empty span { margin-top: .35rem; font-size: .68rem; }
.version-change-timeline { position: relative; width: min(1120px,100%); padding: 1.5rem 1.6rem 2rem; }
.version-change-timeline::before { content: ""; position: absolute; left: 177px; top: 1.5rem; bottom: 2rem; border-left: 1px solid #cfc7c2; }
.version-change-item { position: relative; display: grid; grid-template-columns: 138px 18px minmax(0,1fr); gap: 14px; min-height: 66px; }
.version-change-item time { padding-top: .42rem; color: #817a75; font-size: .67rem; text-align: right; font-variant-numeric: tabular-nums; }
.version-change-marker { position: relative; z-index: 1; width: 11px; height: 11px; margin: .48rem auto 0; border: 3px solid #f7f4f2; border-radius: 50%; background: var(--brown); box-shadow: 0 0 0 1px #a8958c; }
.version-change-item > a { min-width: 0; display: grid; grid-template-columns: 70px minmax(0,1fr); align-items: baseline; column-gap: .75rem; padding: .35rem .65rem .75rem; border-bottom: 1px solid #eee9e5; color: #49433f; text-decoration: none; }
.version-change-item > a:hover, .version-change-item > a:focus-visible { outline: 0; background: #f7f3f1; }
.version-change-item > a > span { color: #9a7569; font-size: .58rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.version-change-item strong { min-width: 0; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.version-change-item small { grid-column: 2; margin-top: .2rem; color: #918985; font-size: .61rem; }
@media (max-width: 760px) {
    .version-history-header { display: block; }
    .version-branch-badge { margin-top: 1rem; }
    .version-graph { grid-template-columns: 100px minmax(0,1fr); }
    .version-track { padding: 1.5rem 2rem; }
    .version-node { flex-basis: 300px; }
    .version-card dl div { grid-template-columns: 1fr; gap: .12rem; }
    .history-visits .section-heading > p { display: none; }
    .version-change-header { display: block; }
    .version-change-header > strong { display: inline-block; margin-top: .8rem; }
    .version-change-timeline { padding-inline: .8rem; }
    .version-change-timeline::before { left: 30px; }
    .version-change-item { grid-template-columns: 18px minmax(0,1fr); gap: 10px; }
    .version-change-item time { grid-column: 2; padding: 0 .55rem .2rem; text-align: left; }
    .version-change-marker { grid-column: 1; grid-row: 1 / span 2; }
    .version-change-item > a { grid-column: 2; grid-template-columns: 1fr; }
    .version-change-item small { grid-column: 1; }
}

