:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--app-text);background:var(--app-page);font-synthesis:none;text-rendering:optimizeLegibility}
*{box-sizing:border-box}
body{margin:0;min-height:100vh}
[hidden]{display:none !important}
.topbar{height:64px;background:var(--app-topbar);color:var(--app-topbar-text);display:flex;align-items:center;gap:1rem;padding:0 max(1rem,calc((100vw - 1080px)/2));box-shadow:var(--app-shadow)}
.brand{font-size:1.15rem;font-weight:750;color:var(--app-topbar-text);text-decoration:none;margin-right:auto}
.topbar button{color:var(--app-topbar-text)}
.layout{max-width:1080px;margin:2.5rem auto;padding:0 1rem}
.card{background:var(--app-card);border:1px solid var(--app-border);border-radius:var(--app-radius-lg);padding:1.5rem;box-shadow:var(--app-shadow-lg)}
.auth-card{max-width:470px;margin:7vh auto}
.auth-card h1{margin:.1rem 0 .5rem}
.auth-card>p{color:var(--app-muted)}
.tabs{display:flex;border-bottom:1px solid var(--app-border);margin:1.5rem 0 1rem}
.tabs button{flex:1;padding:.75rem;border:0;background:none;color:var(--app-control-text)}
.tabs button[aria-selected=true]{color:var(--app-accent);border-bottom:3px solid var(--app-accent);font-weight:700}
label{display:block;font-size:.91rem;font-weight:650;margin:.8rem 0;color:var(--app-control-text)}
input{display:block;width:100%;margin-top:.35rem;border:1px solid var(--app-border-strong);border-radius:var(--app-radius);padding:.75rem;font:inherit;background:var(--app-field)}
input:focus,button:focus-visible,a:focus-visible{outline:3px solid var(--app-focus);outline-offset:2px}
button{font:inherit;cursor:pointer;border-radius:var(--app-radius);padding:.65rem .9rem;border:1px solid transparent}
.primary{background:var(--app-accent);color:var(--app-accent-text);font-weight:700}
.primary:hover{background:var(--app-accent-hover)}
.quiet,.secondary{background:var(--app-card);border-color:var(--app-border);color:var(--app-control-text);border-radius:var(--app-radius)}
.quiet:hover,.secondary:hover{background:var(--app-hover)}
.auth-card .primary{width:100%;margin-top:.65rem}
.message{min-height:1.4em;color:var(--app-muted)}
.heading-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.heading-row h1,.heading-row h2{margin:.1rem 0}
.eyebrow{font-size:.75rem;letter-spacing:.1em;color:var(--app-muted);font-weight:750;margin:.1rem 0}
.tree-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:1rem;margin:1rem 0 2rem}
.tree-card{width:100%;text-align:left;background:var(--app-card);color:var(--app-text);border:1px solid var(--app-border);box-shadow:var(--app-shadow)}
.tree-card strong,.tree-card span{display:block}
.tree-card span{margin-top:.4rem;color:var(--app-muted);font-size:.9rem}
.tree-card[aria-pressed=true]{border:2px solid var(--app-accent)}
.badge{background:var(--app-accent-soft);color:var(--app-accent);border-radius:var(--app-radius-pill);padding:.3rem .65rem;font-size:.82rem;font-weight:700}
.person-form{display:grid;grid-template-columns:2fr 1fr auto;gap:.75rem;align-items:end}
.person-form label{margin:0}
.people-list{padding:0;list-style:none}
.people-list li{padding:.75rem 0;border-bottom:1px solid var(--app-border)}
.muted{font-weight:400;color:var(--app-muted)}
@media(max-width:600px){.layout{margin:1.25rem auto}.card{padding:1.1rem}.heading-row{align-items:flex-start}.person-form{grid-template-columns:1fr}.person-form button{width:100%;min-height:46px}.primary,.quiet{min-height:44px}.tree-grid{grid-template-columns:1fr}}
.message.status-success { color: var(--app-success); }
.message.status-neutral { color: var(--app-muted); }
.message.status-error { color: var(--app-danger); }
.message.status-info,.message.status-pending,.message[data-state="neutral"],.message[data-state="info"],.message[data-state="pending"] { color: var(--app-muted); }
.message[data-state="success"] { color: var(--app-success); }
.message.status-warning,.message[data-state="warning"] { color: var(--app-warning); }
.message[data-state="error"] { color: var(--app-danger); }
.brand { display: inline-flex; align-items: center; gap: .5rem; }
.brand-mark { width: 32px; height: 32px; object-fit: contain; border-radius: var(--app-radius-sm); background: var(--app-soft); }
.tree-actions { display: flex; align-items: center; gap: 0.75rem; }
.feature-section { margin: 1.5rem 0; padding: 1.1rem; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-soft); }
.feature-section h3 { margin: 0 0 1rem; }
.feature-section select { display: block; width: 100%; margin-top: .35rem; border: 1px solid var(--app-border-strong); border-radius: var(--app-radius); padding: .75rem; font: inherit; background: var(--app-field); }
.feature-section .quiet { border-color: var(--app-border-strong); color: var(--app-control-text); }
.proposal-actions { display: flex; gap: .5rem; margin-top: .6rem; }
.proposal-actions button { min-width: 6rem; }
.upload-results { padding-left: 1.25rem; margin: .75rem 0 0; }
.upload-results li { padding: .35rem 0; overflow-wrap: anywhere; }
.admin-link { border: 1px solid var(--app-border-strong); border-radius: var(--app-radius); padding: .65rem .9rem; color: var(--app-accent); font-weight: 650; text-decoration: none; background: var(--app-card); }
.invite-choice { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; margin:1rem 0; }
.invite-choice p { flex-basis:100%; margin:.2rem 0; color:var(--app-muted); }
.home-mode #tree-list{display:flex;gap:.5rem;overflow:auto;margin:.5rem 0 1rem}
.home-mode #tree-list .tree-card{min-width:12rem;padding:.65rem;text-align:left}
.home-mode #tree-view>.heading-row{margin-bottom:.25rem}
.home-mode #selected-tree{display:none!important}
.timeline-shell{margin:0 0 1.5rem;padding:1rem;border:1px solid var(--app-border);border-radius:var(--app-radius-lg);background:var(--app-soft)}
.timeline-header{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.timeline-header h2{margin:.1rem 0}
.timeline-actions{display:flex;gap:.5rem}
.timeline-actions .quiet{border-color:var(--app-border-strong);color:var(--app-control-text);background:var(--app-card)}
.timeline-filters{display:grid;grid-template-columns:repeat(3,1fr) auto;gap:.75rem;align-items:end;border-top:1px solid var(--app-border);margin-top:1rem;padding-top:.75rem}
.timeline-filters label{margin:0}
.timeline-filters select{display:block;width:100%;margin-top:.35rem;border:1px solid var(--app-border-strong);border-radius:var(--app-radius);padding:.75rem;font:inherit;background:var(--app-field)}
.timeline-list{display:grid;gap:.75rem;margin:1rem 0}
.timeline-card{background:var(--app-card);border:1px solid var(--app-border);border-radius:var(--app-radius);padding:1rem}
.timeline-card h3{margin:.15rem 0 .35rem;font-size:1.05rem}
.timeline-card time,.timeline-meta{color:var(--app-muted);font-size:.88rem}
.timeline-card p{margin:.45rem 0;white-space:pre-wrap}
.timeline-more-sentinel{height:1px}
.timeline-secondary{display:flex;gap:1rem;border-top:1px solid var(--app-border);padding-top:.8rem}
.timeline-secondary a{color:var(--app-accent);font-weight:650;text-decoration:none}
.home-mode .layout{width:min(1440px,calc(100% - 2rem));max-width:none;margin:1.5rem auto;padding:0}
.timeline-home-content{display:block}
.timeline-list,.timeline-group-items{min-width:0;grid-template-columns:minmax(0,1fr)}
.timeline-card{min-width:0;overflow-wrap:anywhere}
.timeline-card .ft-person-pill{max-width:100%;min-width:0;white-space:normal}
.timeline-header,.timeline-header>div{min-width:0}
.timeline-feed-content{min-width:0}
.timeline-source-preview{margin:.65rem 0}
.timeline-source-preview img{display:block;max-width:100%;max-height:32rem;object-fit:contain;border-radius:var(--app-radius)}
.timeline-source-preview{display:flex;justify-content:center;width:100%}
.timeline-source-preview-image{margin-inline:auto}
.timeline-source-tag-host{position:relative;perspective:900px}
.timeline-source-preview-image{cursor:default;transform-style:preserve-3d;backface-visibility:hidden;transition:transform .55s cubic-bezier(.2,.75,.25,1),filter .2s ease;box-shadow:10mm 0 7mm -5mm rgb(15 36 40 / 48%)}
.timeline-photo-context-menu{position:fixed;z-index:10050;min-width:13rem;padding:.3rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card);box-shadow:var(--app-shadow-lg)}
.timeline-photo-context-action{display:block;width:100%;padding:.55rem .7rem;border:0;border-radius:var(--app-radius-sm);background:transparent;color:var(--app-control-text);text-align:left;font:inherit;cursor:pointer}
.timeline-photo-context-action:hover,.timeline-photo-context-action:focus-visible{background:var(--app-soft);outline:none}
.timeline-source-cover-image{margin-block:.9rem 1.1rem;padding:.65rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft)}
.timeline-source-cover-image>figcaption,.timeline-source-cover-image>label{display:none}
.timeline-source-privacy-label{display:inline-block;margin:0 .55rem .45rem 0;padding:.18rem .45rem;border-radius:var(--app-radius-pill);background:var(--app-soft);color:var(--app-text);font-size:.74rem;font-weight:600}
.timeline-source-cover-image .timeline-source-preview-image{width:100%;max-height:36rem;object-fit:contain}
.timeline-source-additional-image{margin-block:.75rem}
.timeline-source-association-label{display:block;margin-bottom:.4rem;color:var(--app-muted);font-size:.78rem}
.timeline-source-audio{display:block;width:100%;max-width:38rem;margin:.5rem 0}
.timeline-source-video,.timeline-archive-video{display:block;width:100%;max-width:42rem;max-height:32rem;margin:.6rem 0;background:#000;border-radius:var(--app-radius)}
.timeline-archive-card audio{display:block;width:100%;margin:.6rem 0}
.timeline-archive-panel{margin-top:1rem;padding:1rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft)}
.timeline-archive-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}
.timeline-archive-heading h3{margin:.1rem 0 .35rem}
.timeline-archive-heading p{max-width:58rem;margin:.25rem 0;color:var(--app-muted)}
.timeline-archive-heading label{min-width:min(18rem,100%)}
.timeline-archive-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr));gap:.85rem;margin-block:1rem}
.timeline-archive-card{min-width:0}
.timeline-archive-card h4{margin:.1rem 0 .4rem;overflow-wrap:anywhere}
.timeline-archive-preview{margin:.6rem 0}
.timeline-archive-preview .timeline-source-tag-host{width:100%;min-height:10rem;display:grid;place-items:center}
.timeline-archive-preview .timeline-source-preview-image{max-width:100%;max-height:24rem;object-fit:contain}
.timeline-archive-pagination{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem}
.timeline-archive-pagination .message{margin:0}
.timeline-archive-pagination button[hidden]{display:none}
.timeline-card.timeline-event-card{position:relative;padding:1.1rem 1.2rem;border-inline-start:3px solid var(--app-accent);box-shadow:0 2px 8px color-mix(in srgb,var(--app-text) 7%,transparent)}
.timeline-card.timeline-event-card>h3{margin:.15rem 0 .55rem;padding-inline-end:2.8rem;font-size:1.2rem;line-height:1.35;overflow-wrap:anywhere}
.timeline-event-share-action{margin-top:.7rem}
@media(max-width:600px){.timeline-card.timeline-event-card{padding:1rem}}
.timeline-person-panel-slot{position:fixed;top:64px;right:0;bottom:0;width:440px;z-index:80;overflow:visible}
.timeline-person-panel-slot.is-collapsed{width:0}
.home-mode .topbar.app-topbar{position:sticky;top:0}
.home-mode.timeline-person-panel-open .layout{width:calc(100% - 440px - 3rem);max-width:1440px;margin-left:max(1.5rem,calc((100% - 440px - 1440px)/2));margin-right:calc(440px + 1.5rem)}
dialog[class~="associate-edit-dialog"][open]{position:fixed;top:50%;left:50%;right:auto;bottom:auto;margin:0;transform:translate(-50%,-50%)}
.embedded-viewer-runtime{width:100%;min-height:calc(100vh - 64px)}
.embedded-viewer-runtime.is-parked{position:fixed;left:-200vw;top:0;width:100vw;height:100vh;overflow:hidden}
.embedded-viewer-runtime.viewer-modal-open{position:fixed;inset:0;z-index:1300;width:100vw;height:100vh;min-height:0;overflow:hidden}
.embedded-viewer-runtime.viewer-modal-open>.sub-header,.embedded-viewer-runtime.viewer-modal-open>.main-content{visibility:hidden}
.embedded-viewer-runtime .sub-header{margin:0}
.embedded-viewer-runtime .main-content{min-height:calc(100vh - 64px)}
body.viewer-view-mode .layout{width:100%;max-width:none;margin:0;padding:0}
/* Tree/Fan/People/Places: the page is a column of header + viewer, so the viewer takes exactly the viewport height
   left below the (variable-height) header; no hard-coded header height, and the list views scroll inside the viewer. */
