/* R02 shared primitives. Loaded last; legacy page layouts remain until R02-06..10. */
:root {
 --bg:#f7f5ef;--paper:#fffefb;--ink:#193d40;--muted:#4f6367;
 --green:#164e50;--green-soft:#e6efee;--line:#e2e3d7;--clay:#965238;
 --ui-sunken:#efeee6;--ui-border:#6f827a;--ui-focus:#8a5a1f;
 --ui-on-primary:#fffdf2;--ui-primary-hover:#103c3e;
 --ui-info:#2b5a7a;--ui-info-bg:#e6eff5;
 --ui-success:#1e6a47;--ui-success-bg:#e7f2ec;
 --ui-warning:#7a5200;--ui-warning-bg:#fbf1de;
 --ui-danger:#a0372a;--ui-danger-bg:#f8e9e6;
 --ui-body:1rem;--ui-label:.875rem;--ui-hint:.8125rem;--ui-meta:.8125rem;
 --ui-title:1.5rem;--ui-heading:1.25rem;--ui-reading:1.0625rem;
 --ui-space-1:4px;--ui-space-2:8px;--ui-space-3:12px;--ui-space-4:16px;
 --ui-space-5:20px;--ui-space-6:24px;--ui-space-8:32px;--ui-space-10:40px;
 --ui-radius-card:16px;--ui-radius-button:14px;--ui-radius-field:12px;
 --ui-touch:44px;--ui-field:48px;--ui-duration:160ms;
}
body{font-size:var(--ui-body);line-height:1.8;color:var(--ink);background:var(--bg)}
.center-column{min-width:0}
.center-column :is(h1,h2,h3,p,li,label,button,a,small,summary){overflow-wrap:anywhere}
.center-column :is(p,li){font-size:var(--ui-body);line-height:1.8;color:var(--ink)}
.center-column :is(h1,.detail-title){font-size:var(--ui-title);line-height:1.4;color:var(--ink);font-weight:700}
.center-column h2{font-size:var(--ui-heading);line-height:1.5;color:var(--ink);font-weight:700}
.center-column h3{font-size:var(--ui-reading);line-height:1.6;color:var(--ink);font-weight:700}
.center-column :is(.narrative,.life-narrative,#memory-body,.bank-entry-excerpt,.person-memory-card>span){font-size:var(--ui-reading);line-height:1.95;color:var(--ink)}
.center-column :is(.narrative,.life-narrative){max-width:68ch;white-space:pre-wrap}
.center-column :is(small,.small-notice,.account-status,.memory-edit-guidance,.memory-edit-footnote,.capture-record-help,.capture-title-help,.capture-assurance,.capture-prompt>p,.capture-prompt small,.capture-eyebrow,.capture-heading>p,.capture-empty,.capture-audio-ready,.source-box p,.source-box summary,.source-box small,.memory-import p,.account-header p,.account-card p,.info-page>p,.info-page li,.people-intro p,.people-empty p,.account-password-form p,.review-time,.life-auto-status){font-size:var(--ui-hint);line-height:1.8;color:var(--muted)}
.center-column :is(.bank-entry-date,.bank-entry-foot,.bank-entry-status,.people-card-copy small,.people-summary small,.people-list-heading>span,.people-eyebrow,.bank-cover-eyebrow,.capture-recent-date,.tag){font-size:var(--ui-meta);line-height:1.7;color:var(--muted)}
.center-column :is(.people-card-copy strong,.person-memory-card strong,.bank-entry strong){font-size:var(--ui-reading);line-height:1.6;color:var(--ink)}
.center-column :is(.field-label,.bank-search label,.people-search label){font-size:var(--ui-label);font-weight:600;line-height:1.6;color:var(--ink)}
.center-column :is(.input-field,.capture-writing,.edit-writing,.writing-area,.account-feedback-textarea,.viewer-caption textarea){font-size:var(--ui-body);line-height:1.8;color:var(--ink);background:var(--paper);border:1.5px solid var(--ui-border);border-radius:var(--ui-radius-field);min-height:var(--ui-field);max-width:100%}
.center-column :is(.bank-search-field,.people-search-field,.search-box){border:1.5px solid var(--ui-border);background:var(--paper)}
.center-column :is(.bank-search-field input,.people-search-field input,.search-box input){font-size:var(--ui-body);color:var(--ink);min-height:44px}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}
.center-column :is(button,.primary,.secondary,.text-button,.danger-button,.back-button,.account-back,.account-inline-link,.person-back,.filter,summary),.ui-dialog button,.photo-viewer button{min-width:var(--ui-touch);min-height:var(--ui-touch);font-size:var(--ui-label);line-height:1.6;white-space:normal;max-width:100%}
.center-column :is(.primary,.secondary,.text-button,.danger-button),.ui-dialog :is(.primary,.secondary,.danger-button){border-radius:var(--ui-radius-button);padding:10px 16px;gap:8px;display:inline-flex;align-items:center;justify-content:center}
.center-column .primary,.ui-dialog .primary{background:var(--green);color:var(--ui-on-primary);min-height:48px;font-size:var(--ui-body);font-weight:700}
.center-column .primary:hover,.ui-dialog .primary:hover{background:var(--ui-primary-hover)}
.center-column .secondary,.ui-dialog .secondary{background:var(--paper);color:var(--green);border:1.5px solid var(--ui-border);font-weight:600}
.center-column .secondary:hover,.ui-dialog .secondary:hover{background:var(--green-soft)}
.center-column :is(.text-button,.account-back,.account-inline-link,.person-back,.back-button){color:var(--green)}
.center-column .danger-button,.ui-dialog .danger-button{color:var(--ui-danger);background:var(--paper);border:1.5px solid var(--ui-danger)}
.center-column .danger-button:hover,.ui-dialog .danger-button:hover{background:var(--ui-danger-bg)}
button:disabled{cursor:not-allowed;opacity:1;color:var(--muted)!important;background:var(--ui-sunken)!important;box-shadow:none!important;border-color:var(--ui-border)!important}
button:active:not(:disabled){filter:brightness(.96)}
.center-column .mode-switch button,.center-column .capture-mode-switch button{font-size:var(--ui-body);color:var(--muted);min-height:48px}
.center-column :is(.mode-switch,.capture-mode-switch) button.active{background:var(--paper);color:var(--green);font-weight:700;box-shadow:inset 0 -3px var(--green)}
.center-column :is(.bank-view-tabs,.hero-actions,.detail-actions,.review-actions){flex-wrap:wrap}
.center-column .filter{color:var(--green);border:1.5px solid var(--ui-border);background:var(--paper)}
.center-column .filter.active,.center-column .bank-view-tabs [aria-current]{color:var(--ui-on-primary);background:var(--green);border-color:var(--green);font-weight:700}
.center-column :is(.account-links a,.account-password summary){font-size:var(--ui-label);color:var(--green)}
.center-column :is(.source-box,.small-notice,.processing-progress,.account-status){background:var(--ui-sunken)}
.center-column .person-cover{background:var(--green)}
.center-column .person-cover :is(h1,p,span,small){color:var(--ui-on-primary)}
.center-column .person-cover .people-avatar{color:var(--green)}
.ui-dialog .small-notice,.center-column .collection-order li>span{color:var(--muted)}
.center-column .bank-cover{background:var(--green)}
.center-column .bank-cover :is(h1,p,.bank-cover-eyebrow){color:var(--ui-on-primary)}
.center-column .people-avatar{background:var(--green-soft);color:var(--green)}
.center-column .people-card:nth-child(3n+2) .people-avatar{background:var(--ui-warning-bg);color:var(--clay)}
.center-column .people-card:nth-child(3n+3) .people-avatar{background:var(--green-soft);color:var(--green)}
.center-column .people-card-arrow{color:var(--green)}
.center-column .missing-person form p{font-size:var(--ui-hint);line-height:1.8;color:var(--muted)}
.center-column .capture-page #record-button{width:112px;height:112px;min-width:112px;min-height:112px;border-radius:50%;padding:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:var(--ui-body);font-weight:700;color:var(--ui-on-primary);background:var(--green)}
.center-column .capture-page #record-button svg{width:32px;height:32px;flex-shrink:0}
.center-column :is(.capture-title,.capture-writing){width:100%}
.center-column :is(.memory-photos .photo-thumb,.memory-photos .photo-grid figure){width:72px;flex-basis:72px}
.center-column .memory-photos .photo-thumb{height:72px}
.center-column .memory-photos .photo-remove{width:44px;height:44px;min-height:44px;min-width:44px}
.center-column .memory-photos .photo-remove span{background:var(--paper);color:var(--ui-danger)}
.center-column summary{cursor:pointer;padding-block:10px;line-height:1.8}
.center-column .photo-picker{min-height:48px}
.center-column :is(.account-card,.bank-entry,.people-card,.person-memory-card,.life-event,.review-card,.collection-download){border-radius:var(--ui-radius-card)}
.center-column svg.icon{width:24px;height:24px;stroke-width:1.8}
.center-column :is(.field-label:has(input[type=checkbox]),.field-label:has(input[type=radio]),.collection-options label,.collection-consent){min-height:48px;padding-block:10px;display:flex;align-items:center;gap:12px}
input:is([type=checkbox],[type=radio]){width:24px;height:24px;accent-color:var(--green);flex-shrink:0}
.center-column :is(input,textarea,select)[aria-invalid=true]{border-color:var(--ui-danger)}
.ui-field-error{color:var(--ui-danger)!important;font-size:var(--ui-hint);line-height:1.8}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible,[role=button]:focus-visible,.photo-picker:focus-within{outline:3px solid var(--ui-focus)!important;outline-offset:3px!important;scroll-margin-block:100px}
.ui-status{display:inline-flex;gap:8px;align-items:baseline;overflow-wrap:anywhere;font-size:var(--ui-hint);line-height:1.8;border-radius:12px;padding:8px 12px;color:var(--ui-info);background:var(--ui-info-bg)}
.ui-status[data-tone=warning]{color:var(--ui-warning);background:var(--ui-warning-bg)}
.ui-status[data-tone=danger]{color:var(--ui-danger);background:var(--ui-danger-bg)}
.ui-status[data-tone=success]{color:var(--ui-success);background:var(--ui-success-bg)}
.center-column .bank-entry-status.ui-status{color:var(--ui-info)}
.center-column .bank-entry-status.ui-status[data-tone=warning]{color:var(--ui-warning)}
.center-column .bank-entry-status.ui-status[data-tone=danger]{color:var(--ui-danger)}
.ui-status-icon{font-weight:700;flex-shrink:0}
.ui-dialog,.photo-viewer{font-family:Vazirmatn,Tahoma,sans-serif;font-size:var(--ui-body);line-height:1.8;color:var(--ink);background:var(--paper);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);border:0;border-radius:20px;padding:24px;overflow:auto;direction:rtl}
.ui-dialog{width:min(480px,calc(100vw - 32px));box-shadow:0 16px 48px #193d4038}
.ui-dialog::backdrop,.photo-viewer::backdrop{background:#102b24bd}
.ui-dialog h2{font-size:var(--ui-heading);line-height:1.5;margin-bottom:12px}
.ui-dialog p{margin-bottom:20px;overflow-wrap:anywhere}
.ui-dialog-message{white-space:pre-line}
.ui-dialog-details{margin:0 0 16px}.ui-dialog-details summary{min-height:44px;cursor:pointer}.ui-dialog-details p{margin-top:12px}
.photo-viewer :is(p,small,[role=status]){font-size:var(--ui-hint);line-height:1.8;color:var(--muted)}
.photo-viewer h2{font-size:var(--ui-heading);line-height:1.5;color:var(--ink)}
.photo-viewer .secondary{background:var(--paper);color:var(--green);border:1.5px solid var(--ui-border);border-radius:var(--ui-radius-button)}
.photo-viewer .primary{background:var(--green);color:var(--ui-on-primary);min-height:48px;font-size:var(--ui-body);border-radius:var(--ui-radius-button)}
.photo-viewer .text-button{color:var(--green)}
.photo-viewer .viewer-caption textarea{font-size:var(--ui-body);line-height:1.8;color:var(--ink);background:var(--paper);border:1.5px solid var(--ui-border);border-radius:var(--ui-radius-field);min-height:100px}
.ui-dialog-actions{display:flex;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.ui-toast{position:fixed;inset-inline:16px;bottom:calc(100px + env(safe-area-inset-bottom));margin-inline:auto;max-width:480px;z-index:25;display:flex;gap:12px;align-items:center;padding:12px 16px;background:var(--green);color:var(--ui-on-primary);border-radius:14px;box-shadow:0 8px 24px #193d4026;font-size:var(--ui-body);line-height:1.8}
.ui-toast button{background:transparent;color:var(--ui-on-primary);min-width:44px;min-height:44px;flex-shrink:0;border:1px solid currentColor;border-radius:10px}
.ui-sheet{width:min(420px,calc(100vw - 32px));margin-inline-end:16px;height:calc(100dvh - 32px)}
.ui-sheet header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
.ui-menu{position:relative}
.ui-menu>button{min-height:44px}
.ui-menu-panel{background:var(--paper);border:1.5px solid var(--ui-border);border-radius:12px;box-shadow:0 8px 24px #193d4026;padding:8px;min-width:min(240px,100%)}
.ui-menu-panel :is(button,a){display:flex;align-items:center;width:100%;min-height:48px;padding:10px 12px;text-align:start;color:var(--green);background:transparent}
.ui-menu-panel [data-destructive]{border-block-start:1px solid var(--line);color:var(--ui-danger);margin-top:8px}
.ui-chip{min-height:44px;min-width:44px;display:inline-flex;align-items:center;gap:8px;padding:6px 14px;border-radius:18px;border:1.5px solid var(--ui-border);background:var(--paper);color:var(--green);font-size:var(--ui-label)}
.ui-chip[aria-pressed=true]{background:var(--green-soft);border-color:var(--green);font-weight:700}
.ui-chip[aria-pressed=true]::before{content:'✓';font-weight:700}
#notice:empty{display:none}
#notice,#connection-notice{font-size:var(--ui-body);color:var(--ink);line-height:1.8;overflow-wrap:anywhere}
#notice[role=alert]:not(:empty){color:var(--ui-danger);background:var(--ui-danger-bg);padding:12px 16px;border-radius:12px}
#connection-notice{background:var(--ui-warning-bg);color:var(--ui-warning);border-radius:12px;padding:12px 16px}
@media(max-width:600px){.ui-sheet{inset: auto 0 0;margin:0;width:100%;max-width:100%;height:auto;max-height:90dvh;border-radius:20px 20px 0 0;padding-bottom:calc(24px + env(safe-area-inset-bottom))}.ui-dialog-actions>*{flex:1 1 140px}.center-column .bank-entry-top{flex-wrap:wrap}.center-column :is(.capture-title-help,.account-card p,.info-page p,.info-page li){font-size:var(--ui-hint)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* R02 shared shell: four task destinations, account consistently in the header. */
.skip-link{position:fixed;inset-block-start:8px;inset-inline-start:8px;transform:translateY(-180%);z-index:100;background:var(--paper);color:var(--green);padding:12px 18px;border:2px solid var(--green);border-radius:12px}
.skip-link:focus{transform:none}
.center-column>.topbar{height:auto;min-height:76px;gap:10px;flex-wrap:wrap;padding-block:12px}
.center-column .topbar .brand{flex:none;gap:6px}
.center-column .topbar .brand-symbol{width:32px;height:30px}
.center-column .topbar .brand-wordmark{width:108px;height:32px}
.center-column .header-account{margin-inline-start:auto;display:flex;align-items:center;gap:6px;min-height:44px;padding:8px;color:var(--green);font-size:var(--ui-label);border-radius:12px;white-space:nowrap}
.center-column .header-account[hidden]{display:none}
.header-account svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8}
.header-account[aria-current=page]{background:var(--ui-sunken);font-weight:700}
.center-column:has(#navigation:not([hidden])){max-width:760px;margin-block:0;border:0;border-radius:0;box-shadow:none;background:var(--bg)}
.center-column:has(#navigation:not([hidden]))>.topbar{height:auto;min-height:76px;padding-inline:0}
.center-column:has(#navigation:not([hidden]))>#pilot-main{padding-inline:0}
.center-column:has(#navigation:not([hidden]))>#navigation:not([hidden]){max-width:760px;border-radius:0;gap:8px;padding:8px 12px calc(8px + env(safe-area-inset-bottom));background:var(--paper)}
#navigation:not([hidden]) a{min-height:52px;font-size:var(--ui-label);color:var(--muted)}
#navigation:not([hidden]) a[aria-current=page]{color:var(--green);font-weight:700;background:var(--ui-sunken)}
.center-column .inline-guide{padding:0 16px;margin:16px 0;background:var(--ui-sunken);border:0;border-radius:12px}
.center-column .inline-guide summary{color:var(--green);font-weight:600}
.center-column .inline-guide p{font-size:var(--ui-hint);margin-block:8px}
.center-column .capture-page .capture-heading{margin-bottom:12px}
.center-column .capture-page .capture-heading h1{font-size:1.625rem;line-height:1.4;margin:0 0 6px;letter-spacing:0}
.center-column .capture-page .capture-heading>p{font-size:var(--ui-label);line-height:1.7;margin:0;color:var(--muted)}
.center-column .capture-page .capture-modes{margin-bottom:12px}
.center-column .login-page{margin-top:12px;padding:24px}
.login-page .login-eyebrow{color:var(--muted);font-size:var(--ui-hint);margin-bottom:8px}
.center-column .login-page h1{font-size:1.75rem;line-height:1.6;margin-top:0}
.center-column .login-page .login-value{font-size:1rem;line-height:1.9;color:var(--ink)}
.center-column #google-login-slot{min-width:0;max-width:100%}
.life-owner>header p{font-size:var(--ui-label);color:var(--muted)}
.life-view-tabs{display:flex;gap:8px;margin:16px 0;border-bottom:1px solid var(--line);padding-bottom:12px}
.life-view-tabs a{flex:1;display:flex;justify-content:center;align-items:center;min-height:48px;border:1px solid var(--ui-border);border-radius:12px;color:var(--green)}
.life-view-tabs a[aria-current=page]{background:var(--green);color:var(--ui-on-primary);font-weight:700}
@media(min-width:1000px){
 .account-open .center-column:has(#navigation:not([hidden])){max-width:1160px;padding-inline:216px 24px;position:relative}
 .account-open .center-column:has(#navigation:not([hidden]))>#navigation:not([hidden]){position:fixed;inset-block:104px 24px;inset-inline-start:max(24px,calc((100vw - 1160px)/2 + 24px));inset-inline-end:auto;transform:none;width:168px;max-width:168px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;border:0;border-inline-end:1px solid var(--line);padding:12px 12px;background:var(--bg)}
 #navigation:not([hidden]) a{flex:none;flex-direction:row;justify-content:flex-start;gap:12px;min-height:52px;padding:12px;font-size:1rem}
 .account-open .center-column:has(#navigation:not([hidden]))>#pilot-main{padding-bottom:32px}
}
@media(max-width:999px) and (max-height:500px) and (orientation:landscape){
 .account-open .center-column:has(#navigation:not([hidden]))>#navigation:not([hidden]){position:sticky;inset:auto;top:0;transform:none;order:0;width:100%;max-width:100%;border:0;border-bottom:1px solid var(--line);padding:4px 0;z-index:10}
 #navigation:not([hidden]) a{flex-direction:row;gap:6px;min-height:44px;font-size:var(--ui-label)}
 #navigation:not([hidden]) a svg{width:18px;height:18px}
 .account-open .center-column:has(#navigation:not([hidden]))>#pilot-main{padding-bottom:24px}
 .account-open .center-column:has(#navigation:not([hidden]))>.topbar{min-height:56px;padding-block:6px}
}
@media(max-width:360px){.center-column .topbar .tag{display:none}.center-column .header-account{font-size:var(--ui-hint);padding-inline:6px}.center-column .login-page{padding:18px}}

/* Capture and detail: one reading/editing path, optional controls folded. */
.center-column .capture-sheet{padding:20px}
.center-column .capture-recorder{padding-bottom:12px}
.center-column .capture-prompt{margin-block:16px;padding:0 14px;border-radius:12px;background:var(--ui-sunken)}
.center-column .capture-prompt summary{font-size:var(--ui-label);color:var(--green);font-weight:600}
.center-column .capture-prompt p{font-size:1rem;color:var(--ink);margin-block:12px}
.center-column .capture-prompt .secondary{min-height:48px;padding:10px 20px}
.center-column .capture-prompt .field-label{font-size:var(--ui-hint);font-weight:400;gap:10px}
.center-column .memory-photos{padding:12px 0;margin-block:12px;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent}
.center-column .memory-photos h2{font-size:1rem;margin-block:8px 12px}
.center-column .memory-photos .photo-grid{min-height:0;padding-block:4px;gap:12px}
.center-column .memory-photos .photo-hint{font-size:var(--ui-hint);color:var(--muted);margin:8px 0 0;line-height:1.8}
.center-column .capture-submit-row{margin-top:12px}
.center-column .capture-page .capture-writing{min-height:200px;font-size:var(--ui-reading);line-height:2}
.center-column .capture-page #record-button[data-action=resume-recording]{width:auto;min-height:48px;height:auto;border-radius:12px;max-width:100%;padding:12px 20px}
.center-column .memory-detail{padding:24px;margin-block:12px}
.memory-detail-header #processing-state{margin-bottom:12px}
.center-column .memory-detail h1{font-size:1.625rem;line-height:1.6;margin:8px 0}
.center-column #memory-period{font-size:var(--ui-label);color:var(--muted);margin-block:8px 16px}
.memory-primary-actions{display:flex;align-items:center;gap:12px;justify-content:space-between;margin-block:12px 20px}
.memory-primary-actions>.secondary{min-width:136px}
.center-column .memory-detail .narrative{font-size:var(--ui-reading);line-height:2.1;margin-block:20px}
.center-column :is(.memory-result-review,.memory-facts){margin-block:12px;border-top:1px solid var(--line)}
.center-column :is(.memory-result-review,.memory-facts) summary{font-size:var(--ui-label);color:var(--green)}
.center-column .memory-edit-guidance{font-size:var(--ui-hint);color:var(--muted);line-height:1.9}
.center-column .memory-edit .edit-writing{min-height:260px;font-size:var(--ui-reading);line-height:2}
.center-column .edit-time-options{margin-block:16px;border-top:1px solid var(--line)}
.edit-time-options summary span{font-size:var(--ui-hint);color:var(--muted)}
.edit-submit-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:20px}
.edit-submit-row>*{flex:1 1 160px;text-align:center}
.center-column .time-metadata{margin-top:16px}
@media(max-width:420px){.center-column .memory-detail{padding:18px}.center-column .capture-sheet{padding:16px}.memory-primary-actions>.secondary{min-width:0}.memory-primary-actions>*{flex:1}.memory-primary-actions .ui-menu>button{width:100%}}

/* R02-08: the bank is a reading/search surface; secondary tools open on request. */
.bank-compact .bank-compact-header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-block:4px 16px}
.bank-compact-header h1{font-size:var(--ui-title);line-height:1.5;margin:0}
.bank-compact-header p{margin:4px 0 0;font-size:var(--ui-hint);color:var(--muted)}
.bank-compact .bank-search{margin:0 0 12px}
.bank-chips{display:flex;gap:8px;flex-wrap:wrap;margin-block:12px 16px}
.bank-chips .ui-chip{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;white-space:normal;overflow-wrap:anywhere;max-width:100%;padding:8px 14px}
.bank-chips [aria-current=page],.bank-chips [aria-pressed=true]{background:var(--green);color:#fff;border-color:var(--green)}
.bank-more{display:block;width:100%;margin-block:18px;min-height:48px}
.bank-more span{font-weight:400}
.bank-review{border-block:1px solid var(--line);padding-block:12px;margin-block:8px 20px}
.bank-review>header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.bank-review h2{font-size:var(--ui-body);margin:0}
.bank-review-card{display:flex;flex-direction:column;gap:4px;padding:12px 0;min-height:48px;text-decoration:none;color:var(--green)}
.bank-review-card>span{font-size:var(--ui-hint);color:var(--muted)}
.bank-review-entry{display:inline-flex;align-items:center;min-height:44px;margin-block:4px 8px}
.bank-filter-sheet .primary{display:block;width:100%;margin-top:16px}
.bank-filter-sheet .input-field{width:100%}
.bank-selectable{display:block;padding:14px}
.bank-selection-reading{display:flex;gap:14px;text-decoration:none;color:var(--green)}
.bank-choice{display:flex;align-items:center;gap:10px;min-height:44px;margin-bottom:8px;font-size:var(--ui-hint)}
.bank-choice input{width:24px;height:24px;margin:0;accent-color:var(--green)}
.bank-selection-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;bottom:82px;z-index:3;border:1.5px solid var(--ui-border);border-radius:12px;background:var(--paper);padding:12px;margin-block:16px;box-shadow:0 6px 24px #193d4026;flex-wrap:wrap}
.bank-selection-bar>strong{font-size:var(--ui-hint)}
.bank-selection-bar>.primary{flex:1 1 180px}
@media(max-width:420px){.bank-compact-header h1{font-size:26px}.bank-compact-header>button{padding-inline:14px}.bank-chips{gap:8px}.bank-chips .ui-chip{font-size:14px;padding-inline:12px}.bank-selection-reading{gap:10px}}
.identity-review{padding:16px;margin-block:16px;border:1px solid var(--ui-border)}
.identity-review h2{font-size:var(--ui-heading);margin:0 0 8px}
.identity-question{margin:16px 0;padding:12px;min-width:0;border:1px solid var(--ui-border);border-radius:12px}
.identity-question legend{font-weight:700;padding-inline:6px}
.identity-question blockquote{margin:0 0 14px;padding:8px 12px;border-inline-start:3px solid var(--ui-border);font-size:var(--ui-hint);overflow-wrap:anywhere}
.identity-question .input-field{width:100%;margin-block:4px 12px}
.identity-review>.primary{width:100%}
.person-main-tools{display:flex;gap:12px;flex-wrap:wrap;margin-block:16px}
.person-editor form{padding-block:12px}
.person-editor .input-field{width:100%;margin-block:6px 12px}
.person-editor [data-person-status]:empty{display:none}
.person-editor [data-person-status]{padding:12px;background:var(--ui-warning-bg);border-radius:8px}
.person-editor .primary,.person-editor .secondary{min-height:48px}
.person-advanced{margin-top:16px;border-top:1px solid var(--ui-border);padding-top:8px}
.person-advanced>summary{min-height:48px;display:list-item;align-content:center;font-weight:600}
.person-split-choices{display:grid;gap:8px}
.person-split-choices>label{display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--ui-border);border-radius:8px;min-height:48px}
.person-split-choices input{width:24px;height:24px;flex-shrink:0;margin:0;accent-color:var(--green)}
.person-split-choices small{display:block;color:var(--muted);font-size:var(--ui-hint);overflow-wrap:anywhere}
.person-draft-conflict{padding:12px;border:1px solid var(--ui-warning);border-radius:12px}
.photo-sheet-rows{display:grid;gap:12px}
.photo-sheet-row{position:relative;display:grid;grid-template-columns:64px 1fr;align-items:center;gap:10px;padding:12px;border:1px solid var(--ui-border);border-radius:12px}
.photo-sheet-row .photo-thumb{width:64px;height:64px;min-height:64px;min-width:0;padding:0;border-radius:8px;overflow:hidden;display:block}
.photo-sheet-row .photo-thumb img{display:block;width:100%;height:100%;max-width:100%;object-fit:cover}
.birth-picker-button{text-align:start;width:100%;min-height:48px}
.birth-wheels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.birth-wheels label{min-width:0;font-weight:600;text-align:center}
.birth-wheels select{display:block;width:100%;min-width:0;height:190px;padding:8px 2px;border:1px solid var(--ui-border);border-radius:12px;background:var(--paper);font:inherit;text-align:center;overflow-y:auto}
.birth-wheels option{padding:8px 2px}
.birth-picker .primary{width:100%;margin-top:12px}
.photo-order-actions{grid-column:1/-1;display:flex;gap:8px;padding-inline-end:44px}
.photo-order-actions .secondary{min-height:44px;flex:1;max-width:140px;padding:8px}
.photo-order-actions .photo-remove{position:absolute;top:12px;inset-inline-end:8px;width:44px;height:44px;min-width:44px;min-height:44px;border-radius:8px;background:var(--paper);color:var(--ui-danger)}
@media(max-width:420px){.identity-review{padding:12px}.identity-question{padding:10px}.person-editor .primary{width:100%}.photo-sheet-row{padding:10px}}

/* Book reading is prose first; editor controls are opened deliberately. */
.book-reading-tools{display:flex;align-items:center;gap:var(--space-3,12px);flex-wrap:wrap;margin-block:16px 24px}
.book-passage{padding-block:20px;border-block-end:1px solid var(--ui-border);min-inline-size:0}
.center-column .book-passage .life-narrative{font-size:var(--ui-reading);line-height:2.05;overflow-wrap:anywhere}
.center-column .book-time{color:var(--muted);font-size:var(--ui-meta);margin-block:0 10px}
.book-passage .source-box{margin-block:12px 0}

/* Optional re-reading belongs to the notebook, with deeper controls folded. */
.bank-review-item{display:flex;align-items:center;gap:12px;border-block-end:1px solid var(--ui-border)}
.bank-review-item>.bank-review-card{flex:1;min-width:0;overflow-wrap:anywhere}
.bank-review-item>button{flex:0 0 auto;max-width:40%;min-height:44px}
.bank-review-hint{font-size:var(--ui-meta);color:var(--muted)}
.bank-review-options{margin-block:8px 16px}
.bank-review-options>summary{display:flex;align-items:center;min-height:44px;cursor:pointer;color:var(--green);font-weight:600}
.bank-review-options>summary::before{content:'＋';margin-inline-end:8px}
.bank-review-options[open]>summary::before{content:'−'}
.bank-review-options p{font-size:var(--ui-hint);line-height:var(--ui-reading);color:var(--muted)}
.bank-review-options :is(button,summary){min-height:44px;min-width:44px}
.bank-review-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:8px;border-block-end:1px solid var(--ui-border)}
.bank-review-choice>span{min-width:0;overflow-wrap:anywhere}
.bank-review-choice>button{flex:0 0 auto;max-width:50%}

.collection-scope{font-weight:600;color:var(--green);line-height:var(--ui-reading)}
.collection-page [data-collection-action]{min-height:44px;min-width:44px;max-width:100%;white-space:normal}
.collection-page .review-actions{flex-wrap:wrap}

/* Account overview: outputs first, optional settings and security folded. */
.account-overview{display:grid;gap:16px;min-width:0}
.account-overview .account-header{padding:0}
.account-output-group>h2{font-size:1.125rem;margin-block:0 12px}
.account-output-links{display:grid;gap:10px}
.account-output-links>a{display:grid;grid-template-columns:1fr auto;gap:4px 12px;padding:16px;border:1px solid var(--ui-border);border-radius:12px;background:var(--paper);text-decoration:none;min-height:64px;min-width:0;color:var(--green)}
.account-output-links strong{font-size:var(--ui-label);overflow-wrap:anywhere}
.account-output-links span{font-size:var(--ui-hint);line-height:1.8;color:var(--muted);grid-column:1;overflow-wrap:anywhere}
.account-output-links .account-output-arrow{grid-column:2;grid-row:1/3;align-self:center;font-size:var(--ui-label)}
.account-overview .account-help-links{gap:0;border:1px solid var(--ui-border);border-radius:12px;overflow:hidden}
.account-overview .account-help-links>a{border:0;border-radius:0;border-block-end:1px solid var(--ui-border)}
.account-overview .account-help-links>a:last-child{border-block-end:0}
.account-disclosure-body{padding:12px 16px;min-width:0}
.account-disclosure-body>.account-password{margin-block:12px}
.account-overview .account-footer{margin:0;padding-block-start:8px}
.account-overview .account-footer>button{justify-self:start;min-height:48px}
.account-overview .account-status{margin:0 12px 12px}
.account-overview .small-notice{margin-block:8px;line-height:1.8}
.account-output-links>a:focus-visible{outline:3px solid var(--ui-focus);outline-offset:2px}
.center-column :is(.account-guide,.account-other-outputs,.account-security) a{min-height:44px;display:inline-flex;align-items:center;max-width:100%;overflow-wrap:anywhere}
.account-guide .source-box>summary{min-height:48px}
.account-other-outputs{margin-block:16px}
@media(min-width:900px){.account-output-links{grid-template-columns:repeat(3,minmax(0,1fr))}.account-output-links>a{align-content:start}.account-help-links{grid-template-columns:repeat(3,minmax(0,1fr))}.account-overview .account-help-links>a{border-block-end:0;border-inline-end:1px solid var(--ui-border)}.account-overview .account-help-links>a:last-child{border-inline-end:0}}
/* Book-first life: prose first; local time and secondary controls stay optional. */
.book-options > nav { display:flex; flex-wrap:wrap; gap:var(--space-2, .5rem); }
.book-time-edit { margin-block:.75rem; border-block-start:1px solid var(--color-border,#dce2d5); }
.book-time-edit > summary { min-height:44px; padding-block:.5rem; cursor:pointer; color:var(--color-primary,#164E50); }
.book-time-edit form { padding-block:.5rem; }
.book-source { margin-block:.5rem; }
.book-passage { overflow-wrap:anywhere; }
.book-options, .life-simple-time { min-width:0; }

#local-drafts-access{display:flex;align-items:center;justify-content:flex-start;min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere;padding:8px 12px;margin:0 0 8px}
.local-capture-notice{margin-block-end:12px}.local-capture-notice button{margin:4px;max-width:100%;white-space:normal}

/* One notebook, short reading pages and deliberately opened tools. */
.notebook-tabs{display:flex;gap:8px;margin-block:12px 20px;border-bottom:1px solid var(--ui-border);padding-bottom:12px}
.notebook-tabs a{flex:1;text-align:center;display:flex;align-items:center;justify-content:center;min-height:48px;border-radius:12px;background:var(--wash);color:var(--green);font-weight:600}
.notebook-tabs a[aria-current=page]{background:var(--green);color:var(--ui-on-primary)}
.book-reader header h2,.book-editor header h2{font-size:var(--ui-heading);margin-block:8px 16px;overflow-wrap:anywhere}
.book-chapters{margin-block:12px;border-bottom:1px solid var(--ui-border)}
.book-chapters summary,.book-passage-tools>summary,.book-options>summary,.book-work>summary{min-height:48px;cursor:pointer;font-size:var(--ui-label);padding-block:10px}
.book-chapters nav{display:flex;flex-direction:column;max-height:45vh;overflow:auto;margin-block:8px}
.book-chapters button{text-align:start;justify-content:flex-start;overflow-wrap:anywhere}
.book-chapters button[aria-current=page]{background:var(--wash);font-weight:700}
.book-reader .book-passage{padding-block:12px 16px;border:0}
.book-reader .book-passage h3{font-size:var(--ui-label);color:var(--muted);margin-block:0 12px;overflow-wrap:anywhere}
.first-value-card{margin-block:0 16px;padding:14px 16px;min-inline-size:0}
.first-value-card h2{font-size:var(--ui-label);margin-block:0 8px}
.first-value-card p{font-size:var(--ui-small);margin-block:6px;overflow-wrap:anywhere}
.first-value-card button{min-block-size:44px}
.book-sample{margin-block:12px}
.book-sample section{padding-block:8px}
.book-pagination{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px;margin-block:12px 20px}
.book-pagination :is(button,span){min-width:0;overflow-wrap:anywhere}
.book-pagination button{min-height:48px;padding:10px 8px;white-space:normal}
.book-pagination span{font-size:var(--ui-meta);color:var(--muted);text-align:center}
.book-update{font-size:var(--ui-hint);color:var(--muted);line-height:1.8;margin-block:8px}
.book-reader>.source-box{margin-block:10px}
.book-editor .life-event{margin-block:12px}
#navigation{grid-template-columns:repeat(3,minmax(0,1fr))}

/* IMP-32: preserve the compact layout while making helper text and targets usable. */
.center-column .topbar .brand{min-height:44px;padding-block:6px}
.center-column .capture-voice-note summary span,
.center-column .capture-recent>span:last-child>span,
.center-column .bank-list-heading>span{color:var(--muted);font-size:var(--ui-hint)}
.center-column .capture-recent-heading a{min-height:44px;font-size:var(--ui-label)}
.center-column :is(.people-empty,.bank-empty)>a{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding-inline:8px;font-size:var(--ui-label)}
.center-column .capture-page #record-button{width:max(112px,7rem);height:max(112px,7rem);min-width:max(112px,7rem);min-height:max(112px,7rem)}
.center-column .capture-modes button{flex-wrap:wrap;padding-inline:8px;font-size:var(--ui-label)}
.capture-modes button span{overflow-wrap:normal;word-break:normal}
.center-column .capture-page .capture-record-clock{font-size:var(--ui-hint)}

/* Account exports: one primary path; other formats open on request. */
.account-overview .account-output-links{grid-template-columns:1fr}

.story-reader .story-export-label{display:flex;align-items:center;gap:12px;min-height:44px;margin-block:12px;cursor:pointer}
.story-reader .story-export-label input{flex:none}

/* D-WORDMARK-20261011: approved Persian lockup only; interface typography unchanged. */
@font-face{font-family:FasleManWordmark;src:url('assets/IRANSansX-Medium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}
.center-column .topbar .fasleman-brand{gap:7px;white-space:nowrap}
.center-column .topbar .fasleman-brand .brand-symbol{width:42px;height:39.375px;object-fit:contain;flex:none}
.center-column .topbar .fasleman-brand .brand-wordmark{font-family:FasleManWordmark,sans-serif;font-size:20px;font-weight:500;line-height:1.5;letter-spacing:normal;width:auto;height:auto;white-space:nowrap;color:#164e50}

/* D-SPLASH-20261011: one local opening, tied to real initialization. */
body[data-app-opening]{background:#F8F6F0}
body[data-app-opening]>.center-column,body[data-app-opening]>.skip-link{visibility:hidden}
#app-opening{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:max(24px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));background:#F8F6F0;color:#164E50;overflow:auto}
#app-opening[hidden]{display:none}
#app-opening .opening-brand{text-align:center;transform:translateY(-12px);max-width:100%}
#app-opening .opening-mark{position:relative;width:94px;height:84.34px;margin:0 auto 6px;perspective:500px}
#app-opening .opening-mark svg{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain}
#app-opening .opening-left,#app-opening .opening-right{transform-origin:50% 65%}
#app-opening .opening-dot{transform-origin:90% 12%}
#app-opening .opening-name{font:500 24.12px/1.4 FasleManWordmark,sans-serif}
#app-opening .opening-name span{display:inline-block;position:relative;white-space:nowrap;letter-spacing:normal}
#app-opening .opening-tagline{font:500 14px/1.9 FasleManWordmark,sans-serif;color:#A25435;margin:20px 0 0;white-space:nowrap}
#app-opening .opening-tagline span{display:block}
#app-opening .opening-tagline span+span{margin-top:2px}
#opening-status{font-size:14px;line-height:1.8;max-width:290px;min-height:0;margin:20px 0 0;white-space:normal}
#opening-status:empty{margin:0}
#opening-retry{margin-top:16px}
body[data-app-opening] .opening-dot{animation:opening-dot 260ms cubic-bezier(.2,.75,.25,1) both}
body[data-app-opening] .opening-left{animation:opening-left 620ms 70ms cubic-bezier(.2,.75,.25,1) both}
body[data-app-opening] .opening-right{animation:opening-right 620ms 100ms cubic-bezier(.2,.75,.25,1) both}
body[data-app-opening] .opening-name{animation:opening-name 360ms 350ms cubic-bezier(.2,.75,.25,1) both}
body[data-app-opening] .opening-tagline{animation:opening-tagline 360ms 640ms cubic-bezier(.2,.75,.25,1) both}
@keyframes opening-dot{from{opacity:0;transform:translateY(-5px) scale(.7)}to{opacity:1;transform:none}}
@keyframes opening-left{from{opacity:0;transform:rotateY(-76deg) translateX(4px)}to{opacity:1;transform:none}}
@keyframes opening-right{from{opacity:0;transform:rotateY(76deg) translateX(-4px)}to{opacity:1;transform:none}}
@keyframes opening-name{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
@keyframes opening-tagline{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#app-opening .opening-mark svg,#app-opening .opening-name,#app-opening .opening-tagline{animation:none!important;opacity:1;transform:none}}

/* A01 owner screenshot: clear header controls; native system-bar space is handled by Android. */
.center-column>.topbar,.account-open .center-column:has(#navigation:not([hidden]))>.topbar{min-height:80px;padding-block:16px;gap:12px;align-items:center;flex-wrap:nowrap}
.center-column .topbar .header-account{font-size:16px;line-height:1.5;font-weight:600;min-height:48px;min-width:104px;padding:10px 12px;gap:8px;justify-content:center;background:var(--green-soft);border:1px solid var(--ui-border);border-radius:14px;flex-shrink:0;text-decoration:none}
.center-column .topbar .header-account svg{width:24px;height:24px;flex:none}
.center-column .topbar .header-account[aria-current=page]{background:var(--green);color:var(--ui-on-primary)}
@media(max-width:600px){.center-column .topbar .tag{display:none}}
@media(max-height:500px) and (orientation:landscape){.center-column>.topbar,.account-open .center-column:has(#navigation:not([hidden]))>.topbar{min-height:64px;padding-block:8px}}

/* Capture control stays centered when resume changes its action to record/stop. */
.center-column .capture-page .capture-recorder #record-button{margin-inline:auto;margin-block:16px}
.center-column .capture-active-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;width:100%;margin-block:12px}
.center-column .capture-page[data-recording=true] .capture-active-actions #record-button{width:100%;height:auto;min-width:0;min-height:56px;max-width:100%;border-radius:14px;margin:0;padding:12px;font-size:1rem}
.center-column .capture-active-actions>.secondary{min-width:0;min-height:56px;padding:12px;font-size:1rem}
.center-column .capture-page[data-recording=true] .capture-heading>p{display:none}
.center-column .capture-page[data-recording=true] .capture-recorder{padding-block:8px}
.center-column .capture-page[data-recording=true] #record-clock{font-size:1.5rem;margin:0;text-align:center;font-variant-numeric:tabular-nums;direction:ltr}
.center-column .capture-page[data-recording=true] #record-signal{margin:8px 0;line-height:1.6}
.center-column .capture-screen-status{font-size:var(--ui-hint);line-height:1.6;margin:8px 0;color:var(--muted)}

/* Optional domain continuation: ordinary flow, no overlay on capture controls. */
.topbar .domain-transition-access{flex-basis:100%;font-size:.9rem;text-align:start;margin:.35rem 0 0;white-space:normal}
.center-column:has(#navigation:not([hidden]))>.topbar:has(.domain-transition-access){height:auto;min-height:78px;flex-wrap:wrap;padding-block:.7rem;row-gap:.35rem}
.domain-transition-content{max-inline-size:100%;overflow-wrap:anywhere}
.domain-transition-actions{display:flex;flex-direction:column;gap:.75rem;margin-block:1rem}
.domain-transition-actions a{white-space:normal;text-align:center}
