/* iPhone-sized web layout; desktop retains its existing compact layout. */
@media(max-width:700px){
  html{-webkit-text-size-adjust:100%;scroll-padding-bottom:100px}
  body{min-height:100svh}
  .shell,.shell.journey-mode{width:100%;max-width:520px;margin:auto;padding:calc(12px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(82px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
  .top{gap:8px;flex-wrap:nowrap;padding-bottom:12px}
  .brand{font-size:19px;letter-spacing:-.025em;white-space:nowrap}
  .top-actions{gap:0;margin-left:auto}.top-actions #headerDate{display:none}
  .theme-toggle{width:112px;height:44px}.theme-option{font-size:14px}
  .layout,.journey-mode .layout{display:block;margin-top:20px}
  .content{width:100%;min-width:0;max-width:none}
  h1{font-size:34px;line-height:1.15;margin-bottom:8px}
  h2,#clarity h2{font-size:22px;line-height:1.4}
  .eyebrow{margin-bottom:8px;letter-spacing:.12em}
  .lede{font-size:15px;line-height:1.6;margin-bottom:16px}
  #today .cards{gap:8px;margin:16px 0}
  #today .card{padding:12px 14px;gap:12px;border-radius:14px;min-height:74px}
  #today .card .icon{font-size:19px;flex-basis:22px}
  #today .card label{font-size:17px}#today .card p{font-size:14px;line-height:1.45;margin-top:4px}
  .record-actions{display:grid;grid-template-columns:1fr;gap:10px}
  .main-btn,.quiet{min-height:44px;line-height:1.4;border-radius:12px}
  .record-actions>button{width:100%;min-height:48px;padding:12px 16px;font-size:16px}
  .hint{margin:10px 0 0;line-height:1.6}
  .panel,.clarity-summary{padding:16px;margin:16px 0;border-radius:16px}
  .panel-head,.todo-heading{flex-wrap:wrap;gap:8px}
  .output-text,.review-answer{font-size:16px;line-height:1.8;margin-top:14px}
  textarea,input[type=text],.journey-edit-summary{font-size:16px;padding:12px;line-height:1.7;scroll-margin-bottom:110px}
  textarea{min-height:140px}.journey-edit-summary{min-height:240px}
  .todo-item{padding:12px 0}.todo-item label{min-height:44px;gap:12px}
  .todo-item input,.journey-edit-task input[type=checkbox]{width:24px;height:24px}
  .source-details{margin-top:18px;padding-top:12px}.source-details summary{padding:10px 0}
  .journey-workspace{display:block;border-radius:16px}
  .journey-browser,.journey-reader{height:auto;max-height:none;min-height:0;overflow:visible;padding:14px}
  .journey-browser{border-right:0;border-bottom:1px solid #ffffff20}
  .journey-browser .panel{margin-bottom:18px}.journey-browser .panel:last-child{margin-bottom:0}
  .journey-browser .month-bar{gap:6px;margin-bottom:12px}.journey-browser h2{font-size:20px}
  .month-bar button{min-width:44px;min-height:44px}
  .journey-browser .calendar{gap:3px}.journey-browser .day{min-height:44px;max-height:none;aspect-ratio:auto;border-radius:9px;font-size:14px}
  .weekday{padding:5px 0;font-size:13px}
  .journey-review-row{padding:10px 0;gap:8px}.journey-review-row>span{min-width:0;overflow-wrap:anywhere}
  .journey-browser .journey-review-row .quiet{min-width:52px;min-height:44px;padding:9px}
  .journey-reader{scroll-margin-top:12px}.reader-placeholder{padding:20px 2px}
  .reader-toolbar,.review-detail-heading{flex-wrap:wrap;gap:10px;align-items:center}
  .reader-toolbar h2{font-size:17px}.reader-toolbar-actions{margin-left:auto;gap:8px}
  .reader-toolbar-actions .quiet{min-width:44px;min-height:44px;padding:10px 12px}
  .reader-period,.review-period{margin:14px 0;gap:8px}
  .reader-period .quiet,.review-period .quiet{min-width:44px;padding:9px}
  .reader-paper{padding:14px;border-radius:12px}.reader-paper h3{font-size:19px}
  .reader-paper h3:not(:first-child){margin-top:24px}
  .reader-tasks li{padding:10px 0}.review-question{padding:14px 12px;border-radius:12px}
  .review-meta{flex-wrap:wrap;gap:8px}.review-period h2{font-size:19px}
  .review-sources{gap:4px 12px}.review-sources button{min-height:44px}
  .review-answer,.output-text,.reader-tasks{overflow-wrap:anywhere}
  .mobile-nav{position:fixed!important;left:0;right:0;bottom:0!important;top:auto!important;display:flex;gap:8px;padding:8px max(12px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);transform:translateZ(0);box-sizing:border-box}
  .mobile-nav button{flex:1;min-width:0;min-height:64px;padding:14px 8px;font-size:20px;font-weight:700;line-height:1.25;border-radius:16px;border:1px solid #ffffff35;background:#ffffff0b;color:#d0d8e5}
  .mobile-nav{gap:8px}
  .mobile-nav button.active{background:#ddc399;border-color:#ddc399;color:#172236;font-weight:700;box-shadow:0 2px 6px #0002}
  [data-theme=light] .mobile-nav button{background:#f5f7fa;border-color:#bcc7d5;color:#45566e}
  [data-theme=light] .mobile-nav button.active{background:#263958;border-color:#263958;color:#fff}
  .mobile-nav button:active{transform:translateY(1px)}
  .footer{margin-top:24px;font-size:13px}
  .journey-browser .panel:nth-child(2)>h2,.journey-browser .panel:nth-child(2)>p{display:none!important}
}
@media(max-width:360px){
  .shell,.shell.journey-mode{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
  .brand{font-size:17px}.theme-toggle{width:104px}
  .journey-browser,.journey-reader{padding:10px}.reader-paper{padding:12px}
}

/* Keep the Today landing screen compact without clipping text or recording. */
.journey-browser .panel:nth-child(2)>h2,.journey-browser .panel:nth-child(2)>p{display:none!important}
.journey-browser .panel:nth-child(2)>.section-label{display:block;font-size:18px;letter-spacing:.12em;margin-bottom:10px}
.journey-browser .panel:nth-child(2) .journey-review-links{margin-top:0}
.journey-browser .panel:nth-child(2) .journey-review-row{font-size:18px;line-height:1.55;padding:18px 0}
.journey-browser .panel:nth-child(2) .journey-review-row .quiet{min-height:48px;padding:11px 18px;font-size:16px}
@media(max-width:700px){
  .journey-browser .panel:nth-child(2)>.section-label{font-size:17px;margin-bottom:6px}
  .journey-browser .panel:nth-child(2) .journey-review-row{font-size:17px;padding:15px 0}
  .journey-browser .panel:nth-child(2) .journey-review-row .quiet{min-width:60px;min-height:48px;padding:11px 15px;font-size:16px}
}
#today>.record-actions{position:sticky;top:0;z-index:8;padding:calc(8px + env(safe-area-inset-top)) 0 8px;background:#101725}
[data-theme=light] #today>.record-actions{background:#fff}
#transcriptPanel,#transcript{scroll-margin-top:calc(90px + env(safe-area-inset-top))}
.shell:has(#today:not(.hidden)) .footer{display:none}
@media(max-width:700px){
  #transcriptPanel,#transcript{scroll-margin-top:calc(132px + env(safe-area-inset-top))}
  .shell:has(#today:not(.hidden)) .layout{margin-top:14px}
  #today>.eyebrow{display:none}
  #today h1{font-size:30px;margin-bottom:6px}
  #today .cards{margin:14px 0;gap:8px}
  #today .card{min-height:48px;padding:10px 14px}
  #today .record-actions{gap:8px}
  #today .hint{font-size:14px;line-height:1.5;margin-top:8px}
  .shell:has(#today:not(.hidden)){padding-bottom:calc(82px + env(safe-area-inset-bottom))}
}
@media(max-width:700px) and (max-height:740px){
  .shell:has(#today:not(.hidden)){padding-top:calc(8px + env(safe-area-inset-top))}
  .shell:has(#today:not(.hidden)) .top{padding-bottom:8px}
  .shell:has(#today:not(.hidden)) .layout{margin-top:10px}
  #today h1{font-size:28px}
  #today .cards{margin:10px 0;gap:6px}
  #today .card{min-height:40px;padding:8px 12px}
  #today .record-actions>button{min-height:44px;padding:10px 12px}
  .mobile-nav button{min-height:58px;padding:12px 6px;font-size:19px}
}

/* Give the original record more writing space with a lighter frame. */
#today #transcriptPanel{padding:16px;border-width:.5px}
#today #transcript{min-height:220px;border-width:.5px;margin-top:12px}
#today #inputStatus:empty{display:none}

@media(max-width:700px){
  .mobile-nav button,.mobile-nav button.active,[data-theme=light] .mobile-nav button,[data-theme=light] .mobile-nav button.active{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:64px;padding:7px 8px;border:0;border-radius:10px;box-shadow:none;background:transparent;color:#b4bfd0;font-size:14px;font-weight:500;line-height:1.2}
  [data-theme=light] .mobile-nav button{color:#4d5560}
  .mobile-nav button.active{color:#d5b375;background:#b58b4622}
  [data-theme=light] .mobile-nav button.active{color:#94702f;background:#f3ead9}
  .mobile-nav button svg{width:28px;height:28px;flex-shrink:0}
}

html{touch-action:pan-x pan-y}
input,textarea{font-size:16px}
@media(max-width:700px){
 .shell:has(#today:not(.hidden)){height:100dvh;min-height:0;padding-top:calc(8px + env(safe-area-inset-top));padding-bottom:calc(88px + env(safe-area-inset-bottom));display:flex;flex-direction:column}
 .shell:has(#today:not(.hidden)) .top{flex:0 0 auto;padding-bottom:8px}
 .shell:has(#today:not(.hidden)) .layout{flex:1;min-height:0;display:flex;margin-top:8px}
 .shell:has(#today:not(.hidden)) .content{display:flex;flex-direction:column;min-height:0}
 #today{flex:1;min-height:0;display:flex;flex-direction:column}
 #today h1{font-size:28px;margin-bottom:3px}
 #today .date{font-size:14px}
 #today .cards{margin:8px 0;gap:5px;flex-shrink:0}
 #today .card{min-height:34px;padding:6px 12px}
 #today .card label{font-size:16px}
 #today>.record-actions{position:static;padding:0;gap:6px;flex-shrink:0}
 #today .record-actions>button{min-height:42px;padding:9px 12px}
 #today .hint{font-size:12px;margin:6px 0;line-height:1.4;flex-shrink:0}
 #today #transcriptPanel{display:flex;flex-direction:column;flex:1;min-height:70px;margin:0;padding:10px}
 #today #transcriptPanel .section-label{font-size:11px;flex-shrink:0;letter-spacing:.05em}
 #today #transcript{flex:1;min-height:0;height:100%;margin-top:6px;padding:10px;resize:none;overflow-y:auto;font-size:16px}
 #today #inputStatus{margin:3px 0 0;min-height:0;font-size:12px}
}

@media(max-width:700px){
 .mobile-nav{bottom:0!important;border:0;padding:6px 8px max(0px,env(safe-area-inset-bottom));background:#101725!important}
 [data-theme=light] .mobile-nav{background:#fff!important}
 .mobile-nav button{font-size:12px!important;min-height:60px!important}
 .shell:has(#today:not(.hidden)){padding-left:12px;padding-right:12px;padding-bottom:calc(72px + env(safe-area-inset-bottom))}
 #today .record-actions{gap:12px}
 #today .record-actions>button{min-height:46px;padding:11px 12px}
 #today #transcriptPanel{flex:1;max-height:190px}
}
.journey-reader:has(#review:not(.hidden)) .journey-date-header{display:none}
#review .review-sources,#review .review-prompt,#reviewProgress,#reviewStatus{display:none}
.review-picker{width:100%;padding:12px;margin:8px 0 16px;border:1px solid #cbd4df;border-radius:12px;background:transparent;color:inherit;font:inherit}
.reflection-messages{margin:20px 0;min-height:160px;max-height:45dvh;overflow-y:auto;line-height:1.7}
.reflection-message{padding:16px;border-radius:16px;background:#80808010;white-space:pre-wrap;margin:12px 0;overflow-wrap:anywhere}
.reflection-message.user{background:#b58b4622}
.reflection-notice{padding:14px;color:#8e713e;font-size:14px;line-height:1.7}
#reflectionChat input{padding:12px;border-radius:12px;border:1px solid #bcc7d5;background:transparent;color:inherit;font:inherit}
#reflectionChat textarea{min-height:90px;font-size:16px}
#reflectionForm button{margin-top:12px}

#reflectionChat{display:flex;flex-direction:column;min-height:60dvh}
#reflectionChat .reflection-messages{flex:1;min-height:0;max-height:none;margin:0;overflow:auto}
#reflectionChat .reflection-composer{display:flex;align-items:center;gap:8px;border-radius:32px;padding:8px 12px;background:#ffffff0d;box-shadow:0 3px 28px #00000008;margin-top:14px}
[data-theme=light] #reflectionChat .reflection-composer{background:#fff}
#reflectionChat #reflectionQuestion{flex:1;min-width:0;background:transparent;border:0;border-radius:0;padding:8px;font-size:16px;outline:0;color:inherit}
#reflectionChat .reflection-composer button{display:flex;align-items:center;justify-content:center;width:40px;min-height:40px;padding:8px;margin:0;border:0;background:transparent;color:inherit;border-radius:50%}
#reflectionChat .reflection-composer svg{width:24px;height:24px}
.shell:has(#reflectionChat:not(.hidden)) .footer{display:none}
@media(max-width:700px){
 .shell:has(#reflectionChat:not(.hidden)){height:100dvh;display:flex;flex-direction:column;padding-bottom:calc(76px + env(safe-area-inset-bottom))}
 .shell:has(#reflectionChat:not(.hidden)) .layout{flex:1;min-height:0;display:flex;margin-top:10px}
 .shell:has(#reflectionChat:not(.hidden)) .content{display:flex;flex-direction:column;min-height:0}
 #reflectionChat{flex:1;min-height:0}
}

.review-picker-row{display:flex;gap:10px;align-items:center}.review-picker-row .review-picker{flex:1;min-width:0;width:auto;font-size:16px;margin:8px 0 12px;min-height:46px}.review-picker-label{font-size:14px;color:#a38b62}

/* Fill the writing space and make the chat composer easier to see. */
@media(max-width:700px){
 #today #transcriptPanel{max-height:none;flex:1;min-height:150px;padding:10px;margin-bottom:0}
 #today #transcript{flex:1;min-height:110px;height:100%}
 .shell:has(#today:not(.hidden)){padding-bottom:calc(68px + env(safe-area-inset-bottom))}
}
#reflectionChat .reflection-composer{min-height:62px;padding:8px 12px;border:1px solid #ffffff40;background:#202c40;box-shadow:0 5px 28px #0002;gap:10px}
[data-theme=light] #reflectionChat .reflection-composer{border:1px solid #e0e4eb;background:#fff;box-shadow:0 5px 30px #26395816}
#reflectionChat #reflectionQuestion{font-size:18px;padding:10px 8px;line-height:1.5}
#reflectionChat #reflectionQuestion::placeholder{color:#8a95a6;opacity:1}
#reflectionChat .reflection-composer button{width:44px;min-height:44px;flex:0 0 44px}
#reflectionChat .reflection-composer svg{width:28px;height:28px}
#reflectionChat #reflectionSend{background:#b29461;color:#fff}
#reflectionChat .reflection-composer:focus-within{border-color:#b29461;box-shadow:0 0 0 2px #b294611c,0 5px 30px #26395814}

@media(max-width:700px){
 #today .cards{margin:6px 0;gap:4px}
 #today .card{padding-top:5px;padding-bottom:5px;min-height:32px}
 #today .hint{margin:5px 0}
 #today #transcriptPanel{min-height:170px}
}
#reflectionChat .reflection-composer{min-height:54px;padding:5px 10px;border-radius:28px;gap:8px}
#reflectionChat #reflectionQuestion{font-size:16px;padding:8px 6px}
#reflectionChat .reflection-composer button{width:40px;min-height:40px;flex-basis:40px}
#reflectionChat .reflection-composer svg{width:24px;height:24px}

@media(max-width:700px){
 #today h1{font-size:30px;margin-bottom:6px}
 #today .date{font-size:15px}
 #today .cards{margin:14px 0;gap:8px}
 #today .card{min-height:42px;padding:9px 14px}
 #today .card label{font-size:18px}
 #today .card .icon{font-size:20px}
 #today .record-actions{gap:12px;margin-top:2px}
 #today .record-actions>button{min-height:50px;padding:12px 14px;font-size:17px}
 #today .hint{margin:10px 0;font-size:13px;line-height:1.5}
 #today #transcriptPanel{flex:1;min-height:110px;max-height:280px;padding:10px}
 #today #transcript{min-height:70px}
}
@media(max-width:700px) and (max-height:740px){
 #today .cards{margin:10px 0;gap:6px}
 #today .card{min-height:38px;padding:7px 12px}
 #today .record-actions>button{min-height:44px;padding:9px 12px}
 #today .hint{margin:7px 0}
}

@media(max-width:700px){
 .mobile-nav{position:fixed!important;bottom:0!important;left:0;right:0;z-index:10}
 .shell:has(#today:not(.hidden)){padding-bottom:calc(94px + env(safe-area-inset-bottom))}
 .shell:has(#clarity:not(.hidden)){padding-bottom:calc(104px + env(safe-area-inset-bottom))}
}

#startFromClarity,.journey-date-header #journeyRecordDay{display:flex;align-items:center;justify-content:center;gap:12px;min-height:50px;padding:12px 18px;border:0;border-radius:15px;background:#ddc399;color:#172236;font-size:17px;font-weight:700;line-height:1.4;box-shadow:none}
#startFromClarity{width:100%;margin-top:18px}
.journey-date-header #journeyRecordDay{width:100%;justify-self:stretch}
#startFromClarity:hover,.journey-date-header #journeyRecordDay:hover{background:#f0d7ad}
@media(max-width:700px){
 #today>.record-actions{margin-left:-4px;margin-right:-4px}
 #today .record-actions>button{width:100%;min-height:52px;border-radius:15px}
}

.todo-fold-summary{display:flex;align-items:center;gap:8px;cursor:pointer;list-style:none;min-height:44px}
.todo-fold-summary::-webkit-details-marker{display:none}
.todo-fold-summary>.clarity-todo-heading,.todo-fold-summary>.journey-done-heading{flex:1;min-width:0;margin:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.todo-enable-switch{display:inline-flex;align-items:center;flex:0 0 44px;width:44px;height:26px;min-height:26px;padding:3px;border:0;border-radius:20px;background:#b7bec8;cursor:pointer}
.todo-enable-switch span{width:20px;height:20px;border-radius:50%;background:white;box-shadow:0 1px 3px #0002;transition:transform .15s}
.todo-enable-switch[aria-checked=true]{background:#b29461}
.todo-enable-switch[aria-checked=true] span{transform:translateX(18px)}
.todo-disabled .todo-fold-body,.todo-disabled #clarityTaskSort{display:none!important}
.todo-fold-body{padding-top:10px}
.todo-fold-summary:has(>.hidden){display:none}

.todo-fold-summary>.clarity-todo-heading,.todo-fold-summary>.journey-done-heading{flex-wrap:nowrap;gap:10px;width:100%}
.todo-fold-summary .todo-enable-switch{margin-right:auto}
.todo-fold-summary #clarityTaskSort,.todo-fold-summary .notes-copy{flex-shrink:0}
.todo-fold-summary .clarity-todo-heading h2,.todo-fold-summary .journey-done-heading h3{white-space:nowrap}
@media(max-width:360px){.todo-fold-summary>.clarity-todo-heading,.todo-fold-summary>.journey-done-heading{gap:6px}.todo-fold-summary #clarityTaskSort{width:40px}.todo-fold-summary .notes-copy{width:36px;flex-basis:36px;padding:6px}}

.today-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0}
.today-heading h1{margin:0!important}.journal-theme-control{position:relative;flex-shrink:0}
.journal-theme-button{display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:10px;border:0;border-radius:12px;background:transparent;color:inherit}
.journal-theme-button:hover{background:#b2946118}
.journal-theme-menu{position:absolute;top:calc(100% + 8px);right:0;min-width:210px;padding:8px;border:1px solid #ffffff28;border-radius:16px;background:#182338;box-shadow:0 12px 35px #0003;z-index:30}
.journal-theme-menu button{display:block;width:100%;min-height:46px;text-align:left;padding:12px 14px;border:0;border-radius:10px;background:transparent;color:inherit;font:inherit;white-space:nowrap}
.journal-theme-menu button[aria-checked=true]{background:#b2946126;color:#d2b17b}
[data-theme=light] .journal-theme-menu{background:#fff;border-color:#dce1e8}
[data-theme=light] .journal-theme-menu button[aria-checked=true]{color:#8a692f}
#today:not([data-journal-theme=default]) .card label{line-height:1.5;overflow-wrap:anywhere}
@media(max-width:700px){
 .today-heading{margin-bottom:6px}
 #today:not([data-journal-theme=default]) .card{min-height:42px;padding:8px 12px}
 #today:not([data-journal-theme=default]) .card label{font-size:16px}
 .shell:has(#today:not(.hidden):not([data-journal-theme=default])){height:auto;min-height:100dvh}
 #today:not([data-journal-theme=default]) #transcriptPanel{min-height:150px}
}

.reflection-prompts{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:8px 0 16px;flex-shrink:0}
.reflection-prompts button{display:flex;align-items:baseline;gap:10px;max-width:100%;padding:10px 12px;border:1px solid #ffffff20;border-radius:12px;background:#ffffff06;color:inherit;text-align:left;font:inherit;font-size:14px;line-height:1.6;cursor:pointer}
.reflection-prompts strong{flex-shrink:0;font-weight:600;color:#b29461}
.reflection-prompts span{overflow-wrap:anywhere}
.reflection-prompts button:hover,.reflection-prompts button:focus-visible{background:#b2946115;border-color:#b2946166}
[data-theme=light] .reflection-prompts button{background:#fafbfc;border-color:#e6e9ee}
@media(max-width:700px){.reflection-prompts button{font-size:13px;padding:8px 10px}.reflection-prompts{gap:6px;padding-bottom:10px}}

/* Slightly larger Today actions, with the same full-width layout. */
#today .record-actions>button{min-height:58px;padding:15px 16px;font-size:18px;line-height:1.4}

/* Three-line composer follows the visible viewport when the iOS keyboard opens. */
#reflectionChat .reflection-composer{min-height:112px;flex-shrink:0;padding:10px 12px;border-radius:26px;align-items:flex-end}
#reflectionChat #reflectionQuestion{height:90px;min-height:90px;max-height:90px;box-sizing:border-box;resize:none;overflow-y:auto;font-family:inherit;font-size:17px;line-height:24px;padding:9px 6px;margin:0;box-shadow:none}
#reflectionChat .reflection-composer button{margin-bottom:4px}
@media(max-width:700px){
 body.reflection-keyboard .mobile-nav{visibility:hidden;pointer-events:none}
 body.reflection-keyboard #reflectionChat .reflection-composer{position:fixed;left:14px;right:14px;bottom:calc(var(--reflection-keyboard-inset,0px) + 8px);z-index:30;margin:0}
 body.reflection-keyboard #reflectionChat{padding-bottom:124px}
}

/* One shared bottom anchor for all pages; no scroll-dependent positioning. */
@media(max-width:700px){
 .mobile-nav{height:auto;min-height:0;margin:0;padding:6px 8px min(16px,env(safe-area-inset-bottom,0px));align-items:center}
 .mobile-nav{position:fixed!important;top:auto!important;bottom:0!important;left:0;right:0;transform:none;transition:none;animation:none}
 .shell:has(#today:not(.hidden)){padding-bottom:calc(var(--mobile-nav-height,82px) + 26px)}
 .shell:has(#clarity:not(.hidden)){min-height:100dvh;padding-bottom:calc(var(--mobile-nav-height,82px) + 26px)}
}

/* Standalone iOS uses a stable full-screen anchor, not its initial short viewport. */
@media(max-width:700px) and (display-mode:standalone){
 .mobile-nav{top:calc(100lvh - var(--mobile-nav-height,82px))!important;bottom:auto!important;padding-bottom:28px}
 .shell:has(#today:not(.hidden)){height:100lvh}
 .shell:has(#clarity:not(.hidden)){min-height:100lvh}
}

/* One-line composer grows naturally with wrapped text and Return. */
#reflectionChat .reflection-composer{display:grid;grid-template-columns:minmax(0,1fr) auto;min-height:60px;padding:7px 12px;align-items:end;border-radius:28px}
#reflectionChat #reflectionQuestion{height:42px;min-height:42px;max-height:162px;padding:9px 6px;line-height:24px;font-size:18px;width:100%;overflow-y:hidden}
#reflectionChat .reflection-composer.multiline{border-radius:24px}
#reflectionChat .reflection-composer.multiline #reflectionQuestion{grid-column:1 / -1}
#reflectionChat .reflection-composer button{grid-column:2;justify-self:end;margin:0;align-self:end}
.reflection-prompts button{font-size:16px;line-height:1.6;padding:10px 12px}
@media(max-width:700px){
 .reflection-prompts button{font-size:16px;padding:9px 11px}
 body.reflection-keyboard #reflectionChat{padding-bottom:calc(var(--reflection-composer-height,60px) + 12px)}
}

.reflection-ai-status{font-size:12px;line-height:1.4;color:#8c97a8;margin:0 0 4px;flex-shrink:0}

/* CSS triangles avoid iOS emoji substitution in every disclosure state. */
#claritySummaryFold>summary,#journeySummarySection>summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;min-height:44px}
#claritySummaryFold>summary::-webkit-details-marker,#journeySummarySection>summary::-webkit-details-marker{display:none}
.todo-fold-summary:before,#claritySummaryFold>summary:before,#journeySummarySection>summary:before{content:'';display:block;width:15px;height:15px;flex:0 0 15px;margin:0;background:currentColor;clip-path:polygon(0 0,0 100%,100% 50%);transform:rotate(0deg)}
.todo-fold[open]>.todo-fold-summary:before,#claritySummaryFold[open]>summary:before,#journeySummarySection[open]>summary:before{width:17px;height:17px;flex-basis:17px;transform:rotate(90deg)}
.source-details:not([open])>summary::marker{font-size:12px}
.source-details:not([open])>summary::-webkit-details-marker{font-size:12px;width:12px;height:12px}
#journeySummarySection .journey-summary-title{margin:0;margin-right:auto}
#clarity .todo-fold{scroll-margin-top:16px}

/* Summary title and explicit edit action size. */
#journeySummarySection{--journey-summary-font-size:24px}
#journeyDayEdit{font-size:16px;line-height:1.3}
#journeyDayEdit,#journeyDayDelete{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 64px;width:64px;min-width:64px;height:44px;min-height:44px;padding:0!important;border-radius:12px}

/* Give Clarity cards more room while keeping the mobile safe area. */
#clarity .clarity-summary,#clarity .todo-panel,#journey .journey-workspace,#journey .reader-paper{border-width:.5px}
#journey .journey-browser{border-right-width:.5px;border-bottom-width:.5px}
@media(max-width:700px){
 .shell:has(#clarity:not(.hidden)),.shell:has(#journey:not(.hidden)){max-width:100%;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
}

/* Shared title reference; brand is 6px smaller after the latest reduction. */
:root{--today-title-size:36px}
#today h1{font-size:var(--today-title-size)}
.brand-block{min-width:0}
.brand{font-size:calc(var(--today-title-size) - 6px)}
.reflection-watermark{display:none;position:fixed;left:0;right:0;bottom:18px;text-align:center;font-family:Georgia,serif;font-size:14px;line-height:20px;letter-spacing:.025em;color:#d5ddea55;pointer-events:none;z-index:9}
body:has(#today:not(.hidden)) .reflection-watermark{display:block}
[data-theme=light] .reflection-watermark{color:#76839866}
@media(max-width:700px){
 :root{--today-title-size:30px}
 .top{flex-wrap:wrap}
 .brand-block{flex:0 0 auto}
 .reflection-watermark{bottom:calc(var(--mobile-nav-height,82px) + 4px);font-size:12px}
}
@media(max-width:700px) and (display-mode:standalone){
 .reflection-watermark{top:calc(100lvh - var(--mobile-nav-height,82px) - 24px);bottom:auto}
}

/* Shared reading size for diary output, reviews and real To Do labels. */
.output-text,.review-answer,.todo-item label,.todo-item .task-text,.reader-tasks label{font-size:var(--journal-output-size,17px)}

/* Journey title and local search share one left-aligned row. */
.journey-page-heading{justify-content:flex-start;gap:16px}
.journey-page-heading h1{flex:0 0 auto}
.journey-page-heading input[type=search]{margin-left:auto;flex:0 1 calc(13em + 24px);min-width:0;max-width:calc(13em + 24px);width:calc(13em + 24px);min-height:40px;padding:8px 12px;border:1px solid #ffffff29;border-radius:999px;background:transparent;color:inherit;font:inherit;font-size:16px;line-height:1.4;text-align:left}
.journey-page-heading input[type=search]::placeholder{color:#aab6c5;opacity:1}
[data-theme=light] .journey-page-heading input[type=search]{border-color:#dce1e8}
[data-theme=light] .journey-page-heading input[type=search]::placeholder{color:#59677a}
@media(max-width:700px){.journey-page-heading{gap:12px}.journey-page-heading input[type=search]{padding:8px 10px;font-size:16px}}

/* Fit the note editor to the keyboard-free viewport; scroll long text inside it. */
@media(max-width:700px){
 body.note-keyboard #journeyNoteBody{min-height:0;max-height:none;flex:none;overflow-y:auto;resize:none;scroll-margin:16px}
 body.note-keyboard .mobile-nav{visibility:hidden;pointer-events:none}
}