body.viewer-view-mode{display:flex;flex-direction:column;height:100vh;height:100dvh}
body.viewer-view-mode>.layout,body.viewer-view-mode>.layout>#tree-view{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
body.viewer-view-mode .embedded-viewer-runtime:not(.is-parked):not(.viewer-modal-open){flex:1 1 auto;height:auto;min-height:0}
body.viewer-view-mode .embedded-viewer-runtime:not(.is-parked):not(.viewer-modal-open) .main-content{min-height:0}
body.viewer-view-mode #tree-chooser,body.viewer-view-mode #tree-list,body.viewer-view-mode #timeline-home{display:none!important}
body:not(.viewer-view-mode) .canvas-controls{display:none!important}
.timeline-post-date-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(10rem,.55fr);gap:1rem;align-items:start}
.timeline-post-date-fields>label{min-width:0}
.timeline-post-date-fields input,.timeline-post-date-fields select{width:100%;box-sizing:border-box}
.timeline-post-date-inputs{display:flex;align-items:center;gap:.4rem;position:relative}
.timeline-post-date-inputs input[type=text]{flex:1}
.timeline-post-date-inputs input[type=date].timeline-date-picker-input{position:absolute;right:0;bottom:0;width:2.8rem;height:2.8rem;opacity:0;pointer-events:none;margin:0;padding:0;border:0}
.timeline-post-date-inputs input[type=date]::-webkit-datetime-edit{display:none!important}
.timeline-post-date-inputs input[type=date]{width:2.8rem;height:2.8rem;padding:0;color:transparent!important}
.timeline-date-picker-trigger{display:inline-flex;align-items:center;justify-content:center;width:2.8rem;height:2.8rem;min-width:2.8rem;padding:0;border:1px solid var(--app-border);border-radius:.5rem;background:var(--app-card);color:var(--app-text);font-size:1.25rem;line-height:1;cursor:pointer;touch-action:manipulation}
.timeline-date-picker-trigger:hover,.timeline-date-picker-trigger:focus-visible{border-color:var(--app-accent);background:var(--app-soft);outline:2px solid var(--app-focus);outline-offset:1px}
@media(max-width:600px){.timeline-post-date-fields{grid-template-columns:minmax(0,1fr) minmax(8rem,.7fr);gap:.65rem}}
@media(max-width:760px){.timeline-person-panel-slot{top:58px;width:min(440px,calc(100% - 26px))}.home-mode.timeline-person-panel-open .layout{width:calc(100% - 2rem);margin:1.5rem auto}.embedded-viewer-runtime .main-content{min-height:calc(100dvh - 64px)}}
.ft-export-dialog--timeline .ft-dialog-message,.ft-export-dialog--timeline .status-neutral{color:var(--app-muted)}
.ft-export-dialog--timeline .status-success{color:var(--app-success)}
.ft-export-dialog--timeline .status-error{color:var(--app-danger)}
@media (max-width: 680px) { .tree-actions { align-items: stretch; flex-direction: column; } }
@media (max-width:600px){.timeline-filters{grid-template-columns:1fr}.timeline-actions{flex-direction:column}.timeline-secondary{overflow:auto;white-space:nowrap}}
.offline-brand-mark { display: block; width: 64px; height: 64px; object-fit: contain; margin: 0 auto 1rem; }
.timeline-group{scroll-margin-top:1rem}
.timeline-group-heading{position:sticky;top:0;z-index:1;margin:0;padding:.35rem .25rem;background:var(--app-soft);color:var(--app-muted);font-size:.82rem;letter-spacing:.06em}
.timeline-group-items{display:grid;gap:.75rem}
.timeline-person-link{color:var(--app-accent);font-weight:650;text-decoration:underline;text-underline-offset:.12em}
.timeline-person-link:hover,.timeline-person-link:focus-visible{text-decoration-thickness:2px}
.timeline-person-link.ft-person-pill{text-decoration:none}
#timeline-new-updates{display:block;margin:.65rem auto}
/* Bot trap: real visitors cannot focus or see it, but automated form fillers may. */
.honeypot{position:absolute!important;left:-10000px!important;top:auto!important;width:1px!important;height:1px!important;overflow:hidden!important}
.error-art img{display:block;width:100%;height:auto}
.error-page{box-sizing:border-box;min-height:100svh;max-width:38rem;margin:0 auto;padding:clamp(2rem,8vw,5rem) 1.5rem;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--text-primary)}
.error-art{width:min(14rem,55vw);margin-bottom:1rem}
.error-art svg{display:block;width:100%;height:auto}
.error-code{margin:0;color:var(--text-muted);font-size:.9rem;font-weight:700;letter-spacing:.16em}
.error-page h1{margin:.5rem 0;font-size:clamp(1.7rem,5vw,2.4rem);line-height:1.15}
.error-page>p:not(.error-code){max-width:31rem;line-height:1.6}
.error-caption{font-style:italic;color:var(--text-muted)}
.error-page .button{display:inline-flex;align-items:center;justify-content:center;margin-top:1rem;min-height:2.8rem;padding:.6rem 1rem;border-radius:.55rem;text-decoration:none}
.error-page .button.primary{background:var(--app-accent);color:var(--app-accent-text)}
dialog.ft-dialog{width:min(32rem,calc(100vw - 2rem));max-width:100%;border:1px solid var(--app-border);border-radius:1rem;padding:1.25rem;background:var(--app-card);color:var(--app-text);box-shadow:var(--app-shadow-lg)}
dialog.ft-dialog::backdrop{background:var(--app-overlay)}
.ft-dialog h2{margin-top:0}
.ft-dialog-message{white-space:pre-wrap;overflow-wrap:anywhere}
.ft-dialog input{margin:.75rem 0}
.ft-dialog-actions{display:flex;justify-content:flex-end;gap:.6rem;margin-top:1.5rem}
.ft-dialog-actions .quiet{border-color:var(--app-border);color:var(--app-control-text)}
/* The account shell shares theme preference and artwork with the full viewer. */
/* Theme tokens (palettes, shape, event colours) live in assets/themes/*.css. */
/* The shared dialogs remain centered while long copy scrolls independently of their actions. */
dialog.ft-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
dialog.ft-dialog[open]>form{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;width:100%}
.ft-dialog-message{flex:1 1 auto;min-height:0;max-height:min(55dvh,30rem);overflow:auto;overscroll-behavior:contain}
.ft-dialog-actions{flex:0 0 auto;flex-wrap:wrap;position:sticky;bottom:0;margin-top:.75rem;padding-top:.65rem;background:var(--app-card)}
.ft-dialog-actions button{min-height:44px}
@media(max-height:480px){dialog.ft-dialog[open]{padding:.85rem}.ft-dialog-message{max-height:38dvh}.ft-dialog-actions{margin-top:.5rem}}
body{background:var(--app-page);color:var(--app-text)}
.import-research-preview{margin:.75rem 0;padding:.85rem 1rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft);color:var(--app-text)}
.import-research-preview h4{margin:.1rem 0 .4rem;color:var(--app-text)}
.import-research-preview ul{margin:.25rem 0 .75rem;padding-left:1.25rem;color:var(--app-text)}
.import-research-preview li{margin:.2rem 0;overflow-wrap:anywhere}
.import-research-preview pre{max-width:100%;overflow-wrap:anywhere;white-space:pre-wrap;font:inherit}
.import-rehearsal-pending{margin:.5rem 0;padding:.55rem .7rem;border:1px dashed var(--app-border);border-radius:var(--app-radius);background:var(--app-card);color:var(--app-control-text);overflow-wrap:anywhere}
.import-research-preview h5{margin:.75rem 0 .35rem;color:var(--app-text)}
ul.import-rehearsal-list{list-style:none;margin:.35rem 0 .5rem;padding:0;display:grid;gap:.5rem;min-width:0}
.import-rehearsal-item{min-width:0;margin:0;padding:.55rem .7rem;border:1px solid var(--app-border);border-left:3px solid var(--app-danger);border-radius:var(--app-radius);background:var(--app-card);color:var(--app-text);overflow-wrap:anywhere}
.import-rehearsal-item strong{font-weight:650}
.import-rehearsal-count{margin-left:.4rem;color:var(--app-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.import-rehearsal-items{margin-top:.35rem;min-width:0;color:var(--app-muted)}
.import-rehearsal-items>summary{cursor:pointer;color:var(--app-control-text);font-weight:600}
.import-rehearsal-items ul{margin:.35rem 0 .25rem;padding-left:1.1rem;color:var(--app-text);font-size:.9rem}
.import-rehearsal-items li{margin:.2rem 0;min-width:0;overflow-wrap:anywhere}
.import-rehearsal-items p{margin:.25rem 0;color:var(--app-muted)}
.import-rehearsal-notes{margin-top:.85rem;padding-top:.6rem;border-top:1px solid var(--app-border)}
.import-rehearsal-notes .import-rehearsal-note{border-left:3px solid var(--app-muted);background:var(--app-soft);color:var(--app-control-text)}
.import-rehearsal-notes .import-rehearsal-count{color:var(--app-muted)}
.card,.tree-card,.timeline-shell,.timeline-card,.feature-section,dialog.ft-dialog{background:var(--app-card);color:var(--app-text);border-color:var(--app-border)}
.timeline-shell,.feature-section{background:var(--app-soft)}
.timeline-filters select{display:block;width:100%;margin-top:.35rem;border:1px solid var(--app-border);border-radius:var(--app-radius);padding:.65rem .75rem;font:inherit;background:var(--app-field);color:var(--app-control-text)}
.timeline-discovery-date{display:block;margin-top:.35rem;color:var(--app-muted);font-size:.82rem}
.ft-file-input{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
.ft-file-drop{display:grid;gap:.25rem;width:100%;margin-top:.45rem;padding:1rem;border:1px dashed var(--app-border);border-radius:var(--app-radius);background:var(--app-soft);color:var(--app-control-text);text-align:center;cursor:pointer}
.ft-file-drop-instruction{font-weight:650}
.ft-file-drop-names{color:var(--app-muted);font-size:.85rem;overflow-wrap:anywhere}
.ft-file-browse{justify-self:center;margin-top:.25rem;padding:.45rem .75rem;border:1px solid var(--app-border);border-radius:.5rem;background:var(--app-card);color:var(--app-text);font-weight:650}
.ft-file-previews{display:flex;justify-content:center;gap:.35rem}
.ft-file-preview{width:3rem;height:3rem;object-fit:cover;border-radius:.4rem}
.ft-file-drop-names[data-state=error]{color:var(--app-danger)}
.ft-upload-status{display:grid;grid-template-columns:minmax(5rem,1fr) auto;align-items:center;gap:.4rem;margin:.4rem 0;color:var(--app-muted);font-size:.85rem}
.ft-upload-status progress{grid-column:1/-1;width:100%;height:.45rem;accent-color:var(--app-accent)}
.ft-file-drop:hover,.ft-file-drop.is-dragging,.ft-file-drop.has-files{border-color:var(--app-accent);background:color-mix(in srgb,var(--app-accent) 8%,var(--app-soft))}
.ft-file-input:focus + .ft-file-drop,.ft-file-drop:focus-visible{outline:3px solid var(--app-focus);outline-offset:2px}
.timeline-group-heading{background:var(--app-soft);color:var(--app-muted)}
label,.auth-card>p,.muted,.timeline-card time,.timeline-meta{color:var(--app-muted)}
input,select,.timeline-actions .quiet,.admin-link,.feature-section select,.ft-dialog input{background:var(--app-field);color:var(--app-control-text);border-color:var(--app-border)}
.tree-card{color:var(--app-text)}
.tree-card span{color:var(--app-muted)}
.home-mode #tree-list,.home-mode #tree-view>.heading-row{display:none!important}
a.primary{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:.65rem .9rem;border:1px solid transparent;border-radius:var(--app-radius);text-decoration:none}
.pwa-update-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}
.pwa-update .quiet{border-color:var(--app-border);color:var(--app-control-text);white-space:nowrap}
.topbar{position:sticky;top:0;z-index:5}
.tree-switcher,.theme-control{max-width:min(15rem,30vw);min-height:40px;margin:0;padding:.45rem .6rem;border:1px solid var(--app-topbar-border);border-radius:var(--app-radius);background:var(--app-search-bg);color:var(--app-search-text);font:inherit}
.tree-switcher option,.theme-control option{background:var(--app-card);color:var(--app-text)}
.topbar-action{min-height:40px;background:var(--app-card);color:var(--app-text);font-weight:700}
.topbar-action:hover{background:var(--app-accent-soft)}
.timeline-scope-note{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:.75rem 0 0;line-height:1.5}
.timeline-scope-note>span{flex:1 1 14rem;min-width:0}
.timeline-scope-note>.admin-link{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere}
.timeline-filters{grid-template-columns:1fr;align-items:start}
.timeline-date-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem}
.timeline-date-filters label{margin:0}
.timeline-date-filters input{margin-top:.35rem}
@media(max-width:1280px){.topbar{height:auto;min-height:58px;flex-wrap:wrap;row-gap:.35rem;padding-top:.45rem;padding-bottom:.45rem}.topbar>*{min-width:0}}
@media(max-width:650px){
  .topbar{height:auto;min-height:58px;gap:.4rem;padding:.45rem .6rem;flex-wrap:wrap}
  .brand{font-size:1rem}
  .brand-mark{width:28px;height:28px}
  .tree-switcher{flex:1;max-width:none;min-width:8rem}
  .theme-control{max-width:5.2rem}
  .topbar-action{padding:.45rem .55rem;min-height:40px}
  .topbar #account-label{display:none}
  .topbar #signout{padding:.45rem .55rem;min-height:40px}
  .timeline-header{align-items:flex-start;flex-direction:column}
  .timeline-actions{width:100%;flex-direction:row!important}
  .timeline-actions>*{flex:1}
  .timeline-date-filters{grid-template-columns:1fr 1fr}
}
@media(max-width:650px){.timeline-archive-heading{flex-direction:column}.timeline-archive-heading label{width:100%}}
.timeline-date-jump{display:grid;grid-template-columns:auto minmax(10rem,1fr) auto;align-items:end;gap:.55rem}
.timeline-date-jump label{margin:0}
.timeline-date-jump input{min-height:40px;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card);color:var(--app-control-text);padding:.45rem .6rem}
.timeline-date-jump button{min-height:40px}
@media(max-width:650px){.timeline-date-jump{grid-template-columns:1fr auto}.timeline-date-jump label{grid-column:1/-1}}
/* Timeline posts: keep the composer calm on desktop and comfortable on phones. */
.timeline-post-composer{display:grid;gap:.75rem;margin-top:1rem;padding:1rem;border:1px solid var(--app-border);border-radius:var(--app-radius-lg);background:var(--app-card)}
.timeline-post-composer h3{margin:.1rem 0}
.timeline-post-composer .timeline-post-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
.timeline-post-composer .timeline-post-form label{display:grid;gap:.35rem;margin:0}
.timeline-post-composer .timeline-post-form label:nth-of-type(2),.timeline-post-composer .timeline-post-form label:nth-of-type(3){grid-column:1/-1}
.timeline-post-composer .timeline-post-form textarea{min-height:7rem;resize:vertical}
.timeline-post-composer .timeline-post-form button,.timeline-post-composer .timeline-post-form .message{align-self:center;margin:0}
.timeline-post-feed{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr));gap:.75rem}
.timeline-post{margin:0;padding:1rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card)}
.timeline-post h4{margin:.1rem 0 .45rem}
.timeline-post p{white-space:pre-wrap}
.timeline-post-composer [data-state="error"]{color:var(--app-danger)}
.timeline-post-composer [data-state="success"]{color:var(--app-success)}
@media(max-width:600px){.timeline-post-composer .timeline-post-form{grid-template-columns:1fr}.timeline-post-composer .timeline-post-form label:nth-of-type(2),.timeline-post-composer .timeline-post-form label:nth-of-type(3){grid-column:auto}.timeline-post-composer .timeline-post-form button{width:100%}}
.timeline-post-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}
.timeline-post-history,.timeline-post-edit{display:grid;gap:.6rem;margin-top:.75rem;padding:.75rem;border-top:1px solid var(--app-border)}
.timeline-post-history h5{margin:0}
.timeline-post-revision{padding:.65rem;border-radius:var(--app-radius);background:var(--app-surface)}
.timeline-post-edit label{display:grid;gap:.35rem}
.timeline-post-edit textarea{min-height:6rem}
.timeline-post-attachment{margin:.75rem 0 0}
.timeline-post-attachment img{display:block;width:100%;max-height:32rem;object-fit:contain;border-radius:var(--app-radius);background:var(--app-surface)}
.timeline-post-attachment figcaption{margin-top:.35rem;color:var(--text-muted)}
.timeline-post-form input[type=file]{max-width:100%;padding:.55rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-surface)}
.timeline-post-form input[type=file].ft-file-input{position:absolute!important;width:1px!important;height:1px!important;max-width:none!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;background:transparent!important}
.timeline-post-discussion{margin-top:1rem;padding-top:.75rem;border-top:1px solid var(--app-border)}
.timeline-post-discussion h5{margin:0 0 .5rem}
.timeline-post-comments{display:grid;gap:.5rem}
.timeline-post-comment{padding:.55rem;border-radius:var(--app-radius);background:var(--app-surface)}
.timeline-post-comment p{margin:.1rem 0 .25rem}
.timeline-post-comment-actions{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.4rem}
.timeline-post-comment-actions button{font-size:.8rem}
.topbar button.topbar-action,.topbar button#signout{background:transparent!important;color:var(--app-topbar-text)!important;border:1px solid var(--app-topbar-border)!important;font-weight:700}
.topbar button.topbar-action:hover,.topbar button#signout:hover{background:var(--app-hover)!important}
dialog.timeline-post-dialog:not([open]):not(.ft-modal-fallback-open){display:none!important}
dialog.ft-modal-tabbed:not([open]):not(.ft-modal-fallback-open){display:none!important}
dialog.timeline-post-dialog[open],dialog.timeline-post-dialog.ft-modal-fallback-open,.timeline-post-dialog[open],.timeline-post-dialog.ft-modal-fallback-open,dialog.ft-modal-tabbed[open],dialog.ft-modal-tabbed.ft-modal-fallback-open{width:min(96vw,56rem);height:min(48rem,92dvh);max-height:92dvh;margin:auto;padding:.85rem 1.15rem 1rem;display:flex;flex-direction:column;overflow:hidden}
.timeline-post-dialog .ft-modal-form,.ft-modal-tabbed .ft-modal-form{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;height:100%;max-height:100%;overflow:hidden}
.ft-modal .ft-modal-header{height:auto;min-height:0;background:transparent;border-bottom:0;z-index:auto;color:inherit}
.timeline-post-dialog .ft-modal-header,.ft-modal-tabbed .ft-modal-header{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin:0 0 .25rem;padding:0}
.timeline-post-dialog .ft-modal-header h2,.ft-modal-tabbed .ft-modal-header h2{margin:0;font-size:1.25rem;line-height:1.25}
.ft-modal-tabs{display:flex;overflow-x:auto;gap:.35rem;padding:.15rem .25rem 0;margin:0 0 .35rem;border-bottom:1px solid var(--app-border);background:var(--app-card);flex-shrink:0}
.ft-modal-tab{padding:.5rem .9rem;border:0;border-bottom:3px solid transparent;background:transparent;color:var(--app-muted);font:inherit;font-weight:600;cursor:pointer;border-radius:6px 6px 0 0}
.ft-modal-tab:hover{color:var(--app-text);background:var(--app-soft)}
.ft-modal-tab[aria-selected="true"]{color:var(--app-accent);border-bottom-color:var(--app-accent);background:transparent}
.timeline-post-dialog .ft-modal-body,.ft-modal-tabbed .ft-modal-body{flex:1 1 auto;min-height:0;overflow-y:auto;max-height:none;padding:.65rem .85rem;display:flex;flex-direction:column;gap:.75rem}
.ft-modal-tabpanel{display:flex;flex-direction:column;gap:var(--space-4);min-height:0}
.ft-modal-tabpanel[hidden]{display:none!important}
.timeline-post-type-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.75rem;align-items:end}
.timeline-post-type-row>.timeline-smart-picker{grid-column:auto;min-width:0}
.timeline-post-dialog .ft-modal-footer,.ft-modal-tabbed .ft-modal-footer{flex-shrink:0;display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:.6rem;min-height:3.75rem;box-sizing:border-box;margin-top:.5rem;padding-top:.65rem;border-top:1px solid var(--app-border)}
.timeline-post-dialog .ft-modal-footer .timeline-post-dialog-status,.ft-modal-tabbed .ft-modal-footer .ft-modal-status{margin:0 auto 0 0;flex:1 1 auto;min-width:0;max-height:3.9em;overflow-y:auto;font-size:.88rem;line-height:1.3;text-align:left;float:none}
.ft-modal-tabbed .ft-modal-footer .ft-modal-status.is-error{color:var(--app-danger)}
.ft-modal-tabbed .ft-modal-footer button{flex:0 0 auto}
.timeline-event-participant{display:grid;grid-template-columns:2rem minmax(0,1fr) minmax(7.5rem,10.5rem) auto;gap:.65rem;align-items:center;padding:.5rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card)}
.timeline-event-participant-avatar{width:32px;height:32px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--app-surface);font-size:1.1rem;overflow:hidden;flex-shrink:0}
.timeline-event-participant-avatar img{width:100%;height:100%;object-fit:cover}
.timeline-participant-name{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.timeline-event-participant-overflow.ft-participant-expand{display:inline-flex;align-items:center;vertical-align:middle;padding:0 .2rem;border:0;background:transparent;color:var(--app-accent);font-family:inherit;font-size:inherit;font-weight:650;line-height:inherit;text-decoration:none;white-space:nowrap;cursor:pointer}
.timeline-event-participant-overflow.ft-participant-expand:hover,.timeline-event-participant-overflow.ft-participant-expand:focus-visible{color:var(--app-accent-hover);text-decoration:underline}
.timeline-event-participant-overflow.ft-participant-expand:focus-visible{outline:2px solid var(--app-focus);outline-offset:2px;border-radius:4px}
.timeline-event-participant-extra[hidden]{display:none!important}
.timeline-post-dialog select:focus,.timeline-post-dialog input:focus,.timeline-post-dialog textarea:focus,.timeline-post-dialog .timeline-smart-picker input[role=combobox]:focus{outline:2px solid var(--app-accent)!important;outline-offset:-1px!important;border-color:var(--app-accent)!important}
.timeline-details-dropzone{display:none!important}
@media(max-width:540px){.timeline-post-type-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.45rem}.timeline-post-type-row>label{min-width:0}.timeline-post-type-row select{min-width:0;width:100%}}
.timeline-post-composer{display:flex;align-items:center;gap:.7rem;margin:.25rem 0 1rem;padding:.6rem 0;border:0;background:transparent}
.timeline-post-composer h3,.timeline-post-composer>p{display:none}
.timeline-post-open{min-height:44px}
.timeline-post-dialog textarea{min-height:7rem;resize:vertical}
.timeline-post-pending{display:inline-block;margin:.2rem 0}
.timeline-card.timeline-post{border-left:4px solid var(--app-accent)}
.timeline-post-comment-form textarea{min-height:4rem}
@media(max-width:600px){.timeline-post-dialog,.ft-modal-tabbed{width:calc(100vw - 1rem)}}
dialog.ft-modal-tabbed--compact[open],dialog.ft-modal-tabbed--compact.ft-modal-fallback-open{width:min(96vw,38rem);height:min(40rem,92dvh)}
.timeline-existing-media-section{display:flex;flex-direction:column;gap:.65rem;margin-bottom:1.25rem;padding-bottom:1rem;border-bottom:1px solid var(--app-border)}
.timeline-existing-media-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.timeline-existing-media-title{margin:0;font-size:1rem;font-weight:650;color:var(--app-text)}
.timeline-existing-media-table-wrapper{overflow-x:auto;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card)}
.timeline-existing-media-table{width:100%;border-collapse:collapse;text-align:left;font-size:.9rem}
.timeline-existing-media-table th,.timeline-existing-media-table td{padding:.5rem .65rem;border-bottom:1px solid var(--app-border);vertical-align:middle}
.timeline-existing-media-table tbody tr:last-child td{border-bottom:none}
.timeline-existing-media-table th{background:var(--app-surface,var(--app-soft));color:var(--app-muted);font-weight:600;font-size:.8rem;text-transform:uppercase;letter-spacing:.03em}
.timeline-existing-media-row.is-dragging{opacity:.4;background:var(--app-soft)}
.timeline-existing-media-row.drag-over-above{border-top:2px solid var(--app-accent)}
.timeline-existing-media-row.drag-over-below{border-bottom:2px solid var(--app-accent)}
.timeline-drag-controls{display:flex;align-items:center;gap:.25rem}
.timeline-drag-handle{display:inline-flex;align-items:center;justify-content:center;padding:.25rem .35rem;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--app-muted);cursor:grab;font-size:1.1rem;line-height:1;user-select:none}
.timeline-drag-handle:hover,.timeline-drag-handle:focus-visible{color:var(--app-text);background:var(--app-surface);border-color:var(--app-border)}
.timeline-drag-handle:active{cursor:grabbing}
.timeline-reorder-btn{display:inline-flex;align-items:center;justify-content:center;width:1.4rem;height:1.4rem;padding:0;border:1px solid var(--app-border);border-radius:3px;background:var(--app-surface);color:var(--app-muted);font-size:.65rem;cursor:pointer}
.timeline-reorder-btn:hover:not(:disabled){color:var(--app-text);border-color:var(--app-accent)}
.timeline-reorder-btn:disabled{opacity:.35;cursor:default}
.timeline-media-thumb{width:44px;height:44px;object-fit:cover;border-radius:4px;display:block;background:var(--app-soft);border:1px solid var(--app-border)}
.timeline-media-doc-icon{display:inline-grid;place-items:center;width:44px;height:44px;border-radius:4px;background:var(--app-soft);font-size:1.5rem}
.timeline-media-filename{font-weight:600;color:var(--app-text);word-break:break-word}
.timeline-media-caption{font-size:.8rem;color:var(--app-muted);margin-top:.15rem}
.timeline-media-remove-btn{padding:.3rem .6rem;font-size:.8rem}
.timeline-post-discussion>summary{cursor:pointer;color:var(--app-muted);font-weight:600}
.timeline-photo-date-suggestion{grid-column:1/-1;display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;padding:.65rem;border-radius:var(--app-radius);background:var(--app-surface);color:var(--app-muted)}
.timeline-photo-date-suggestion[hidden]{display:none}
.timeline-photo-date-suggestion button{margin:0}
.timeline-photo-gps-choice{grid-column:1/-1;display:flex!important;align-items:center;gap:.5rem}
.timeline-photo-gps-choice[hidden]{display:none!important}
.timeline-photo-gps-choice input{width:auto}
.timeline-photo-gps-help{grid-column:1/-1;margin-top:-.5rem}
.face-interest-notice{line-height:1.55}
.face-interest-attestation{display:grid;grid-template-columns:auto 1fr;align-items:start;gap:.65rem;margin:1rem 0;padding:1rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft);color:var(--app-text);line-height:1.5}
.face-interest-attestation input{width:1.1rem;height:1.1rem;margin:.15rem 0 0;accent-color:var(--app-accent)}
.timeline-post-composer{justify-content:flex-end}
.timeline-post-dialog .ft-modal-body>label{display:grid;gap:.35rem;margin:0;min-width:0}
.timeline-post-dialog .ft-modal-body>label>input,.timeline-post-dialog .ft-modal-body>label>select,.timeline-post-dialog .ft-modal-body>label>textarea{width:100%;min-width:0;margin:0}
.timeline-post-dialog .ft-modal-body>label>input,.timeline-post-dialog .ft-modal-body>label>select,.timeline-post-dialog .ft-modal-body>label>textarea{min-height:44px;padding:.65rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-field);color:var(--app-control-text);font:inherit}
.timeline-post-dialog .ft-modal-body>label>textarea{min-height:7rem;resize:vertical}
.import-research-states{margin:.8rem 0;padding:.75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft);color:var(--app-text)}
.import-research-states h5,.import-research-states p{margin:.2rem 0 .55rem}
.import-research-states table{width:100%;border-collapse:collapse;text-align:left}
.import-research-states caption{text-align:left;font-weight:650;margin-bottom:.35rem}
.import-research-states th,.import-research-states td{padding:.35rem .45rem;border-top:1px solid var(--app-border)}
.import-research-states th:last-child,.import-research-states td:last-child{text-align:right;font-variant-numeric:tabular-nums}
.timeline-post-composer>.timeline-post-result:empty{display:none}
.timeline-post-composer>.timeline-post-result:not(:empty){display:block;flex-basis:100%;margin:.15rem 0}
.timeline-post-composer>.timeline-post-result.timeline-post-result-toast{position:fixed;z-index:12000;top:calc(env(safe-area-inset-top,0px) + .75rem);left:50%;width:min(36rem,calc(100vw - 2rem));transform:translateX(-50%);padding:.85rem 1rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card);box-shadow:var(--app-shadow-lg);color:var(--app-text)}
.timeline-post-result-clickable{cursor:pointer}
.timeline-post-result-clickable:focus-visible{outline:2px solid var(--app-focus);outline-offset:2px}
.timeline-post-result-clickable:hover{box-shadow:var(--app-shadow-lg)}
.timeline-card-after-share{outline:3px solid var(--app-accent);outline-offset:3px;transition:outline-color .4s ease}
.timeline-upcoming-prompts{display:grid;gap:.45rem;flex:1 1 100%;min-width:0;padding:.7rem .9rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft);color:var(--app-text)}
.timeline-upcoming-prompts[hidden]{display:none}
.timeline-upcoming-prompt{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin:0}
.timeline-upcoming-prompt button{flex:0 0 auto}
@media(max-width:600px){.timeline-upcoming-prompt{align-items:stretch;flex-direction:column}.timeline-upcoming-prompt button{width:100%}}
.timeline-event-fields{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;min-width:0;margin:0;padding:.75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-surface);color:var(--app-text)}
.timeline-event-fields legend{padding:0 .35rem;font-weight:700}
.timeline-event-fields label{display:grid;gap:.35rem}
.timeline-event-fields label:first-of-type{grid-column:1/-1}
.timeline-event-participants{display:grid;gap:.5rem;grid-column:1/-1}
/* Keep the main stream focused like a social feed, with a clear author row. */
.timeline-card.timeline-post{position:relative;padding:1.1rem 1.2rem;border-inline-start:3px solid var(--app-accent);box-shadow:0 2px 8px color-mix(in srgb,var(--app-text) 7%,transparent)}
.timeline-post-author{display:flex;justify-content:flex-end;align-items:center;gap:.6rem;max-width:100%;margin:0 2.5rem .6rem 0;text-align:right}
.timeline-post-avatar{display:grid;place-items:center;width:2.2rem;height:2.2rem;border-radius:50%;background:var(--app-soft);color:var(--app-accent);font-weight:700;font-size:.9rem}
.timeline-post-byline{display:grid;gap:.12rem;min-width:0;text-align:right}
.timeline-post-byline strong{color:var(--app-text);font-size:.95rem;line-height:1.25}
.timeline-post-shared-date{color:var(--app-muted);font-size:.8rem}
.timeline-post-signature{margin-top:-.3rem;color:var(--app-muted);font-style:italic;text-align:right}
.timeline-card{position:relative;background:var(--app-card);border:1px solid var(--app-border);border-radius:var(--app-radius);padding:1rem 3.5rem 1rem 1rem}
.timeline-card.timeline-card-world-event,.timeline-card[data-event-kind="world_event"]{background:var(--app-event-world-bg);border-color:var(--app-event-world-border);color:var(--app-event-world-text)}
.timeline-card.timeline-card-birth,.timeline-card[data-event-type="birth"],.timeline-card[data-event-type="birt"],.timeline-card[data-event-type="birthday"]{background:var(--app-event-birth-bg);border-color:var(--app-event-birth-border)}
.timeline-card.timeline-card-anniversary,.timeline-card.timeline-card-marriage,.timeline-card[data-event-type="anniversary"],.timeline-card[data-event-type="marr"],.timeline-card[data-event-type="marriage"],.timeline-card[data-event-type="wedding"]{background:var(--app-event-anniversary-bg);border-color:var(--app-event-anniversary-border)}
.timeline-card.timeline-card-death,.timeline-card[data-event-type="death"],.timeline-card[data-event-type="deat"],.timeline-card[data-event-type="burial"],.timeline-card[data-event-type="buri"],.timeline-card[data-event-type="funeral"]{background:var(--app-event-death-bg);border-color:var(--app-event-death-border)}
.timeline-post-menu{position:absolute;top:.75rem;right:.8rem;z-index:5}
.timeline-post-menu>summary{display:grid;place-items:center;width:2.25rem;height:2.25rem;border:1px solid var(--app-border);border-radius:.5rem;background:var(--app-card);color:var(--app-text);font-size:1.2rem;cursor:pointer;list-style:none}
.timeline-post-menu>summary::-webkit-details-marker{display:none}
.timeline-post-menu-items{position:absolute;top:calc(100% + .3rem);right:0;display:grid;min-width:11rem;padding:.3rem;background:var(--app-card);border:1px solid var(--app-border);border-radius:.6rem;box-shadow:var(--app-shadow-lg);z-index:10}
.timeline-post-menu-items button,.timeline-post-menu-items a{padding:.55rem .65rem;border:0;border-radius:.35rem;background:transparent;color:var(--app-text);text-align:left;cursor:pointer;font:inherit;font-size:.9rem;white-space:nowrap;text-decoration:none}
.timeline-post-menu-items button:hover,.timeline-post-menu-items button:focus-visible,.timeline-post-menu-items a:hover,.timeline-post-menu-items a:focus-visible{background:var(--app-soft);outline:none}
.timeline-post-menu-items button.danger{background:var(--app-danger);color:var(--app-accent-text);font-weight:700}
.timeline-post-menu-items button.timeline-card-hide-action{color:var(--app-muted);border-top:1px solid var(--app-border);margin-top:.2rem;padding-top:.45rem}
.timeline-post-menu-items button.timeline-card-hide-action:hover{color:var(--app-text)}
.timeline-card.timeline-post>h3{margin:.15rem 0 .55rem;padding-inline-end:2.8rem;font-size:1.2rem;line-height:1.35;overflow-wrap:anywhere}
.timeline-card.timeline-post>p{line-height:1.6}
.timeline-card.timeline-post .timeline-post-discussion{margin-top:1rem;padding-top:.85rem}
@media(max-width:600px){.timeline-card.timeline-post{padding:1rem}}
.timeline-event-participant{display:grid;grid-template-columns:2rem minmax(0,1fr) minmax(7.5rem,10.5rem) auto;align-items:center;gap:.6rem;padding:.5rem .65rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card)}
.timeline-event-type{display:inline-block;margin:.25rem 0;padding:.25rem .55rem}
.timeline-event-participant-list{display:flex;flex-wrap:wrap;gap:.25rem .4rem}
.timeline-place-picker{display:grid;grid-column:1/-1;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:.6rem}
.timeline-place-create{display:grid;grid-column:1/-1;grid-template-columns:minmax(0,1.2fr) minmax(0,.7fr) minmax(0,1fr) auto auto;align-items:end;gap:.6rem;margin:0;padding:.75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card);color:var(--app-text)}
.timeline-place-create legend{padding:0 .35rem;font-weight:700}
.timeline-place-create label{display:grid;gap:.35rem}
.timeline-place-create button{min-height:40px}
.timeline-place-status{grid-column:1/-1;margin:0}
@media(max-width:600px){.timeline-event-fields{grid-template-columns:1fr}.timeline-event-fields label:first-of-type,.timeline-event-participants{grid-column:1}.timeline-event-participant{grid-template-columns:2rem minmax(0,1fr) minmax(6.5rem,8.5rem) auto;gap:.45rem}}
@media(max-width:600px){.timeline-place-picker,.timeline-place-create{grid-template-columns:1fr}.timeline-place-picker>*{grid-column:1}.timeline-place-create>*{grid-column:1}.timeline-place-picker>button{width:100%}}
/* Tree settings use addressable, responsive sections and the shared theme tokens. */
.tree-settings-nav{display:flex;flex-wrap:wrap;gap:.45rem;margin:1rem 0 1.25rem;padding-bottom:.75rem;border-bottom:1px solid var(--app-border);}
.tree-settings-nav a{display:inline-flex;align-items:center;min-height:2.5rem;padding:.55rem .8rem;border:1px solid var(--app-border);border-radius:var(--app-radius-pill);background:var(--app-field);color:var(--app-control-text);text-decoration:none;font-weight:600;}
.tree-settings-nav a[aria-current="page"]{border-color:var(--app-accent);background:var(--app-accent);color:var(--app-accent-text);}
.tree-settings-nav a:focus-visible{outline:3px solid var(--app-focus);outline-offset:2px;}
#selected-tree .heading-row .tree-actions{justify-content:flex-end;margin-left:auto;}
@media(max-width:640px){.tree-settings-nav{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;padding-bottom:.6rem}.tree-settings-nav a{white-space:nowrap;}}
.timeline-post-heading{align-items:center}
.timeline-post-heading .timeline-post-open{margin-left:auto;flex-shrink:0}
@media(max-width:520px){.timeline-post-heading{align-items:flex-start;gap:.75rem}.timeline-post-heading .timeline-post-open{margin-left:0}}
/* Compact, theme-aware membership controls. Keep both selectors aligned on desktop and stack them on phones. */
#invite-form select,
#admin-member-list select {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: .6rem .7rem;
  background: var(--app-field);
  color: var(--app-control-text);
  font: inherit;
}
#admin-member-list li {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) repeat(2, minmax(9rem, .8fr));
  align-items: center;
  gap: .55rem;
}
.admin-invitation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.admin-invitation-row button { flex: 0 0 auto; }
@media (max-width: 640px){
  #admin-member-list li { grid-template-columns: 1fr; gap: .5rem; }
  .admin-invitation-row { align-items: stretch; flex-direction: column; }
}
.viewer-research-books{margin:1.5rem 0;padding:1rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card);color:var(--app-text)}
.viewer-research-book-picker{display:block;color:var(--app-text)}
.viewer-research-book-picker select{display:block;width:100%;margin-top:.4rem;padding:.7rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-field);color:var(--app-control-text);font:inherit}
.research-book-source{max-height:min(65vh,48rem);overflow:auto;overflow-wrap:anywhere;padding:1rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft);color:var(--app-text);line-height:1.55}
.date-input-hint,.date-input-preview{display:block;margin-top:.25rem;font-size:.78rem;font-weight:400;color:var(--app-muted);line-height:1.4}
.date-input-preview:empty{display:none}
.timeline-post-date-fields>.date-input-hint,.timeline-post-date-fields>.date-input-preview,.timeline-post-date-fields>.timeline-post-date-help{grid-column:1/-1;margin-top:-.35rem}
.timeline-post-dialog .timeline-background-upload-choice{display:flex!important;grid-column:1/-1;align-items:flex-start;gap:.55rem}
.timeline-post-dialog .timeline-background-upload-choice input{margin-top:.25rem}
.timeline-post-dialog .timeline-background-upload-help{grid-column:1/-1;margin-top:-.45rem}
.timeline-generated{border-inline-start:4px solid var(--app-accent);background:var(--app-soft)}
.timeline-generated-label{display:inline-flex;width:max-content;margin:.25rem 0 .5rem}
.timeline-generated-action{display:block;min-height:40px;margin:.2rem 0 0}
.timeline-claim-status{display:inline-flex;margin:.25rem .35rem .25rem 0}
.timeline-source-citation,.timeline-item-notes{overflow-wrap:anywhere}
.timeline-source-citation strong,.timeline-item-notes strong{color:var(--app-text)}
.timeline-occasion-settings{display:grid;gap:.4rem;min-width:0;margin:0;padding:.65rem .8rem;border:1px solid var(--app-border);border-radius:var(--app-radius)}
.timeline-occasion-settings legend{padding:0 .3rem;font-weight:650}
.timeline-occasion-settings p{margin:0;min-height:1.2em}
.timeline-upcoming-heading{margin:0;font-size:.95rem}
.timeline-occasion-settings .checkbox-row{min-height:44px;padding:.2rem .1rem;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.timeline-occasion-settings .checkbox-row input{width:20px;height:20px;min-width:20px;min-height:20px;accent-color:var(--app-accent);cursor:pointer}
.timeline-occasion-settings select{min-height:44px;touch-action:manipulation}
.settings-form{display:grid;gap:1.25rem;margin:1.2rem 0;max-width:40rem}
.settings-form fieldset{display:grid;gap:1rem;margin:0;padding:1rem 1.1rem;border:1px solid var(--app-border);border-radius:var(--app-radius)}
.settings-form legend{padding:0 .4rem;font-weight:700;color:var(--app-text)}
.settings-form label{display:grid;gap:.35rem;margin:0}
.settings-form select,.settings-form input{width:100%;min-height:44px;box-sizing:border-box;margin:0}
.settings-form select{padding:.65rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);font:inherit;background:var(--app-field);color:var(--app-control-text)}
.settings-form select[multiple]{min-height:0}
.settings-form button{min-height:44px}
.settings-form .upload-help,.settings-form .message{margin:0}
.checkbox-row{display:flex;align-items:center;gap:.6rem;font-weight:650}
.checkbox-row input,.settings-form .checkbox-row input{width:auto;min-height:0;margin:0;flex:none}
.settings-form .checkbox-row{display:flex;gap:.6rem}
.settings-form small{color:var(--app-muted)}
.settings-form-actions{max-width:40rem;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.75rem}
.settings-form-actions [role=status]{margin:0 auto 0 0}
.account-settings-tabs{display:flex;gap:.5rem;margin:1.1rem 0 0;border-bottom:1px solid var(--app-border);overflow-x:auto}
.account-settings-tabs [role=tab]{min-height:44px;padding:.65rem 1rem;border:1px solid transparent;border-bottom:0;border-radius:8px 8px 0 0;background:transparent;color:var(--app-text);font:inherit;font-weight:650;white-space:nowrap;cursor:pointer}
.account-settings-tabs [aria-selected=true]{border-color:var(--app-border);background:var(--app-card);color:var(--app-accent)}
.settings-form [role=tabpanel]{display:grid;gap:1.25rem}
.settings-form [role=tabpanel][hidden]{display:none}
.account-email-section{display:grid;gap:.7rem}
.account-email-section h2{margin:.3rem 0 0;font-size:1.05rem}
.account-email-list{display:grid;gap:.5rem;margin:0;padding:0;list-style:none}
.account-email-list li{display:flex;justify-content:space-between;align-items:center;gap:.75rem;flex-wrap:wrap;padding:.65rem;border:1px solid var(--app-border);border-radius:var(--app-radius)}
.account-email-actions{display:flex;gap:.4rem}
.account-email-add{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:.6rem}
.account-email-add label{grid-column:1/-1}
.account-email-add input{min-height:44px;padding:.65rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-field);color:var(--app-control-text);font:inherit}
.account-session-button{justify-self:start;min-width:200px;border:1px solid var(--app-accent)!important}
.account-data-export{margin:0}
/* Keep menus above the people canvas and place timeline controls on one row. */
.topbar.app-topbar{position:relative;z-index:300}
.ft-account-menu .ft-account-panel{z-index:310}
.timeline-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:.5rem;margin-left:auto}
.timeline-actions #timeline-filters-toggle{order:1;flex:0 0 auto}
.timeline-actions .timeline-post-open{order:2;flex:0 0 auto;margin-left:0}
.timeline-post-composer h3{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.timeline-post-composer:has(.timeline-post-heading:only-child),.timeline-post-composer>.timeline-post-heading:not(:has(.timeline-post-open)){display:none}
.timeline-post-composer{margin:0;padding:0;gap:.5rem}
#timeline-status{margin:.5rem 0 0}
.timeline-post-moderation[hidden]{display:none!important}
#timeline-post-moderation{scroll-margin-top:1rem}
body.timeline-post-moderation-view #timeline-home> :not(#timeline-post-moderation):not(#timeline-evidence-moderation){display:none!important}
body.timeline-post-moderation-view #timeline-post-moderation,
body.timeline-post-moderation-view #timeline-post-moderation[hidden],
body.timeline-post-moderation-view #timeline-evidence-moderation,
body.timeline-post-moderation-view #timeline-evidence-moderation[hidden]{display:block!important}
body.timeline-post-moderation-view #timeline-post-moderation{min-height:18rem;padding:1.25rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft)}
.evidence-moderation{margin-top:1rem}
.evidence-review-search{display:grid;gap:.35rem;max-width:36rem}
.evidence-review-search input{box-sizing:border-box;width:100%;min-height:44px;padding:.65rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-field);color:var(--app-control-text);font:inherit}
.evidence-review-list{display:grid;gap:1rem;margin-top:1rem}
.evidence-review-card{display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem;padding:1rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-soft)}
.evidence-review-card h3,.evidence-review-details{margin:.1rem 0}
.evidence-review-preview{display:block;max-width:min(100%,44rem);max-height:32rem;margin-inline:auto;object-fit:contain;object-position:center;border-radius:var(--app-radius-sm)}
.evidence-review-actions{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-top:.35rem}
.proposal-actions,.timeline-post-actions,.panel-actions,.pwa-update-actions,.export-preview-actions{justify-content:flex-end}
.heading-row>.quiet,.timeline-header>.quiet{margin-left:auto}
.tree-actions{justify-content:flex-end}
@media(max-width:650px){.timeline-actions>*{flex:0 0 auto}.timeline-actions .timeline-post-open{margin-left:auto}}
/* The sharing dialog styles every nested field and keeps inline actions below inputs. */
dialog.timeline-post-dialog[open]{overflow:hidden}
.timeline-post-dialog .timeline-event-fields{grid-template-columns:minmax(0,1fr);gap:1rem}
.timeline-post-dialog label,dialog.ft-modal-tabbed label{min-width:0;margin:0}
.timeline-post-dialog input:not([type=checkbox]):not([type=file]),.timeline-post-dialog select,.timeline-post-dialog textarea,dialog.ft-modal-tabbed input:not([type=checkbox]):not([type=file]),dialog.ft-modal-tabbed select,dialog.ft-modal-tabbed textarea{box-sizing:border-box;width:100%;min-width:0;min-height:44px;margin:0;padding:.65rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-field);color:var(--app-control-text);font:inherit}
.timeline-post-dialog [hidden],.ft-modal-tabbed [hidden]{display:none!important}
.timeline-post-dialog .timeline-place-picker{grid-template-columns:minmax(0,1fr);align-items:stretch}
.timeline-post-dialog .timeline-place-create,.timeline-post-dialog .timeline-event-type-create{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;min-width:0;margin:0;padding:.75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card)}
.timeline-place-create>label:first-of-type,.timeline-event-type-create>*,.timeline-inline-actions{grid-column:1/-1}
.timeline-inline-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}
.timeline-post-dialog .timeline-place-status:empty,.timeline-post-dialog .timeline-event-participants:empty,.timeline-event-type-create>p:empty{display:none}
.timeline-inline-actions .quiet,.timeline-event-participant .quiet{border:1px solid var(--app-border);background:var(--app-card);color:var(--app-control-text)}
.timeline-post-dialog .timeline-event-participant{grid-template-columns:2rem minmax(0,1fr) minmax(7.5rem,10.5rem) auto;align-items:center}
.timeline-post-dialog .timeline-event-participant>label{grid-column:auto}
.timeline-event-participant>span{align-self:center;overflow-wrap:anywhere}
.timeline-smart-picker{position:relative;min-width:0;grid-column:1/-1}
.timeline-post-type-row>.timeline-smart-picker{grid-column:auto}
.timeline-smart-picker>label{display:grid;gap:.35rem}
.timeline-post-dialog .timeline-smart-picker input[role=combobox]{padding-right:2rem;background-image:linear-gradient(45deg,transparent 50%,var(--app-muted) 50%),linear-gradient(135deg,var(--app-muted) 50%,transparent 50%);background-position:calc(100% - 17px) 50%,calc(100% - 12px) 50%;background-size:5px 5px;background-repeat:no-repeat}
.timeline-smart-options{z-index:10050;max-height:15rem;overflow-y:auto;border:1px solid var(--app-border);border-radius:var(--app-radius);margin-top:.25rem;padding:.25rem;background:var(--app-card);color:var(--app-text);box-shadow:var(--app-shadow-lg)}
.timeline-smart-options>button{display:block;width:100%;min-height:40px;text-align:left;border:0;border-radius:5px;padding:.5rem .65rem;background:transparent;color:var(--app-text);font:inherit;cursor:pointer}
.timeline-smart-options>button:hover,.timeline-smart-options>button[aria-selected=true]{background:var(--app-soft);color:var(--app-accent)}
.timeline-smart-options>p{margin:.5rem;font-size:.85rem;color:var(--app-muted)}
@media(max-width:480px){.timeline-post-dialog .timeline-place-create{grid-template-columns:minmax(0,1fr)}.timeline-post-dialog .timeline-event-participant{grid-template-columns:2rem minmax(0,1fr) minmax(6rem,8rem) auto;gap:.4rem}}
/* Shared disclosure control for extra modal fields. */
.ft-modal .ft-modal-advanced-toggle { border: 0; background: transparent; text-decoration: underline; text-underline-offset: .18em; padding-inline: 0; justify-self: start; }
.ft-modal-footer .ft-modal-advanced-toggle { margin-right: auto; }
@media(max-width:600px){
  dialog.timeline-post-dialog[open],dialog.timeline-post-dialog.ft-modal-fallback-open{position:fixed;inset:auto;left:0;top:var(--ft-visual-viewport-top,0px);transform:none;width:100vw;height:var(--ft-visual-viewport-height,100dvh);max-height:var(--ft-visual-viewport-height,100dvh);margin:0;padding:max(.45rem,env(safe-area-inset-top)) max(.5rem,env(safe-area-inset-right)) max(.45rem,env(safe-area-inset-bottom)) max(.5rem,env(safe-area-inset-left));border:0;border-radius:0}
  .timeline-post-dialog .ft-modal-footer .timeline-post-dialog-status:empty{display:none}
  .timeline-post-dialog .timeline-event-participant{grid-template-columns:2.35rem minmax(0,1fr) minmax(5.3rem,8rem) 2.2rem;grid-template-rows:none;column-gap:.45rem;row-gap:0;padding:.55rem}
  .timeline-post-dialog .timeline-participant-details{display:contents}
  .timeline-post-dialog .timeline-event-participant>.timeline-event-participant-avatar{grid-column:1;grid-row:1;width:2.35rem;height:2.35rem}
  .timeline-post-dialog .timeline-event-participant .timeline-participant-name{grid-column:2;grid-row:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;line-height:1.25}
  .timeline-post-dialog .timeline-event-participant .timeline-participant-details>select{grid-column:3;grid-row:1;min-width:0;width:100%;padding-inline:.35rem}
  .timeline-post-dialog .timeline-event-participant .timeline-participant-details>.timeline-participant-remove{grid-column:4;grid-row:1;width:2.2rem;min-width:2.2rem;padding-inline:0;white-space:nowrap}
}
.relationship-history-dialog { width: min(760px, calc(100vw - 1.5rem)); }
.relationship-history-dialog .ft-modal-body { display: block; }
.relationship-history-dialog label { display: block; margin-block: .75rem; font-weight: 600; }
.relationship-history-dialog label input, .relationship-history-dialog label select, .relationship-history-dialog textarea { display: block; width: 100%; margin-top: .3rem; }
.relationship-history-dialog [hidden] { display: none !important; }
.relationship-history-list { padding-left: 1.3rem; }
.relationship-history-list > li { padding: .8rem .25rem; border-bottom: 1px solid var(--border-color, var(--app-border)); overflow-wrap: anywhere; }
.relationship-history-list p { margin: .3rem 0; }
.relationship-history-meta, .relationship-history-summary { color: var(--text-secondary, var(--app-muted)); }
.relationship-history-tools { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.relationship-history-dialog fieldset { min-width: 0; }
.relationship-history-dialog .ft-modal-footer { flex-wrap: wrap; }
/* Viewer export options move into the shared app dialog at runtime, outside
   the embedded-viewer stylesheet scope. Keep primary download actions clear. */
.ft-export-dialog--viewer .btn-action-primary {
  background: var(--app-accent) !important;
  color: var(--app-accent-text) !important;
  border: 1px solid var(--app-accent) !important;
}
.ft-export-dialog--viewer .btn-action-primary:hover,
.ft-export-dialog--viewer .btn-action-primary:focus-visible {
  background: var(--app-accent-hover) !important;
  color: var(--app-accent-text) !important;
}
/* Timeline event visibility controls */
.timeline-event-type-filters{grid-column:1/-1;display:grid;gap:.45rem;margin:0;padding:.75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-surface);color:var(--app-text)}
.timeline-event-type-options{display:flex;flex-wrap:wrap;gap:.35rem .75rem}
.timeline-event-type-options .checkbox-row{white-space:nowrap}
.ft-person-pill{display:inline-flex;align-items:center;gap:.32rem;max-width:100%;vertical-align:middle;color:var(--app-accent);font-weight:650;text-decoration:none;white-space:nowrap}
.ft-person-pill:hover,.ft-person-pill:focus-visible{text-decoration:underline}
.ft-person-pill-avatar{display:grid;place-items:center;flex:0 0 1.45rem;width:1.45rem;height:1.45rem;overflow:hidden;border-radius:50%;background:var(--app-soft);font-size:.9rem;line-height:1}
.ft-person-pill-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.timeline-event-participant-list{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .55rem}
.timeline-event-participant-pills{display:inline-flex;flex-wrap:wrap;align-items:center;gap:0;min-width:0}
.timeline-event-participant-pills>.timeline-event-participant-overflow{flex:0 0 auto}
.timeline-post-author{display:flex;justify-content:flex-end;align-items:center;max-width:100%;margin:0 2.5rem .6rem 0;text-align:right}
.timeline-photo-preview-dialog{width:min(96vw,100rem);height:min(96dvh,70rem);max-width:96vw;max-height:96dvh}
.timeline-photo-preview-dialog .ft-modal-body{display:grid;place-items:center;min-height:0;padding:.35rem;overflow:hidden}
.timeline-photo-preview-dialog .ft-modal-body img{display:block;max-width:100%;max-height:calc(96dvh - 8rem);object-fit:contain}
.timeline-photo-preview-open{margin:.45rem 0 0;padding:.4rem .65rem;border:1px solid var(--app-border);border-radius:.5rem;background:var(--app-card);color:var(--app-accent);font-weight:650}
.timeline-attachment-status{margin:.6rem 0;padding:.55rem .7rem;border-radius:.5rem;background:var(--app-soft)}
@media(max-width:600px){.timeline-post-author{max-width:100%;margin-right:2.35rem;margin-left:0}.ft-person-pill{gap:.2rem}.ft-person-pill-avatar{flex-basis:1.25rem;width:1.25rem;height:1.25rem;font-size:.78rem}}
.timeline-post-discussion,.timeline-card.timeline-post .timeline-post-discussion{margin-top:.45rem!important;padding:0!important;border:0!important}
.timeline-card:has(.timeline-post-discussion){padding-bottom:1.7rem;margin-bottom:.7rem}
.timeline-post-discussion>summary{position:absolute;left:1rem;bottom:-.8rem;z-index:2;display:inline-flex;align-items:center;min-height:1.8rem;padding:.2rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius-pill);background:var(--app-card);color:var(--app-text);list-style:none;font-size:.8rem;line-height:1.2}
.timeline-post-discussion>summary::-webkit-details-marker{display:none}
.timeline-post-author{position:absolute;right:1rem;bottom:-.8rem;z-index:2;max-width:calc(100% - 9rem);margin:0;gap:.35rem;padding:.2rem .55rem;border:1px solid var(--app-border);border-radius:var(--app-radius-pill);background:var(--app-card);font-size:.8rem}
.timeline-post-avatar{width:1.4rem;height:1.4rem;font-size:.7rem;flex:0 0 auto}
.timeline-post-byline{display:flex;gap:.25rem;align-items:center;flex-wrap:wrap;line-height:1.2}
.timeline-post-byline strong,.timeline-post-byline time{font-size:.75rem}
@media(max-width:600px){.timeline-post-author{margin:0;max-width:calc(100% - 9rem)}}
.timeline-post-dialog .ft-modal-body>.timeline-post-date-fields{grid-column:1/-1}
.timeline-source-preview.timeline-world-image{flex-direction:column;align-items:center}
.timeline-world-image>img{display:block;max-width:100%;max-height:32rem;object-fit:contain}
.timeline-world-image>figcaption{align-self:stretch;margin-top:.45rem;text-align:center;overflow-wrap:anywhere}
.timeline-tag-crop-dialog{width:min(96vw,68rem);max-width:96vw;max-height:96dvh}
.timeline-tag-crop-dialog .ft-modal-body{display:block;max-height:calc(96dvh - 10rem);overflow:auto}
.timeline-tag-crop-counter{margin:0 0 .5rem;text-align:center}
.timeline-tag-crop-slide h3{margin:.25rem 0 .65rem;overflow-wrap:anywhere}
.timeline-tag-crop-slide[hidden]{display:none}
.timeline-tag-crop-slide .media-region-host{width:100%;max-height:calc(96dvh - 15rem)}
.timeline-tag-crop-slide .media-region-image>img{max-width:100%;max-height:calc(96dvh - 18rem);object-fit:contain}
.timeline-tag-crop-dialog .ft-modal-footer{flex-wrap:wrap}
/* Person Page Styles (Unit E) */
.person-page-view { margin: 0 0 1.5rem; }
.post-page-view{max-width:1120px;margin:0 auto 2rem;padding:1.5rem 1rem}
.post-page-header{display:flex;align-items:center;justify-content:flex-end;gap:1rem;margin-bottom:.35rem}
.post-page-actions{display:flex;align-items:center;justify-content:flex-end;margin-left:auto;gap:.5rem}
.post-page-content{min-width:0}
.post-page-card{margin:0;max-width:none}
.post-page-card .timeline-post-body{max-width:78ch}
.post-page-card .timeline-post-read-more{display:none}
.post-page-actions .post-page-timeline-link{float:right}
.post-page-actions .post-page-timeline-link:hover,.post-page-actions .post-page-timeline-link:focus-visible{border-color:var(--app-accent);color:var(--app-accent);text-decoration:none}
.post-page-actions .post-page-timeline-link:focus-visible{outline:2px solid var(--app-focus);outline-offset:2px}
.button-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.timeline-markdown{max-width:78ch}
.timeline-markdown>:first-child{margin-top:0}
.timeline-markdown>:last-child{margin-bottom:0}
.timeline-markdown pre{max-width:100%;overflow:auto;padding:.75rem;border-radius:.5rem;background:var(--app-soft)}
.timeline-markdown blockquote{margin-inline:0;padding-left:1rem;border-left:3px solid var(--app-accent)}
.timeline-markdown .markdown-table-scroll{max-width:100%;overflow:auto}
.timeline-post-read-more,.timeline-post-media-more{display:inline-flex;margin-top:.35rem;font-weight:700}
@media(max-width:640px){.post-page-view{padding:1rem .5rem}.post-page-header{align-items:center;flex-direction:row}.post-page-actions{width:auto;justify-content:flex-end}}
.person-page-shell { display: grid; gap: 1rem; }
.person-page-top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.person-page-top-actions .quiet { border: 1px solid var(--app-border); color: var(--app-text); background: var(--app-card); }
.person-page-identity-card { display: flex; gap: 1.5rem; align-items: flex-start; padding: 1.5rem; background: var(--app-card); border-radius: var(--app-radius-lg); border: 1px solid var(--app-border); }
.person-page-avatar-col { flex: 0 0 120px; }
.person-page-photo-wrap { display: flex; flex-direction: column; align-items: center; }
.person-page-photo { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; border: 3px solid var(--app-accent); box-shadow: var(--app-shadow-sm); }
.person-page-photo-caption { font-size: .75rem; color: var(--app-muted); text-align: center; margin: .3rem 0 0; max-width: 120px; overflow-wrap: anywhere; }
.person-page-initials-avatar { width: 110px; height: 110px; border-radius: 50%; background: var(--app-soft); color: var(--app-accent); font-size: 2.75rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--app-border); }
.person-page-details-col { flex: 1; min-width: 0; }
.person-page-title-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .35rem; }
.person-page-name { margin: 0; font-size: 1.75rem; font-weight: 750; color: var(--app-text); }
.person-page-dates-badge { font-size: .85rem; padding: .25rem .6rem; border-radius: var(--app-radius-pill); background: var(--app-soft); color: var(--app-accent); font-weight: 650; }
.person-page-living-badge { background: color-mix(in srgb, var(--app-accent) 14%, var(--app-card)); color: var(--app-accent); }
.person-page-aliases { margin: .2rem 0 .75rem; font-size: .9rem; }
.person-page-vitals-grid { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: .6rem 0 .9rem; padding: .6rem .8rem; background: var(--app-surface); border-radius: var(--app-radius); border: 1px solid var(--app-border); }
.person-vital-item { display: flex; flex-direction: column; gap: .1rem; }
.person-vital-label { font-size: .75rem; font-weight: 700; color: var(--app-muted); text-transform: uppercase; letter-spacing: .05em; }
.person-vital-value { font-size: .95rem; font-weight: 600; color: var(--app-text); }
.person-page-relations { display: grid; gap: .4rem; margin-top: .5rem; font-size: .88rem; }
.person-relation-row { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.person-relation-label { font-weight: 650; color: var(--app-muted); min-width: 7.5rem; }
.person-relation-list { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.person-page-nav-tabs { display: flex; gap: .5rem; border-bottom: 2px solid var(--app-border); margin-top: 1.25rem; }
.person-tab-btn { padding: .75rem 1.25rem; border: 0; background: none; font: inherit; font-weight: 650; color: var(--app-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.person-tab-btn:hover { color: var(--app-accent); }
.person-tab-btn.active { color: var(--app-accent); border-bottom-color: var(--app-accent); font-weight: 750; }
.person-page-tab-content { margin-top: 1rem; }
.person-works-container, .person-research-container { display: grid; gap: 1.5rem; }
.person-works-section, .person-research-section { background: var(--app-card); padding: 1.25rem; border-radius: var(--app-radius); border: 1px solid var(--app-border); }
.person-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; border-bottom: 1px solid var(--app-border); padding-bottom: .5rem; }
.person-section-header h3 { margin: 0; font-size: 1.15rem; color: var(--app-text); }
.person-journals-list, .person-docs-list { display: grid; gap: .75rem; }
.person-journal-card, .person-doc-card { padding: .9rem 1.1rem; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.person-journal-top, .person-doc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .3rem; }
.person-journal-top h4, .person-doc-top h4 { margin: 0; font-size: 1rem; }
.person-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.person-media-card { overflow: hidden; border-radius: var(--app-radius); border: 1px solid var(--app-border); background: var(--app-surface); padding: .5rem; text-align: center; }
.person-media-thumb { width: 100%; height: 140px; object-fit: contain; border-radius: var(--app-radius-sm); background: #000; }
.person-media-thumb-placeholder { width: 100%; height: 140px; display: grid; place-items: center; font-size: 2.5rem; background: var(--app-soft); border-radius: var(--app-radius-sm); }
.person-media-info { padding: .4rem .2rem; }
.person-media-caption { display: block; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.person-facts-table-wrap { overflow-x: auto; }
.person-facts-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.person-facts-table th, .person-facts-table td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--app-border); }
.person-facts-table th { background: var(--app-surface); font-weight: 700; color: var(--app-muted); }
.person-hypotheses-list, .person-leads-list { display: grid; gap: .75rem; }
.person-hypothesis-card, .person-question-card, .person-lead-card, .person-candidate-card { padding: .85rem 1rem; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.person-hypothesis-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.person-hypothesis-stmt { margin: .25rem 0; font-size: .9rem; }
@media (max-width: 680px){
  .person-page-identity-card { flex-direction: column; align-items: center; text-align: center; }
  .person-page-title-row { justify-content: center; }
  .person-page-vitals-grid { justify-content: center; text-align: center; }
  .person-relation-row { flex-direction: column; align-items: center; gap: .2rem; }
  .person-relation-label { min-width: auto; }
  .person-page-nav-tabs { overflow-x: auto; scrollbar-width: none; }
  .person-tab-btn { padding: .65rem .9rem; white-space: nowrap; }
}
.timeline-post-panel-details.is-dragging { outline: 2px dashed var(--app-accent); outline-offset: 4px; border-radius: var(--app-radius); background: color-mix(in srgb, var(--app-accent) 6%, transparent); }
.timeline-details-drop-zone { padding: .55rem .75rem; border: 1px dashed var(--app-border); border-radius: var(--app-radius); background: var(--app-soft); color: var(--app-muted); font-size: .84rem; text-align: center; cursor: pointer; }
.timeline-details-drop-zone:hover, .timeline-details-drop-zone.is-dragging { border-color: var(--app-accent); color: var(--app-text); }
dialog.timeline-create-person-dialog[open], .timeline-create-person-dialog[open] { width: min(92vw, 30rem); z-index: 10060; }
/* Shared tabbed-modal fields and the grouped list rows used by Edit person's family and friends tabs. */
.ft-modal-tabpanel>label,.ft-modal-tabpanel>fieldset>label{display:grid;gap:.35rem;font-weight:650}
.ft-modal-field-help{margin:-.35rem 0 0;font-size:.85rem;font-weight:400;color:var(--app-muted)}
.ft-modal-tabpanel>p.relationship-edit-help{margin:0}
.ft-modal-group{margin:0 0 1.1rem}
.ft-modal-group-heading{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin:0 0 .5rem}
.ft-modal-group-heading h4{margin:0;font-size:.95rem;color:var(--app-text)}
.ft-modal-group-add{flex:0 0 auto;min-width:44px;min-height:44px;margin:0;padding:0 .6rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-card);color:var(--app-accent);font:inherit;font-size:1.25rem;font-weight:700;line-height:1;cursor:pointer}
.ft-modal-group-add:hover{background:var(--app-surface)}
.ft-modal-group-rows{display:flex;flex-direction:column;gap:.4rem}
.ft-modal-group-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.5rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius-sm);background:var(--app-card)}
.ft-modal-group-row:focus-visible{outline:2px solid var(--app-focus);outline-offset:2px}
.ft-modal-group-row>span{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.ft-modal-group-row .ft-modal-group-actions{display:flex;gap:.4rem;flex:0 0 auto}
.ft-modal-group-row .badge{display:inline-block;padding:.15rem .45rem;border-radius:4px;font-size:.75rem;background:var(--app-surface);color:var(--app-muted);margin-left:.5rem}
.ft-modal-notice{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.6rem .75rem;border:1px solid var(--app-border);border-radius:var(--app-radius);background:var(--app-surface);color:var(--app-text)}
.ft-modal-notice[hidden]{display:none}
