:root{font:16px/1.5 system-ui,sans-serif;color:#19352e;background:#f4f5ed}
*{box-sizing:border-box}
main{max-width:1000px;margin:auto;padding:24px 18px 40px}
header{display:flex;justify-content:space-between;align-items:center;padding-bottom:20px}
header b{font-size:26px;letter-spacing:-1px}header span{color:#a54e37;margin-left:4px}
small,footer{color:#52645a}footer{padding-top:20px}
.hero{display:flex;align-items:end;justify-content:space-between;gap:18px;padding:clamp(20px,5vw,48px);background:#153e34;color:white;border-radius:26px}
.hero p{margin:8px 0 0}.eyebrow{font-size:14px;letter-spacing:.12em;color:#d2e6bb}
h1,h2{font-family:Georgia,serif;font-weight:normal;margin:0}h1{font-size:clamp(32px,6vw,64px);line-height:1.05}h2{font-size:27px}
button,input,select{font:inherit}button,.upload{cursor:pointer}
button,.upload,input,select{border:1px solid #a9b9ac;border-radius:10px;padding:9px 12px;background:#fff;color:#19352e}
button[aria-pressed=true],.upload{background:#d9edb7;color:#18382e;border-color:#94ab73;font-weight:650}
.upload{position:relative;display:inline-block;white-space:nowrap}.upload input{position:absolute;inset:0;width:100%;opacity:0;cursor:pointer}.upload:focus-within{outline:2px solid #bd805b}
nav,.toolbar,.actions,.fields{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:14px 0}
.toolbar input[type=search]{min-width:190px;flex:1}.fields input,.fields select{width:100%}.fields label{flex:1;min-width:75px}.actions{justify-content:end}
article,.focus,.empty{background:#fff;border:1px solid #d9e2d7;border-radius:13px;padding:14px;margin:8px 0}
article{display:flex;align-items:center;justify-content:space-between;gap:10px}article p,.focus p{margin:4px 0;color:#52645a}
.name{border:0;padding:0;font-weight:700;text-align:left;text-decoration:underline;text-underline-offset:3px}
dialog{width:min(94vw,540px);border:0;border-radius:20px;padding:22px}dialog::backdrop{background:#102820a8}
#formError{color:#9b352b}#status{min-height:24px}
@media(max-width:600px){.hero{align-items:start;flex-direction:column}}
.diagram{border:1px solid #d9e2d7;border-radius:18px;overflow:hidden;background:#ebeee5;margin:12px 0 18px}
.diagram-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:#fff;padding:14px 16px}
.diagram-controls{display:flex;flex-wrap:wrap;gap:5px}
.tree-viewport{overflow:auto;height:min(68vh,690px);min-height:240px;overscroll-behavior:contain;container-type:inline-size;background:linear-gradient(150deg,#f2f0e8,#e3ede7)}
.tree-stage{width:max-content;padding:40vh 50cqw}
.workspace-sidebar{display:contents}
.tree-workspace{margin:0}
.tree-workspace main{max-width:none;height:100dvh;min-height:520px;padding:12px 16px;display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto auto auto minmax(300px,1fr);column-gap:14px}
.tree-workspace .workspace-heading{grid-area:1/1;padding:0;gap:12px;white-space:nowrap}
.tree-workspace .workspace-nav{grid-area:1/2;margin:0}
.tree-workspace .hero{grid-area:1/3;background:none;padding:0;border-radius:0;align-self:center}
.tree-workspace .hero>div{display:none}
.tree-workspace .workspace-search{grid-area:2/1/3/3;margin:9px 0 4px}
.tree-workspace .workspace-search input[type=search]{max-width:420px;min-width:130px}
.tree-workspace #status{grid-area:2/3;align-self:center;margin:0;font-size:13px}
.tree-workspace #options{grid-area:3/1/4/4;margin:5px 0 9px}
.tree-workspace #content{grid-area:4/1/5/4;min-width:0;position:relative}
.tree-workspace footer{display:none}
.tree-workspace .diagram{position:relative;margin:0;height:100%;min-height:300px;border-radius:17px}
.tree-workspace .tree-viewport{position:absolute;inset:0;height:auto;min-height:0;cursor:grab;scrollbar-width:none;touch-action:pan-x pan-y;background-color:#edf1e8;background-image:radial-gradient(#6b8a712b 1px,transparent 1px),linear-gradient(145deg,#f6f4ea,#e4eee6);background-size:19px 19px,100% 100%}
.tree-workspace .tree-viewport::-webkit-scrollbar{display:none}
.tree-workspace .tree-viewport.dragging{cursor:grabbing;user-select:none}
.tree-workspace .diagram-bar,.tree-workspace .diagram-controls{position:absolute;z-index:1;background:#fdfdf6f0;border:1px solid #cddacd;border-radius:13px;box-shadow:0 5px 20px #19352e14}
.tree-workspace .diagram-bar{top:12px;left:12px;max-width:calc(100% - 95px);padding:8px 12px;pointer-events:none}
.tree-workspace .diagram-bar h2{font-size:18px}
.tree-workspace .diagram-controls{right:12px;bottom:12px;display:grid;padding:5px;gap:4px}
.tree-workspace .diagram-controls button{padding:5px 8px;font-size:14px}
.people-results{position:absolute;z-index:2;left:12px;top:78px;width:min(400px,calc(100% - 95px));max-height:calc(100% - 90px);overflow:auto;background:#f6f7f1f7;border:1px solid #cddacd;border-radius:13px;padding:8px;box-shadow:0 5px 20px #19352e20}
.people-results article{padding:8px;flex-wrap:wrap}
.people-results article>button{padding:5px 8px;font-size:14px}
@media(max-width:780px){
  .tree-workspace main{padding:8px;min-height:600px;grid-template-columns:1fr auto;grid-template-rows:auto auto auto auto minmax(350px,1fr) auto;gap:5px}
  .tree-workspace .workspace-heading{grid-area:1/1}
  .tree-workspace .workspace-heading small,.tree-workspace #status:empty{display:none}
  .tree-workspace .hero{grid-area:1/2}
  .tree-workspace .workspace-nav{grid-area:2/1/3/3}
  .tree-workspace .workspace-search{grid-area:3/1/4/3;margin:0}
  .tree-workspace #status{grid-area:6/1/7/3}
  .tree-workspace #options{grid-area:4/1/5/3;margin:0}
  .tree-workspace #content{grid-area:5/1/6/3}
  .tree-workspace button,.tree-workspace select,.tree-workspace .upload{font-size:14px}
}
.tree-sheet{position:relative;margin-inline:auto}
.tree-sheet svg{position:absolute;inset:0;pointer-events:none}
.tree-sheet path{fill:none;stroke:#547969;stroke-width:1.5}
.tree-sheet .branch-1{stroke:#8b6689}
.tree-sheet .branch-2{stroke:#8b6b41}
.tree-sheet .partner-line{stroke:#8b6689;stroke-dasharray:4 4;stroke-width:2}
.tree-sheet .distant-partner{display:none}
.tree-sheet .family-branch{stroke-width:2}
.tree-sheet .selected-route{filter:drop-shadow(0 0 2px #fffdf5)}
.tree-sheet .selected-route{stroke:#a46b35;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}
.has-route .tree-sheet path:not(.selected-route){opacity:.3}
.tree-card.on-route{outline:2px solid #a46b35;outline-offset:-2px}
.connection-panel{position:absolute;z-index:2;bottom:12px;left:12px;width:min(460px,calc(100% - 96px));max-height:36%;overflow:auto;padding:10px 12px;border:1px solid #cddacd;border-radius:13px;background:#fffdf5;box-shadow:0 5px 20px #19352e24;font-size:14px}
.connection-panel[hidden]{display:none}
.connection-panel p{margin:5px 0 8px;overflow-wrap:anywhere}
.connection-panel button{margin-right:6px;padding:4px 7px}
.edit-tree-card{font-size:17px}
.tree-more{font-weight:700}
#personActionsList{display:grid;gap:7px;margin:12px 0}
#personActionsList>button{text-align:left}
#personActionsList article{flex-wrap:wrap;margin:0}
#personActions{background:#f8faf3;max-height:85dvh}
.tree-legend{display:block}
.add-relative{position:absolute;transform:translateX(-50%);z-index:1;padding:0;width:32px;height:32px;line-height:1;border-radius:50%;background:#edf4dc;font-size:21px;box-shadow:0 2px 5px #19352e24}
#relativeForm label:not([hidden]){display:grid;gap:4px;margin:8px 0}
#relativeForm select,#relativeForm input{min-width:0;width:100%}
#relativeError{color:#9b352b}
.tree-card{position:absolute;transform:translateX(-50%);width:198px;height:208px;display:grid;justify-items:center;align-content:start;gap:7px;padding:9px 10px;font-size:15px;line-height:1.15;background:#fff;text-align:center;border-radius:20px;box-shadow:0 5px 12px #19352e18}
.tree-card strong{overflow-wrap:anywhere}
.tree-card small{font-size:13px}
.tree-card .tree-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;line-height:16px;max-height:48px;width:100%}
.tree-card .tree-date{position:absolute;bottom:9px;left:10px;right:10px;white-space:nowrap}
.tree-avatar{display:grid;place-items:center;background:#e3ece7;border:1px solid #96afa2;border-radius:15px;width:66px;height:66px;font-size:24px;font-weight:700}
.tree-age{background:#edf2e9;border:1px solid #cad8c4;color:#375346;border-radius:8px;padding:2px 8px;font-size:13px}
.tree-relation{color:#526f64;font-size:12px;font-weight:700;line-height:1}
.tree-photo-frame{position:relative;display:block;width:66px;height:66px}
.tree-candle{position:absolute;bottom:-2px;right:-3px;display:grid;place-items:center;min-width:23px;height:23px;padding:1px;border:1px solid #cbb18d;border-radius:8px;background:#f8e6ca;color:#674934;font-size:15px;line-height:1}
.tree-root{background:#e0ecc9;border:2px solid #527047}
.portrait{width:44px;height:44px;object-fit:cover;border-radius:9px;flex:none}
.tree-card .portrait{width:66px;height:66px;border-radius:15px;border:2px solid #fff;box-shadow:0 2px 7px #19352e35}
#content article>div{flex:1}
#gallery article{flex-wrap:wrap}
dialog{max-height:92dvh;overflow:auto}
#editor{background:#f2f4ee;color:#19352e;width:min(calc(100% - 20px),550px)}
.person-editor{position:relative}
.person-editor h2{text-align:center;margin:10px 24px 18px}
.person-editor h3{margin:16px 0 5px}
.person-editor label{display:grid;gap:4px;margin:7px 0;min-width:0}
.person-editor [hidden]{display:none!important}
.person-editor .tree-date{white-space:normal}
.person-editor textarea{font:inherit;color:inherit;border:1px solid #a9b9ac;border-radius:10px;padding:9px 12px;resize:vertical}
.person-editor input,.person-editor textarea,.person-editor select{min-width:0;width:100%}
.person-editor details{margin:14px 0;padding:10px;border-radius:10px;background:#fff}
.person-editor summary{cursor:pointer}
.close-person{position:absolute;right:0;top:0;font-size:22px;line-height:1}
.profile-photo{display:grid;place-items:center;width:min(175px,55vw);aspect-ratio:1;margin:auto;background:#e0ebe2;border:1px dashed #8aa795;border-radius:24px;overflow:hidden}
.profile-image{width:100%;height:100%;object-fit:cover}
.profile-names{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
.profile-tabs{gap:6px}
.profile-tabs button{padding:7px 10px;font-size:14px}
.person-editor [data-profile]{padding:12px;background:#fff;border-radius:14px}
.person-editor [data-profile][hidden],#lifeEventFields[hidden]{display:none}
.life-event{flex-wrap:wrap;gap:6px}
.life-event>div{flex:1;min-width:100px;overflow-wrap:anywhere}
.life-event small{display:block;margin-top:4px}
.life-event button{font-size:14px}
#lifeEventFields:not([hidden]){margin-top:10px;padding:10px;background:#eef3eb;border-radius:10px}
.tree-note{position:absolute;bottom:27px;left:10px;right:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tree-card:has(.tree-note){gap:4px}
@media(max-width:480px){.profile-names{grid-template-columns:1fr}}
.print-output{display:none}
.calendar-page{--season:#dfeade;color:#312f38;background:#fcfaf6;margin:16px 0 24px;overflow:hidden;border-radius:14px}
.calendar-page.winter{--season:#dce8f5}
.calendar-page.summer{--season:#f4e6d6}
.calendar-page.autumn{--season:#eee1ea}
.month-heading{display:grid;grid-template-columns:1fr auto;align-items:end;gap:6px;background:var(--season);padding:clamp(16px,5vw,35px)}
.month-heading small{grid-column:1/-1;color:inherit;letter-spacing:.04em}
.month-heading h2{font-size:clamp(40px,8vw,75px);line-height:1}
.month-heading>span{font-size:clamp(23px,4vw,36px)}
.month-content{padding:clamp(12px,4vw,32px)}
.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:#dcd9d0;border:1px solid #dcd9d0}
.month-grid .weekday{background:#fcfaf6;padding:5px 2px;text-align:center;font-size:14px}
.day-cell{background:#fcfaf6;min-height:clamp(52px,8vw,84px);padding:3px 5px}
.tone-birthday{--event-fill:#e1f3e6;--event-ink:#23583a}
.tone-remembered{--event-fill:#ece7f5;--event-ink:#5e467d}
.tone-memorial{--event-fill:#f8ead2;--event-ink:#82511a}
.tone-other{--event-fill:#e5edf5;--event-ink:#365771}
.calendar-day-bands>span,.calendar-date[class*="tone-"]{background:var(--event-fill)}
.day-cell{position:relative;isolation:isolate}
.calendar-day-bands{position:absolute;inset:0;z-index:-1;display:flex}
.calendar-day-bands>span{flex:1}
.calendar-event-symbol{color:var(--event-ink);flex:none;font-size:14px;line-height:1}
.calendar-day-symbols,.calendar-legend,.calendar-legend li{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.calendar-day-symbols{margin-bottom:3px}
.calendar-legend{margin:0 0 8px;padding:0;gap:4px 12px;font-size:12px}
.calendar-legend li{break-inside:avoid}
.day-portraits .memorial-marker{filter:grayscale(1)}
.day-number{display:block;text-align:right;font:italic clamp(16px,3vw,24px) Georgia,serif}
.jubilee-day .day-number,.jubilee-date,.jubilee-date .name,.jubilee-date small{font-weight:800}
.day-cell:nth-child(7n),.day-cell:nth-child(7n - 1){color:#9a4c49}
.day-portraits{display:flex;align-items:center;gap:3px;min-width:0}
.day-portraits .portrait{width:min(44%,36px);height:auto;aspect-ratio:1;border-radius:5px}
.day-portraits small{color:inherit;font-size:10px}
.month-content h3{font:normal 30px Georgia,serif;margin:18px 0 8px}
.calendar-date{justify-content:start;min-height:49px;margin:0;background:transparent;border:0;border-bottom:1px solid #e0ddd6;border-radius:0;padding:7px 0}
.calendar-date time{min-width:46px;font-variant-numeric:tabular-nums}
.calendar-date small{display:block}
.calendar-date .portrait{border-radius:12px;width:56px;height:56px}
.calendar-date .name{background:transparent;text-decoration:none}
#options input[type=number]{width:92px}
.tree-workspace{background:#f8fbf9;color:#17342a}
.tree-workspace .workspace-heading{color:#fff;background:#14372a;justify-content:flex-start}
.tree-workspace .workspace-heading b{letter-spacing:-.035em}
.tree-workspace .workspace-heading span{color:#a8d2ad}
.tree-workspace .workspace-heading small{color:#c4ddcd}
.tree-workspace .workspace-nav button[aria-pressed=true]{background:#c9e3ce;border-color:#c9e3ce}
.tree-workspace .tree-viewport{background:#e4f0e9;background-image:radial-gradient(ellipse at 55% 38%,#f2f8f5 0%,#e5f1e9 55%,#d9eae1 100%);background-size:auto}
.tree-workspace .diagram{border-color:#d2e5d9;border-radius:19px}
.tree-workspace .diagram-bar,.tree-workspace .diagram-controls{background:#fbfefbf5;border-color:#d6e6db;box-shadow:0 5px 18px #19352e13}
.tree-workspace .diagram-bar{padding:10px 12px;max-width:min(245px,calc(100% - 95px))}
.tree-context>small{display:block;font-size:12px;color:#48665a}
.tree-context .tree-legend{margin-top:5px;line-height:1.25}
.context-person{display:flex;gap:8px;align-items:center;margin:6px 0}
.tree-workspace .context-person h2{font:700 15px/1.25 system-ui,sans-serif;overflow-wrap:anywhere}
.context-initials{display:grid;place-items:center;width:36px;height:36px;border-radius:8px;background:#dceee0;font-weight:700;flex:none}
.tree-card,.tree-card:has(.tree-note){display:grid;grid-template-columns:60px minmax(0,1fr);justify-items:stretch;align-content:start;align-items:start;gap:9px;padding:49px 10px 31px;background:#fdfefd;border:1px solid #cdded2;border-radius:17px;text-align:left;box-shadow:0 6px 15px #203f3217}
.tree-card.tree-root{background:#f0faf2;border:2px solid #6fa37c}
.tree-card .tree-photo-frame,.tree-card .portrait,.tree-card .tree-avatar{width:60px;height:78px;border-radius:10px}
.tree-card .portrait{border:0;box-shadow:none}
.tree-card .tree-avatar{background:#e4eee7;border-color:#d6e6db;font-size:21px}
.tree-identity{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0}
.tree-card .tree-name{-webkit-line-clamp:4;max-height:64px;line-height:16px;font-size:14px}
.tree-card .tree-relation,.tree-card .tree-age{background:#dceee0;border:0;border-radius:6px;color:#274d38;padding:3px 5px;font-size:11px;line-height:1.15;overflow-wrap:anywhere}
.tree-card .tree-date{text-align:center;color:#3d5e50}
.tree-card .tree-note{text-align:center}
.tree-workspace .add-relative{background:#eef6ef;border-color:#cbded0;color:#315640}
@media(min-width:781px){
  .tree-workspace main{grid-template-columns:184px minmax(0,1fr) auto;grid-template-rows:72px auto auto minmax(300px,1fr);padding:0 14px 14px 0;gap:0 14px;position:relative}
  .tree-workspace .workspace-sidebar{display:block;grid-area:1/1/5/2;align-self:start;position:sticky;top:0;z-index:3;height:calc(100dvh - 14px);overflow:auto;border-radius:0 0 16px 0}
  .tree-workspace .workspace-sidebar .workspace-heading{height:72px;align-content:flex-start}
  .tree-workspace .workspace-heading{grid-area:1/1;align-self:start;z-index:1;padding:18px 14px 10px;flex-wrap:wrap;gap:2px 10px}
  .tree-workspace .workspace-heading small{font-size:12px}
  .tree-workspace .workspace-nav{grid-area:2/1/5/2;align-self:start;display:grid;z-index:1;margin:8px 12px;gap:6px}
  .tree-workspace .workspace-nav button{background:transparent;color:#eaf5ec;border-color:transparent;text-align:left}
  .tree-workspace .workspace-nav button[aria-pressed=true]{background:#28543b;color:white;border-color:#376547}
  .tree-workspace .workspace-search{grid-area:1/2;margin:10px 0;align-self:center}
  .tree-workspace .hero{grid-area:1/3}
  .tree-workspace #status{grid-area:2/2/3/4;margin:0}
  .tree-workspace #options{grid-area:3/2/4/4}
  .tree-workspace #content{grid-area:4/2/5/4}
  .tree-workspace .diagram-controls{bottom:auto;top:12px}
}
@media(max-width:780px){
  .tree-workspace .workspace-heading{padding:4px 9px;border-radius:10px}
}
.tree-workspace .tree-viewport{background:radial-gradient(ellipse at 52% 37%,#faf9f3 0%,#f1f1e8 66%,#e5ebe1 100%)}
.tree-workspace .workspace-heading,.tree-workspace .workspace-sidebar{background:#263d33}
.tree-workspace .workspace-sidebar{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 220'%3E%3Cg fill='%23c1cfad' opacity='.24'%3E%3Cpath d='M12 218Q62 121 97 26' fill='none' stroke='%23c1cfad' stroke-width='2'/%3E%3Cpath d='M50 156Q11 149 9 109Q41 116 50 156M56 145Q91 107 129 124Q105 151 56 145M70 113Q35 105 37 73Q63 82 70 113M79 90Q100 55 130 62Q112 92 79 90M92 56Q74 35 93 9Q108 30 92 56'/%3E%3C/g%3E%3C/svg%3E");background-position:left bottom;background-repeat:no-repeat;background-size:145px auto}
.tree-card,.tree-card:has(.tree-note){grid-template-columns:minmax(0,1fr);justify-items:center;gap:5px;padding:10px 10px 32px;text-align:center;background:#fffefa;border-color:#d8ded2}
.tree-card .tree-photo-frame,.tree-card .portrait,.tree-card .tree-avatar{width:68px;height:68px}
.tree-identity{width:100%;align-items:center;gap:3px}
.tree-card .tree-name{-webkit-line-clamp:3;max-height:45px;line-height:15px;font-size:14px}
.tree-card .tree-date{overflow:hidden;text-overflow:ellipsis}
.tree-card .tree-age,.tree-card .tree-relation{padding:2px 5px}
.tree-card.tree-root{background:#f2f7eb;border-color:#77937c}
.export-options{display:grid;gap:7px;margin:12px 0}
.export-options button{text-align:left;display:grid;gap:3px}
.export-options small{font-size:13px}
#directoryItems{margin:12px 0}
.directory-row{align-items:flex-start}
.directory-row>div{min-width:0;overflow-wrap:anywhere}
.directory-row>button{flex:none}
.directory-photos{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
@media screen{
  .calendar-workspace{margin:0}
  .calendar-workspace main{height:auto;min-height:100dvh;grid-template-columns:minmax(0,1fr);grid-template-rows:none;padding:18px clamp(12px,2.6vw,48px) 36px}
  .calendar-workspace main>*{min-width:0}
  .calendar-workspace :is(.workspace-heading,.workspace-nav,.hero,.workspace-search),.calendar-workspace :is(#status,#options,#content){grid-area:auto}
  .calendar-workspace .hero{display:none}
  .calendar-workspace .workspace-heading{padding-bottom:12px}
  .calendar-workspace #status{margin:0}
  .calendar-workspace #status:empty{display:none}
  .calendar-workspace .workspace-nav,.calendar-workspace .workspace-search,.calendar-workspace #options{margin:10px 0}
  .calendar-workspace #options{gap:8px 14px}
  .calendar-period,.calendar-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
  .calendar-period button{font-size:20px;line-height:1;padding:8px 12px}
  .calendar-period button:disabled{opacity:.42;cursor:default}
  .calendar-workspace .calendar-page{margin:16px 0 0;border:1px solid #dce5da;background:#fffefa;border-radius:14px;box-shadow:0 5px 16px #263d330b}
  .calendar-workspace .month-heading{padding:clamp(12px,1.6vw,24px) clamp(14px,2vw,32px);border-bottom:1px solid #dce5da}
  .calendar-workspace .month-heading h2{font-size:clamp(34px,4.2vw,62px)}
  .calendar-workspace .month-heading>span{font-size:clamp(20px,2vw,30px)}
  .calendar-workspace .month-content{padding:clamp(10px,1.6vw,26px)}
  .calendar-workspace .day-cell{min-height:clamp(44px,5vw,76px)}
  .calendar-workspace .day-cell.blank-day{background:#f8f7f1}
  .calendar-workspace .day-number{font-size:clamp(15px,1.6vw,23px)}
  .calendar-workspace .month-dates{margin-top:14px}
  .calendar-workspace .calendar-date{gap:8px}
  .calendar-workspace .calendar-date .portrait{width:38px;height:38px;border-radius:8px}
  .calendar-workspace .calendar-date .name{overflow-wrap:anywhere}
}
@media screen and (min-width:781px){
  .calendar-workspace main{grid-template-columns:184px minmax(0,1fr);grid-template-rows:72px auto auto 1fr;padding:0 14px 14px 0}
  .calendar-workspace main::before{grid-area:1/1/5/2}
  .calendar-workspace .workspace-heading{grid-area:1/1;padding-bottom:10px}
  .calendar-workspace .workspace-nav{grid-area:2/1/5/2;margin:8px 12px}
  .calendar-workspace #status{grid-area:2/2}
  .calendar-workspace .workspace-search{grid-area:1/2;align-self:center}
  .calendar-workspace #options{grid-area:3/2;margin:5px 0 9px}
  .calendar-workspace #content{grid-area:4/2}
  .calendar-workspace .month-content{display:grid;grid-template-columns:minmax(0,2fr) minmax(220px,1fr);gap:clamp(14px,2vw,30px);align-items:start}
  .calendar-workspace #content{display:flex;flex-direction:column}
  .calendar-workspace .calendar-page:only-child{display:flex;flex-direction:column;flex:1}
  .calendar-workspace .calendar-page:only-child .month-content{flex:1}
  .calendar-workspace .month-grid{align-self:stretch;grid-auto-rows:1fr;grid-template-rows:auto}
  .calendar-workspace .month-dates{min-width:0;margin-top:0}
  .calendar-workspace .month-dates h3{margin-top:0}
}
@media screen and (max-width:780px){
  .tree-workspace main{grid-template-rows:48px auto auto auto auto minmax(350px,1fr)}
  .tree-workspace #status{grid-area:4/1/5/3}
  .tree-workspace #options{grid-area:5/1/6/3}
  .tree-workspace #content{grid-area:6/1/7/3}
  .calendar-workspace main{padding:8px;grid-template-rows:48px}
  .calendar-workspace .workspace-heading{padding-bottom:4px}
  .calendar-workspace .workspace-nav{grid-area:2/1;margin:0}
  .calendar-workspace .workspace-search{grid-area:3/1;margin:0}
  .calendar-workspace #status{grid-area:4/1}
  .calendar-workspace #options{grid-area:5/1;margin:0}
  .calendar-workspace #content{grid-area:6/1}
}
@media print{
  .add-relative{display:none!important}
  body>main,body>dialog{display:none!important}
  :root{background:white}
  .print-output{display:block}
  .print-output h1{font-size:28px;margin:0 0 10px}
  .print-output h2{break-after:avoid}
  .print-output article{break-inside:avoid;padding:6px 10px}
  .print-output .tree-card{print-color-adjust:exact}
  .calendar-page,.calendar-cover{print-color-adjust:exact;color:#312f38}
  .calendar-page{break-before:page;margin:0;border-radius:0;min-height:208mm}
  .calendar-page .month-heading{padding:10mm 12mm}
  .calendar-page .month-heading h2{font-size:52px}
  .calendar-page .month-content{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:7mm;align-items:start;padding:7mm 12mm}
  .calendar-page .month-dates h3{margin-top:0}
  .calendar-page .month-grid{min-height:145mm;grid-auto-rows:1fr;grid-template-rows:auto;break-inside:avoid;gap:0;border:0;border-top:.25mm solid #a8a39a;border-left:.25mm solid #a8a39a}
  .calendar-page .month-grid>span,.calendar-page .month-grid>.day-cell{border-right:.25mm solid #a8a39a;border-bottom:.25mm solid #a8a39a}
  .calendar-page .day-cell{min-height:12mm}
  .calendar-page .day-portraits .portrait{width:24px;height:24px}
  .print-output .calendar-date{padding:3px 0;min-height:31px}
  .calendar-date .portrait{width:28px;height:28px}
  .calendar-cover{height:208mm;background:#faf6ec;padding:10mm;position:relative;display:grid;place-items:center;text-align:center;font-family:Georgia,serif}
  .calendar-cover::before{content:'';position:absolute;inset:10mm;border:1px solid #d6ccc0}
  .cover-title{position:relative;margin-top:-13mm}
  .cover-title svg{width:40mm;height:46mm;margin-bottom:15mm}
  .print-output .cover-title h1{font:normal 13mm Georgia,serif}
  .cover-title b{font:normal 30mm Georgia,serif;color:#62536b}
  .cover-title p{font-size:8mm;margin:3mm 0}
  .cover-credit{position:absolute;bottom:22mm;font-size:5.6mm;margin:0}
  .cover-credit::before{content:'';display:block;width:30mm;border-top:1px solid #bca9ae;margin:0 auto 7mm}
}

#calendarPrint #printGroup select{width:100%}
#calendarPrint #printPhoto{align-self:end}

.holiday-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}
.holiday-fields label{display:grid;gap:4px;min-width:0}
.holiday-fields input,.holiday-fields select,.holiday-fields textarea{width:100%;min-width:0}
.holiday-fields .holiday-note{grid-column:1/-1}
.holiday-fields textarea{font:inherit;color:inherit;border:1px solid #a9b9ac;border-radius:10px;padding:9px 12px;resize:vertical}
.calendar-date .calendar-event-note{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:450px){.holiday-fields{grid-template-columns:minmax(0,1fr)}}

@media screen{
  .people-workspace :is(#status,#options,.workspace-search){display:none}
  .people-workspace #content{grid-area:3/1;display:block}
  .people-page{padding:clamp(12px,2vw,28px)}
  .people-page-heading,.people-page-tools,.people-identity,.people-row-actions,.people-completion{display:flex;align-items:center;gap:10px}
  .people-page-heading,.people-page-tools{flex-wrap:wrap}
  .people-page-heading h1{font-size:clamp(30px,4vw,48px)}
  .people-page-heading .upload{margin-left:auto}
  .people-count{background:#e3ede3;border-radius:20px;padding:2px 10px}
  .people-page-tools{margin:18px 0 14px}
  .people-page-tools input{flex:1 1 220px;min-width:0}
  .people-page-tools select{max-width:100%}
  .people-table-panel{overflow:auto;border:1px solid #d9e2d7;border-radius:14px;background:#fff}
  .people-table{width:100%;min-width:730px;border-collapse:collapse;text-align:left}
  .people-table th,.people-table td{padding:12px;border-bottom:1px solid #e7ede6}
  .people-table th{background:#eef3eb;font-weight:650}
  .people-table tbody tr:last-child td{border-bottom:0}
  .people-identity .portrait{width:38px;height:38px;border-radius:8px;flex:none}
  .people-completion progress{width:60px;accent-color:#487553}
  .people-row-actions{white-space:nowrap}
}
@media screen and (min-width:781px){
  .people-workspace #content{grid-area:1/2/5/3}
}
@media screen{
  .people-age{font-size:13px;color:#52645a}
}

@media screen{
  .timeline-page{padding:clamp(12px,2vw,28px)}
  .timeline-page h1{font-size:clamp(32px,4vw,52px);margin-bottom:18px}
  .timeline-row{display:grid;grid-template-columns:80px repeat(3,minmax(0,1fr));border-top:1px solid #dce5db}
  .timeline-head{background:#e7eee4;border-radius:12px 12px 0 0;font-weight:700}
  .timeline-head>span,.timeline-year{padding:10px 12px}
  .timeline-year{font-size:23px}
  .timeline-track{padding:9px 12px 13px;border-left:2px solid #dbe6d9;min-width:0}
  .timeline-mobile-label{display:none}
  .timeline-card{display:grid;justify-content:stretch;gap:4px;margin:0 0 7px;padding:9px 12px;border-left:4px solid #668d70}
  .timeline-card:last-child{margin-bottom:0}
  .timeline-lane-1{border-left-color:#b4865f}
  .timeline-lane-2{border-left-color:#7493ae}
  .timeline-card-heading{display:flex;align-items:center;gap:8px}
  .timeline-card .portrait{width:32px;height:32px;border-radius:7px;flex:none}
  .timeline-card a{color:#3c6654;font-size:13px;justify-self:start}
  .timeline-card :is(button,small,p){overflow-wrap:anywhere}
  .timeline-card button{justify-self:start}
}
@media screen and (max-width:900px){
  .timeline-row{grid-template-columns:minmax(0,1fr)}
  .timeline-head,.timeline-track:empty{display:none}
  .timeline-mobile-label{display:block;font-size:14px;margin:0 0 8px}
}

.gallery-page{padding:clamp(12px,2vw,28px)}
.gallery-page h2{margin:14px 0}
.gallery-tabs{display:flex;gap:8px;padding:5px;background:#e8efe4;border-radius:14px}
.gallery-tabs button{flex:1 1 120px}
.gallery-tabs button[aria-pressed=true]{color:white;background:#315b43;border-color:#315b43}
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,190px),1fr));gap:14px;margin-top:14px}
.gallery-photo-tile,.gallery-album-tile{display:grid;align-content:start;justify-content:stretch;gap:8px;margin:0;text-align:left}
.gallery-image{width:100%;aspect-ratio:4/3;object-fit:contain;border-radius:8px;background:#edf1e8}
.gallery-people article{justify-content:start;flex-wrap:wrap}
.gallery-people article>strong{flex:1 1 145px}
.gallery-people .portrait{width:40px;height:40px;border-radius:8px}
.gallery-form{display:grid;gap:10px}
.gallery-form label:not([hidden]){display:grid;gap:4px}
.gallery-form textarea{font:inherit;border:1px solid #a9b9ac;border-radius:10px;padding:9px 12px;resize:vertical}
.gallery-form p:empty{display:none}

.gallery-preview{display:block;padding:0;border:0;background:none;cursor:zoom-in}
.gallery-preview img{display:block}
#galleryViewer{width:min(94vw,1040px);max-height:94dvh;background:#152b23;color:#fff;padding:12px}
#galleryViewer::backdrop{background:#091a15dd}
#closeGalleryViewer{display:block;margin-left:auto}
.gallery-viewer-stage{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px}
#galleryViewerImage{grid-column:2;width:100%;height:min(72dvh,680px);object-fit:contain;touch-action:pan-y pinch-zoom}
#galleryPrevious{grid-column:1;grid-row:1}
#galleryNext{grid-column:3;grid-row:1}
#galleryViewerStatus{text-align:center;margin:8px 0 2px;overflow-wrap:anywhere}
.gallery-photo-actions{display:flex;gap:6px;flex-wrap:wrap}
.gallery-photo-actions button{padding:5px 8px}
.records-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr))}
.record-card :is(strong,p){overflow-wrap:anywhere}
.record-card p{white-space:pre-wrap}
.record-card .name{justify-self:start}
