/* A Little Space — the one accessibility and readability sheet.
   Consolidated Nov 20, 2026: this file holds the single copy of the
   rules that used to be pasted into theme.css and nine pages, plus
   the panel, close-button, and contrast fixes from the site repair.
   It is linked last on every page so these rules win ties. */

/* Site-wide accessibility refresh, Nov 20, 2026. */
:root{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html[data-theme="dark"]{--als-readable-ink:#f2f8f3;--als-readable-muted:#d9eadd}
html[data-theme="light"]{--als-readable-ink:#193b2a;--als-readable-muted:#365747}
html[data-theme="dark"] #startPop :is(.small,.hint,p,small,label,summary,h3,h2),
html[data-theme="dark"] #backPop :is(.small,p,small,label,h3,h2),
html[data-theme="dark"] #coolQuest :is(.cqhint,.cqeyebrow,p,small,h2,summary),
html[data-theme="dark"] :is(#amPop,#eodPop,#maPop,#forkSheet,#fjWelcome,#popCard) :is(.small,.hint,small,p,label,summary,h2,h3,h4),
html[data-theme="dark"] :is(#topAdd,#colorNutrition,#fjTargetPanel,#fjQuickTips,#fjCoachingCollapsed,#fjNutritionFirst) :is(>p,>label,>small,>summary,>h2,>h3),
html[data-theme="dark"] #startPop #sleepLine {color:#e2f0e6!important;opacity:1!important;text-shadow:none!important}
html[data-theme="dark"] #startPop .sp-card{background:#16263f!important;border:2px solid #33507a!important;color:#eef4fb!important}
html[data-theme="dark"] #startPop .sp-card :is(p.small,#sleepLine){color:#dcebdd!important;opacity:1!important}
html[data-theme="dark"] #startPop .sp-card h3{color:#f6f8f0!important}
html[data-theme="dark"] #topAdd>p.small,html[data-theme="dark"] #topAdd>section>details>summary {color:#dcebdd!important;opacity:1!important}
html[data-theme="dark"] .sf-door-name, html[data-sf-sky="night"] .sf-door-name{color:#fff!important;text-shadow:0 1px 3px #071c13!important;opacity:1!important}
html[data-theme="dark"] #topAdd :is(#als-usuals,#fjFoodConfirm),html[data-theme="dark"] #topAdd :is(#als-usuals,#fjFoodConfirm) :is(label,p,span,small,strong,h2,h3,summary){color:#183b28!important;opacity:1!important}
html[data-theme="dark"] #fjFoodConfirm :is(label,p,span,small,strong,h2,h3,summary){color:#183b28!important}
html[data-theme="dark"] :is(.panel,.card,.sp-card,.ep-panel) :is(.small,.hint){opacity:1!important}
html[data-theme="dark"] #startPop #energyFeedback{color:#f3f8ef!important}
html[data-theme="dark"] #startPop #spPainDetails:not([hidden]){border:1px solid #7e9f87!important;background:#203c2e!important;padding:14px!important;border-radius:12px}
html[data-theme="dark"] :is(#startPop,#backPop,#coolQuest,#amPop,#eodPop,#maPop,#forkSheet,#fjWelcome,#popCard) :is(input,textarea,select){background:#fff!important;color:#193b2a!important;border-color:#8bb49a!important}
html[data-theme="dark"] :is(#startPop,#backPop,#coolQuest,#amPop,#eodPop,#maPop,#forkSheet,#fjWelcome,#popCard) :is(input,textarea)::placeholder{color:#506c58!important;opacity:1!important}
html[data-theme="light"] :is(input,textarea)::placeholder{color:#526d59!important;opacity:1!important}
body :is(button,input,select,textarea){font-size:max(16px,1rem)}
body :is(button,[role="button"]){min-height:44px}
body :is(.small,.hint,small){font-size:max(15px,.91rem);line-height:1.55}
body :is(button,a,input,textarea,select,summary,[role="button"]):focus-visible{outline:3px solid #eec66d!important;outline-offset:3px}
html[data-theme="dark"] .brand{color:#d2f5e0!important}
.als-site-modal-close{
position:absolute!important;z-index:9999!important;top:12px!important;right:12px!important;
width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;
display:flex!important;justify-content:center!important;align-items:center!important;
margin:0!important;padding:0!important;border-radius:50%!important;
background:#f4f8f1!important;color:#193d2b!important;border:2px solid #819f8a!important;
font-size:27px!important;font-weight:750!important;line-height:1!important;
box-shadow:0 2px 10px #0002!important;touch-action:manipulation!important;
}
.als-site-modal-close:hover{background:#fff!important}
.als-site-modal-host{position:relative!important}
#startPop>.sp-card,#fjWelcome>.panel,#maPop>.ep-panel,#forkSheet>.ep-panel,#amPop>.ep-panel,#eodPop>.ep-panel,#backPop>.bp-card,#coolQuest>.cqcard{padding-top:max(60px, 1.1rem)!important}
#startPop .sp-card .als-site-modal-close{top:14px!important}
#coolQuest .cqtop [data-cq="close"]{display:none!important}
@media(max-width:640px){
body :is(p,li,label,summary,button){line-height:1.55}
#startPop .sp-card{padding:64px 16px 24px!important}
#startPop .sp-card .row{gap:10px!important}
#startPop #spNoPain,#startPop #spShowPain{font-size:16px!important;min-height:48px!important}
#startPop .als-site-modal-close{top:9px!important;right:10px!important}
#topAdd #topSearch{font-size:17px!important;min-height:48px}
}

html[data-theme="dark"] main .panel,html[data-theme="dark"] main .card{background-color:rgba(22,38,63,.82)!important;color:#f1f8f0!important;border-color:#33507a!important}
html[data-theme="dark"] main :is(.panel,.card) :is(h1,h2,h3,h4,label,summary,p:not(.als-habit-note),strong,small,.small,.hint){color:#eef7ef!important;opacity:1!important;text-shadow:none!important}
html[data-theme="dark"] main :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){background:#fff!important;color:#163b29!important;border-color:#84a68e!important}
html[data-theme="light"] main :is(.panel,.card) :is(p:not(.als-habit-note),small,.small,.hint){color:#315240!important;opacity:1!important}
html[data-theme="light"] main :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){background:#fff!important;color:#153b28!important;border-color:#86a58f!important}
main :is(button,a,input,select,summary):focus-visible{outline:3px solid #eec66d!important;outline-offset:3px}
main :is(.small,.hint){font-size:max(14px,.875rem);line-height:1.5}

/* --- Consolidated in the Nov 20, 2026 repair: one copy of each rule. --- */

/* The generated close button from the shared dialog harmonizer and the
   two native Food Journal close buttons get the same single look as
   .als-site-modal-close above. */
.als-unified-generated-close{
position:absolute!important;z-index:9999!important;top:12px!important;right:12px!important;
width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;
display:flex!important;justify-content:center!important;align-items:center!important;
margin:0!important;padding:0!important;border-radius:50%!important;
background:#f4f8f1!important;color:#193d2b!important;border:2px solid #819f8a!important;
font-size:27px!important;font-weight:750!important;line-height:1!important;
box-shadow:0 2px 10px #0002!important;touch-action:manipulation!important;
}
.als-unified-generated-close:hover{background:#fff!important}
#maPop>.ep-panel>#maPopX{
position:absolute!important;z-index:9999!important;top:12px!important;right:12px!important;
width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;max-width:44px!important;max-height:44px!important;
display:flex!important;justify-content:center!important;align-items:center!important;
margin:0!important;padding:0!important;border-radius:50%!important;
background:#f4f8f1!important;color:#193d2b!important;border:2px solid #819f8a!important;
font-size:27px!important;font-weight:750!important;line-height:1!important;
box-shadow:0 2px 10px #0002!important;touch-action:manipulation!important;
}
#forkSheet>.ep-panel>#forkSheetX{
position:absolute!important;z-index:9999!important;top:12px!important;right:12px!important;
width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;
display:flex!important;justify-content:center!important;align-items:center!important;
margin:0!important;padding:0!important;border-radius:50%!important;
background:#f4f8f1!important;color:#193d2b!important;border:2px solid #819f8a!important;
font-size:27px!important;font-weight:750!important;line-height:1!important;
box-shadow:0 2px 10px #0002!important;touch-action:manipulation!important;float:none!important;transform:none!important;
}
.als-unified-popup-host{position:relative!important}
.als-unified-close-hidden{display:none!important}

/* One dialog panel rule for the whole site: the panel scrolls inside
   the viewport, with room for the bottom dock and the safe area. */
:is(#maPop,#forkSheet,#startPop,#coolQuest,#backPop,#fjWelcome,#popCard,#amPop,#eodPop,[role="dialog"],[role="alertdialog"],[aria-modal="true"],dialog) :is(.ep-panel,.sp-card,.cqcard,.bp-card,.panel,.modal-card,.modal-content,.dialog-content){
max-height:calc(100dvh - 136px - env(safe-area-inset-bottom,0px))!important;
overflow-y:auto;scroll-padding-bottom:60px;padding-bottom:max(42px,env(safe-area-inset-bottom,0px) + 32px);
}
@media (max-height:550px){
:is(#maPop,#forkSheet,#startPop,#coolQuest,#backPop,#fjWelcome,#popCard,#amPop,#eodPop,[role="dialog"],[role="alertdialog"],[aria-modal="true"],dialog) :is(.ep-panel,.sp-card,.cqcard,.bp-card,.panel,.modal-card,.modal-content,.dialog-content){
max-height:calc(100dvh - 104px - env(safe-area-inset-bottom,0px))!important;
}
}
/* The Journal's reminder card keeps its own height limit. */
#popCard{box-sizing:border-box;bottom:calc(100px + env(safe-area-inset-bottom));max-height:65dvh;overflow-y:auto}

/* The background page stays still only while a pop-up is open. */
body:has(#eodPop:not([hidden]),#amPop:not([hidden]),#maPop:not([hidden]),#forkSheet:not([hidden]),#fjWelcome:not([hidden]),#startPop.show,#backPop.show,#coolQuest.show){overflow:hidden}

/* Home in dark mode: the daily shell's words get colors that read on
   the dark green the shell paints. */
html[data-theme="dark"] #dailyHome{color:#e9f1ea}
html[data-theme="dark"] #dailyHome .kicker{color:#9fd3ae}
html[data-theme="dark"] #dailyHome .lead{color:#c8d8cb}
html[data-theme="dark"] .daily-date{color:#cfe2d3}
html[data-theme="dark"] .daily-eyebrow{color:#cfe2d3}
html[data-theme="dark"] .daily-subtle{color:#b9d2bf}
.daily-subtle{color:#47634f}

/* Move: helper text outside the dark panels washes out on the light
   page background; darken it there. Panels keep their light text. */
html[data-theme="light"].als-move-page .small{color:#476354}
/* The workout target box is a dark surface of its own in both themes;
   its small print takes the pale muted ink instead. */
html[data-theme="light"].als-move-page .tgt .small{color:#a9bcab}
html[data-theme="light"].als-move-page .band .small{color:#a9bcab}

/* Mood Journal: the small caps label over the reminder card. */
.popcard .poplab{color:#476338}
html[data-theme="dark"] .popcard .poplab{color:#b7d3a8}

/* Home quick chips meet the same 44px touch target as buttons. */
.quick a,.mini-links a{min-height:44px;display:inline-flex;align-items:center}

/* One focus color everywhere, including the two link rows that had
   their own. */
#als-door-guide a:focus-visible,.als-related-links a:focus-visible{outline-color:#eec66d!important}

/* Reveal buttons on a night sky (Nov 20, 2026, preview audit): the
   "show more" buttons from the calm and simple layers take the night
   surface colors whenever the sky is night, in either theme, so they
   never sit pale and washed out on the dark scene. */
html[data-sf-sky="night"] .als-basic-reveal, html[data-sf-sky="night"] .als-calm-reveal{background:#16263f!important;border-color:#33507a!important;color:#e9f1ea!important}

/* Current-space label on a night sky (Nov 20, 2026, preview audit):
   scroll-story.css makes the switcher bar transparent over the night
   scene, so the label takes the pale night color in either theme. */
html.ss-bg-on[data-sf-sky="night"] .als-space-where{color:#eaf6ed!important}

/* The Food Journal's own close control stays reachable (Nov 20, 2026,
   Graham: always be able to minimize what expanded). The simple layer
   tags "Back to your day" as a secondary extra and hides it; it is the
   add panel's bottom close button, not an extra. */
#topAdd #doneAdd{display:block!important}

/* Brand on the light top bar over a night sky (Nov 20, 2026 sweep):
   the teal logotype measured 4.15:1 on the translucent bar; the darker
   green clears AA and matches the bar's day color family. */
html[data-theme="light"].ss-bg-on[data-sf-sky="night"] .top .brand{color:#1c473e!important}

/* Workout notes that sit directly on the scene (Nov 20, 2026 sweep):
   #ouraReady, #buddyNote and the touch hint are loose text over the
   sky, so at night they take the pale scene color in either theme. */
html.als-move-page.ss-bg-on[data-sf-sky="night"] #ouraReady,
html.als-move-page.ss-bg-on[data-sf-sky="night"] #buddyNote,
html.als-move-page.ss-bg-on[data-sf-sky="night"] .touchhint{color:#d8ead9!important}
html.als-move-page.ss-bg-on[data-sf-sky="night"] #ouraReady a{color:#9adbbd!important}
html.als-move-page.ss-bg-on[data-sf-sky="night"] footer,
html.als-move-page.ss-bg-on[data-sf-sky="night"] footer :is(p,span,small,div){color:#d8ead9!important}

/* Tovala fridge card in the dark theme (Nov 20, 2026 sweep): the card
   stays light, but a dark-theme heading rule paints its text pale.
   Its own ink is #25483d; keep the whole card on it. */
html[data-theme="dark"] #tovalaFridgeInventory :is(h2,h3,p,small,span,li,label,strong){color:#25483d!important}

/* Liquid glass tab bar (Nov 21, 2026, Graham's ask): transparent glass, bright edge, glass slider pill. This sheet loads on every main page, so the bar's final look lives here. */
#appTabs{position:fixed;left:10px;right:10px;bottom:max(10px,env(safe-area-inset-bottom));z-index:120;max-width:700px;margin:0 auto;display:flex;gap:8px;padding:8px;background:linear-gradient(180deg,rgba(255,255,255,.40),rgba(255,255,255,.16))!important;-webkit-backdrop-filter:blur(20px) saturate(1.6);backdrop-filter:blur(20px) saturate(1.6);border:1px solid rgba(255,255,255,.55);border-radius:26px;box-shadow:0 10px 34px rgba(9,20,38,.28),inset 0 1px 0 rgba(255,255,255,.65)}
#appTabs a{flex:1;text-align:center;padding:12px 4px;border-radius:16px;color:#14273f!important;text-decoration:none;font-weight:700;font-size:clamp(.78rem,3.5vw,1.02rem);text-shadow:none!important;position:relative;z-index:1}
#appTabs a.on{background:transparent!important;color:#0b1c30!important}
#appTabs .glassPill{position:absolute;top:8px;bottom:8px;left:0;width:0;border-radius:16px;background:linear-gradient(180deg,rgba(255,255,255,.78),rgba(255,255,255,.42))!important;border:1px solid rgba(255,255,255,.85);box-shadow:0 4px 14px rgba(9,20,38,.18),inset 0 1px 0 rgba(255,255,255,.9)}

/* Removed at Graham's word, Nov 21, 2026: the door switcher strip and the day/night toggle never show. */
.sf-door-switcher{display:none!important}
.als-theme-toggle,.als-theme-row,.als-theme-top{display:none!important}
