/* Readability and interaction layer. Keep after page-specific styles. */
:root{--muted:#596370;--focus:#235d86;--control-border:#596370}
body{font-size:1rem;line-height:1.85}
:where(button,input,select,textarea,a,summary,[tabindex]):focus-visible{outline:3px solid var(--focus)!important;outline-offset:4px!important;box-shadow:0 0 0 2px var(--paper)}
:where(input,select,textarea){scroll-margin-block:5rem 12rem}
input:not([type=checkbox]):not([type=radio]):not([type=file]),textarea,select{font-size:1rem;border-color:var(--control-border);max-width:100%;min-width:0}
input::placeholder,textarea::placeholder{color:#596370;opacity:1}
input[type=checkbox],input[type=radio]{width:1.35em;height:1.35em;min-width:1.35em;accent-color:#253449;vertical-align:middle}
:where(button,.button,.text-button,summary,nav a){min-height:44px;max-width:100%;overflow-wrap:anywhere}
.button{font-size:1rem;gap:12px;white-space:normal;text-align:center}
.button.secondary{border-color:var(--control-border)}
.text-button{font-size:1rem;text-decoration:underline;text-underline-offset:4px;padding-inline:5px}
:where(.helper,.notice,.intro p,.field-label,.story-card p,.home-path p,.empty p){font-size:1rem}
:where(.card-foot,.person small,.editor-bottom,.pill,.category,.count,.support-note){font-size:.875rem}
:where(.modal-actions,.toolbar,.section-top,.feed-toolbar){flex-wrap:wrap}
:where(.story-card,.question-card,.home-path,.settings-card,.group-room-header>div){min-width:0}
:where(.person,.group-room-header,.settings-profile-preview){overflow-wrap:anywhere}
:where(.filter,.avatar-options button,.avatar-tones button)[aria-pressed=true]{border:2px solid currentColor;font-weight:700;box-shadow:inset 0 -3px 0 currentColor}
.sidebar nav a[aria-current=page]{box-shadow:inset 4px 0 0 currentColor;font-weight:700}
:where(.reading-size,.size-option){display:flex;align-items:center;gap:10px;min-height:48px;cursor:pointer;padding:6px 10px;border:1px solid var(--control-border);border-radius:8px;background:var(--paper);color:var(--ink);font-size:1rem;width:fit-content;max-width:100%}
.reading-size input{flex:none}.reading-size span{overflow-wrap:anywhere}
.entry-language{flex-wrap:wrap;align-items:center;gap:12px}.reading-tools{margin:0 0 20px}.profile-setup>.reading-size{margin-bottom:20px}
.language-control{flex-wrap:wrap}.language-control select{min-height:44px}
.skip-main{position:fixed;left:12px;top:-150px;padding:12px 18px;background:var(--paper);border:2px solid var(--focus);border-radius:6px;z-index:1000}
.skip-main:focus{top:12px}
#main:focus{outline:none}
dialog{scroll-padding-block:64px 20px;overscroll-behavior:contain}
dialog .close{position:sticky;float:right;top:0;right:0;width:44px;height:44px;min-width:44px;margin:-20px -16px 0 12px;background:var(--paper);border:1px solid var(--control-border);border-radius:50%;color:var(--ink);line-height:1;z-index:10}
.modal-title{padding-right:24px;overflow-wrap:anywhere}
.identity-upload:focus-within,.photo-picker:focus-within{outline:3px solid var(--focus);outline-offset:4px}
.identity-upload input:focus-visible,.photo-picker input:focus-visible{outline:none!important}
#toast{max-width:calc(100% - 32px);overflow-wrap:anywhere;font-size:1rem}
.large-text{font-size:1.125rem}
.large-text :is(p,li,label,input,textarea,select,.button,.text-button,.filter,summary,.helper,.notice,.person,.answer-content,.reply){font-size:1.125rem}
.large-text :is(small,.card-foot,.editor-bottom,.pill,.category,.count,.support-note,.home-path-note,.home-path-label,.home-reading-status){font-size:1rem}
.large-text .reader-body,.large-text .writing-sheet #entry-text{font-size:1.375rem}
.large-text .why-article{font-size:1.25rem}
.large-text .settings-text-preview p{font-size:1.125rem}
.large-text .setup-progress{font-size:1rem}
@media(max-width:760px){
 .sidebar{height:auto;min-height:76px;padding:4px 6px calc(4px + env(safe-area-inset-bottom))}
 .sidebar nav{align-items:stretch;gap:2px}
 html body .sidebar nav a,html body.large-text .sidebar nav a{font-size:.875rem;line-height:1.45;min-height:64px;padding:6px 2px;white-space:normal;overflow-wrap:anywhere;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
 html body.large-text .sidebar nav a{font-size:1rem}
 .sidebar nav a span{height:auto;line-height:1.1;flex:none}
 .sidebar nav a[aria-current=page]{box-shadow:inset 0 -3px 0 currentColor}
 .shell{padding-bottom:calc(112px + env(safe-area-inset-bottom))}
 body.writing-page .shell,body.signed-out .shell,body.profile-setup-page .shell{padding-bottom:0}
 .topbar{height:auto;min-height:76px;gap:12px;flex-wrap:wrap;padding-block:12px}
 .topbar-actions{flex-wrap:wrap;gap:12px}
 .topbar .text-button{font-size:.875rem}
 .home-context-note{display:none}
 dialog{padding:24px 20px;width:calc(100% - 24px);max-height:calc(100dvh - 24px)}
 dialog .close{margin:-12px -8px 0 8px}
 .modal-actions{gap:12px}.modal-actions>.button{flex:1 1 140px}
 .share-footer{flex-wrap:wrap;position:static}.share-footer button{flex:1 1 140px}
 #sharing .modal-actions{position:static}
 .toolbar{align-items:stretch}.toolbar input{width:100%}
 .settings-sharing-stats{grid-template-columns:1fr}
 #toast{left:50%;bottom:calc(120px + env(safe-area-inset-bottom))}
 .signed-out #toast,.profile-setup-page #toast{bottom:20px}
 .story-illustration{min-height:440px}
 .story-illustration figcaption{font-size:.875rem}
}
@media(max-width:640px){
 /* Flowing controls remain reachable with large text and a software keyboard. */
 .writing-sheet .writing-footer{position:static;inset:auto;display:block;padding:18px 0;box-shadow:none;backdrop-filter:none}
 .writing-page #main{padding-bottom:40px}
 .writing-sheet .writing-footer .modal-actions{display:flex;flex-wrap:wrap;gap:12px}
 .writing-sheet .writing-footer #save-story{min-height:48px;flex:1 1 180px}
 .writing-sheet .writing-footer #draft-close{min-height:48px}
 .writer-input-tools{flex-wrap:wrap}.writer-input-tools button{min-height:44px}
 .private-profile-fields{padding:16px 12px}.private-profile-fields input{width:100%}
 .large-text .setup-progress{display:grid;gap:6px}.setup-progress li{min-height:40px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(forced-colors:active){
 .button,.filter,.avatar-options button,.avatar-tones button{border:1px solid ButtonText}
 [aria-pressed=true],.sidebar nav a[aria-current=page]{outline:2px solid Highlight;outline-offset:-3px;text-decoration:underline}
 :focus-visible{outline:3px solid Highlight!important;box-shadow:none}
}
@media(max-width:760px){
 .shell{padding-bottom:calc(var(--navigation-height,112px) + 24px)}
 #toast{bottom:calc(var(--navigation-height,112px) + 16px)}
 .navigation-expanded .sidebar{position:static;width:100%;min-height:0}
 .navigation-expanded .sidebar nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .navigation-expanded .shell{padding-bottom:24px}
 .navigation-expanded #toast{bottom:16px}
 body.writing-page .shell,body.signed-out .shell,body.profile-setup-page .shell{padding-bottom:0}
}
.private-profile-fields{min-inline-size:0;max-width:100%}
.private-profile-fields legend{max-width:100%;overflow-wrap:anywhere}
.writer-toolbar{flex-wrap:wrap}
.writer-toolbar .brand,.writer-toolbar .pill{max-width:100%;min-width:0;flex-shrink:1;white-space:normal;overflow-wrap:anywhere}
.writer-toolbar .brand-word{overflow-wrap:anywhere}
@media(max-width:640px){.writing-sheet .writing-footer .modal-actions{flex-wrap:wrap}.writing-sheet #draft-close{max-width:none;flex:1 1 110px}}
.text-button{display:inline-flex;align-items:center;justify-content:center}
@media(max-width:760px){.brandcaption{margin-left:0}.navigation-expanded .sidebar nav a{flex-direction:row;gap:8px}.navigation-expanded .sidebar nav a span{width:auto}}
@media(max-width:760px){
 .why-header-actions{flex-wrap:wrap;min-width:0}.why-header-actions>div{min-width:0;max-width:100%}
 .why-header .text-button{white-space:normal}.why-header .language-control{max-width:100%}
 .brand{max-width:100%;min-width:0;flex-wrap:wrap}.brand-word{overflow-wrap:anywhere;min-width:0;max-width:100%}
}
.shell>footer{flex-wrap:wrap;gap:12px;overflow-wrap:anywhere}
.shell>footer>span{max-width:100%}
button[aria-pressed=true]{box-shadow:inset 0 -3px 0 currentColor;font-weight:700}
.signed-out.navigation-expanded .sidebar nav{display:none}
.login-card .login-divider{white-space:normal;overflow-wrap:anywhere}
.large-text .story-illustration{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;height:auto;min-height:0}
.large-text :is(.illustration-question,.illustration-story,.illustration-reply){position:relative;inset:auto;transform:none;min-width:0;max-width:100%;overflow-wrap:anywhere}
.large-text .story-illustration figcaption{position:static;max-width:100%}
.large-text .story-illustration::before{transform:none}
@media(max-width:1000px){.story-illustration::before{transform:none}}

/* A single next step, with the same progress labels across invitation and sharing. */
.welcome-paths{display:grid;gap:1rem;margin:1.5rem 0}
.journey-choice{display:flex;flex-direction:column;align-items:flex-start;gap:.6rem;text-align:left;border:1px solid #596370;border-radius:16px;padding:1.3rem;background:#f1ebdf;color:#253449;white-space:normal}
.journey-choice strong{font-size:1.2rem}.journey-choice span{font-size:1rem;line-height:1.7}
.journey-progress{list-style:none;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.5rem;margin:1rem 0 1.5rem;width:100%}
.journey-progress li{display:flex;flex-direction:column;gap:.4rem;font-size:.875rem;color:#596370;border-bottom:2px solid #8993a0;padding:.5rem;overflow-wrap:anywhere}
.journey-progress li[aria-current=step]{border-bottom:4px solid #253449;font-weight:700;color:#253449;background:#f1ebdf}
.journey-progress li>span{font-size:1.125rem}.sharing-setup .journey-progress{max-width:40rem}
.writing-sheet .editor-bottom{margin:.5rem 0 1rem;gap:1rem;flex-wrap:wrap}
@media(max-width:640px){.journey-progress{grid-template-columns:repeat(2,minmax(0,1fr))}.welcome-choice .modal-actions{display:flex;flex-wrap:wrap}}

/* A quiet bookmark for the next visit; no countdowns or posting targets. */
.next-plan,.next-save {padding:1.3rem;border:1px solid var(--line,#c8c4ba);border-radius:18px;background:#e9edf1;margin-block:1.25rem;min-width:0}
.next-save {background:#faf8f3}
.next-plan-heading {display:flex;align-items:center;gap:.8rem}
.next-plan-heading h3 {margin:.4rem 0;flex:1;min-width:0}
.next-plan-actions {display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;margin:1rem 0}
.next-plan small {display:block;line-height:1.8}
.next-suggestions {display:grid;gap:.65rem;margin-block:1.3rem}
.next-suggestion {display:flex;gap:.7rem;align-items:center;text-align:left;background:#fffdf8;border:1px solid #8993a0;border-radius:12px;padding:.75rem;color:#253449;font:inherit;cursor:pointer}
.next-suggestion span {min-width:0;overflow-wrap:anywhere}
.next-picker select {width:100%;max-width:100%;min-width:0}
.revisit-story {display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;padding:1.5rem;margin-block:2rem;background:#f1ebdf;border:1px solid #cbc3b6;border-radius:22px}
.revisit-story h2 {font-family:var(--serif,serif);font-size:1.6rem;line-height:1.7}
.revisit-preview {min-width:0;border-left:3px solid #596370;padding-left:1.3rem}
.revisit-preview blockquote {margin:1rem 0;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:640px){.revisit-story{grid-template-columns:1fr;padding:1rem}.next-plan,.next-save{padding:1rem}.next-plan-actions{align-items:stretch;flex-direction:column}.next-plan-heading{align-items:flex-start}.next-picker .modal-actions{flex-wrap:wrap}}

/* A reading-first home: the same warm palette, with text and borders for state. */
.home-mode {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;margin-bottom:1.5rem}
.home-mode>span {font-weight:650;color:#253449}
.home-mode .filters {display:flex;flex-wrap:wrap;gap:.5rem}
.home-mode [aria-pressed=true],.received-toolbar [aria-pressed=true] {border:2px solid #253449;background:#e9edf1;font-weight:700;box-shadow:inset 0 -3px #253449}
.reading-home {display:grid;gap:1.8rem}
.reading-welcome {display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.8fr);align-items:center;gap:1rem;padding:1.5rem;background:#f1ebdf;border:1px solid #c8c4ba;border-radius:24px}
.reading-welcome h1 {font-family:var(--serif,serif);font-size:clamp(1.8rem,2.8vw,2.6rem);line-height:1.5;margin:.6rem 0}
.reading-welcome p {line-height:1.9}
.reading-welcome img {width:100%;height:auto;max-width:280px;justify-self:center}
.reading-links {display:flex;flex-wrap:wrap;gap:.7rem;margin-top:1.5rem}
.saved-shelf {margin-block:2rem;padding-block:1.5rem;border-block:1px solid #c8c4ba;min-width:0}
.reading-home .saved-shelf {margin:0}
.saved-empty {padding:1.3rem;background:#f1ebdf;border-radius:12px}
.saved-badge {display:inline-block;color:#253449;font-size:.9rem;line-height:1.7;font-weight:650;margin-bottom:.7rem}
.reading-invitation {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem;background:#faf8f3;border-radius:18px;padding:1.3rem}
.reading-invitation h2 {font-size:1.25rem}
.reader-bookmark {margin:1rem 0 2rem;padding:1rem;border:1px solid #c8c4ba;border-radius:14px;background:#f1ebdf}
.reader-bookmark [aria-pressed=true] {border:2px solid #253449;font-weight:700;background:#e9edf1}
.reader-bookmark p {margin:.7rem 0 0;line-height:1.8}
.saved-heading {margin-bottom:2rem;max-width:48rem}
.received-intro[hidden] {display:none}
@media(max-width:700px){.reading-welcome{grid-template-columns:1fr;padding:1.25rem}.reading-welcome img{max-width:230px}.home-mode{align-items:flex-start;flex-direction:column}.reading-links{align-items:stretch;flex-direction:column}.reading-invitation{padding:1rem}.reading-home{gap:1.5rem}}

.received-person-icon .identity-picture {width:100%;height:100%;min-width:0}

/* One shared grid and a single primary writing action keep home quiet. */
.calm-home {max-width:1040px;margin:0 auto;display:grid;gap:2rem}
.home-topline {display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.home-topline .home-mode {margin:0;display:flex;align-items:center;gap:.6rem;font-size:.875rem;font-weight:500}
.home-mode select {width:auto;min-width:0;max-width:100%;font:inherit}
.calm-welcome {display:grid;grid-template-columns:minmax(0,1fr) 200px;gap:1.5rem;align-items:center;padding:0 0 1.5rem;border-bottom:1px solid var(--line)}
.calm-welcome h1 {font-family:var(--serif,serif);font-size:clamp(1.8rem,2.8vw,2.5rem);line-height:1.6;margin:0 0 .5rem}
.calm-welcome p {margin:0;line-height:1.8}
.calm-welcome img {width:100%;height:145px;object-fit:contain}
.home-focus {padding:1.5rem 2rem;background:#f1ebdf;border:1px solid #c8c4ba;border-radius:18px}
.home-focus h2 {font-family:var(--serif,serif);font-size:1.65rem;line-height:1.7;margin:.5rem 0}
.home-focus p {max-width:42rem;line-height:1.9;overflow-wrap:anywhere}
.home-focus-actions {display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-top:1.25rem}
.calm-home .section-top {display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 0 1rem}
.calm-home .section-top h2 {font-size:1.3rem;margin:0}.calm-home .section-top p{margin:.3rem 0 0}
.calm-home .received-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
.home-shelf {border-top:1px solid var(--line);padding-top:1.5rem}
.home-story-links {list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.home-story-links button {display:flex;justify-content:space-between;gap:1rem;text-align:left;width:100%;background:transparent;border:0;border-bottom:1px solid var(--line);padding:.8rem 0;font:inherit;color:inherit;cursor:pointer}
.home-story-links span {overflow-wrap:anywhere}.home-story-links small{flex-shrink:0;color:#596370}
.home-quiet-links {display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:1rem}
@media(max-width:700px){.calm-home{gap:1.5rem}.home-topline{align-items:flex-start}.home-topline>.eyebrow{display:none}.calm-welcome{grid-template-columns:1fr}.calm-welcome img{display:none}.home-focus{padding:1.1rem}.calm-home .received-grid{grid-template-columns:1fr}.home-story-links button{flex-direction:column;gap:.4rem}.home-story-links small{flex-shrink:1}.home-mode select{width:100%}.home-topline .home-mode{width:100%;align-items:flex-start;flex-direction:column}.home-focus-actions{align-items:stretch;flex-direction:column}}

.home-topline{justify-content:flex-end}.notice-address{overflow-wrap:anywhere;color:var(--muted)}.notice-row{display:grid;grid-template-columns:1fr minmax(150px,220px);gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--line)}.notice-row label{font-weight:700}.notice-zone{display:grid;grid-template-columns:1fr minmax(180px,300px);gap:20px;align-items:center;margin-top:24px}.notice-card select{width:100%;min-width:0}.notice-card .helper{margin:16px 0}.notice-card .settings-save-row{margin-top:24px}@media(max-width:600px){.notice-row,.notice-zone{grid-template-columns:1fr;gap:8px}.home-mode-choice{width:100%}}

.home-received-card{display:flex;flex-direction:column;text-align:left;background:var(--paper,#fffdf7);border:1px solid var(--line);border-radius:18px;padding:0;overflow:hidden;color:inherit;font:inherit;cursor:pointer}.home-received-card>img{width:100%;height:180px;object-fit:cover}.home-received-card>div{padding:24px;position:relative;flex:1}.home-received-card h3{font-size:1.2rem;line-height:1.65;margin:8px 0 12px}.home-card-author{display:flex;gap:12px;align-items:center;margin:0;color:var(--muted);font-size:.9rem}.home-card-excerpt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.8;margin:0 0 20px}.home-card-date{font-size:.875rem;color:var(--muted)}.home-card-arrow{float:right}.home-received-card:hover{border-color:var(--sage,#596370)}

.notice-zone{grid-template-columns:1fr minmax(150px,220px)}#settings-notifications{scroll-margin-top:40px}.calm-home .home-received-card:only-child{grid-column:1/-1}.calm-home .home-received-card.has-cover:only-child{display:grid;grid-template-columns:30% minmax(0,1fr)}.calm-home .home-received-card.has-cover:only-child>img{height:100%;min-height:200px;max-height:320px}@media(max-width:600px){.notice-zone{grid-template-columns:1fr}.calm-home .home-received-card.has-cover:only-child{display:flex}.calm-home .home-received-card.has-cover:only-child>img{height:160px;min-height:0}}

.home-card-symbol{display:flex;align-items:center;justify-content:center;height:180px;background:#f1ebdf}.home-card-symbol .question-motif{width:72px;height:72px}.home-received-card>div{display:flex;flex-direction:column}.home-card-date{margin-top:auto}.home-card-arrow{position:absolute;right:24px;bottom:24px}.home-card-author{flex-wrap:wrap}.calm-home .home-received-card:only-child>.home-card-symbol{height:100%;min-height:200px}@media(max-width:600px){.calm-home .home-received-card:only-child>.home-card-symbol{height:160px;min-height:0}}

/* Route/dialog headings receive focus for announcements, but are not controls. */
:where(h1,h2,h3,h4,h5,h6)[tabindex="-1"]:focus{outline:none!important;box-shadow:none!important}
