/* One visual system for the shared web and Android interface. */
:root{--fm-text:#f2f7fc;--fm-secondary:#bed1df;--fm-panel:#102b3e;--fm-border:#36546a;--fm-accent:#38bdf8;--ink:#162d3d;--muted:#526a7a;color-scheme:dark}
body{color:var(--fm-text);background:#081b2a;font-size:16px;line-height:1.5}
body::before,body::after{display:none}
button,input,select,textarea{font-family:inherit}
button{cursor:pointer}
button,input,select,textarea,a,summary{-webkit-tap-highlight-color:transparent}
input,select,textarea{font-size:1rem;color-scheme:light;min-height:48px}
label{font-size:.9375rem;line-height:1.4;margin:18px 0 8px}
label>input,label>select,label>textarea{display:block;margin-top:8px}
h1{color:var(--fm-text);font-size:1.6rem;line-height:1.25;letter-spacing:-.025em;margin:12px 0 24px}
h2{font-size:1.2rem;line-height:1.35}
.back{min-height:44px;color:#bfe6fc;font-size:1rem}
.view:not(.camera-view){padding:20px;min-height:calc(100dvh - 68px)}
.view>:first-child.back{margin-top:-6px}
.page-lead,.empty{color:var(--fm-secondary);font-size:1rem;line-height:1.5}
.save-button,.outline-button{min-height:48px;font-size:1rem;line-height:1.35;font-weight:700;border-radius:14px}
.save-button{background:#087db8}
.outline-button{background:#15364b;border-color:#477087;color:#e8f6ff}
.notice,.summary-card,.record-card{color:var(--ink);color-scheme:light;box-shadow:none}
.notice p{color:#526a7a}
[role="status"]:empty{display:none}
.topbar{min-height:68px;padding-bottom:8px;box-shadow:0 1px 0 #ffffff14}
.topbar .brand strong{font-size:1.0625rem}
.topbar .brand small{font-size:.875rem}
.disclosure{margin-top:16px;padding:0 16px 16px;border:1px solid var(--fm-border);border-radius:14px;background:var(--fm-panel);color:var(--fm-text)}
.disclosure:not([open]){padding-bottom:0}
.disclosure>summary{min-height:48px;display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;font-size:1rem;font-weight:650;line-height:1.4}
.disclosure>summary::-webkit-details-marker{display:none}
.disclosure>summary::after{content:'';width:7px;height:7px;flex:none;margin-left:auto;margin-right:3px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .15s}
.disclosure[open]>summary::after{transform:rotate(225deg)}
.disclosure>summary:focus-visible{outline:3px solid var(--fm-accent);outline-offset:4px;border-radius:5px}
.disclosure p{color:var(--fm-secondary);font-size:.9375rem;line-height:1.55}
.disclosure p:last-child{margin-bottom:0}
.disclosure label:first-of-type{margin-top:8px}
.control-icon{display:block;width:24px;height:24px;margin:auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
/* Compact space, not type: all home labels remain readable. */
#homeView{padding:0}
#homeView .home-hero{display:grid;grid-template-columns:48px minmax(0,1fr);min-height:0;gap:12px;padding:calc(18px + var(--fm-safe-top,env(safe-area-inset-top))) 20px 32px}
#homeView .home-logo{width:48px;height:48px;border-radius:12px}
#homeView .home-brand h1{font-size:1.5rem;line-height:1.2;letter-spacing:-.025em}
#homeView .home-brand p{font-size:1rem;line-height:1.3;margin-top:3px}
#homeView .home-header-button{min-height:44px;font-size:.9375rem;padding:9px 13px}
#homeView .home-connection{font-size:.875rem;padding:6px 12px}
#homeView .home-content{margin-top:-12px;padding:0 16px calc(20px + var(--fm-safe-bottom,env(safe-area-inset-bottom)));gap:12px}
#homeView .home-actions{gap:12px}
#homeView .home-action,#homeView .home-primary{grid-template-columns:46px minmax(0,1fr) 18px;min-height:80px;padding:14px;gap:14px;border-radius:18px;background:#133348;border-color:#3a5a70;box-shadow:none}
#homeView .home-primary{background:linear-gradient(110deg,#077eb6,#059bd0);border-color:#5bc8f0}
#homeView .home-icon-tile{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;color:#81d9ff;background:#0b2337;border:1px solid #5dc5f12e}
#homeView .home-primary .home-icon-tile{background:#ffffff1c;color:#fff;border-color:#ffffff36}
#homeView .home-action-icon{width:32px;height:32px;stroke-width:1.6}
#homeView .home-action-icon .icon-tint{fill:currentColor;fill-opacity:.2;stroke:none}
#homeView .home-action-icon .icon-highlight{stroke-width:2.5}
#homeView .home-action-icon .icon-play{fill:currentColor;stroke:none}
#homeView .home-action-copy strong{font-size:1.1875rem;line-height:1.25;font-weight:700}
#homeView .home-action-copy small{font-size:.875rem;line-height:1.35;margin-top:4px;color:#c5ddea;opacity:1}
#homeView .home-primary .home-action-copy small{color:#e2f6ff}
#homeView .home-photo-alert{grid-template-columns:30px minmax(0,1fr) 16px;padding:12px 14px;gap:10px;border-radius:16px;box-shadow:none}
#homeView .home-alert-mark{width:30px;height:30px;font-size:19px}
#homeView .home-photo-alert strong{font-size:1rem;line-height:1.35}
#homeView .home-photo-alert small{font-size:.875rem;line-height:1.4}
#homeView .home-sync-card{grid-template-columns:28px minmax(0,1fr) auto;gap:10px;padding:14px;border-radius:16px;box-shadow:none}
#homeView .home-cloud{width:28px;height:28px}
#homeView .home-sync-copy strong{font-size:1rem;line-height:1.35}
#homeView .home-sync-copy small{font-size:.875rem;line-height:1.4;margin-top:3px}
#homeView .home-queue-link{grid-column:auto;font-size:.875rem;min-height:44px;padding:8px}
/* Album: only the daily controls are expanded. */
.album-tools{background:#102b3e;color:#edf6fc;border:1px solid #36546a;padding:16px;border-radius:18px;box-shadow:none;margin:0 0 16px}
.album-sources{gap:4px;background:#071e30;border-radius:13px;padding:4px}
.album-sources button{font-size:.9375rem;min-height:44px;border:0;background:transparent;color:#bed1df;padding:9px 10px;border-radius:10px}
.album-sources button[aria-pressed="true"]{background:#e4f3fc;color:#0c405e}
.album-tools>label{margin-top:12px}
.album-tools p{color:#bed1df;font-size:.9375rem}
.album-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:start}
.album-menu-grid .disclosure{background:#0a2335;padding-inline:12px;margin-top:12px;min-width:0}
.album-menu-grid:has(details[open]){grid-template-columns:1fr}
.album-menu-grid .disclosure[open]{order:1}
.album-actions{flex-direction:column;gap:8px}
.album-actions button{font-size:.9375rem;min-height:48px}
.album-tools #albumStorage{display:block;font-size:.9375rem;line-height:1.45;margin-top:8px}
.filter-count:not(:empty){display:inline-grid;place-items:center;min-width:23px;height:23px;padding:0 6px;border-radius:99px;background:#b5e8ff;color:#06364f;font-size:.8125rem}
#selectPhotosBtn{margin-top:0}
.album-day{margin:28px 0}
.album-day h2{font-size:1.3rem;line-height:1.4;margin-bottom:16px}
.album-work h3{font-size:1.0625rem;color:#c2dfef;margin-bottom:12px}
.gallery-review-label{font-size:.75rem;font-weight:700}
.gallery-verse>span{font-size:.8125rem;text-transform:none;letter-spacing:.04em}
.album-selection{max-height:65dvh;overflow-y:auto;overscroll-behavior:contain}
.album-selection button{font-size:.9375rem}
.album-selection .selection-actions{align-items:stretch;flex-wrap:wrap}
.album-selection .selection-actions button{min-width:120px}
/* Viewer: contain the whole photo; sharing and downloads always use originals. */
.photo-viewer .viewer-stage{height:52dvh;background:#020c14;margin:16px 0}
.viewer-header strong{font-size:1.125rem}
.viewer-header p{font-size:.875rem;line-height:1.4}
.viewer-actions,.viewer-navigation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.viewer-actions button,.viewer-navigation button{min-height:48px;font-size:1rem;font-weight:700;border-radius:14px;padding:12px 8px}
.viewer-navigation button{font-size:.9375rem}
#viewerMessage{font-size:.9375rem}
#viewerMore{margin-top:16px}
#viewerMore .remove-local{margin-top:8px}
/* Forms, administration and app settings share spacing and typography. */
.settings-panel,.updates-panel{margin:18px 0;padding:18px;border:1px solid #36546a;border-radius:18px;background:#102b3e;color:#edf6fc}
.settings-panel h2,.updates-panel h2{margin:0 0 12px;font-size:1.125rem}
.settings-panel>.outline-button:first-of-type{margin-top:0}
.settings-panel .admin-section-title{margin:20px 0 0}
.settings-panel .disclosure,.updates-panel .disclosure{background:#0a2335}
.settings-panel label:first-of-type{margin-top:12px}
.settings-panel .notice{margin-bottom:12px}
.updates-panel p{font-size:.9375rem}
.works-intro,.work-form{padding:18px;border:1px solid #36546a;border-radius:18px;background:#102b3e;color:#edf6fc}
.works-intro p{font-size:.9375rem;color:#bed1df}
.works-intro .outline-button{margin-top:10px}
.work-row{gap:16px;border:1px solid #dce6ed}
.works-list{margin-top:16px}
.work-row strong{font-size:1.0625rem;line-height:1.4}
.stats-summary{gap:12px}
.stats-work h3{font-size:1.0625rem}
.stats-section-title{color:#f1f8fc}
.stats-message{font-size:.9375rem}
.stats-work-status{font-size:.8125rem}
.stats-summary dt{font-size:.9375rem}
.correction-dialog{max-height:calc(100dvh - 48px);color-scheme:light}
.correction-dialog h2{font-size:1.3rem}
.dialog-actions button{margin:0;border-radius:12px;font:inherit;font-weight:700;padding:12px;border:1px solid #b6cfdf}
.dialog-actions button:not(.save-button){background:#edf4f8;color:#173a51}
.summary-card{gap:16px;flex-wrap:wrap}
.summary-card span{overflow-wrap:anywhere}
.record-head{flex-wrap:wrap}
.record-head strong{font-size:1.0625rem;line-height:1.4}
.record-head small{font-size:.875rem}
.record-badge{font-size:.8125rem}
.camera-view .camera-top>button,.camera-view .camera-tools button,.camera-view .round{display:grid;place-items:center}
.camera-options label,.camera-options select,.camera-work-picker select{font-size:1rem}
.camera-work-picker label{font-size:.875rem}
.camera-view .camera-mode button{font-size:.9375rem}
.camera-view .camera-top{flex-wrap:nowrap}
.camera-finish>span{font-size:.875rem}
.shared-update-banner{bottom:calc(12px + var(--fm-safe-bottom,env(safe-area-inset-bottom)));font-size:.9375rem}
@media(max-width:360px){
 #homeView .home-content{padding-inline:12px}
 #homeView .home-action{gap:12px;padding:12px}
 #homeView .home-queue-link{padding:6px}
 #homeView .home-sync-card{grid-template-columns:24px minmax(0,1fr) auto;gap:8px;padding:12px}
 .album-menu-grid{grid-template-columns:1fr}
 .camera-view .camera-top>button,.camera-view .camera-tools button{width:40px;min-width:40px}
 .camera-view .camera-tools{gap:4px}
 .camera-view .camera-mode button{min-width:45px;padding:8px 6px}
}
@media(min-width:760px){
 .view:not(.camera-view){padding:28px}
 #homeView.active{display:grid;grid-template-columns:.95fr 1.05fr;align-items:stretch;padding:28px;gap:28px}
 #homeView .home-hero{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;border-radius:24px;min-height:580px;padding:30px}
 #homeView .home-header-actions{position:absolute;top:24px;right:24px}
 #homeView .home-brand{display:flex;flex-direction:column;gap:20px}
 #homeView .home-logo{width:72px;height:72px}
 #homeView .home-brand h1{font-size:2rem}
 #homeView .home-connection{margin-top:10px}
 #homeView .home-content{padding:0;margin:0;align-content:center;gap:16px}
 #homeView .home-action{min-height:92px}
 .album-tools{max-width:800px}
 .album-sources{max-width:460px}
 .album-menu-grid:has(details[open]){grid-template-columns:1fr}
 .album-photo-grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px}
 .photo-viewer .viewer-stage{height:60dvh}
}
@media(orientation:landscape){.camera-work-picker{left:206px}.camera-work-picker select{font-size:.9375rem}}
@media(orientation:landscape) and (max-height:600px){.photo-viewer .viewer-stage{height:60dvh}}
@media(prefers-reduced-motion:reduce){.disclosure>summary::after{transition:none}}
/* Gallery pinch adjusts only the thumbnail grid; regular vertical scrolling stays native. */
#albumList{touch-action:pan-y;overflow-anchor:none}
#albumList .album-photo-grid{grid-template-columns:repeat(var(--album-columns,3),minmax(0,1fr))}
@media(max-width:380px){#albumList .album-photo-grid{grid-template-columns:repeat(var(--album-columns,2),minmax(0,1fr))}}
@media(min-width:760px){#albumList .album-photo-grid{grid-template-columns:repeat(var(--album-columns,auto-fill),minmax(min(230px,100%),1fr))}}
#albumList[style*="--album-columns"] .album-photo-grid{grid-template-columns:repeat(var(--album-columns),minmax(0,1fr))}
