/* AVERLINQ mobile design system — fast, accessible, offline. No network fonts. */
:root{--bg:#0c1520;--panel:#142431;--panel2:#1b3340;--text:#eaf7f3;--muted:#a7bec8;--line:#315061;--mint:#87edc0;--blue:#9cd6fe;--lav:#c3b7ff;--orange:#f3cb95;--radius:20px;--uiShadow:0 12px 36px #02101c35}
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
button,a,input,select,textarea,summary{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #8bffdb;outline-offset:3px}
button{touch-action:manipulation}
.panel{box-shadow:var(--uiShadow)}
.sidebar{background:linear-gradient(180deg,#111f2c,#0b1521)}
.sidebar .nav.active{background:#1d3f3e;color:#c1ffdf}
.brandmark{background:linear-gradient(135deg,#bdffe3,#66d5a8);border-radius:15px;box-shadow:0 8px 23px #58cfa32c}
.header{background:#101d2dc7;backdrop-filter:blur(12px)}
.headerSection{display:block;font-size:11px;color:var(--muted);font-weight:500;margin-top:2px}
main{max-width:1320px;margin-inline:auto}
.hero{background:radial-gradient(ellipse at 90% 0%,#367a65 0,transparent 48%),linear-gradient(115deg,#1a4540,#192f43 68%,#1e2440);border:1px solid #467669;box-shadow:0 15px 43px #05121d30;position:relative;overflow:hidden}
.hero h1{font-weight:800;letter-spacing:-1.2px}
.heroShortcuts{display:flex;flex-wrap:wrap;gap:9px;margin-top:12px}
.heroShortcuts button{min-height:44px;padding:10px 16px;border-radius:13px;font-weight:800}
.heroAdd{background:#c0ffdf;border:1px solid #dcffec;color:#0e4230}
.heroPlan{color:#e5fff3;background:#e5fff30e;border:1px solid #90d5b58a}
.primary{background:linear-gradient(150deg,#9ef3c9,#6cd9aa);color:#0b392e}
.chip,.statepill{background:#213b48;color:#c5dddf;border:1px solid #3d5e69}
.metric b,.statValue{font-variant-numeric:tabular-nums}
.dailyCockpit{background:linear-gradient(140deg,#193442,#142230);border-color:#3f7063}
.mealIdea:hover,.dailyTask:hover,.moreItem:hover{border-color:#71cba5}
.dailyRightNow{background:#1b3f3c;border-color:#4c866f}
.bottomNav{z-index:65}
.bottomNav>button.active{color:#a5f8ca!important;background:transparent!important}
.bottomNav .quickNav{font-weight:750;color:#d6f8df}
.bottomNav .quickNav span{width:49px;height:49px;border-radius:16px;background:linear-gradient(135deg,#c2ffe1,#6bd8a5);display:grid;place-items:center;color:#144635;font-size:29px;font-weight:800;box-shadow:0 8px 26px #39b98050;margin-top:-16px;line-height:1}
.bottomNav button{touch-action:manipulation}
.appDrawer[hidden]{display:none!important}
.appDrawer{position:fixed;inset:0;z-index:130;display:flex;justify-content:center;align-items:flex-end}
.drawerScrim{position:absolute;inset:0;background:#030a12ba;backdrop-filter:blur(5px)}
.drawerPanel{position:relative;width:min(550px,100%);max-height:min(93dvh,900px);overflow-y:auto;overscroll-behavior:contain;padding:9px 18px max(18px,env(safe-area-inset-bottom));background:linear-gradient(155deg,#1e3d44,#112232 55%);border:1px solid #3c6570;border-radius:25px 25px 0 0;box-shadow:0 -25px 75px #0008}
.drawerHandle{height:5px;width:43px;border-radius:25px;background:#77969c;margin:5px auto 18px}
.drawerHead{display:flex;align-items:start;justify-content:space-between;gap:12px;margin-bottom:18px}
.drawerHead h2{font-size:23px;letter-spacing:-.65px;margin:5px 0}
.drawerClose{background:#264550;color:#dff3ec;border:1px solid #426771;font-size:24px;border-radius:13px;min-width:44px;height:44px}
.drawerActive{overflow:hidden}
.quickGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0 19px}
.quickGrid>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:104px;padding:12px 5px;color:#eaf6f1;background:#1d3b43;border:1px solid #3a5a65;border-radius:16px}
.quickGrid>button .quickIcon{display:grid;place-items:center;height:35px;width:35px;font-size:23px;background:#2c6655;color:#b5f8d2;border-radius:12px;margin-bottom:4px}
.quickGrid>button b{font-size:13px}.quickGrid>button small{font-size:10px;color:#aac5c9}
.quickSubtitle{color:#cdece1;font-size:13px;margin-bottom:11px}
.recentFood{border:1px solid #375966;background:#172e3c;padding:12px;display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:left;color:var(--text);border-radius:13px;margin-bottom:8px;min-height:58px}
.recentFood strong,.recentFood small{display:block}.recentFood strong{font-size:13px}.recentFood small{font-size:11px;color:#a7c0c9}.recentFood>span:last-child{font-size:24px;color:var(--mint)}
.quickFooter{display:flex;gap:9px;flex-wrap:wrap;margin:17px 0}
.morePanel{max-height:94dvh}.moreSearch{display:block;color:#afc7cf;font-size:12px;margin-bottom:18px}.moreSearch input{margin-top:6px}
.moreGroup{margin:15px 0 22px}.moreGroup h3{font-size:11px;color:#96e9be;text-transform:uppercase;letter-spacing:1.7px;margin-bottom:10px}
.moreItem{display:flex;width:100%;align-items:center;gap:12px;min-height:62px;padding:9px 12px;margin-bottom:7px;border-radius:13px;color:var(--text);background:#1a3441;border:1px solid #315463;text-align:left}
.moreIcon{height:40px;width:40px;flex-shrink:0;border-radius:12px;background:#28544a;color:#a9f1ca;display:grid;place-items:center;font-size:21px}
.moreCopy{flex:1;min-width:0}.moreCopy strong,.moreCopy small{display:block}.moreCopy strong{font-size:13px}.moreCopy small{font-size:11px;color:#aec5cf}.moreItem>span:last-child{font-size:23px;color:#98b5bf}
.moreFooter{display:flex;gap:9px;flex-wrap:wrap;border-top:1px solid #3b5b67;padding-top:16px}
input,select,textarea{font-size:16px}
.uiPreferences p{font-size:12px}
@media(min-width:781px){.appDrawer{align-items:center}.drawerPanel{border-radius:24px;padding:24px;max-height:87vh}}
@media(max-width:780px){
.content{padding-bottom:calc(91px + env(safe-area-inset-bottom))}
.header{height:69px;padding:11px 18px}
.headDate{font-size:15px}
main{padding:16px 13px calc(45px + env(safe-area-inset-bottom))}
.hero{min-height:170px;padding:23px;border-radius:21px;margin-bottom:12px}
.hero h1{font-size:clamp(25px,6vw,32px)}
.hero p{font-size:12px}
.heroOrb{width:95px;height:95px;flex-basis:95px}
.heroShortcuts{margin-top:9px}
.grid3{gap:9px}.grid3>.panel{padding:15px}
.metric b{font-size:30px}
.dailyChecklist{gap:7px}
.dailyTask{min-height:85px;padding:11px;border-radius:13px}
.bottomNav{height:calc(73px + env(safe-area-inset-bottom));padding:7px 8px calc(8px + env(safe-area-inset-bottom));background:#101e2df2;backdrop-filter:blur(18px);border-top:1px solid #40616a;box-shadow:0 -8px 27px #0004}
.bottomNav button{width:20%;min-height:51px;margin:0;padding:4px;font-size:10px;gap:2px}
.bottomNav button span{font-size:22px}
.toast{z-index:160;bottom:calc(88px + env(safe-area-inset-bottom))}
}
@media(max-width:430px){
.heroOrb{display:none}
.hero{min-height:165px;padding:20px}
.dailyChecklist{grid-template-columns:repeat(2,minmax(0,1fr))}
.quickGrid>button{min-height:99px}
.hero h1{font-size:27px}
}
@media(max-height:560px){.drawerPanel{max-height:98dvh}.bottomNav{height:65px}}
@media(max-width:780px){body.keyboardActive .bottomNav{display:none}}
/* Light theme */
:root[data-theme="light"]{--bg:#f2f6f6;--panel:#fff;--panel2:#f4f8f8;--line:#d8e5e3;--text:#1b3540;--muted:#506875;--mint:#146f50;--lav:#5746b9;--blue:#205f95;--radius:19px;--uiShadow:0 7px 26px #254a5213}
:root[data-theme="light"] body,:root[data-theme="light"] html{background:var(--bg);color:var(--text)}
:root[data-theme="light"] .sidebar,:root[data-theme="light"] .header{background:#eaf2f2}
:root[data-theme="light"] .panel{background:#fff;border-color:#d8e5e4;color:var(--text)}
:root[data-theme="light"] .sectionHead p,:root[data-theme="light"] .panel p{color:#56707c}
:root[data-theme="light"] .hero{background:linear-gradient(130deg,#21645b,#143f53);color:#fff}
:root[data-theme="light"] .hero p{color:#d8f7f0}
:root[data-theme="light"] .hero h1,:root[data-theme="light"] .hero .eyebrow{color:#fff}
:root[data-theme="light"] .dailyCockpit{background:#f7fbfa}
:root[data-theme="light"] .dailyTask,:root[data-theme="light"] .mealIdea,:root[data-theme="light"] .estimate,:root[data-theme="light"] .nutritionGap{background:#edf6f4;color:#1e3e45;border-color:#c6dcd6}
:root[data-theme="light"] .dailyTask b,:root[data-theme="light"] .mealIdea h3,:root[data-theme="light"] .mealIdeaStats,:root[data-theme="light"] .dailyTask>small{color:#234b47}
:root[data-theme="light"] .dailyRightNow{background:#d9f2e8;color:#184d3d;border-color:#a8d9bf}
:root[data-theme="light"] .dailyRightNow b,:root[data-theme="light"] .dailyRightNow strong{color:#144d3b}
:root[data-theme="light"] input,:root[data-theme="light"] select,:root[data-theme="light"] textarea{background:#fff;color:#163741;border-color:#c4d5d8}
:root[data-theme="light"] .secondary,:root[data-theme="light"] .fileButton{background:#edf5f5;color:#21535b;border-color:#b4d0d0}
:root[data-theme="light"] .bottomNav{background:#fff;border-color:#cddfdf}
:root[data-theme="light"] .bottomNav button{color:#536e75}
:root[data-theme="light"] .bottomNav button.active{color:#126b51!important}
:root[data-theme="light"] .drawerPanel{background:#f7fbfa;color:#183a42}
:root[data-theme="light"] .drawerPanel .eyebrow{color:#166f54}
:root[data-theme="light"] .moreItem,:root[data-theme="light"] .recentFood,:root[data-theme="light"] .quickGrid>button{background:#e7f2f1;color:#23434b;border-color:#c3d8d7}
:root[data-theme="light"] .moreCopy small,:root[data-theme="light"] .recentFood small,:root[data-theme="light"] .quickGrid small{color:#536e78}
:root[data-theme="light"] .drawerClose{background:#ddeeed;color:#22525b;border-color:#bad4d2}
:root[data-theme="light"] .onboardingManage,:root[data-theme="light"] .uiPreferences{background:#fff}
/* Habit learning cards — facts distinguished from guesses */
.learningCard{background:linear-gradient(150deg,#142d37,#152230);border-color:#36595b}
.learningCard .panelTop{flex-wrap:wrap}
.learningCard .panelTop h2{font-size:18px;margin:5px 0 0}
.learningCard>p{margin:10px 0}
.learningMetrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:17px 0 15px}
.learningItem{border:1px solid #355361;background:#1b3740;border-radius:13px;padding:12px;min-width:0}
.learningItem span,.learningItem b,.learningItem small{display:block}
.learningItem span{font-size:11px;color:#aac7cb}
.learningItem b{font-size:17px;color:#c5f8dd;margin:7px 0 4px}
.learningItem small{font-size:10px;color:#94afbc}
.learningProposal{border:1px solid #497666;background:#1b403f;border-radius:12px;padding:13px;margin-bottom:9px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.learningProposal strong,.learningProposal small{display:block}
.learningProposal strong{color:#e4fff2;font-size:13px}
.learningProposal small{color:#a6c5bc;font-size:11px;margin-top:5px}
.habitControls{border-top:1px solid #315463;padding-top:12px;margin-top:13px}
.habitControls summary{color:#b8f0d5}
.quietControls{padding:4px 0 8px}
.quietControls h3{font-size:13px;color:#dceeea;margin:12px 0 8px}
.quietControls p{font-size:12px}
.quietControls label{font-size:12px;color:#b8d0d1}
.quietControls input,.quietControls select{margin-top:6px}
.quietControls .formRow{margin:9px 0}
.quietRow{border-bottom:1px solid #2d4a52;padding:9px 0;display:flex;justify-content:space-between;align-items:center;gap:7px;font-size:12px}
@media(max-width:760px){.learningMetrics{gap:6px}.learningItem{padding:10px}.learningItem b{font-size:15px}.learningProposal{display:block}.learningProposal .buttonRow{margin-top:11px}}
:root[data-theme="light"] .learningCard{background:#fff}
:root[data-theme="light"] .learningItem,:root[data-theme="light"] .learningProposal{background:#edf6f3;color:#1e5149;border-color:#b9dacf}
:root[data-theme="light"] .learningItem b,:root[data-theme="light"] .learningProposal strong{color:#165b45}
:root[data-theme="light"] .learningItem span,:root[data-theme="light"] .learningItem small,:root[data-theme="light"] .learningProposal small{color:#436d68}

/* Light appearance: fix dark-background legacy modules to maintain legible text */
:root[data-theme="light"] .mission,:root[data-theme="light"] .logitem,:root[data-theme="light"] .evidenceCard,
:root[data-theme="light"] .evidenceList article,:root[data-theme="light"] .reviewLine,:root[data-theme="light"] .exerciseGuide,
:root[data-theme="light"] .weekDay,:root[data-theme="light"] .adaptiveDay,:root[data-theme="light"] .adaptiveExercise,
:root[data-theme="light"] .microCell,:root[data-theme="light"] .mealCard,:root[data-theme="light"] .coachHistoryEntry,
:root[data-theme="light"] .programDay,:root[data-theme="light"] .priceRow,:root[data-theme="light"] .quietRow,
:root[data-theme="light"] .stretchMove,:root[data-theme="light"] .mediaDetail,
:root[data-theme="light"] .panel .estimate,:root[data-theme="light"] .panel .featureTextarea{
background:#eef7f5!important;color:#1d4143!important;border-color:#c6dddb!important
}
:root[data-theme="light"] .mission strong,:root[data-theme="light"] .logitem strong,
:root[data-theme="light"] .evidenceCard h3,:root[data-theme="light"] .exerciseGuide h3,
:root[data-theme="light"] .weekDay b,:root[data-theme="light"] .adaptiveDay strong,
:root[data-theme="light"] .microCell strong,:root[data-theme="light"] .reviewLine,
:root[data-theme="light"] .coachHistoryEntry strong,:root[data-theme="light"] .stretchMove h3{
color:#174b42!important
}
:root[data-theme="light"] .mission small,:root[data-theme="light"] .logitem small,
:root[data-theme="light"] .evidenceCard p,:root[data-theme="light"] .adaptiveDay small,
:root[data-theme="light"] .adaptiveDay span,:root[data-theme="light"] .coachHistoryEntry p,
:root[data-theme="light"] .stretchMove p,:root[data-theme="light"] .microCell small{
color:#456a70!important
}
:root[data-theme="light"] .researchLink{color:#125e48;background:#e3f4ee;border-color:#a7d3bd}
:root[data-theme="light"] .notice{background:#fff0ce;color:#6b4b18}
:root[data-theme="light"] .panel .evidenceSources .researchLink{color:#145f49}
:root[data-theme="light"] .learningCard .muted{color:#536e76}
:root[data-theme="light"] .intakeContainer{background:linear-gradient(145deg,#163342,#14293a);color:#ebf9f2}
:root[data-theme="light"] .intakeContainer .intakeField{color:#c0d8df}
:root[data-theme="light"] .intakeContainer input,:root[data-theme="light"] .intakeContainer select{background:#1b3441;color:#eff9f2;border-color:#4a6674}
:root[data-theme="light"] .intakeReview{background:#1e3c48}
:root[data-theme="light"] .intakeReview b{color:#b1f6d3}
:root[data-theme="light"] .intakeReview span{color:#e7f8f4}
/* Dated journal corrections and accessible history controls */
.histDate{display:flex;align-items:end;gap:9px;flex-wrap:wrap;margin-bottom:17px}
.histDate label{min-width:170px;flex:1;max-width:260px}
.histDate button{min-height:43px;font-size:18px}
.histMetrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;margin:14px 0 21px}
.histMetric{min-width:0;background:#1b3541;padding:13px;border:1px solid #365660;border-radius:12px}
.histMetric small,.histMetric strong{display:block}
.histMetric small{font-size:10px;color:#abc8ca}
.histMetric strong{font-size:16px;margin-top:6px;color:#ceffe2;overflow-wrap:anywhere}
.histItem{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #315062;background:#182f3e;padding:13px;border-radius:12px;margin:8px 0}
.histItem strong,.histItem small{display:block}
.histItem strong{font-size:13px;color:#edf9f6}
.histItem small{margin-top:4px;font-size:11px;color:#a2bbc3}
.histItem .buttonRow{flex-shrink:0;gap:6px}
#editHistory{border-color:#63b18e}
#editHistory label{font-size:12px}
#editHistory input,#editHistory select{font-size:16px}
:root[data-theme="light"] .histMetric,:root[data-theme="light"] .histItem{background:#eef7f4;border-color:#bfd9ce}
:root[data-theme="light"] .histMetric strong,:root[data-theme="light"] .histItem strong{color:#13513c}
:root[data-theme="light"] .histMetric small,:root[data-theme="light"] .histItem small{color:#4a6b70}
@media(max-width:820px){.histMetrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:450px){.histMetrics{grid-template-columns:repeat(2,minmax(0,1fr))}.histDate{gap:6px}.histDate label{max-width:none;flex:1 0 55%}.histItem{flex-direction:column;align-items:stretch}.histItem .buttonRow{justify-content:flex-end}}
