:root {
  color-scheme: light;
  --family-ink: #18202a;
  --family-muted: #5c6875;
  --family-paper: #f8f6f1;
  --family-surface: #ffffff;
  --family-accent: #466a5e;
  --family-accent-strong: #203f38;
  --family-warm: #b5683a;
  --family-wash: #edf2ed;
  --family-danger: #8d2d2d;
  --family-border: #d8d3ca;
  --family-radius: 0.65rem;
  --family-shadow: 0 0.25rem 1rem rgb(22 31 38 / 8%);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--family-paper); color: var(--family-ink); font: 16px/1.55 system-ui, sans-serif; }
a { color: var(--family-accent-strong); }
header { background: var(--family-accent-strong); color: white; }
header a { color: white; text-decoration: none; }
.shell { width: min(72rem, 100% - 2rem); margin-inline: auto; }
.topbar { display: flex; gap: 1.25rem; align-items: center; min-height: 4.5rem; flex-wrap: wrap; }
.brand { font-weight: 750; margin-right: auto; }
nav { display: flex; gap: 1rem; flex-wrap: wrap; }
main { padding-block: 2rem 4rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.035em; }
h2 { line-height: 1.15; }
.card { min-width: 0; background: var(--family-surface); border: 1px solid var(--family-border); border-radius: 1rem; box-shadow: var(--family-shadow); padding: clamp(1rem, 3vw, 1.5rem); margin-block: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
label { display: grid; gap: 0.35rem; margin-block: 0.75rem; font-weight: 650; }
input, select, textarea, button { font: inherit; padding: 0.65rem 0.75rem; border: 1px solid var(--family-border); border-radius: 0.4rem; }
input, select, textarea { min-width: 0; max-width: 100%; }
button, .button { background: var(--family-accent); color: white; border: 0; cursor: pointer; display: inline-block; text-decoration: none; font-weight: 700; }
button:hover, .button:hover { background: var(--family-accent-strong); }
.button.secondary, button.secondary { background: transparent; color: var(--family-accent-strong); border: 1px solid var(--family-border); }
.danger { background: var(--family-danger); }
.muted { color: var(--family-muted); }
.error { color: var(--family-danger); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 0.6rem; border-bottom: 1px solid var(--family-border); text-align: left; vertical-align: top; }
code { overflow-wrap: anywhere; }
.hero { display: flex; justify-content: space-between; gap: 2rem; align-items: end; padding: clamp(1.5rem, 5vw, 3.5rem); color: white; border-radius: 1.25rem; background: radial-gradient(circle at top right, #708f77, transparent 45%), var(--family-accent-strong); margin-bottom: 1.25rem; }
.hero h1 { max-width: 16ch; margin-bottom: .6rem; }
.hero p { max-width: 55ch; margin-bottom: 0; }
.hero.compact { padding: 2rem; }
.eyebrow { color: var(--family-warm); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: .4rem; }
.hero .eyebrow { color: #f4c39e; }
.dashboard { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
.span-2 { grid-column: span 1; }
.section-heading, .page-heading, .key-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-heading { margin-block: .5rem 1.5rem; }
.page-heading h1 { margin-bottom: .35rem; }
.metric { min-width: 9rem; padding: 1rem; background: rgb(255 255 255 / 12%); border: 1px solid rgb(255 255 255 / 20%); border-radius: 1rem; text-align: center; }
.metric strong { display: block; font-size: 2.3rem; line-height: 1; }
.metric.mini { color: white; background: var(--family-accent-strong); }
.metric.mini strong { font-size: 1.5rem; }
.stack { display: grid; gap: .65rem; }
.list-row, .story { display: grid; gap: .25rem; padding: .9rem; color: inherit; text-decoration: none; border: 1px solid var(--family-border); border-radius: .7rem; }
.list-row { grid-template-columns: minmax(9rem, auto) 1fr auto; align-items: center; }
.list-row:hover, .story:hover { background: var(--family-wash); }
.story > span, .list-row time { color: var(--family-muted); font-size: .82rem; }
.story > strong { font-size: 1.12rem; }
.story p { color: var(--family-muted); margin: 0; }
.badge, .status-dot { display: inline-block; border-radius: 100vw; padding: .3rem .65rem; background: var(--family-wash); color: var(--family-accent-strong); text-decoration: none; font-size: .8rem; font-weight: 750; }
.status-dot::before { content: ''; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #4e9867; margin-right: .4rem; }
.shortcut-grid, .cards-compact { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; }
.shortcut-grid > *, .cards-compact > * { min-width: 0; }
.shortcut-grid a, .cards-compact article { padding: 1rem; border: 1px solid var(--family-border); border-radius: .7rem; }
.wide { width: 100%; text-align: center; }
.meeting-card { background: linear-gradient(145deg, #fff, #edf2ed); }
.empty { padding: 1.2rem; color: var(--family-muted); background: #f3f1ec; border-radius: .7rem; }
.notice { position: sticky; top: .5rem; z-index: 2; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid #9ebba5; border-radius: .65rem; background: #eaf5ec; box-shadow: var(--family-shadow); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.profile-editor { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.avatar-panel { min-width: 0; }
.avatar { display: block; width: min(100%, 14rem); aspect-ratio: 1; border: 1px solid var(--family-border); border-radius: 1rem; object-fit: cover; background: var(--family-wash); }
.avatar-placeholder { display: grid; place-items: center; color: var(--family-accent-strong); font-size: clamp(3rem, 10vw, 5rem); font-weight: 800; }
.avatar-actions input[type="file"] { width: 100%; max-width: 100%; }
.avatar-actions .muted { font-size: .85rem; }
.avatar-links { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: .85rem; }
.avatar-links form { margin: 0; }
.check { display: flex; grid-column: 1 / -1; flex-direction: row; align-items: center; font-weight: 500; }
.check input { width: auto; }
.inline-form, .filter-row, .review-row { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.inline-form > *, .filter-row > *, .review-row > * { flex: 1 1 8rem; }
.article { max-width: 52rem; margin-inline: auto; padding: clamp(1.5rem, 5vw, 3rem); }
.article .prose { white-space: pre-wrap; font-size: 1.08rem; }
.comment { border-left: .25rem solid var(--family-accent); padding: .5rem 1rem; }
.muted-item { opacity: .62; }
.history { display: grid; gap: .5rem; padding-left: 1.2rem; }
.history li span { display: block; color: var(--family-muted); }
.timeline { display: grid; gap: .35rem; }
.timeline a { display: grid; grid-template-columns: 8rem 1fr auto; gap: 1rem; align-items: center; padding: .75rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--family-border); }
.timeline time { font-weight: 750; }.timeline time small { display: block; color: var(--family-muted); font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.danger-zone { border-color: #d5aaaa; }.back { display: inline-block; margin-bottom: 1rem; }
.meeting-room.default { border-color: #8daf97; box-shadow: 0 0 0 .15rem #dfece2; }
.review-row, .notification { padding-block: .8rem; border-top: 1px solid var(--family-border); }
.notification { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }.notification.read { opacity: .65; }
.policy-line { padding: .75rem; background: var(--family-wash); border-radius: .65rem; }
.token-box { padding: 1rem; margin-block: 1rem; background: #f1efe9; border: 1px dashed var(--family-border); border-radius: .65rem; overflow-wrap: anywhere; }
.auth-shell { width: min(46rem, 100%); margin: 1rem auto; padding: clamp(1.25rem, 5vw, 3rem); }
.auth-shell h1 { max-width: 18ch; }
.status-panel { text-align: center; }
.status-panel p { max-width: 48ch; margin-inline: auto; }
.alert { padding: .8rem 1rem; border: 1px solid #d5aaaa; border-radius: .65rem; background: #fff1f1; }
.nav-count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding-inline: .3rem; border-radius: 100vw; background: var(--family-warm); color: white; font-size: .72rem; font-weight: 800; }
.registration-card { border-left: .3rem solid var(--family-warm); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; }
.detail-grid div { min-width: 0; padding: .75rem; background: var(--family-wash); border-radius: .65rem; }
.detail-grid dt { color: var(--family-muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.detail-grid dd { margin: .25rem 0 0; overflow-wrap: anywhere; }
.applicant-note { padding: 1rem; border: 1px solid var(--family-border); border-radius: .65rem; }
.applicant-note p { margin: .35rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr); gap: 1rem; align-items: start; margin-top: 1rem; }
fieldset { min-width: 0; margin: .75rem 0; border: 1px solid var(--family-border); border-radius: .65rem; }
.review-actions form { min-width: 0; padding: 1rem; background: #faf9f6; border-radius: .65rem; }
.table-wrap { overflow-x: auto; }.signout { margin-top: 2rem; text-align: right; }
.media-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: 1rem; }
.media-tile { min-width: 0; padding: .7rem; border: 1px solid var(--family-border); border-radius: .8rem; background: var(--family-surface); color: inherit; text-decoration: none; }
.media-tile > a { color: inherit; text-decoration: none; }
.media-tile > strong, .media-tile > span { display: block; overflow-wrap: anywhere; }
.media-tile > span { color: var(--family-muted); font-size: .82rem; }
.media-frame { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; margin-bottom: .65rem; overflow: hidden; border-radius: .55rem; background: var(--family-wash); color: var(--family-muted); }
.media-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
.media-viewer img { display: block; max-width: 100%; max-height: 75vh; margin-inline: auto; object-fit: contain; }
.four-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
.metric-grid .card { margin: 0; }
.metric-grid strong { display: block; font-size: 1.7rem; overflow-wrap: anywhere; }
.report-metric { color: inherit; text-decoration: none; }
.report-metric:hover, .report-metric:focus-visible { border-color: var(--family-accent); background: var(--family-wash); }
.report-metric small { color: var(--family-muted); }
.message-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr); gap: 1rem; align-items: start; }
.message-thread { display: grid; gap: .75rem; max-width: 52rem; margin-inline: auto; }
.message-card { min-width: 0; padding: 1rem; border: 1px solid var(--family-border); border-radius: 1rem; background: var(--family-surface); overflow-wrap: anywhere; }
.message-card.mine { margin-left: clamp(0rem, 8vw, 5rem); border-color: #9ebba5; background: #f4faf5; }
.message-card header, .message-card footer { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.message-card header { justify-content: space-between; color: var(--family-muted); font-size: .84rem; }
.message-card p { white-space: pre-wrap; margin: .8rem 0; }
.message-card footer { font-size: .85rem; }
.message-card footer form { margin: 0; }
.message-card summary { cursor: pointer; color: var(--family-accent-strong); }
.composer { position: sticky; bottom: .5rem; max-width: 52rem; margin-inline: auto; }
.composer textarea { width: 100%; resize: vertical; }
.supervision-disclosure { border-color: #c98a61; background: #fff7ef; }
.positions-hero { margin-bottom: 1rem; }
.genealogy-hero, .reports-hero { background: radial-gradient(circle at top right, #9a7655, transparent 42%), linear-gradient(135deg, #203f38, #315b50); }
.reports-hero { background: var(--family-accent-strong); color: #fff; border-radius: .8rem; padding: 1.2rem; }
.reports-hero :is(h1, p, .eyebrow) { color: inherit; }
.genealogy-actions, .person-grid, .report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: 1rem; }
.person-card { display: flex; gap: .8rem; align-items: center; min-width: 0; padding: .85rem; border: 1px solid var(--family-border); border-radius: .8rem; background: var(--family-surface); color: inherit; text-decoration: none; }
.person-card:hover { border-color: var(--family-accent); background: var(--family-wash); }
.person-card span:last-child { display: grid; min-width: 0; }
.person-card strong { overflow-wrap: anywhere; }
.person-card small { color: var(--family-muted); }
.person-mark { display: inline-grid; place-items: center; flex: 0 0 2.6rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--family-wash); color: var(--family-accent-strong); font-weight: 850; }
.person-mark.large { flex-basis: 5rem; width: 5rem; height: 5rem; font-size: 2rem; }
.person-header { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.person-header h1 { margin-bottom: .3rem; }
.workspace-person-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.workspace-person-title h1 { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; margin-bottom: .25rem; }
.workspace-person-title p { margin-bottom: 0; }
.workspace-genealogy-action { text-align: center; }
.numbered-medallion { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border: 2px solid #7b5c05; border-radius: 50%; background: linear-gradient(145deg, #f8dc7a, #c69b24); color: #2c2103; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 35%); font-size: .85rem; font-weight: 900; letter-spacing: -.03em; vertical-align: middle; }
.numbered-medallion.small { width: 1.8rem; height: 1.8rem; border-width: 1px; font-size: .68rem; }
.classification-mark { display: inline-block; margin-left: .5rem; padding: .12rem .45rem; border: 1px solid var(--family-border); border-radius: .35rem; color: var(--family-muted); font-size: .8rem; }
.direct-family-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: .75rem; }
.workspace-action-panel { margin-top: 1rem; padding: 1rem; border: 1px solid var(--family-border); border-radius: .75rem; background: #faf9f6; }
.workspace-action-panel summary { cursor: pointer; color: var(--family-accent-strong); font-weight: 800; }
.workspace-more { margin: -.45rem 0 .8rem; text-align: right; }
.workspace-more summary { cursor: pointer; color: var(--family-muted); font-size: .85rem; }
.workspace-more .button { margin: .4rem 0 0 .35rem; }
[data-workspace-panel].loading { opacity: .55; pointer-events: none; }
.workspace-biography { max-width: 65ch; white-space: pre-wrap; }
.blessing-record { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--family-border); }
.transcript-revision { padding: .8rem; margin-top: .6rem; border-radius: .65rem; background: var(--family-wash); }
.transcript-revision p { white-space: pre-wrap; }
.view-tabs { display: flex; gap: .35rem; max-width: 100%; margin-block: 1rem; padding-bottom: .35rem; overflow-x: auto; }
.view-tabs a { flex: 0 0 auto; padding: .5rem .75rem; border: 1px solid var(--family-border); border-radius: 100vw; background: var(--family-surface); text-decoration: none; }
.view-tabs a[aria-current="page"] { border-color: var(--family-accent-strong); background: var(--family-accent-strong); color: white; }
.relationship-canvas { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; align-items: center; padding: clamp(1rem, 4vw, 2.5rem); border-radius: 1rem; background: var(--family-wash); }
.relationship-canvas.fan { border-radius: 50% 50% 1rem 1rem; }
.tree-person { min-width: 0; padding: .8rem; border: 1px solid var(--family-border); border-radius: .65rem; background: white; text-align: center; box-shadow: var(--family-shadow); }
.tree-person strong, .tree-person small { display: block; overflow-wrap: anywhere; }
.tree-person small { color: var(--family-muted); }
.tree-person.focus { border-width: 2px; border-color: var(--family-accent); }
.tree-person.spouse { border-color: #b78d68; }
.timeline-record { display: grid; grid-template-columns: minmax(8rem, auto) 1fr auto; gap: 1rem; padding: .8rem; border-bottom: 1px solid var(--family-border); }
.spouse-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.spouse-grid fieldset { background: #faf9f6; }
.spouse-grid legend { color: var(--family-accent-strong); font-weight: 800; }
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; }
.impact-grid div, .private-panel .metric-grid article { padding: .8rem; border-radius: .65rem; background: var(--family-wash); }
.impact-grid dt { color: var(--family-muted); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.impact-grid dd { margin: .3rem 0 0; }
.preview-card { border-color: #9ebba5; }
.growth-card { overflow: hidden; }
.report-series { display: grid; gap: 1rem; }
.report-definition { max-width: 72rem; }
.growth-figure { margin: 1rem 0; }
.growth-chart { display: block; width: 100%; min-height: 16rem; color: var(--family-accent-strong); }
.growth-chart .chart-grid { stroke: var(--family-border); stroke-width: 1; }
.growth-chart .chart-axis, .growth-chart .chart-tick { stroke: var(--family-ink); stroke-width: 1.5; }
.growth-chart .chart-step { fill: none; stroke: currentcolor; stroke-width: 5; stroke-linecap: square; stroke-linejoin: miter; }
.growth-chart circle { fill: var(--family-warm); stroke: white; stroke-width: 2; }
.growth-chart circle:focus { outline: none; stroke: var(--family-ink); stroke-width: 4; }
.growth-chart .chart-label { fill: var(--family-muted); font-size: 13px; }
.growth-chart .chart-axis-title { fill: var(--family-ink); font-size: 14px; font-weight: 750; }
.growth-figure figcaption { color: var(--family-muted); font-size: .82rem; text-align: center; }
.population-current { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; align-items: baseline; padding: .85rem; border-radius: .7rem; background: var(--family-wash); }
.population-current strong { color: var(--family-accent-strong); font-size: 2rem; }
.population-current small { grid-column: 1 / -1; color: var(--family-muted); }
.population-events { width: 100%; }
.population-events caption { padding: 1rem 0 .5rem; font-weight: 850; text-align: left; }
.population-delta { font-weight: 850; font-variant-numeric: tabular-nums; }
.population-marker { cursor: pointer; outline: none; }
.population-marker circle { fill: var(--family-accent); stroke: var(--family-surface); stroke-width: 2; }
.population-marker:focus circle, .population-marker:hover circle, .population-marker[aria-expanded="true"] circle { fill: var(--family-warm); stroke: var(--family-ink); stroke-width: 3; }
.population-marker-detail { margin-top: .75rem; padding: .85rem; border: 1px solid var(--family-border); border-radius: .7rem; background: var(--family-wash); }
.population-marker-detail ul { margin-bottom: 0; }
.report-warnings { margin: 1rem 0; padding: .8rem; border-left: .3rem solid #b87333; background: #fff7e8; }
.report-warnings summary { cursor: pointer; font-weight: 850; }
.report-warnings li { margin-block: .45rem; }
.projection-digests { display: grid; gap: .35rem; }
.projection-digests > div { display: grid; grid-template-columns: minmax(11rem, auto) 1fr; gap: .75rem; }
.projection-digests dt { font-weight: 750; }
.projection-digests dd { min-width: 0; margin: 0; }
.projection-digests code { overflow-wrap: anywhere; }
.chart-foot { display: flex; justify-content: space-between; gap: 1rem; color: var(--family-muted); }
.private-panel { border-color: #b78d68; }
.position-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.position-action { display: grid; gap: .35rem; min-height: 9rem; padding: 1.3rem; border: 1px solid var(--family-border); border-radius: 1rem; background: var(--family-surface); color: inherit; text-decoration: none; box-shadow: var(--family-shadow); }
.position-action:hover, .position-action:focus-visible { border-color: var(--family-accent); background: var(--family-wash); }
.position-action strong { color: var(--family-accent-strong); font-size: 1.25rem; }
.position-action span, .secondary-action, .breadcrumbs { color: var(--family-muted); }
.secondary-action { margin-top: 1rem; }
.breadcrumbs, .review-states, .inline-actions, .chart-heading { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.breadcrumbs { margin-block: .5rem 1rem; font-size: .88rem; }
.filter-bar { display: grid; grid-template-columns: 2fr repeat(3, minmax(8rem, 1fr)) auto; gap: .75rem; align-items: end; }
.position-table-wrap { max-width: 100%; margin-top: 1rem; overflow-x: auto; }
.position-table { min-width: 42rem; }
.vacancy { display: inline-flex; align-items: center; gap: .3rem; font-weight: 800; }
.vacancy-danger { color: #9f2525; }
.card-grid, .review-list, .workspace-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: 1rem; }
.review-card, .revision-card, .source-compare, .workspace-grid > section, .admin-panel { min-width: 0; padding: 1rem; border: 1px solid var(--family-border); border-radius: .8rem; background: var(--family-surface); overflow-wrap: anywhere; }
.review-card form { margin-top: .75rem; }
.comparison-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1rem; }
.contribution-picker [data-contribution-panel] { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--family-border); }
.moderation-preview { display: block; width: min(100%, 48rem); max-height: 32rem; object-fit: contain; margin: 0 auto 1rem; border-radius: .75rem; background: var(--family-muted-surface, #eef2ef); }
.search-selector { position: relative; display: grid; gap: .35rem; min-width: 0; margin-top: .25rem; }
.search-selector-input { width: 100%; }
.search-selector-results { position: absolute; z-index: 20; top: 3rem; left: 0; right: 0; max-height: 18rem; padding: .35rem; overflow-y: auto; border: 1px solid var(--family-border); border-radius: .55rem; background: var(--family-surface); box-shadow: var(--family-shadow); }
.search-selector-option { display: grid; width: 100%; gap: .15rem; padding: .6rem; border: 0; border-radius: .35rem; background: transparent; color: inherit; text-align: left; }
.search-selector-option small { color: var(--family-muted); font-weight: 500; }
.search-selector-option:hover, .search-selector-option.active { background: var(--family-wash); outline: 2px solid var(--family-accent); }
.search-selector-more { width: 100%; margin-top: .35rem; }
.search-selector-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.search-selector-chip { display: inline-flex; max-width: 100%; align-items: center; gap: .35rem; padding: .25rem .35rem .25rem .55rem; border: 1px solid var(--family-border); border-radius: 100vw; background: var(--family-wash); font-size: .85rem; overflow-wrap: anywhere; }
.search-selector-chip button { min-width: 1.6rem; padding: .05rem .35rem; border: 0; border-radius: 50%; background: transparent; color: var(--family-accent-strong); }
.search-selector-status { min-height: 1.1rem; margin: 0; font-size: .78rem; font-weight: 500; }
.mrp-section + .mrp-section { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--family-border); }
.mrp-record { padding: 1rem; border: 1px solid var(--family-border); border-radius: .75rem; }
.mrp-record + .mrp-record { margin-top: .75rem; }
.stack-form { display: grid; gap: .75rem; }
.stack-form textarea { min-height: 7rem; }
.position-header { display: flex; align-items: start; justify-content: space-between; gap: 1.5rem; padding: 1.25rem; margin-bottom: 1rem; border-radius: 1rem; background: var(--family-wash); }
.position-holder { display: grid; gap: .35rem; text-align: right; }
.chart-heading { justify-content: space-between; align-items: start; }
.org-chart { width: 100%; max-width: 100%; padding-block: 1rem; overflow-x: clip; }
.org-chart ul { list-style: none; margin: 0; padding: 0; }
.org-roots, .org-children { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); justify-content: center; gap: clamp(.7rem, 2vw, 1.25rem); width: 100%; }
.org-item { position: relative; display: grid; justify-items: center; min-width: 0; padding-top: 1rem; }
.org-item:has(> .org-children:not([hidden])) { grid-column: 1 / -1; width: 100%; }
.org-children { position: relative; width: 100%; padding-top: 1.6rem !important; }
.org-children::before { position: absolute; top: .45rem; left: 50%; width: 1px; height: 1.15rem; background: var(--family-border); content: ""; }
.org-children > .org-item::before { position: absolute; top: .45rem; left: 50%; width: 1px; height: .55rem; background: var(--family-border); content: ""; }
.org-node { display: grid; grid-template-columns: 2rem minmax(8rem, 13rem) auto; align-items: stretch; min-width: 0; border: 1px solid var(--family-border); border-radius: .65rem; background: var(--family-surface); box-shadow: 0 .2rem .7rem rgb(0 0 0 / 8%); }
.org-node-custom { border-style: dashed; }
.org-node-category { border-style: dashed; background: var(--family-wash); }
.org-category-body { cursor: default; }
.org-group-label { grid-column: 1 / -1; width: 100%; padding: .55rem .75rem; border-bottom: 1px solid var(--family-border); color: var(--family-accent-strong); text-align: left; }
.org-node-body { display: grid; min-width: 0; padding: .7rem .5rem; color: inherit; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.org-node-body strong { color: var(--family-accent-strong); }
.org-node-body small { margin-top: .25rem; }
.org-chevron, .org-pin { min-width: 2rem; padding: .35rem; border: 0; border-radius: .55rem 0 0 .55rem; background: transparent; color: var(--family-accent-strong); }
.org-pin { border-radius: 0 .55rem .55rem 0; font-size: .7rem; }
.org-pin[aria-pressed="true"] { background: var(--family-wash); }
.org-chevron-spacer { width: 2rem; }
.org-full-branch { margin-top: .45rem; font-size: .8rem; }
.chart-error { max-width: 18rem; padding: .75rem; color: #9f2525; }
@media (min-width: 58rem) { .dashboard > .span-2 { grid-column: 1; } }
@media (max-width: 42rem) { .workspace-person-header { grid-template-columns: auto 1fr; align-items: start; } .workspace-genealogy-action { grid-column: 1 / -1; width: 100%; } }
@media (max-width: 57.99rem) { .dashboard, .photo-layout, .message-layout { grid-template-columns: 1fr; } .hero { align-items: start; flex-direction: column; } .metric { width: 100%; } .profile-editor { grid-template-columns: 1fr; } .avatar { width: min(100%, 12rem); } .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 42rem) { .shell { width: min(100% - 1rem, 72rem); } .topbar { padding-block: 0.75rem; } nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .35rem; } nav a { white-space: nowrap; } .form-grid, .two, .review-actions, .four-fields, .position-actions, .filter-bar, .spouse-grid { grid-template-columns: 1fr; } .form-grid .full { grid-column: auto; } .list-row, .timeline a, .timeline-record { grid-template-columns: 1fr; gap: .15rem; } .page-heading, .position-header, .person-header { align-items: start; flex-direction: column; } .position-holder { text-align: left; } th, td { min-width: 8rem; } .review-row, .notification { align-items: stretch; flex-direction: column; } .auth-shell { padding: 1rem; } .org-roots, .org-children { grid-template-columns: 1fr; width: 100%; gap: .7rem; } .org-item { width: 100%; padding: 0 0 0 1rem; } .org-node { width: 100%; grid-template-columns: 2rem minmax(0, 1fr) auto; } .org-children { padding: .7rem 0 0 1rem !important; } .org-children::before, .org-children > .org-item::before { top: 0; left: .35rem; right: auto; width: 1px; height: 100%; } .chart-foot { flex-direction: column; gap: .2rem; } }
@media (max-width: 42rem) { .topbar > nav[aria-label="Public navigation"] { overflow-x: visible; flex-wrap: wrap; padding-bottom: 0; } }

/* Production V1 owner-acceptance application shell. */
.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; }
.site-header { position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgb(255 255 255 / 14%); }
.site-header .topbar { min-height: 3.75rem; flex-wrap: nowrap; gap: .8rem; }
.site-header .brand { margin-right: 0; white-space: nowrap; }
.menu-button { width: 2.55rem; height: 2.55rem; padding: .3rem; background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 24%); font-size: 1.2rem; }
.top-links { margin-left: .5rem; flex-wrap: nowrap; }
.top-links a { padding: .55rem .65rem; border-radius: .45rem; white-space: nowrap; }
.top-links a:hover, .top-links a:focus-visible, .top-links a[aria-current="page"] { background: rgb(255 255 255 / 14%); outline: none; }
.global-search { display: flex; min-width: 8rem; max-width: 18rem; margin-left: auto; }
.global-search input { width: 100%; border-radius: .5rem 0 0 .5rem; background: rgb(255 255 255 / 96%); }
.global-search button { border-radius: 0 .5rem .5rem 0; border: 1px solid rgb(255 255 255 / 24%); background: rgb(255 255 255 / 10%); }
.global-search .search-clear { border-radius: 0; border-inline-width: 0 1px; }
.header-profile { display: flex; min-width: 0; gap: .5rem; align-items: center; padding: .3rem .45rem; border-radius: .5rem; color: white; text-decoration: none; }
.header-profile:hover, .header-profile:focus-visible { background: rgb(255 255 255 / 14%); }
.header-profile > span:last-child { display: grid; min-width: 0; max-width: 11rem; }
.header-profile small { color: rgb(255 255 255 / 72%); font-size: .66rem; line-height: 1; }
.header-profile strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.header-avatar { display: grid; flex: 0 0 2rem; width: 2rem; height: 2rem; place-items: center; border: 1px solid rgb(255 255 255 / 38%); border-radius: 50%; background: rgb(255 255 255 / 14%); font-size: .75rem; font-weight: 850; }
.account-menu { position: relative; }
.account-menu summary { cursor: pointer; list-style: none; padding: .55rem .7rem; border-radius: .45rem; font-weight: 700; }
.account-menu summary:hover, .account-menu summary:focus-visible { background: rgb(255 255 255 / 14%); }
.account-menu > div { position: absolute; right: 0; top: calc(100% + .5rem); display: grid; min-width: 12rem; padding: .4rem; border: 1px solid var(--family-border); border-radius: .65rem; background: white; box-shadow: var(--family-shadow); }
.account-menu > div a, .account-menu .link-button { width: 100%; padding: .65rem; color: var(--family-ink); background: transparent; text-align: left; border-radius: .4rem; }
.account-menu > div a:hover, .account-menu .link-button:hover { background: var(--family-wash); }
.account-menu form { margin: 0; }
.site-drawer { position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(20rem, calc(100vw - 2.5rem)); padding: 1rem; overflow-y: auto; background: #fff; box-shadow: .4rem 0 2rem rgb(0 0 0 / 24%); transform: translateX(-105%); transition: transform .18s ease; }
.site-drawer.open { transform: translateX(0); }
.drawer-overlay { position: fixed; z-index: 60; inset: 0; background: rgb(10 20 18 / 48%); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: .25rem .35rem .8rem; border-bottom: 1px solid var(--family-border); }
.drawer-head button { background: transparent; color: var(--family-ink); font-size: 1.5rem; }
.drawer-nav { display: grid; width: auto; gap: .6rem; padding: .6rem 0; overflow: visible; }
.drawer-nav section { display: grid; gap: .16rem; padding-bottom: .55rem; border-bottom: 1px solid var(--family-border); }
.drawer-nav h2 { margin: .35rem .6rem .15rem; color: var(--family-muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.drawer-nav a { padding: .65rem .7rem; color: var(--family-ink); border-radius: .45rem; text-decoration: none; }
.drawer-nav a:hover, .drawer-nav a:focus-visible { background: var(--family-wash); outline: 2px solid transparent; }
.drawer-nav a[aria-current="page"] { background: var(--family-accent-strong); color: #fff; font-weight: 750; }
body.drawer-open { overflow: hidden; }
.watchman-launcher { position: fixed; z-index: 45; right: 1.25rem; bottom: 1.25rem; padding: .8rem 1rem; border-radius: 100vw; box-shadow: 0 .5rem 1.8rem rgb(0 0 0 / 22%); }
.watchman-backdrop { position: fixed; z-index: 75; inset: 0; background: rgb(16 33 30 / 28%); }
.watchman-panel { position: fixed; z-index: 80; right: 1rem; bottom: 4.8rem; width: min(26rem, calc(100vw - 2rem)); height: min(39rem, calc(100vh - 6rem)); border: 1px solid var(--family-border); border-radius: 1rem; background: #fff; box-shadow: 0 1rem 3rem rgb(0 0 0 / 28%); overflow: hidden; }
.watchman-panel header { display: flex; align-items: center; justify-content: space-between; min-height: 3rem; padding: .5rem .75rem; }
.watchman-panel header small { margin-left: auto; padding-right: .65rem; color: rgb(255 255 255 / 82%); }
.watchman-panel header button { background: transparent; color: white; font-size: 1.4rem; }
.watchman-panel iframe { display: block; width: 100%; height: calc(100% - 3rem); border: 0; background: var(--family-paper); }
.watchman-research-actions { display: flex; align-items: center; gap: .65rem; padding: .45rem 1rem; border-top: 1px solid var(--family-border); background: var(--family-paper); }
.watchman-research-actions button { min-height: 2.25rem; padding: .35rem .65rem; }
.watchman-research-actions small { color: var(--family-muted); }
.drawer-mode .site-header, .drawer-mode .site-drawer, .drawer-mode .drawer-overlay { display: none !important; }
.drawer-mode .content-shell { width: 100%; padding: .8rem; }
.drawer-mode .watchman-intro h1 { margin-bottom: .35rem; font-size: 1.6rem; }
.drawer-mode .watchman-answer, .drawer-mode .watchman-form { margin-block: .65rem; padding: .9rem; }
.drawer-mode textarea { min-height: 6rem; }
.watchman-uncertainty { color: var(--family-muted); font-size: .9rem; }
.watchman-sources { padding-left: 1.1rem; }
.watchman-sources li { margin-block: .35rem; }
.watchman-app { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; width: min(58rem, 100%); height: calc(100dvh - 8.5rem); min-height: 34rem; margin-inline: auto; overflow: hidden; border: 1px solid var(--family-border); border-radius: 1rem; background: var(--family-surface); box-shadow: var(--family-shadow); }
.watchman-app-header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1rem; color: var(--family-ink); background: var(--family-surface); border-bottom: 1px solid var(--family-border); }
.watchman-app-header h1 { margin: 0; font-size: clamp(1.35rem, 4vw, 2rem); }
.watchman-app-header .eyebrow { margin: 0; }
.watchman-window-actions { flex: 0 0 auto; }
.watchman-conversation-bar { display: flex; min-width: 0; align-items: center; gap: .65rem; padding: .55rem .75rem; border-bottom: 1px solid var(--family-border); background: var(--family-wash); }
.watchman-conversation-bar form { margin: 0; }
.watchman-recents { position: relative; min-width: 0; }
.watchman-recents summary { cursor: pointer; font-weight: 750; }
.watchman-conversation-list { position: absolute; z-index: 8; top: calc(100% + .45rem); left: 0; display: grid; width: min(30rem, calc(100vw - 2rem)); max-height: 18rem; padding: .45rem; overflow-y: auto; border: 1px solid var(--family-border); border-radius: .65rem; background: #fff; box-shadow: var(--family-shadow); }
.watchman-conversation-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; align-items: center; padding: .35rem; border-bottom: 1px solid var(--family-border); }
.watchman-conversation-row .link-button { max-width: 100%; overflow: hidden; color: var(--family-ink); background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.watchman-conversation-row .link-button[aria-current="true"] { color: var(--family-accent-strong); background: var(--family-wash); }
.watchman-transcript { position: relative; min-width: 0; min-height: 0; padding: .8rem; overflow-x: hidden; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; scroll-behavior: auto; background: #f4f2ed; }
.watchman-message-list { display: grid; min-width: 0; gap: .8rem; }
.watchman-message { width: min(82%, 42rem); min-width: 0; padding: .8rem 1rem; overflow-wrap: anywhere; border: 1px solid var(--family-border); border-radius: .85rem; background: #fff; box-shadow: 0 .15rem .55rem rgb(22 31 38 / 6%); }
.watchman-message p:last-child { margin-bottom: 0; }
.watchman-message--user { justify-self: end; color: #fff; border-color: var(--family-accent); background: var(--family-accent); }
.watchman-message--user .eyebrow { color: #f4c39e; }
.watchman-message--assistant { justify-self: start; }
.watchman-message-content { white-space: pre-wrap; }
.watchman-message-citations { margin-top: .7rem; padding-top: .55rem; border-top: 1px solid var(--family-border); font-size: .88rem; }
.watchman-message-citations > p { margin-bottom: .25rem; font-weight: 800; }
.watchman-turn-status { justify-self: start; padding: .45rem .7rem; color: var(--family-muted); border-radius: .65rem; background: var(--family-surface-soft); }
.watchman-empty { max-width: 32rem; margin: auto; padding: 2rem 1rem; color: var(--family-muted); text-align: center; }
.watchman-load-older { display: block; margin: 0 auto .8rem; }
.watchman-jump-latest { position: sticky; z-index: 4; bottom: .25rem; display: block; margin: .75rem auto 0; border-radius: 100vw; box-shadow: var(--family-shadow); }
.watchman-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: end; padding: .7rem; border-top: 1px solid var(--family-border); background: #fff; }
.watchman-composer textarea { width: 100%; min-height: 3.2rem; max-height: 9rem; resize: vertical; }
.watchman-composer small { grid-column: 1 / -1; color: var(--family-muted); }
.watchman-loading { padding: .45rem .75rem; color: var(--family-muted); text-align: center; background: #fff; }
.drawer-mode .content-shell { height: 100dvh; padding: 0; }
.drawer-mode .watchman-app { width: 100%; height: 100dvh; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.drawer-mode .watchman-window-actions { gap: .3rem; }
.drawer-mode .watchman-window-actions > * { padding: .45rem .55rem; font-size: .8rem; }
.drawer-mode .watchman-conversation-list { width: min(23rem, calc(100vw - 1.5rem)); }
.family-tree { overflow: hidden; }
.tree-viewport { max-width: 100%; padding: .75rem; overflow: auto; overscroll-behavior: auto; border-radius: .7rem; background: linear-gradient(#f8f5ef 1px, transparent 1px), linear-gradient(90deg, #f8f5ef 1px, transparent 1px); background-size: 24px 24px; }
.tree-board { position: relative; min-width: 50rem; transform: scale(var(--tree-scale, 1)); transform-origin: center top; transition: transform .15s ease; }
.tree-controls { display: flex; gap: .3rem; }
.tree-controls button { min-width: 2.5rem; }
.tree-family-level > h3 { margin: .25rem 0 .65rem; color: var(--family-muted); font-size: .8rem; text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.tree-generation { position: relative; display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: .75rem; }
.tree-generation .tree-person { display: flex; min-width: 12rem; max-width: 18rem; gap: .65rem; align-items: center; color: inherit; text-decoration: none; text-align: left; }
.connected-tree-board { display: grid; gap: 2.4rem; padding: 1rem 1.25rem 1.5rem; }
[data-tree-generation-store] { display: grid; gap: 2.4rem; }
.tree-generation-row { position: relative; z-index: 2; margin: 0; }
.tree-lines { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tree-lines path { fill: none; stroke: #6d8f83; stroke-width: 2; vector-effect: non-scaling-stroke; }
.tree-lines path.spouse { stroke: #a7764d; stroke-width: 3; }
.tree-edge-actions { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.tree-edge-action { position: absolute; width: 1.9rem; height: 1.9rem; padding: 0; overflow: hidden; border: 2px solid #fff; border-radius: 50%; background: var(--family-accent-strong); color: transparent; box-shadow: var(--family-shadow); pointer-events: auto; transform: translate(-50%, -50%); }
.tree-edge-action::before { content: "Edit"; display: grid; width: 100%; height: 100%; place-items: center; color: #fff; font-size: .55rem; font-weight: 850; }
.tree-avatar { width: 2.65rem; height: 2.65rem; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.tree-branch-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0; }
.tree-live-status:empty { display: none; }
.tree-live-status { padding: .55rem .7rem; border-radius: .45rem; background: var(--family-wash); }
.tree-person-card { display: grid; min-width: 13rem; max-width: 19rem; align-content: start; }
.tree-person-card .tree-person { width: 100%; }
.tree-person-card.focus .tree-person { border-color: var(--family-accent); border-width: 2px; }
.tree-parent-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); gap: .3rem; margin: 0 .4rem .45rem; }
.tree-position-action { display: inline-flex; min-height: 2.65rem; align-items: center; justify-content: center; gap: .3rem; padding: .45rem .6rem; border: 2px dashed #77998e; border-radius: .55rem; color: var(--family-accent-strong); background: #fff; }
.tree-position-action small { font-size: .68rem; font-weight: 650; }
.tree-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; margin: .4rem .3rem 0; }
.tree-card-actions button { min-height: 2.45rem; padding: .4rem; font-size: .73rem; }
.tree-households { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--family-border); }
.tree-household-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: .7rem; }
.tree-household-branch { display: grid; gap: .5rem; align-content: start; padding: .75rem; border: 1px solid var(--family-border); border-radius: .7rem; background: var(--family-wash); }
.tree-household-branch p { display: flex; align-items: center; justify-content: center; gap: .45rem; margin: 0; text-align: center; }
.tree-household-branch > small { color: var(--family-muted); text-align: center; }
.tree-union-mark { color: #a7764d; font-weight: 900; }
.tree-editor-dialog { width: min(52rem, calc(100% - 1rem)); }
.tree-editor-dialog [hidden] { display: none !important; }
.tree-editor-choice { display: grid; grid-template-columns: minmax(12rem, 1fr) auto minmax(18rem, 2fr); gap: .8rem; align-items: center; margin: 1rem 0; }
.tree-editor-choice fieldset { min-width: 0; background: var(--family-wash); }
.tree-person-relationship-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem; margin: 1rem 0; }
.tree-editor-dialog .form-status:not(:empty) { padding: .65rem; border-left: .3rem solid #a34c38; background: #fff2ee; }
.tree-accessible-list { margin-top: .8rem; }
.tree-connector { width: 2px; height: 2rem; margin: 0 auto; background: var(--family-border); }
.tree-placeholder { padding: .75rem 1rem; color: var(--family-muted); border: 1px dashed var(--family-border); border-radius: .65rem; }
.tree-add { display: inline-flex; min-width: 8rem; min-height: 3.5rem; align-items: center; justify-content: center; gap: .4rem; padding: .65rem; border: 2px dashed var(--family-border); border-radius: .65rem; color: var(--family-accent-strong); background: #fff; text-decoration: none; }
.family-summary { display: flex; flex-wrap: wrap; gap: .7rem 1.3rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--family-border); }
.family-summary a { margin-left: auto; }
.relationship-correction { display: grid; grid-template-columns: minmax(12rem, 1fr) auto auto; gap: .6rem; align-items: center; padding: .65rem 0; border-top: 1px solid var(--family-border); }
.relationship-correction form { display: flex; align-items: center; gap: .45rem; margin: 0; }
.directory-details summary, .relationship-editor summary { cursor: pointer; font-weight: 800; }
.directory-details[open] summary, .relationship-editor[open] summary { margin-bottom: 1rem; }
.settings-layout { display: grid; grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.settings-nav { position: sticky; top: 4.75rem; display: grid; gap: .25rem; }
.settings-nav h2 { margin-bottom: .35rem; font-size: 1rem; }
.settings-nav a { padding: .62rem .7rem; border-radius: .45rem; color: inherit; text-decoration: none; }
.settings-nav a:hover, .settings-nav a:focus-visible { background: var(--family-wash); }
.settings-nav a[aria-current="page"] { color: #fff; background: var(--family-accent-strong); font-weight: 750; }
.settings-nav hr { width: 100%; border: 0; border-top: 1px solid var(--family-border); }
.settings-actions { display: grid; gap: .65rem; }
.storage-total { margin: .3rem 0; color: var(--family-accent-strong); font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 850; }
.form-dialog { width: min(48rem, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 1.4rem; border: 1px solid var(--family-border); border-radius: 1rem; box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 32%); }
.form-dialog::backdrop { background: rgb(10 20 18 / 55%); }
.calendar-card { overflow: hidden; }
.calendar-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: center; }
.calendar-toolbar h2 { margin: 0; text-align: center; }
.view-switch { display: flex; justify-content: end; gap: .3rem; }
.view-switch button[aria-pressed="true"] { color: #fff; background: var(--family-accent-strong); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 1rem; border: solid var(--family-border); border-width: 1px 0 0 1px; }
.calendar-weekday { padding: .55rem; color: var(--family-muted); font-size: .75rem; font-weight: 750; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 7.5rem; min-width: 0; padding: .4rem; border: solid var(--family-border); border-width: 0 1px 1px 0; background: #fff; }
button.calendar-day-number { min-width: 2rem; min-height: 2rem; padding: .2rem; border: 0; border-radius: 50%; color: var(--family-ink); background: transparent; }
.calendar-day.today button.calendar-day-number { color: #fff; background: var(--family-accent-strong); }
.calendar-day.outside { background: #f4f2ed; }
.calendar-day.outside .calendar-day-number { color: var(--family-muted); }
.calendar-events { display: grid; gap: .25rem; margin-top: .35rem; }
.calendar-event { display: block; min-width: 0; padding: .25rem .35rem; overflow: hidden; border-left: .25rem solid var(--event-color, var(--family-accent)); border-radius: .25rem; color: var(--family-ink); background: var(--family-wash); font-size: .75rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event time { color: var(--family-muted); }
.calendar-grid.week-view, .calendar-grid.day-view { grid-template-columns: repeat(var(--calendar-columns, 7), minmax(0, 1fr)); }
.calendar-grid.day-view { --calendar-columns: 1; }
.calendar-hours { display: grid; gap: 0; margin-top: .5rem; border-top: 1px solid var(--family-border); }
.calendar-hour { min-height: 2.35rem; padding: .3rem .45rem; border: 0; border-bottom: 1px solid var(--family-border); border-radius: 0; color: var(--family-muted); background: transparent; text-align: left; font-size: .72rem; }
.calendar-hour:hover, .calendar-hour:focus-visible { color: var(--family-ink); background: var(--family-wash); }
.attendance-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin: .8rem 0; }
.attendance-summary > div { padding: .65rem; border-radius: .55rem; background: var(--family-wash); text-align: center; }
.attendance-summary strong, .attendance-summary span { display: block; }
.attendance-summary strong { font-size: 1.55rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #df9b65; outline-offset: 2px; }
@media (max-width: 56rem) {
  .top-links { display: none; }
  .global-search { max-width: none; }
  .header-profile strong { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
  .settings-nav h2 { grid-column: 1 / -1; }
  .calendar-toolbar { grid-template-columns: 1fr auto; }
  .calendar-toolbar h2 { grid-column: 1 / -1; grid-row: 1; }
  .calendar-toolbar > :first-child { grid-column: 1; grid-row: 2; }
  .view-switch { grid-column: 2; grid-row: 2; }
  .calendar-day { min-height: 5.5rem; }
}
@media (max-width: 38rem) {
  .three { grid-template-columns: 1fr; }
  .site-header .topbar { width: calc(100% - 1rem); gap: .4rem; }
  .site-header .brand { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; }
  .global-search { min-width: 4rem; }
  .global-search input { min-width: 0; }
  .header-profile > span:last-child { display: none; }
  .account-menu summary { font-size: 0; }
  .account-menu summary::before { content: "●"; font-size: 1rem; }
  .watchman-launcher { right: .65rem; bottom: .65rem; }
  .watchman-panel { inset: 3.9rem .5rem .5rem; width: auto; height: auto; }
  .watchman-app { width: 100%; height: calc(100dvh - 7.5rem); min-height: 30rem; border-radius: .65rem; }
  .watchman-app-header { padding: .6rem .7rem; }
  .watchman-app-header .eyebrow { display: none; }
  .watchman-message { width: 92%; padding: .7rem .8rem; }
  .drawer-mode .watchman-app { height: 100dvh; border-radius: 0; }
  .tree-generation { display: grid; }
  .tree-board { min-width: 46rem; }
  .tree-editor-choice { grid-template-columns: 1fr; }
  .tree-editor-choice > span { text-align: center; }
  .tree-editor-dialog { padding: .9rem; }
  .relationship-correction { grid-template-columns: 1fr; }
  .calendar-card { margin-inline: -.25rem; padding: .55rem; }
  .calendar-toolbar { display: flex; align-items: stretch; flex-direction: column; }
  .calendar-toolbar h2 { order: -1; }
  .calendar-toolbar .inline-actions, .view-switch { display: grid; grid-template-columns: repeat(3, 1fr); }
  .calendar-weekday { font-size: .6rem; padding: .25rem 0; }
  .calendar-day { min-height: 4.7rem; padding: .18rem; }
  .calendar-event { max-width: 100%; padding: .18rem; font-size: .62rem; }
  .calendar-grid.week-view { grid-template-columns: 1fr; }
  .attendance-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .site-drawer { transition: none; } }

/* Family Tree V2: one deterministic husband-and-wives unit inside its own canvas. */
.family-tree-v2 { min-width: 0; overflow: hidden; }
.family-tree-v2 .tree-heading { align-items: flex-start; }
.family-tree-v2 .tree-controls { flex-wrap: wrap; justify-content: end; }
.family-tree-v2 .tree-viewport { height: clamp(31rem, 68vh, 52rem); max-width: 100%; overflow: auto; cursor: grab; touch-action: pan-x pan-y pinch-zoom; }
.family-tree-v2 .tree-viewport:active { cursor: grabbing; }
.family-tree-v2 .family-unit-board { width: max-content; min-width: max(52rem, 100%); min-height: 28rem; padding: 3rem 3.5rem 6rem; }
.family-tree-v2 [data-tree-generation-store] { min-width: max-content; }
.tree-family-unit { display: grid; grid-template-columns: 16rem max-content; gap: 5rem; align-items: start; }
.tree-husband-column, .tree-standalone { display: grid; width: 16rem; gap: .65rem; align-content: start; }
.tree-wives { display: flex; min-width: max-content; gap: 4.5rem; align-items: start; }
.tree-wife-branch { position: relative; display: grid; width: 16rem; gap: .6rem; align-content: start; }
.tree-wife-ancestry:not(:empty) { order: -1; margin-bottom: .35rem; }
.membership-excluded-name, .tree-person.membership-excluded strong { color: #a62620; }
.tree-role-label { margin: 0; color: var(--family-muted); font-size: .72rem; font-weight: 850; letter-spacing: .09em; text-align: center; text-transform: uppercase; }
.tree-union-date { margin: 0; color: var(--family-muted); font-size: .75rem; text-align: center; }
.tree-union-rail { position: absolute; top: 4.55rem; right: calc(100% + .35rem); width: 4.15rem; height: 1rem; border-top: 3px solid #a7764d; }
.tree-union-rail::after { content: ""; position: absolute; top: -.45rem; right: -.1rem; width: .7rem; height: .7rem; border: 3px solid #a7764d; border-radius: 50%; background: #fff; }
.tree-wife-branch + .tree-wife-branch .tree-union-rail { width: 4.15rem; }
.family-tree-v2 .tree-person-card { width: 16rem; min-width: 16rem; max-width: 16rem; padding: .35rem; border: 1px solid transparent; border-radius: .8rem; background: #fff; box-shadow: 0 .2rem .65rem rgb(36 52 47 / 9%); }
.family-tree-v2 .tree-person-card.focus { border-color: var(--family-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--family-accent) 22%, transparent); }
.family-tree-v2 .tree-person { min-width: 0; border: 0; box-shadow: none; }
.tree-refocus { display: block; margin: .2rem .4rem 0; font-size: .74rem; font-weight: 750; text-align: right; }
.tree-branch-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.tree-branch-buttons button, .tree-branch-button { min-height: 2.4rem; padding: .4rem; font-size: .72rem; }
.tree-branch-buttons button small { display: block; font-size: .62rem; }
.tree-context-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; margin-top: .45rem; padding-top: .45rem; border-top: 1px solid var(--family-border); }
.tree-context-actions a, .tree-context-actions button { min-height: 2.25rem; padding: .35rem; font-size: .68rem; text-align: center; }
.tree-lazy-slot:empty { display: none; }
.tree-loaded-branch { display: grid; box-sizing: border-box; width: 100%; max-width: 100%; gap: .55rem; margin-top: .5rem; padding: .65rem; overflow: hidden; border-left: 3px solid #86a89c; border-radius: .45rem; background: var(--family-wash); }
.tree-loaded-heading { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.tree-loaded-heading h3 { margin: 0; font-size: .8rem; }
.tree-loaded-heading button { min-height: 2rem; padding: .25rem .45rem; font-size: .68rem; }
.tree-branch-people { display: grid; grid-template-columns: minmax(0, 1fr); gap: .55rem; align-items: start; padding: .2rem; }
.tree-branch-generation { position: relative; display: grid; gap: .35rem; padding-top: .45rem; border-top: 2px solid #86a89c; }
.tree-branch-generation h4 { margin: 0; color: var(--family-muted); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.tree-loaded-branch[data-tree-branch-type="posterity"] .tree-branch-generation,
.tree-loaded-branch[data-tree-branch-type="descendants"] .tree-branch-generation,
.tree-loaded-branch[data-tree-branch-type="other-children"] .tree-branch-generation { border-top-color: #a7764d; }
.tree-loaded-branch .tree-person-card { width: 13rem; min-width: 13rem; }
.tree-loaded-branch .tree-person { font-size: .82rem; }
.personal-pedigree-board [data-tree-generation-store] { gap: 2rem; }
.tree-focus-parent-branch { display: grid; width: 34rem; gap: .55rem; justify-items: center; }
.tree-parent-row { display: flex; gap: 1rem; align-items: start; justify-content: center; }
.tree-parent-branch, .tree-child-branch { display: grid; width: 16rem; gap: .45rem; align-content: start; }
.tree-child-row { display: grid; grid-template-columns: 1fr; gap: .65rem; }
.tree-union-children { display: grid; gap: .5rem; margin-top: .35rem; padding-top: .75rem; border-top: 2px solid #a7764d; }
.tree-other-children { display: grid; width: 16rem; gap: .6rem; }
.tree-missing-parent-card { display: grid; box-sizing: border-box; width: 16rem; min-height: 5rem; place-items: center; padding: .8rem; border: 2px dashed #77998e; border-radius: .8rem; color: var(--family-accent-strong); background: #fff; font-weight: 850; box-shadow: 0 .2rem .65rem rgb(36 52 47 / 9%); }
.tree-parent-slots .tree-missing-parent-card { width: 100%; min-height: 3.5rem; }
.tree-ancestor-button::before, .tree-branch-button::before, .posterity-toggle::before, [data-posterity-lazy]::before { content: "›"; display: inline-block; margin-right: .3rem; font-size: 1rem; transform: rotate(0deg); }
[aria-expanded="true"].tree-ancestor-button::before, [aria-expanded="true"].tree-branch-button::before, [aria-expanded="true"].posterity-toggle::before, [aria-expanded="true"][data-posterity-lazy]::before { transform: rotate(90deg); }
.family-tree-v2 [hidden], .family-posterity-tree [hidden] { display: none !important; }

/* Family Tree V2-R1 global posterity: protected #87 root above reviewed wife branches. */
.family-posterity-tree { min-width: 0; overflow-x: auto; }
.family-posterity-tree .tree-controls { flex-wrap: wrap; }
.posterity-root { display: flex; position: relative; z-index: 2; justify-content: center; margin: 1.5rem auto 0; }
.posterity-root-card { width: 16rem; }
.posterity-root-rail { width: 3px; height: 2.25rem; margin: 0 auto; background: #a7764d; }
.posterity-wife-row { display: grid; min-width: 66rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.5rem; align-items: start; border-top: 3px solid #a7764d; padding: 2rem 1rem 1rem; }
.posterity-wife-branch { position: relative; display: grid; min-width: 0; gap: .55rem; justify-items: stretch; padding: .8rem; border: 1px solid var(--family-border); border-radius: .8rem; background: color-mix(in srgb, var(--family-wash) 70%, white); }
.posterity-wife-branch::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 3px; height: 2rem; background: #a7764d; }
.posterity-wife-branch > .tree-person-card { width: 16rem; margin-inline: auto; }
.posterity-union-rail { width: 3px; height: 1.2rem; margin: 0 auto; background: #a7764d; }
.posterity-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .85rem; align-items: start; }
.posterity-person { display: grid; min-width: 0; gap: .4rem; align-content: start; }
.posterity-person > .tree-person-card { width: 100%; min-width: 0; }
.posterity-person > .tree-person-card .tree-person { min-width: 0; }
.posterity-descendants { display: grid; gap: .75rem; margin-top: .25rem; padding: .75rem .3rem .2rem; border-top: 2px solid #86a89c; }
.posterity-descendant-union, .posterity-single-parent { min-width: 0; padding: .55rem; border-left: 3px solid #a7764d; border-radius: .35rem; background: rgb(255 255 255 / 70%); }
.tree-union-context { margin: 0 0 .5rem; color: var(--family-muted); font-size: .75rem; text-align: center; }
.posterity-toggle, [data-posterity-lazy] { min-height: 2.4rem; padding: .4rem; font-size: .72rem; }
.posterity-other-branch { display: grid; gap: .75rem; margin: 1rem; padding: 1rem; border: 1px solid var(--family-border); border-radius: .8rem; }
.wife-order-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .8rem; padding-left: 1.5rem; }
.wife-order-list > [data-wife-order-item] { display: grid; gap: .55rem; padding: .65rem; border: 1px solid var(--family-border); border-radius: .7rem; }
.wife-order-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
@media (max-width: 52rem) {
  .family-tree-v2 .tree-heading { display: grid; }
  .family-tree-v2 .tree-controls { justify-content: start; }
  .family-tree-v2 .tree-viewport { height: 65vh; }
  .family-posterity-tree { overflow: visible; }
  .posterity-wife-row { min-width: 0; grid-template-columns: 1fr; border-top: 0; padding-inline: 0; }
  .posterity-wife-branch { width: 100%; }
  .posterity-wife-branch::before { left: 50%; height: 1.5rem; }
  .posterity-people { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .family-tree-v2 .tree-board { transition: none; }
  .family-tree-v2 .tree-viewport { scroll-behavior: auto; }
}

/* Production Archive Reader and Watchman grounding R1C. */
.search-summary { display: block; margin: .5rem 0; color: inherit; line-height: 1.55; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Family Tree / Genealogy R3-D: original 87Family pedigree and profile presentation. */
.personal-pedigree { background: linear-gradient(155deg, #fff 0%, #f3f7f4 62%, #eef4f2 100%); }
.personal-pedigree .tree-focus-column,
.personal-pedigree .tree-spouse-branch { display: flex; flex-direction: column; }
.personal-pedigree .tree-focus-ancestry-slot,
.personal-pedigree .tree-wife-ancestry { order: -3; }
.personal-pedigree .tree-focus-ancestry-slot { display: grid; gap: .45rem; margin-bottom: .4rem; }
.personal-pedigree .tree-spouse-branch > [data-tree-primary-ancestry] { order: -2; }
.personal-pedigree .tree-spouse-branch > .tree-union-rail { order: -1; }
.tree-family-selector { display: grid; width: min(28rem, 100%); gap: .25rem; margin: .4rem 0 1rem; color: var(--family-ink); font-weight: 800; }
.tree-family-selector select { background: #fff; }
.tree-family-selector small { color: var(--family-muted); font-weight: 500; }
.tree-parent-selector { display: grid; width: 18rem; gap: .25rem; color: var(--family-muted); font-size: .75rem; font-weight: 800; }
.tree-parent-selector select { background: #fff; font-size: .8rem; }
.genealogy-sheet { width: min(30rem, calc(100vw - 1.5rem)); max-width: none; max-height: calc(100dvh - 2rem); margin: auto 1rem auto auto; padding: 0; border: 0; border-radius: 1rem 0 0 1rem; box-shadow: 0 1rem 3rem rgb(20 43 36 / 28%); }
.genealogy-sheet::backdrop { background: rgb(20 34 30 / 36%); }
.genealogy-sheet-toolbar { position: sticky; z-index: 2; top: 0; display: flex; justify-content: end; padding: .7rem; border-bottom: 1px solid var(--family-border); background: rgb(255 255 255 / 96%); }
.genealogy-sheet-content { display: grid; gap: 1rem; padding: .5rem 1.25rem 1.5rem; }
.genealogy-sheet-content h2 { margin-bottom: .25rem; font-family: var(--font-display); font-size: 1.75rem; }
.genealogy-sheet-content header p:last-child { margin: 0; color: var(--family-muted); }
.genealogy-sheet-vitals { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 0; }
.genealogy-sheet-vitals > div { padding: .8rem; border: 1px solid var(--family-border); border-radius: .7rem; background: var(--family-wash); }
.genealogy-sheet-vitals dt { color: var(--family-muted); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.genealogy-sheet-vitals dd { margin: .3rem 0 0; }
.genealogy-profile { display: grid; gap: 1rem; }
.genealogy-profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; padding: 1.25rem; border: 1px solid #d9e5df; border-radius: 1rem; background: linear-gradient(135deg, #fff, #f0f6f2); }
.genealogy-profile-hero h1 { margin: .1rem 0; font-family: var(--font-display); }
.genealogy-portrait { display: grid; width: 6.5rem; height: 6.5rem; object-fit: cover; place-items: center; border: 4px solid #fff; border-radius: 50%; background: #769889; color: #fff; font-size: 2.25rem; font-weight: 900; box-shadow: 0 .35rem 1rem rgb(34 64 54 / 18%); }
.genealogy-lifespan { margin: 0; color: var(--family-muted); font-size: 1.05rem; }
.genealogy-vital-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0; }
.genealogy-vital-grid > div { padding: 1rem; border-left: 4px solid #77998e; border-radius: .35rem; background: var(--family-wash); }
.genealogy-vital-grid dt { color: var(--family-muted); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.genealogy-vital-grid dd { display: grid; gap: .2rem; margin: .35rem 0 0; }
.genealogy-vital-grid dd span { color: var(--family-muted); }
.genealogy-profile-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(18rem, .8fr); gap: 1rem; align-items: start; }
.genealogy-relation-group + .genealogy-relation-group { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--family-border); }
.genealogy-relation-group h3 { margin-bottom: .55rem; }
.genealogy-relative-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .55rem; }
.genealogy-relative { display: flex; gap: .65rem; align-items: center; padding: .65rem; border: 1px solid var(--family-border); border-radius: .65rem; color: inherit; background: #fff; text-decoration: none; }
.genealogy-relative:hover { border-color: var(--family-accent); box-shadow: 0 .2rem .7rem rgb(39 73 61 / 12%); }
.genealogy-relative .person-mark { width: 2.35rem; height: 2.35rem; min-width: 2.35rem; }
.genealogy-relative span:last-child { display: grid; min-width: 0; }
.genealogy-relative small { color: var(--family-muted); }
.genealogy-union { display: grid; gap: .7rem; padding: .8rem; border: 1px solid var(--family-border); border-radius: .75rem; background: var(--family-wash); }
.genealogy-union + .genealogy-union { margin-top: .75rem; }
.genealogy-union-heading { display: flex; gap: .6rem; align-items: baseline; justify-content: space-between; }
.genealogy-union-heading span { color: var(--family-muted); font-size: .85rem; }
.genealogy-relation-action summary { color: var(--family-accent-strong); font-weight: 800; cursor: pointer; }
.genealogy-timeline ol { display: grid; gap: .15rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.genealogy-timeline li { display: grid; grid-template-columns: 6.1rem minmax(0, 1fr); gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--family-border); }
.genealogy-timeline time { color: var(--family-muted); font-variant-numeric: tabular-nums; }
.genealogy-timeline li div { display: grid; }
.genealogy-timeline li span { color: var(--family-muted); font-size: .86rem; }
.empty.compact { margin: .35rem 0; padding: .65rem; }
@media (max-width: 52rem) {
  .genealogy-profile-hero { grid-template-columns: auto minmax(0, 1fr); }
  .genealogy-full-profile { grid-column: 1 / -1; }
  .genealogy-profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 38rem) {
  .genealogy-profile-hero { grid-template-columns: 1fr; text-align: center; }
  .genealogy-portrait { margin-inline: auto; }
  .genealogy-vital-grid, .genealogy-sheet-vitals { grid-template-columns: 1fr; }
  .genealogy-sheet { width: 100%; max-height: 88dvh; margin: auto 0 0; border-radius: 1rem 1rem 0 0; }
  .genealogy-union-heading { display: grid; }
}

/* Reports / Family Progress R3-E. */
.progress-nav { display: flex; flex-wrap: wrap; gap: .45rem; align-items: stretch; margin: 0 0 1rem; }
.progress-nav > a, .progress-nav-group { display: inline-flex; min-height: 2.65rem; gap: .35rem; align-items: center; padding: .5rem .7rem; border: 1px solid var(--family-border); border-radius: .65rem; background: #fff; }
.progress-nav a { color: var(--family-accent-strong); font-weight: 750; text-decoration: none; }
.progress-nav a[aria-current="page"] { color: #fff; background: var(--family-accent-strong); border-radius: .4rem; padding: .3rem .45rem; }
.progress-nav-group strong { color: var(--family-muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.report-filters { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; margin: 1rem 0; }
.progress-table th small, .progress-table td small { display: block; margin-top: .2rem; color: var(--family-muted); font-weight: 500; }
.progress-mobile { display: none; }
.progress-person-card, .definition-block, .alert-explanation { min-width: 0; padding: .9rem; border: 1px solid var(--family-border); border-radius: .7rem; background: #fff; }
.progress-person-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.progress-person-card dl div { min-width: 0; padding: .45rem; border-radius: .45rem; background: var(--family-wash); }
.progress-person-card dt { color: var(--family-muted); font-size: .72rem; font-weight: 750; }
.progress-person-card dd { margin: .15rem 0 0; overflow-wrap: anywhere; font-weight: 800; }
.progress-domain-grid, .entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.entry-grid details { min-width: 0; padding: .75rem; border: 1px solid var(--family-border); border-radius: .65rem; background: var(--family-wash); }
.progress-chart { display: block; width: 100%; min-width: 0; max-height: 24rem; color: var(--family-muted); }
.progress-chart line { stroke: var(--family-border); stroke-width: 2; }
.progress-chart polyline { fill: none; stroke: var(--family-accent-strong); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.progress-chart circle { fill: #fff; stroke: var(--family-accent-strong); stroke-width: 4; }
.progress-chart circle:focus { outline: none; stroke: #7a4b22; stroke-width: 7; }
.progress-chart text { fill: currentcolor; font-size: 14px; }
.alert-explanation { border-left: .35rem solid #a7764d; }
.definition-block { display: grid; gap: .65rem; }
.private-value { color: var(--family-muted); font-style: italic; }
@media (max-width: 52rem) {
  .progress-nav { display: grid; grid-template-columns: 1fr; }
  .progress-nav > a, .progress-nav-group { width: 100%; flex-wrap: wrap; }
  .progress-desktop { display: none; }
  .progress-mobile { display: grid; gap: .75rem; }
  .progress-person-card dl { grid-template-columns: 1fr; }
  .report-filters, .report-filters label, .report-filters input, .report-filters select, .report-filters button { width: 100%; }
  .alert-explanation .section-heading { display: grid; }
}

/* Manual Watchman compact UI — conversation-first drawer. */
body.watchman-open .watchman-launcher {
  display: none !important;
}

body.watchman-open .watchman-panel {
  bottom: 1rem;
  height: min(46rem, calc(100vh - 2rem));
}

.watchman-panel > header {
  min-height: 2.35rem;
  padding: .3rem .6rem;
}

.watchman-panel > header strong {
  font-size: .9rem;
}

.watchman-panel > header button {
  min-height: 1.8rem;
  padding: .1rem .4rem;
  line-height: 1;
}

.watchman-panel > iframe {
  height: calc(100% - 2.35rem);
}

.drawer-mode .watchman-app {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.drawer-mode .watchman-app-header {
  min-height: 2.4rem;
  padding: .3rem .55rem;
}

.drawer-mode .watchman-app-header h1 {
  font-size: 1rem;
}

.drawer-mode .watchman-app-header .eyebrow {
  display: none;
}

.drawer-mode .watchman-window-actions {
  gap: .2rem;
}

.drawer-mode .watchman-window-actions > * {
  min-height: 1.8rem;
  padding: .2rem .4rem;
  font-size: .72rem;
}

.drawer-mode .watchman-conversation-bar {
  min-height: 2.2rem;
  padding: .3rem .5rem;
  gap: .4rem;
}

.drawer-mode .watchman-composer {
  position: relative;
  padding: .45rem .5rem;
  gap: .35rem;
}

.drawer-mode .watchman-composer textarea {
  min-height: 2.35rem;
  height: 2.35rem;
  max-height: 8rem;
  padding-block: .42rem;
  resize: none;
  overflow-y: hidden;
}

.drawer-mode .watchman-composer small {
  display: none;
}

.drawer-mode .watchman-jump-latest {
  position: absolute;
  z-index: 8;
  right: .75rem;
  bottom: 4.1rem;
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 0 .25rem 1rem rgb(0 0 0 / 22%);
}

.drawer-mode .watchman-research-actions {
  position: absolute;
  z-index: 7;
  left: .65rem;
  bottom: 4.15rem;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.drawer-mode .watchman-research-actions button {
  min-height: 1.9rem;
  padding: .25rem .5rem;
  border-radius: 100vw;
  font-size: .72rem;
  box-shadow: 0 .15rem .65rem rgb(0 0 0 / 14%);
}

@media (max-width: 650px) {
  body.watchman-open .watchman-panel {
    inset: 3.9rem .5rem .5rem;
    width: auto;
    height: auto;
  }
}

/* Watchman compact UI v2. */
.drawer-mode .watchman-app-header {
  display: none;
}

/* Search deeper belongs to the answer it extends. */
.drawer-mode .watchman-message-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: .55rem;
}

.drawer-mode .watchman-search-deeper {
  min-height: 1.85rem;
  padding: .22rem .5rem;
  border-radius: 100vw;
  font-size: .72rem;
}

/* Chat-style jump-to-latest control. */
.drawer-mode .watchman-jump-latest {
  box-sizing: border-box;
  width: 2.35rem !important;
  min-width: 2.35rem !important;
  max-width: 2.35rem !important;
  height: 2.35rem !important;
  min-height: 2.35rem !important;
  max-height: 2.35rem !important;
  padding: 0 !important;
  aspect-ratio: 1 / 1;
  border: 1px solid rgb(20 35 31 / 16%);
  border-radius: 50% !important;
  color: var(--family-ink);
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 .2rem .75rem rgb(0 0 0 / 16%);
}

.drawer-mode .watchman-jump-latest:hover,
.drawer-mode .watchman-jump-latest:focus-visible {
  background: rgb(255 255 255 / 96%);
}

/* Watchman compact UI v4 — fixed controls, transcript-only scrolling. */
.drawer-mode .watchman-app {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.drawer-mode .watchman-conversation-bar {
  grid-row: 1;
}

.drawer-mode .watchman-transcript {
  grid-row: 2;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.drawer-mode .watchman-jump-row {
  position: relative;
  grid-row: 3;
  height: 0;
  overflow: visible;
  z-index: 12;
  pointer-events: none;
}

.drawer-mode .watchman-jump-latest {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  bottom: .55rem !important;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 2.35rem !important;
  min-width: 2.35rem !important;
  max-width: 2.35rem !important;
  height: 2.35rem !important;
  min-height: 2.35rem !important;
  max-height: 2.35rem !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: auto;
  border: 1px solid rgb(20 35 31 / 14%);
  border-radius: 50% !important;
  color: var(--family-ink) !important;
  background: rgb(255 255 255 / 78%) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 .2rem .8rem rgb(0 0 0 / 15%);
}

.drawer-mode .watchman-jump-latest[hidden] {
  display: none !important;
}

.drawer-mode .watchman-composer {
  position: relative;
  z-index: 10;
  grid-row: 4;
  flex: 0 0 auto;
  background: rgb(255 255 255 / 98%);
}

.drawer-mode .watchman-loading {
  position: absolute;
  z-index: 11;
  right: .65rem;
  bottom: 3.55rem;
  left: .65rem;
  padding: .3rem .5rem;
  border-radius: .45rem;
  box-shadow: 0 .1rem .4rem rgb(0 0 0 / 8%);
}


/* Watchman background answers R3. */
.watchman-launcher { position: fixed; }
.watchman-unread-badge { display: inline-grid; min-width: 1.35rem; height: 1.35rem; margin-left: .25rem; padding: 0 .3rem; place-items: center; border: 2px solid #fff; border-radius: 100vw; background: #a62620; color: #fff; font-size: .72rem; font-weight: 900; line-height: 1; }
.watchman-unread-badge[hidden] { display: none !important; }
.watchman-notification { position: fixed; z-index: 46; right: 1.25rem; bottom: 4.7rem; width: min(22rem, calc(100vw - 2rem)); }
.watchman-notification[hidden] { display: none !important; }
.watchman-notification > button { display: grid; width: 100%; gap: .2rem; padding: .75rem .85rem; border: 1px solid var(--family-border); border-radius: .8rem; color: var(--family-ink); background: #fff; box-shadow: 0 .5rem 1.8rem rgb(0 0 0 / 20%); text-align: left; }
.watchman-notification span { display: -webkit-box; overflow: hidden; color: var(--family-muted); font-size: .82rem; font-weight: 500; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@media (max-width: 38rem) { .watchman-notification { right: .65rem; bottom: 4.15rem; width: min(21rem, calc(100vw - 1.3rem)); } }

/* Long person names must not squeeze the mobile program selector. */
@media (max-width: 42rem) {
  .program-heading { flex-direction: column; align-items: stretch; }
  .program-heading form { min-width: 0; width: 100%; }
  .program-heading select { width: 100%; }
}
