:root{
  color-scheme:light;
  --chrome:#fcfcf8;--soft:#f0f3e9;--hero:#ebefdf;
  --button-bg:#244a3d;--button-hover:#35604e;--button-ink:#fff;
  --warning-bg:#faf2e6;--warning-ink:#846831;
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#12191d;--paper:#1c262c;--ink:#e5ece8;--muted:#adb8b6;
  --green:#acd5b9;--light:#293c36;--line:#36444a;--accent:#dfb17b;--red:#ffb3a7;
  --chrome:#172126;--soft:#243138;--hero:#21372e;
  --button-bg:#426d56;--button-hover:#507f65;--button-ink:#fff;
  --warning-bg:#3c3324;--warning-ink:#ebca91;
}
:root[data-theme="grey"]{
  color-scheme:light;
  --bg:#e9ebed;--paper:#f7f8f9;--ink:#303840;--muted:#626d76;
  --green:#3f5963;--light:#dce3e6;--line:#cbd2d8;--accent:#99774c;--red:#9a413a;
  --chrome:#dce1e5;--soft:#e5e9ed;--hero:#d7e0e2;
  --button-bg:#405b65;--button-hover:#334b54;--button-ink:#fff;
  --warning-bg:#eee6d9;--warning-ink:#79603b;
}
:root[data-theme="light-blue"]{
  color-scheme:light;
  --bg:#edf5fc;--paper:#fff;--ink:#243b53;--muted:#60768c;
  --green:#245e8c;--light:#e0edf9;--line:#cbddec;--accent:#a47e4d;--red:#9e4641;
  --chrome:#f6faff;--soft:#e9f2fb;--hero:#deedf9;
  --button-bg:#245e8c;--button-hover:#1b4c74;--button-ink:#fff;
  --warning-bg:#fbf1df;--warning-ink:#80643b;
}
/* Light keeps the original product colours. Other palettes use these shared surfaces. */
:root[data-theme]:not([data-theme="light"]) body{background:var(--bg);color:var(--ink)}
:root[data-theme]:not([data-theme="light"]) :is(.sidebar,.topbar){background:var(--chrome)}
:root[data-theme]:not([data-theme="light"]) :is(.nav-button,.server-state,.crumb span,label,.plan-promises span){color:var(--muted)}
:root[data-theme]:not([data-theme="light"]) .nav-button:hover{background:var(--soft)}
:root[data-theme]:not([data-theme="light"]) .nav-button.active{background:var(--light);color:var(--green)}
:root[data-theme]:not([data-theme="light"]) :is(.panel,.photo-card,.album-card,.tree-board,dialog,.icon-button,.button.secondary){background:var(--paper);border-color:var(--line);color:var(--ink)}
:root[data-theme]:not([data-theme="light"]) :is(input,select){background:var(--paper);border-color:var(--line);color:var(--ink)}
:root[data-theme]:not([data-theme="light"]) input::placeholder{color:var(--muted);opacity:.85}
:root[data-theme]:not([data-theme="light"]) :is(.search,input[readonly],.photo-preview,.photo-cover,.album-picks label){background:var(--soft)}
:root[data-theme]:not([data-theme="light"]) .search input{background:transparent}
:root[data-theme]:not([data-theme="light"]) .button:not(.secondary):not(.ghost):not(.danger){background:var(--button-bg);color:var(--button-ink)}
:root[data-theme]:not([data-theme="light"]) .button:not(.secondary):not(.ghost):not(.danger):hover{background:var(--button-hover)}
:root[data-theme]:not([data-theme="light"]) .button.secondary:hover{background:var(--light)}
:root[data-theme]:not([data-theme="light"]) .button.ghost{background:transparent;color:var(--muted)}
:root[data-theme]:not([data-theme="light"]) .button.danger{background:var(--warning-bg);color:var(--red)}
:root[data-theme]:not([data-theme="light"]) :is(.hero,.auth-story,.plan-intro,.pro-card){background:var(--hero);border-color:var(--line)}
:root[data-theme]:not([data-theme="light"]) :is(.hero p,.auth-story>div>p,.plan-intro p,.pro-card p,.plan-emblem){color:var(--muted)}
:root[data-theme]:not([data-theme="light"]) .plan-emblem span{background:var(--hero);color:var(--accent)}
:root[data-theme]:not([data-theme="light"]) :is(.empty,.file-input){background:var(--paper);border-color:var(--line)}
:root[data-theme]:not([data-theme="light"]) :is(.empty-mark,.avatar,.badge,.tag){background:var(--light);color:var(--green)}
:root[data-theme]:not([data-theme="light"]) .badge.neutral{background:var(--soft);color:var(--muted)}
:root[data-theme]:not([data-theme="light"]) :is(.badge.pro,.preview-pill,.note.warn){background:var(--warning-bg);color:var(--warning-ink);border-color:var(--line)}
:root[data-theme]:not([data-theme="light"]) .note{background:var(--soft);color:var(--muted);border-color:var(--line)}
:root[data-theme]:not([data-theme="light"]) :is(.photo-meta,.footer-note,.hero-mark,.upload-progress,.feature-list .icon){color:var(--muted)}
:root[data-theme]:not([data-theme="light"]) .photo-cover .file-art{background:var(--soft);color:var(--green)}
:root[data-theme]:not([data-theme="light"]) .photo-cover .badge{background:var(--paper);color:var(--ink)}
:root[data-theme]:not([data-theme="light"]) .tree-board svg rect{fill:var(--soft);stroke:var(--line)}
:root[data-theme]:not([data-theme="light"]) .tree-board svg text{fill:var(--ink)}
:root[data-theme]:not([data-theme="light"]) .tree-board svg .year{fill:var(--muted)}
:root[data-theme]:not([data-theme="light"]) .tree-board svg path{stroke:var(--green)}
:root[data-theme]:not([data-theme="light"]) .tree-board svg path.partner{stroke:var(--accent)}
:root[data-theme]:not([data-theme="light"]) .plan-table thead th{background:var(--soft);color:var(--muted)}
:root[data-theme]:not([data-theme="light"]) :is(.plan-table td:last-child,.plan-table thead th:last-child){background:var(--light);color:var(--green)}
:root[data-theme]:not([data-theme="light"]) #toast{background:var(--button-bg);color:var(--button-ink)}

.appearance-panel{margin-bottom:23px}
.theme-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:24px}
.theme-option{padding:10px;border:2px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);text-align:left;min-width:0}
.theme-option:hover{border-color:var(--muted)}
.theme-option[aria-pressed="true"]{border-color:var(--green);box-shadow:0 0 0 2px var(--light)}
.theme-option-label{display:flex;align-items:center;justify-content:space-between;gap:7px;font-size:12px;font-weight:600;margin:13px 3px 4px}
.theme-option-label .icon{width:16px;height:16px;color:var(--green)}
.theme-preview{display:grid;grid-template-columns:25% 1fr;height:92px;border:1px solid #233a321a;border-radius:7px;overflow:hidden;background:var(--preview-bg)}
.theme-preview-nav{background:var(--preview-chrome);padding:13px 5px;display:grid;align-content:start;gap:6px}
.theme-preview-nav i{height:4px;background:var(--preview-line);border-radius:2px}
.theme-preview-nav i:first-child{background:var(--preview-accent);margin-bottom:7px;width:70%}
.theme-preview-main{padding:13px 10px}
.theme-preview-title{height:5px;background:var(--preview-accent);width:58%;border-radius:3px;margin-bottom:10px}
.theme-preview-banner{height:17px;background:var(--preview-line);border-radius:3px;margin-bottom:8px}
.theme-preview-cards{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px}
.theme-preview-cards i{height:22px;background:var(--preview-paper);border:1px solid var(--preview-line);border-radius:3px}
[data-theme-choice="light"]{--preview-bg:#f7f8f4;--preview-chrome:#fcfcf8;--preview-paper:#fff;--preview-line:#e3e8df;--preview-accent:#244a3d}
[data-theme-choice="dark"]{--preview-bg:#12191d;--preview-chrome:#172126;--preview-paper:#1c262c;--preview-line:#36444a;--preview-accent:#acd5b9}
[data-theme-choice="grey"]{--preview-bg:#e9ebed;--preview-chrome:#dce1e5;--preview-paper:#f7f8f9;--preview-line:#cbd2d8;--preview-accent:#3f5963}
[data-theme-choice="light-blue"]{--preview-bg:#edf5fc;--preview-chrome:#f6faff;--preview-paper:#fff;--preview-line:#cbddec;--preview-accent:#245e8c}
.theme-options[aria-busy="true"]{pointer-events:none;opacity:.7}
.testing-panel{margin-top:23px}
.testing-panel h3{margin-top:14px}
.testing-toggle{display:flex;align-items:center;gap:12px;cursor:pointer;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--soft);color:var(--ink);font-size:13px}
.testing-toggle input{appearance:none;width:43px;height:25px;padding:0;border:0;border-radius:20px;background:#839087;position:relative;flex-shrink:0;cursor:pointer;transition:background .15s}
.testing-toggle input:before{content:'';position:absolute;width:19px;height:19px;left:3px;top:3px;background:white;border-radius:50%;transition:transform .15s}
.testing-toggle input:checked{background:var(--button-bg)}
.testing-toggle input:checked:before{transform:translateX(18px)}
.testing-toggle input:disabled{cursor:wait;opacity:.5}
:root[data-theme]:not([data-theme="light"]) .testing-toggle input{background:#839087}
:root[data-theme]:not([data-theme="light"]) .testing-toggle input:checked{background:var(--button-bg)}
.testing-panel .help{margin-top:14px}
@media(max-width:1000px){.theme-options{gap:10px}.theme-preview{height:78px}.theme-preview-main{padding:11px 7px}}
@media(max-width:650px){.theme-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.theme-preview{height:92px}}
fieldset{border:1px solid var(--line);border-radius:10px;padding:15px;min-width:0;margin:0}
legend{font-size:12px;font-weight:600;color:var(--ink);padding:0 5px}
.people-checkboxes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:190px;overflow:auto;margin-bottom:14px}
.people-checkboxes label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:400;color:var(--ink)}
.people-checkboxes input{width:auto;flex-shrink:0}
@media(max-width:500px){.people-checkboxes{grid-template-columns:1fr}}
[hidden]{display:none!important}
:root{--person-male-bg:#e3effa;--person-male-border:#b4cfe6;--person-female-bg:#fae7ef;--person-female-border:#e6bfd0}
:root[data-theme="dark"]{--person-male-bg:#273d50;--person-male-border:#507da2;--person-female-bg:#44303b;--person-female-border:#966579}
:root[data-theme] .tree-board svg g.sex-male rect{fill:var(--person-male-bg);stroke:var(--person-male-border)}
:root[data-theme] .tree-board svg g.sex-female rect{fill:var(--person-female-bg);stroke:var(--person-female-border)}
.tree-legend{flex-wrap:wrap}
.tree-legend i.sex-key-male,.tree-legend i.sex-key-female{width:12px;height:12px;border:1px solid var(--person-male-border);background:var(--person-male-bg);border-radius:3px}
.tree-legend i.sex-key-female{background:var(--person-female-bg);border-color:var(--person-female-border)}
.check-label{display:flex;align-items:center;gap:9px;color:var(--ink);font-weight:400;line-height:1.5}
.check-label input{width:auto;flex-shrink:0}
.photo-import-details{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:22px 0}
.photo-import-details div{min-width:0}
.photo-import-details dt{font-size:10px;text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin-bottom:7px}
.photo-import-details dd{margin:0;font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.photo-import-details .badge{margin-left:5px}
.import-tags{margin:14px 0 22px}
.face-scan-panel{padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--soft);margin:22px 0}
.face-scan-panel h3{font-size:14px;margin-bottom:10px}
.face-suggestion{margin-top:15px;padding-top:15px;border-top:1px solid var(--line)}
.face-suggestion img{width:64px;height:64px;object-fit:cover;border-radius:10px;background:var(--paper)}
.face-suggestion strong{font-size:13px}
.face-scan-panel[aria-busy="true"]{opacity:.75}
.member-profile-panel{max-width:850px}
.member-profile-panel>.profile-form{display:grid;gap:23px}
.member-profile-modal{width:min(760px,calc(100vw - 32px))}
.profile-fields{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.profile-form fieldset>.muted{font-size:12px;margin-bottom:18px}
.profile-form fieldset>.help{line-height:1.8}
.reference-preview-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin:14px 0}
.reference-preview-grid:empty{display:none}
.reference-preview-grid img{width:100%;aspect-ratio:1;object-fit:cover;border:1px solid var(--line);border-radius:10px;background:var(--soft)}
.reference-preview-grid .placeholder{aspect-ratio:1;border:1px dashed var(--line);border-radius:10px;background:var(--soft)}
.relationship-row{display:grid;grid-template-columns:155px minmax(0,1fr) 38px;gap:10px;align-items:center;margin:14px 0}
.profile-form .file-input{margin-top:15px}
@media(max-width:600px){.relationship-row{grid-template-columns:110px minmax(0,1fr) 32px;gap:7px}.relationship-row select{padding:10px 7px;font-size:12px}.relationship-row .icon-button{width:32px;height:32px}.reference-preview-grid{gap:8px}.photo-import-details{grid-template-columns:1fr}.profile-fields{gap:12px}.face-suggestion .spacer{display:none}}

.profile-progress:not([hidden]){padding:16px;border:1px solid var(--line,#dce3d8);border-radius:12px;background:var(--soft,#f0f3e9);color:var(--ink,#23483b);font-weight:600;margin-bottom:18px;display:flex;align-items:center;gap:12px}
.profile-progress.processing:before{content:"";width:18px;height:18px;flex-shrink:0;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:profile-spin 1s linear infinite}
@keyframes profile-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.profile-progress.processing:before{animation:none}}

.face-ready{display:inline-flex;align-items:center;gap:7px;margin-top:6px}.face-ready .icon{width:20px;height:20px;flex-shrink:0}

.bulk-toolbar{justify-content:flex-end;margin:18px 0;gap:12px}.photo-card.selectable{position:relative}.photo-card.selected{outline:3px solid var(--accent,#46735e);outline-offset:3px}.selection-marker{position:absolute;right:12px;top:12px;z-index:2;display:grid;place-items:center;width:28px;height:28px;border:2px solid #fff;border-radius:7px;background:#23483b;color:#fff;box-shadow:0 1px 5px #0006}.selection-marker .icon{width:20px;height:20px}.photo-card.selectable:disabled{opacity:.5;cursor:not-allowed}

.album-entry{min-width:0}.album-entry .album-card{width:100%;height:auto;min-height:160px;overflow-wrap:anywhere}.album-entry>.button{margin-top:10px}

.people-folder-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:20px;margin-top:22px}.person-folder,.date-folder{text-align:left;display:flex;flex-direction:column;gap:12px;cursor:pointer;color:inherit;min-width:0}.person-folder img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:12px}.person-folder small,.date-folder small,.person-memory small{display:block;font-weight:400;font-size:12px;line-height:1.6}.person-folder-placeholder{min-height:150px;display:grid;place-items:center}.person-folder-placeholder .icon{width:55px;height:55px}.date-folder>.icon{width:35px;height:35px}.person-folder-path{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:20px 0}.person-folder-path button{border:0;background:transparent;color:inherit;padding:6px;text-decoration:underline;cursor:pointer}.person-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:18px}.person-memory{padding:0;border:1px solid var(--line,#dce3d8);border-radius:12px;overflow:hidden;background:var(--paper,#fff);color:inherit;text-align:left;cursor:pointer;min-width:0}.person-memory img{width:100%;aspect-ratio:1;object-fit:cover;display:block}.person-memory>span{display:block;padding:12px;overflow-wrap:anywhere}.person-memory strong{font-size:13px}.event-caption{margin-top:8px}.event-caption .icon{width:14px;height:14px;vertical-align:middle}.person-timeline{border-left:2px solid var(--line,#dce3d8);padding-left:25px;margin:25px 0 0 10px}.timeline-year{font-size:30px;margin:28px 0 20px}.timeline-entry{position:relative;margin-bottom:35px;max-width:1000px}.timeline-entry:before{content:"";position:absolute;width:12px;height:12px;border-radius:50%;background:currentColor;left:-32px;top:8px}.timeline-date{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:16px}.timeline-event{gap:6px}.photo-import-details dd{overflow-wrap:anywhere}
@media(max-width:600px){.people-folder-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.person-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.person-timeline{padding-left:18px;margin-left:6px}.timeline-entry:before{left:-25px}.page-heading>.row{flex-wrap:wrap}}

.import-summary{margin:24px 0}.import-summary progress{display:block;width:100%;height:12px;margin:18px 0}.import-summary .row{gap:12px}.import-review-list{display:grid;gap:20px}.import-review-card{display:grid;grid-template-columns:minmax(160px,260px) minmax(0,1fr);gap:25px;align-items:start}.import-photo img{width:100%;max-height:330px;object-fit:contain;border-radius:12px;background:var(--soft)}.import-file-placeholder{min-height:160px;display:grid;place-items:center;background:var(--soft);border-radius:12px}.import-file-placeholder .icon{width:45px;height:45px}.import-file-detail{min-width:0}.import-file-detail h2{font-size:21px;overflow-wrap:anywhere}.import-file-detail .help,.import-file-detail .form-error{overflow-wrap:anywhere}.import-face-match{display:grid;grid-template-columns:60px minmax(0,1fr) auto;gap:12px;align-items:center;padding:15px 0;border-top:1px solid var(--line);margin:12px 0}.import-face-match>img{width:60px;height:60px;object-fit:cover;border-radius:9px}.import-face-match .row{gap:8px}.import-working:before{content:"";width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:profile-spin 1s linear infinite;margin-right:7px}.import-face-match strong{font-size:13px}
@media(max-width:900px){.import-face-match{grid-template-columns:50px minmax(0,1fr)}.import-face-match .row{grid-column:2}.import-face-match>img{width:50px;height:50px}}
@media(max-width:600px){.import-review-card{grid-template-columns:1fr;gap:16px}.import-photo img{max-height:250px}.import-face-match .row{grid-column:1 / -1}.import-face-match{grid-template-columns:50px minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.import-working:before{animation:none}}

.storage-meter{height:30px;position:relative;background:var(--soft);border:1px solid var(--line);border-radius:8px;overflow:hidden;margin-top:14px;--meter-color:#4c8a62}.storage-meter-fill{display:block;height:100%;background:var(--meter-color)}.storage-amber{--meter-color:#c88c24}.storage-red{--meter-color:#bd4b40}.storage-meter-label{position:absolute;inset:0;display:grid;place-items:center;font-size:11px;font-weight:700;color:#fff;background:transparent;text-shadow:0 1px 2px #0008;width:max-content;max-width:100%;padding:0 9px;height:22px;margin:auto;border-radius:5px}.storage-pro .storage-meter-label{color:#fff;font-size:12px}.storage-pro{--meter-color:#38734c}

.import-summary progress{accent-color:var(--button-bg)}

.import-warning-box{margin:16px 0;padding:16px;border:1px solid var(--warning-ink);background:var(--warning-bg);color:var(--warning-ink);border-radius:12px}.import-warning-box ul{margin:12px 0;padding-left:20px}.import-warning-box .row{gap:8px}.import-warning-box .help{color:inherit}.import-warning-box [aria-pressed=true]{outline:2px solid currentColor;outline-offset:2px}

.person-folder-block{display:flex;flex-direction:column;gap:16px;min-width:0}.person-folder-block>.person-folder{padding:0;border:0;background:transparent;color:inherit;width:100%;flex:1}.person-folder-block>.button{align-self:flex-start}.timeline-entry>summary{cursor:pointer;padding:14px 18px;border:1px solid var(--line);border-radius:12px;background:var(--paper);list-style:none}.timeline-entry>summary::-webkit-details-marker{display:none}.timeline-summary-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-weight:600}.timeline-summary-tags{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.timeline-summary-tags:empty{display:none}.timeline-expand-hint{display:flex;align-items:center;gap:7px;margin-top:12px;font-size:12px;color:var(--green)}.timeline-expand-hint>.icon{width:16px;height:16px}.timeline-entry:not([open]) .when-open,.timeline-entry[open] .when-closed{display:none}.timeline-entry[open] .timeline-expand-hint>.icon{transform:rotate(90deg)}.timeline-entry[open]>.person-photo-grid{margin-top:16px}.timeline-entry>summary:focus-visible,.person-folder:focus-visible{outline:3px solid var(--accent);outline-offset:3px}

.recent-imports{display:grid;gap:18px}.recent-import{min-width:0}.recent-import>summary{padding:20px;border:1px solid var(--line);border-radius:13px;background:var(--paper);cursor:pointer;list-style:none}.recent-import>summary::-webkit-details-marker{display:none}.recent-import-heading{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:9px}.recent-import-heading>span:not(.badge){font-size:12px;color:var(--muted)}.recent-import-tags{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.recent-import-tags:empty{display:none}.recent-import[open]>.gallery{margin-top:18px}.recent-import:not([open]) .when-open,.recent-import[open] .when-closed{display:none}.recent-import[open] .timeline-expand-hint>.icon{transform:rotate(90deg)}.recent-import>summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.recent-all-tags{margin:18px 0}

.storage-meter{background:#26343a;border-color:var(--muted)}.storage-meter-fill{position:absolute;left:0;top:0;bottom:0;border-radius:6px;box-shadow:1px 0 0 var(--paper)}:root[data-theme="dark"] .storage-meter{background:#091216;border-color:#61727b}.storage-meter-label{background:transparent}

.storage-meter>progress.storage-meter-fill{appearance:none;-webkit-appearance:none;display:block;position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:6px;background:transparent;box-shadow:none}.storage-meter>progress.storage-meter-fill::-webkit-progress-bar{background:transparent}.storage-meter>progress.storage-meter-fill::-webkit-progress-value{background:var(--meter-color);border-radius:6px}.storage-meter>progress.storage-meter-fill::-moz-progress-bar{background:var(--meter-color);border-radius:6px}
