:root{--bg:#101720;--card:#192631;--surface:#192631;--sub:#223340;--surface2:#223340;--line:#354959;--stroke:#354959;--text:#f1f6f7;--ink:#f1f6f7;--muted:#9aafbd;--accent:#99d7c3;--ui-page-space:16px;--ui-top:12px;--ui-radius:16px;--ui-button:#263b49;--ui-selected:#547d76}
html,body{background:var(--bg)!important;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea,[contenteditable=true]{-webkit-user-select:text!important;user-select:text!important;-webkit-touch-callout:default!important}
button{touch-action:manipulation}button:disabled{opacity:.3;cursor:default}button:focus-visible{outline:2px solid #99d7c3;outline-offset:2px}
body[data-v2-page] main.page,body[data-v2-page] main.app,body[data-v2-page=analysis] main{padding-top:calc(var(--ui-top) + env(safe-area-inset-top,0px))!important;padding-left:var(--ui-page-space)!important;padding-right:var(--ui-page-space)!important;max-width:560px}
body[data-v2-page=ai] main.app{padding-left:0!important;padding-right:0!important}
body[data-v2-page=ai] .appHead{padding:0 var(--ui-page-space)!important}
.v2-unified-head{display:grid!important;grid-template-columns:minmax(0,1fr) 72px;grid-template-rows:30px 30px;column-gap:8px!important;row-gap:0!important;height:60px!important;min-height:60px!important;margin:0 0 16px!important;padding:0!important;align-items:center!important;flex-shrink:0}
.v2-unified-brand{grid-column:1;grid-row:1/3;gap:10px!important;min-width:0}
.v2-unified-icon{width:48px!important;height:48px!important;flex-basis:48px!important;border-radius:15px}
.v2-unified-title{gap:4px;min-width:0}.v2-unified-title h1{font-size:23px!important;white-space:nowrap}.v2-unified-title p{font-size:11px!important;white-space:nowrap;letter-spacing:-.025em!important}
.v2-unified-actions{grid-column:2;grid-row:2;justify-content:flex-end;gap:5px!important}
.v2-unified-head .iconButton{width:30px!important;min-width:30px!important;height:28px!important;min-height:28px!important;border:1px solid var(--line);border-radius:9px;background:var(--sub);padding:0!important;display:grid;place-items:center}
.v2-sync-pill{grid-column:2;grid-row:1/3;justify-self:end;display:flex;align-items:center;gap:5px;padding:6px 7px;border:1px solid #607078;border-radius:999px;background:#24333e;color:#c7d3da;white-space:nowrap;font:600 10px -apple-system,sans-serif;min-height:27px}
.v2-unified-head:has(.v2-unified-actions) .v2-sync-pill{grid-row:1}
.v2-sync-dot{height:6px;width:6px;border-radius:50%;background:#a4afb5;display:inline-block}
.v2-date-bar{display:grid!important;grid-template-columns:38px minmax(0,1fr) 38px;align-items:center;gap:8px!important;padding:9px!important;background:var(--card)!important;border:1px solid var(--line)!important;border-radius:var(--ui-radius)!important;margin:0 0 14px!important;min-height:58px;flex-shrink:0}
.v2-date-bar>button{height:38px!important;min-height:38px!important;width:38px!important;min-width:0!important;max-width:none!important;border:1px solid var(--line)!important;border-radius:11px!important;background:var(--ui-button)!important;color:var(--text)!important;margin:0!important;padding:0!important;font-size:20px!important;line-height:1.2!important}
.v2-date-bar>button.v2-date-trigger{width:100%!important;display:flex!important;align-items:center;justify-content:center;gap:7px!important;font-size:14px!important;font-weight:700!important;white-space:nowrap;overflow:hidden}
.v2-date-trigger svg{width:16px;height:16px;flex-shrink:0}.v2-date-trigger strong,.v2-date-trigger span{font-size:14px!important;line-height:1.2!important;font-weight:700!important;position:static!important;transform:none!important}.v2-date-trigger small{display:none!important}
body[data-v2-page=ai] .daystrip{margin-left:16px!important;margin-right:16px!important}
body[data-v2-page=ai] .composeShell{padding-left:5px!important;padding-right:5px!important}
.table-wrap,.detail-table,.daily-table{background:var(--card)!important}.detail-table th,.daily-table th{background:var(--sub)!important}.detail-table td,.daily-table td{background:transparent!important;border-color:var(--line)!important}
.switch,.switcher,.tooltabs,.daily-mode{background:var(--sub);border-color:var(--line);border-radius:14px}.switch button.on,.switcher button.active,.tooltabs button.active{background:#3b565f;color:#f1f6f7}
.modal,.sheet,.confirm-inner,.photo-shell{background:var(--card);border-color:var(--line)}
.v2-calendar-backdrop{position:fixed;inset:0;z-index:1000;background:#050b10b8;display:grid;place-items:center;padding:18px;opacity:0;transition:opacity .2s ease}.v2-calendar-backdrop[hidden]{display:none!important}.v2-calendar-backdrop.visible{opacity:1}
.v2-calendar{box-sizing:border-box;width:min(100%,390px);max-height:calc(100dvh - 36px);overflow-y:auto;background:#1c2c39;border:1px solid #455968;border-radius:22px;padding:16px;box-shadow:0 20px 60px #0009;transform:translateY(12px) scale(.985);transition:transform .2s ease;color:var(--text)}.visible>.v2-calendar{transform:none}
.v2-calendar-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:15px}.v2-calendar-heading strong{font-size:15px}.v2-calendar-heading button{width:36px;height:34px;border:0;border-radius:10px;background:#304250;color:var(--text);display:grid;place-items:center}.v2-calendar svg{width:18px;height:18px}
.v2-calendar-week,.v2-calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}.v2-calendar-week{font-size:11px;color:#91a9b7;margin-bottom:7px}.v2-calendar-week span{height:25px;display:grid;place-items:center}
.v2-calendar-view{overflow:hidden;touch-action:pan-y}.v2-calendar-track{display:flex;transform:translate3d(-100%,0,0)}.v2-calendar-days{flex:0 0 100%;width:100%;min-width:0}
.v2-calendar-days button,.v2-calendar-days>span{height:37px;min-width:0;border:0;border-radius:9px;display:grid;place-items:center;padding:0;background:transparent;color:var(--text);font-size:12px}.v2-calendar-days button.selected{background:#547d76;color:white;font-weight:750}.v2-calendar-days button.today:not(.selected){border:1px solid #7ca89a}
.v2-calendar-today{width:100%;margin-top:14px;border:1px solid #476658;border-radius:12px;background:#294b42;color:#def7ed;min-height:43px;font:750 13px -apple-system,sans-serif}.v2-calendar-today:disabled{opacity:1}
@media(max-width:350px){.v2-unified-title h1{font-size:19px!important}.v2-unified-title p{font-size:9px!important}.v2-unified-brand{gap:8px!important}.v2-unified-head{grid-template-columns:minmax(0,1fr) 68px}.v2-date-trigger span{font-size:12px!important}.v2-date-bar{gap:5px!important}}
@media(prefers-reduced-motion:reduce){.v2-calendar-backdrop,.v2-calendar{transition:none}}
/* The home page's confirmed secondary action is the shared Today treatment. */
.v2-calendar-today{height:42px;min-height:42px;width:100%;background:#2a3e4c;border:1px solid #415b69;border-radius:13px;margin-top:10px;color:#d3e5ed;font-size:13px;font-weight:500}
.v2-form-date{width:100%;display:flex;align-items:center;justify-content:center;gap:7px;min-height:40px;background:var(--ui-button);border:1px solid var(--line);border-radius:11px;color:var(--text);font:600 13px -apple-system,sans-serif}.v2-form-date svg{width:16px;height:16px}
.v2-date-trigger [hidden]{display:none!important}
.v2-sync-pill{grid-row:1}
/* Calendar can also open from the meal editor's existing higher overlay layer. */
.v2-calendar-backdrop{z-index:10000}
.v2-date-bar>button.v2-date-trigger{flex-direction:row!important}
.v2-about{margin-top:24px;padding:16px;background:var(--card);border:1px solid var(--line);border-radius:16px}.v2-about h2{font-size:15px;margin:0 0 10px}.v2-about p{font-size:12px;color:var(--muted);margin:7px 0}
/* 0.1.12: the selected compact framed date control. */
.v2-date-bar{grid-template-columns:36px minmax(0,1fr) 36px;gap:5px!important;padding:5px!important;min-height:48px!important;height:48px!important;border-radius:14px!important}
.v2-date-bar>button{width:36px!important;height:36px!important;min-height:36px!important;border-radius:10px!important;font-size:18px!important}
.v2-date-bar>button.v2-date-trigger{gap:7px!important}
.v2-date-trigger span{font-size:13px!important}
/* Status remains global; a compact dot leaves the AI actions on one row. */
.v2-sync-pill{grid-row:1/3!important;min-width:30px;min-height:32px;padding:0;justify-content:center;background:var(--sub);border-color:var(--line)}
.v2-sync-pill>span:not(.v2-sync-dot){display:none}.v2-sync-dot{height:7px;width:7px}
body[data-v2-page=ai] .v2-unified-head{display:flex!important;gap:8px!important}
body[data-v2-page=ai] .v2-unified-brand{flex:1;min-width:0}
body[data-v2-page=ai] .v2-unified-actions{gap:4px!important;order:3}
body[data-v2-page=ai] .v2-sync-pill{flex:none;order:2}
body[data-v2-page=ai] .v2-unified-title h1{font-size:21px!important}
body[data-v2-page=ai] .v2-unified-title p{font-size:10px!important;white-space:normal!important;line-height:1.35!important}
body[data-v2-page=ai] .v2-unified-icon{width:40px!important;height:40px!important;flex-basis:40px!important}
body[data-v2-page=ai] .v2-unified-head .iconButton{width:30px!important;height:32px!important;min-height:32px!important}
@media(max-width:350px){body[data-v2-page=ai] .v2-unified-title h1{font-size:17px!important}body[data-v2-page=ai] .v2-unified-brand{gap:6px!important}body[data-v2-page=ai] .v2-unified-title p{font-size:9px!important}}
/* Use one stable flow placeholder. Only its inner chrome contracts, avoiding scroll feedback. */
.v2-sticky-holder{--collapse:0;height:138px;position:sticky;top:env(safe-area-inset-top,0px);z-index:80;pointer-events:none;flex-shrink:0}
.v2-sticky-inner{position:absolute;inset:0 0 auto;padding:0 0 8px;background:var(--bg);pointer-events:auto;border-bottom:1px solid transparent}
.v2-sticky-holder .v2-sticky-inner{border-bottom-color:rgb(53 73 89 / var(--collapse));box-shadow:0 8px 14px rgb(8 14 22 / calc(.2 * var(--collapse)))}
.v2-sticky-inner .v2-unified-head{height:calc(60px - 24px * var(--collapse))!important;min-height:calc(60px - 24px * var(--collapse))!important;grid-template-rows:1fr!important;margin-bottom:calc(16px - 10px * var(--collapse))!important;transition:none!important}
.v2-sticky-inner .v2-unified-brand,.v2-sticky-inner .v2-sync-pill{grid-row:1!important}
.v2-sticky-inner .v2-unified-icon{width:calc(48px - 20px * var(--collapse))!important;height:calc(48px - 20px * var(--collapse))!important;flex-basis:calc(48px - 20px * var(--collapse))!important;border-radius:calc(15px - 6px * var(--collapse));transition:none!important}
.v2-sticky-inner .v2-unified-icon svg{width:calc(26px - 8px * var(--collapse));height:calc(26px - 8px * var(--collapse))}
.v2-sticky-inner .v2-unified-title h1{font-size:calc(23px - 7px * var(--collapse))!important;transition:none!important}
.v2-sticky-inner .v2-unified-title p{opacity:calc(1 - var(--collapse));max-height:calc(16px * (1 - var(--collapse)));overflow:hidden;transition:none!important}
.v2-sticky-inner .v2-unified-title{gap:calc(4px * (1 - var(--collapse)))}
.v2-sticky-inner .v2-date-bar{height:calc(48px - 6px * var(--collapse))!important;min-height:calc(48px - 6px * var(--collapse))!important;padding:calc(5px - 3px * var(--collapse))!important;margin-bottom:0!important;transition:none!important}
body[data-v2-page=analysis] .v2-sticky-holder{height:133px}
.v2-sticky-inner .switch{margin-bottom:0!important}.v2-sticky-inner .switch button{min-height:42px;transition:none!important}
.v2-sticky-inner button{transition:none!important}
/* Equal-width segmented choices; the tools entry is right aligned in every mode. */
body[data-v2-page=details] .toolbar{justify-content:flex-end!important}
body[data-v2-page=details] .extra-controls{margin-left:auto;justify-content:flex-end}
body[data-v2-page=details] .daily-mode{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;background:var(--sub);border:1px solid var(--line);border-radius:14px}
body[data-v2-page=details] .daily-mode button{width:100%;min-width:0;min-height:40px;margin:0;border:1px solid transparent;border-radius:10px;padding:9px 6px;color:var(--muted);background:transparent;font-size:12px;white-space:nowrap}
body[data-v2-page=details] .daily-mode button[aria-pressed=true]{background:#3b565f;border-color:#59717a;color:var(--text)}
/* Landscape redesign is limited to the details page. */
body.landscape-nav #app{flex-direction:row}
body.landscape-nav #panes{flex:1;min-width:0}
body.landscape-nav nav.shellNav{order:-1;flex:0 0 68px;display:flex;flex-direction:column;gap:3px;padding:8px 5px calc(8px + env(safe-area-inset-bottom,0px));border-top:0;border-right:1px solid #304757}
body.landscape-nav .shellNav button{flex:1;width:100%;min-height:42px;gap:2px}
@media(orientation:landscape){
 body[data-v2-page=details] main.app{max-width:none;padding:10px max(16px,env(safe-area-inset-right)) 20px max(16px,env(safe-area-inset-left))!important;min-height:100dvh}
 body[data-v2-page=details] .v2-sticky-holder{height:80px}
 body[data-v2-page=details] .v2-sticky-inner{display:grid;grid-template-columns:minmax(150px,1fr) minmax(245px,1fr);gap:12px;align-items:center;padding-bottom:8px}
 body[data-v2-page=details] .v2-sticky-inner .v2-unified-head{margin:0!important}
 body[data-v2-page=details] .v2-sticky-inner .v2-unified-icon{width:32px!important;height:32px!important;flex-basis:32px!important}
 body[data-v2-page=details] .v2-sticky-inner .v2-unified-title h1{font-size:17px!important}
 body[data-v2-page=details] .v2-sticky-inner .v2-unified-title p{font-size:10px!important}
 body[data-v2-page=details] .v2-sticky-inner .v2-unified-head{height:calc(60px - 18px * var(--collapse))!important;min-height:calc(60px - 18px * var(--collapse))!important}
 body[data-v2-page=details] .summary{gap:8px;margin:0 0 10px}
 body[data-v2-page=details] .summary>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 12px}
 body[data-v2-page=details] .summary strong{font-size:17px;margin:0}
 body[data-v2-page=details] .switcher{margin:8px 0}.switcher button{min-width:0}
 body[data-v2-page=details] .table-wrap{max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}
 body[data-v2-page=details] .detail-table th,body[data-v2-page=details] .detail-table td{padding:10px 12px!important;font-size:12px!important;line-height:1.45}
 body[data-v2-page=details] .detail-table th{position:sticky;top:0;z-index:2}
 body[data-v2-page=details] .daily-mode{max-width:320px;margin-left:auto}
 body[data-v2-page=details] .events{margin-top:10px}
 body[data-v2-page=details] .event{grid-template-columns:46px 25px minmax(0,1fr);gap:8px;margin-bottom:12px}
 body[data-v2-page=details] .events:before{left:66px}
 body[data-v2-page=details] .event-main{padding:10px 12px}
 body[data-v2-page=details] .event-title{margin-top:4px}.event-sub{margin-top:4px}
 body[data-v2-page=details] .me-sheet{width:min(100%,940px);max-height:94dvh;border-radius:18px 18px 0 0}
 body[data-v2-page=details] .sheet{width:min(100%,760px);max-height:94dvh}
 body[data-v2-page=details] .photo-shell{width:min(100%,850px);max-height:96dvh}
 body[data-v2-page=details] .photo-large{max-height:calc(100dvh - 110px)}
 body[data-v2-page=details] .v2-calendar{max-height:calc(100dvh - 24px)}
}
body[data-v2-page=analysis] .v2-sticky-holder{height:137px}
@media(orientation:landscape){
 body[data-v2-page=details] .v2-detail-controls{display:flex;align-items:center;gap:10px;margin:6px 0 9px}
 body[data-v2-page=details] .v2-detail-controls .switcher{flex:1;min-width:0;margin:0}
 body[data-v2-page=details] .v2-detail-controls .toolbar{flex:none;margin:0}
 body[data-v2-page=details] .v2-detail-controls .open-tools{padding:9px 10px}
}

/* 0.1.13: restore a readable status pill; AI tools use a separate row. */
.v2-sync-pill{min-width:0;min-height:28px;padding:5px 9px;gap:6px;background:#203a35;border-color:#46645a;color:#c9e4d5;font-size:10px}
.v2-sync-pill>span:not(.v2-sync-dot){display:inline}.v2-sync-dot{background:#e0b678}
body[data-v2-page=ai] .v2-unified-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:34px 28px;height:66px!important;min-height:66px!important;align-items:center;gap:0 8px!important}
body[data-v2-page=ai] .v2-unified-brand{grid-column:1;grid-row:1/3}
body[data-v2-page=ai] .v2-sync-pill{grid-column:2;grid-row:1!important;justify-self:end}
body[data-v2-page=ai] .v2-unified-actions{grid-column:2;grid-row:2;justify-self:end}
@media(max-width:350px){body[data-v2-page=ai] .v2-unified-icon{width:34px!important;height:34px!important;flex-basis:34px!important}}
/* Arrow glyph sizing is independent of its 36px touch target. */
:root{--date-arrow-size:16px}
.v2-date-bar>button:not(.v2-date-trigger) svg{width:var(--date-arrow-size)!important;height:var(--date-arrow-size)!important;display:block;margin:auto}
/* One highlight travels between buttons in each segmented selector. */
.v2-segmented{position:relative;isolation:isolate}
.v2-segmented .v2-segment-indicator{position:absolute;left:0;top:0;width:1px;height:1px;border-radius:10px;background:#3b565f;border:1px solid #59717a;pointer-events:none;z-index:-1;transition:transform .24s linear,width .24s linear,height .24s linear}
.v2-segmented>button{position:relative;z-index:1;background:transparent!important;border-color:transparent!important;transition:color .24s linear!important}
.v2-segmented>button.on,.v2-segmented>button.active,.v2-segmented>button[aria-pressed=true]{color:#f1f6f7!important}
.v2-segmented .v2-segment-indicator{z-index:0}.v2-segmented>button{z-index:1}
.v2-segmented .v2-segment-indicator{background:#3b565f}
/* Content changes at a constant rate. */
body[data-v2-page=analysis] .swipeSurface,body[data-v2-page=analysis] .summary,body[data-v2-page=analysis] .focus,
body[data-v2-page=details] .table-panel.show,body[data-v2-page=details] .timeline-panel:not(.hide),
body[data-v2-page=details] #toolsBody,body[data-v2-page=details] #dailyTableContent{animation:v2-content-in .24s linear both}
@keyframes v2-content-in{from{opacity:.35;transform:translateX(7px)}to{opacity:1;transform:translateX(0)}}
body[data-v2-page=details] .overlay{z-index:2100}
body[data-v2-page=details] .confirm{z-index:2150}
body[data-v2-page=details] .photo-overlay{z-index:2200}
body[data-v2-page=details] .sheet{transition:transform .28s linear}
@media(prefers-reduced-motion:reduce){.v2-segmented .v2-segment-indicator{transition:none}body[data-v2-page=analysis] .summary,body[data-v2-page=analysis] .focus,body[data-v2-page=details] .table-panel.show,body[data-v2-page=details] .timeline-panel:not(.hide),body[data-v2-page=details] #toolsBody,body[data-v2-page=details] #dailyTableContent{animation:none}}

/* 0.1.14: dynamic trend chips are redrawn by the chart; keep their own visible surface. */
body[data-v2-page=analysis] .focusChoices button{background:#263643!important;border-color:#3d5060!important}
body[data-v2-page=analysis] .focusChoices button.on{background:#354b61!important;border-color:#728ca6!important}
/* The expanded event must retain its own height in WebKit after tab animation. */
body[data-v2-page=details] .event-detail{display:block;max-height:0;opacity:0;overflow:hidden;transition:max-height .28s linear,opacity .28s linear}
body[data-v2-page=details] .event-card.open .event-detail{max-height:var(--detail-height,1200px);opacity:1}
body[data-v2-page=details] .event-detail-inner{overflow:visible}
body[data-v2-page=details] .timeline-panel:not(.hide){animation:none}
@media(orientation:landscape){
 body[data-v2-page=analysis] main{max-width:1100px!important;padding:10px 16px 24px!important}
 body[data-v2-page=analysis] .v2-sticky-holder{height:138px}
 body[data-v2-page=analysis] .swipeSurface{display:grid;grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr);align-items:start;gap:12px}
 body[data-v2-page=analysis] .focus{margin:0}
 body[data-v2-page=analysis] .graphScroll svg{height:190px}
}
@media(prefers-reduced-motion:reduce){body[data-v2-page=details] .event-detail{transition:none}}

/* 0.1.15: one clipboard entry beside the status pill. */
body[data-v2-page=ai] .v2-unified-head{display:flex!important;gap:8px!important;height:60px!important;min-height:60px!important}
body[data-v2-page=ai] .v2-unified-brand{flex:1}
body[data-v2-page=ai] .v2-unified-actions{flex:none}
body[data-v2-page=ai] .v2-sync-pill{flex:none}
body[data-v2-page=ai] #showLedger svg{width:19px;height:19px;display:block}
body[data-v2-page=ai] .miniStat>.hudLabel{display:block;font-size:10px;color:var(--muted)}
body[data-v2-page=ai] .miniStat strong{display:flex;align-items:baseline;justify-content:center;gap:4px;font-size:18px;line-height:1.18;font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap}
body[data-v2-page=ai] .miniStat strong .hudChars{display:inline-block;font-size:inherit;line-height:inherit;color:inherit;white-space:nowrap;letter-spacing:-.035em}
body[data-v2-page=ai] .miniStat strong small{font-size:11px;color:var(--muted);font-weight:400}
@media(max-width:350px){body[data-v2-page=ai] .miniStat strong{font-size:16px;gap:2px}body[data-v2-page=ai] .v2-unified-title h1{font-size:16px!important}}
/* Commands have individual containers, including inactive and disabled commands. */
body[data-v2-page=details] .actions button{background:var(--sub);border:1px solid var(--line);border-radius:10px;color:var(--text)}
body[data-v2-page=details] .actions button.active{background:#3b565f;border-color:#71968c;color:#f1f6f7}

/* 0.1.16: landscape uses one left navigation rail on every page. */
body.landscape-nav nav.shellNav{flex-basis:calc(68px + env(safe-area-inset-left,0px));padding-left:max(5px,env(safe-area-inset-left,0px));padding-bottom:max(8px,env(safe-area-inset-bottom,0px));overflow-y:auto}
body.landscape-nav .shellNav button{flex:1 0 44px;min-height:44px}
body.landscape-nav .shellNav .glyph svg{width:22px;height:22px}
body.landscape-nav .shellNav button small{font-size:10px}
.v2-home-content,.v2-home-secondary,.v2-settings-content,.v2-settings-group,.v2-ai-sidebar{display:contents}
@media(orientation:landscape){
 body[data-v2-page=home] main.page,body[data-v2-page=settings] main.page{max-width:1100px!important;padding:10px 16px 24px!important}
 body[data-v2-page=home] .v2-sticky-holder{height:80px}
 body[data-v2-page=home] .v2-sticky-inner{display:grid;grid-template-columns:minmax(150px,1fr) minmax(245px,1fr);gap:12px;align-items:center;padding-bottom:8px}
 body[data-v2-page=home] .v2-sticky-inner .v2-unified-head{margin:0!important;height:calc(60px - 18px * var(--collapse))!important;min-height:calc(60px - 18px * var(--collapse))!important}
 body[data-v2-page=home] .v2-unified-icon,body[data-v2-page=settings] .v2-unified-icon{width:32px!important;height:32px!important;flex-basis:32px!important}
 body[data-v2-page=home] .v2-unified-title h1,body[data-v2-page=settings] .v2-unified-title h1{font-size:17px!important}
 body[data-v2-page=home] .v2-unified-title p,body[data-v2-page=settings] .v2-unified-title p{font-size:10px!important}
 body[data-v2-page=home] .v2-home-content{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:16px;align-items:start}
 body[data-v2-page=home] .firstFold{display:block!important;min-height:0!important;height:auto!important}
 body[data-v2-page=home] .v2-home-secondary{display:block;min-width:0}
 body[data-v2-page=home] .firstFold .hero{padding:16px!important;min-height:0!important;height:auto!important}
 body[data-v2-page=home] .firstFold .heroNumber{margin:14px 0 10px!important}
 body[data-v2-page=home] .firstFold .heroNumber strong{font-size:38px!important}
 body[data-v2-page=home] .firstFold .heroInfo{margin:0 0 10px!important}
 body[data-v2-page=home] .firstFold .heroDivider{margin:12px 0!important}
 body[data-v2-page=home] .firstFold .heroStats{margin:8px 0!important}
 body[data-v2-page=home] .firstFold .heroItem strong{font-size:19px!important}
 body[data-v2-page=home] .sectionHeader{margin:15px 0 9px!important}
 body[data-v2-page=home] .v2-home-secondary>.sectionHeader:first-child{margin-top:0!important}
 body[data-v2-page=home] .quick{gap:6px!important}
 body[data-v2-page=home] .quickCard{min-height:130px!important;padding:11px 8px!important;gap:7px!important}
 body[data-v2-page=home] .quickCard h3{font-size:10px!important}
 body[data-v2-page=home] .quickCard .valueLine strong{font-size:18px!important}
 body[data-v2-page=home] .sheet,body[data-v2-page=settings] .sheet{max-height:calc(100dvh - 14px);max-width:760px;padding-top:12px}
 body[data-v2-page=settings] .v2-unified-head{height:46px!important;min-height:46px!important;grid-template-rows:1fr;margin-bottom:12px!important}
 body[data-v2-page=settings] .v2-settings-content{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
 body[data-v2-page=settings] .v2-settings-group{display:block;min-width:0}
 body[data-v2-page=settings] .sectionHead{margin:0 0 9px}
 body[data-v2-page=settings] .profile{padding:14px}
 body[data-v2-page=settings] .profileTop{gap:6px;margin-bottom:12px;flex-wrap:wrap}
 body[data-v2-page=settings] .profileIcon{display:none}
 body[data-v2-page=settings] .profileStats{gap:5px}
 body[data-v2-page=settings] .profileStat{padding:10px 6px}
 body[data-v2-page=settings] .profileStat strong{font-size:18px}
 body[data-v2-page=settings] .activityFoot{gap:6px;flex-wrap:wrap}
 body[data-v2-page=settings] .activityDesc{max-width:100%}
 body[data-v2-page=settings] .tdeePreview strong{font-size:21px}
 body[data-v2-page=settings] .v2-about{margin-top:0}
 /* Chat keeps a full-height message column and input; date and HUD sit alongside. */
 body[data-v2-page=ai] main.app{display:grid!important;grid-template-columns:210px minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) auto;gap:0 12px;padding:6px 12px 0!important;box-sizing:border-box}
 body[data-v2-page=ai] .appHead.v2-unified-head{grid-column:1/-1;grid-row:1;height:40px!important;min-height:40px!important;margin:0!important;padding:0!important}
 body[data-v2-page=ai] .v2-unified-icon{width:30px!important;height:30px!important;flex-basis:30px!important;border-radius:10px}
 body[data-v2-page=ai] .v2-unified-title h1{font-size:17px!important}
 body[data-v2-page=ai] .v2-unified-title p{display:none}
 body[data-v2-page=ai] .v2-ai-sidebar{display:block;grid-column:1;grid-row:2/4;min-height:0;overflow:auto;padding:5px 0 10px}
 body[data-v2-page=ai] .daystrip{margin:0 0 10px!important;width:100%;box-sizing:border-box}
 body[data-v2-page=ai] .daystrip .v2-date-trigger svg{display:none}
 body[data-v2-page=ai] .daystrip .v2-date-label{font-size:12px!important}
 body[data-v2-page=ai] .miniStats{display:grid;grid-template-columns:1fr;gap:8px;padding:0;max-height:none;overflow:visible;margin:0}
 body[data-v2-page=ai] .miniStat{display:flex;justify-content:space-between;align-items:center;padding:12px;gap:6px;min-height:52px}
 body[data-v2-page=ai] .messages{grid-column:2;grid-row:2;min-width:0;min-height:0;padding:8px 0 12px;overflow:auto}
 body[data-v2-page=ai] .composeShell{grid-column:2;grid-row:3;min-width:0;padding-left:0!important;padding-right:0!important}
 body[data-v2-page=ai] .composeFoot{display:none}
 body[data-v2-page=ai] .welcome{margin:0 0 12px;padding:12px}
 body[data-v2-page=ai] .proposal{width:100%;max-width:100%}
 body[data-v2-page=ai] .modal{max-width:680px;max-height:calc(100dvh - 20px)}
 body[data-v2-page=ai].keyboard-open .miniStats{max-height:0;overflow:hidden;padding:0}
}
@media(orientation:landscape) and (max-width:600px){
 body[data-v2-page=home] .v2-home-content,body[data-v2-page=settings] .v2-settings-content{grid-template-columns:minmax(0,1fr)}
 body[data-v2-page=home] .quickCard h3{font-size:11px!important}
 body[data-v2-page=home] .quickCard .valueLine strong{font-size:20px!important}
 body[data-v2-page=analysis] .swipeSurface{grid-template-columns:minmax(0,1fr)}
 body[data-v2-page=analysis] .focus{margin-top:12px}
}
@media(orientation:landscape){
 body[data-v2-page=ai] main.app{width:100%;max-width:none!important}
 body[data-v2-page=home] .firstFold .hero{justify-content:flex-start!important;gap:0!important}
 body[data-v2-page=home] .firstFold .hero .goalRow{margin:10px 0 6px!important}
 body[data-v2-page=home] .firstFold .hero .heroCaption{margin-top:8px!important}
 body[data-v2-page=analysis] .v2-sticky-holder{height:80px}
 body[data-v2-page=analysis] .v2-sticky-inner{display:grid;grid-template-columns:minmax(190px,.9fr) minmax(250px,1.2fr);gap:10px;align-items:center;padding-bottom:8px}
 body[data-v2-page=analysis] .v2-unified-head{margin:0!important;height:calc(60px - 18px * var(--collapse))!important;min-height:calc(60px - 18px * var(--collapse))!important}
 body[data-v2-page=analysis] .v2-unified-icon{width:32px!important;height:32px!important;flex-basis:32px!important}
 body[data-v2-page=analysis] .v2-unified-title h1{font-size:17px!important}
 body[data-v2-page=analysis] .v2-unified-title p{font-size:10px!important}
 body[data-v2-page=analysis] .switch button{font-size:12px}
}
.v2-sync-pill[data-connected=true] .v2-sync-dot{background:#99d7c3}
#v2SyncPanel .sync-sheet{max-height:90dvh;overflow:auto}
#v2SyncPanel .sync-sheet>button{margin:8px 8px 0 0}
.v2-pending-row{border:1px solid #46645a;border-radius:12px;padding:10px;margin:10px 0}
.v2-pending-row p{margin:0 0 5px}.v2-pending-row small{display:block;color:#b7c9ce;line-height:1.5}
.v2-stage-note{font-size:11px;color:var(--muted);line-height:1.6;margin:10px 0}
.v2-pull-hint{position:fixed;top:max(8px,env(safe-area-inset-top,0px));left:50%;transform:translateX(-50%);max-width:85%;padding:9px 14px;border:1px solid var(--line);border-radius:99px;background:var(--card);color:var(--text);font-size:12px;z-index:20000;opacity:0;pointer-events:none;transition:opacity .18s linear;text-align:center}.v2-pull-hint.visible{opacity:1}
/* Online settings and meal workflows, preserving the accepted compact layout. */
body[data-v2-page=settings] .inputBox select,body[data-v2-page=settings] textarea{width:100%;min-width:0;background:#14232e;border:0;color:#ecf5f5;font:inherit;font-size:16px;padding:10px 0}body[data-v2-page=settings] textarea{padding:12px;border:1px solid #4d6472;border-radius:12px;min-height:90px;resize:vertical}body[data-v2-page=settings] .inputBox input[type=date]{font-size:15px!important}
.wf-overlay{position:fixed;inset:0;z-index:1800;background:#050d16c9;display:none;align-items:flex-end;justify-content:center;opacity:0;transition:opacity .2s linear}.wf-overlay.show{display:flex;opacity:1}.wf-sheet{position:relative;width:min(100%,620px);max-height:calc(100dvh - 15px - env(safe-area-inset-top,0px));overflow:auto;overscroll-behavior:contain;background:#1c2b36;border:1px solid #4b6470;border-radius:22px 22px 0 0;padding:18px 16px calc(20px + env(safe-area-inset-bottom,0px));color:#e7f2f5}.wf-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.wf-top h2{font-size:18px}.wf-sheet button,.wf-controls button{border:1px solid #567080;border-radius:10px;background:#293e4c;color:#dcecf3;padding:10px 12px;font:inherit;font-size:12px;min-height:38px}.wf-sheet button.primary{background:#315b4e;border-color:#83b7a3;color:#e4fff1}.wf-sheet button:disabled{opacity:.4}.wf-sheet p,.wf-sheet small{font-size:12px;line-height:1.7;color:#adc1ce;white-space:pre-wrap;overflow-wrap:anywhere}.wf-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}.wf-fields label{font-size:12px;color:#b5cbd5;display:grid;gap:7px;min-width:0}.wf-fields .wide{grid-column:1/-1}.wf-fields input,.wf-fields select,.wf-fields textarea,.wf-search input,.wf-search select{width:100%;min-width:0;border:1px solid #476373;background:#12232e;border-radius:10px;padding:11px 9px;color:#eaf4f6;font:inherit;font-size:16px;box-sizing:border-box}.wf-fields textarea{min-height:70px;resize:vertical}.wf-actions,.wf-controls{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.wf-actions button{flex:1}.wf-controls{justify-content:flex-end}.wf-error{color:#f1bba7!important;margin-top:12px;min-height:20px}.wf-tabs{display:flex;gap:6px;overflow:auto;margin:8px 0 14px;padding-bottom:5px}.wf-tabs button{white-space:nowrap;flex:none}.wf-tabs button[aria-pressed=true]{background:#3b5f61;border-color:#89afb1}.wf-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.wf-photo-grid img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px}.wf-card{border:1px solid #3b5667;background:#20323e;padding:13px;border-radius:14px;margin:10px 0;overflow-wrap:anywhere}.wf-card strong{font-size:13px}.wf-search{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:12px 0}.wf-search select{grid-column:1/-1}.wf-status{color:#b5ddcc}.wf-sheet [hidden]{display:none!important}
@media(orientation:landscape) and (max-height:600px){.wf-sheet{width:min(100%,920px);max-height:calc(100dvh - 10px);padding:12px 18px 16px}.wf-fields{grid-template-columns:repeat(4,minmax(0,1fr))}.wf-fields .wide{grid-column:1/-1}.wf-top{margin-bottom:8px}}
body[data-v2-page=details] .wf-overlay{z-index:2300}
body[data-v2-page=details] .overlay[aria-hidden=true]{pointer-events:none}
body[data-v2-page=details] .wf-controls button,body[data-v2-page=details] .toolbar button{scroll-margin-top:155px;scroll-margin-bottom:24px}
body[data-v2-page=details] .wf-fields input,body[data-v2-page=details] .wf-fields select,body[data-v2-page=details] .wf-fields textarea{scroll-margin-top:24px;scroll-margin-bottom:70px}
body[data-v2-page=settings] .segIndicator{transition:transform .24s linear}
/* 0.1.21: preserve the approved editor's two panes and equal-width controls. */
body[data-v2-page=details] .plan-closed{filter:saturate(.16);background:#202a33;border-color:#35424c}
body[data-v2-page=details] .plan-closed strong{color:#9caeb8}body[data-v2-page=details] .plan-closed small,body[data-v2-page=details] .plan-closed .pill{color:#8fa1ac;border-color:#4c5b65}
.wf-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:visible}.wf-tabs button{min-width:0;font-size:11px;padding:10px 3px}
.wf-sheet.meal-edit-sheet{width:min(100%,580px);height:min(820px,calc(100dvh - 20px - env(safe-area-inset-top,0px)));display:flex;flex-direction:column;overflow:hidden;padding:16px 16px calc(14px + env(safe-area-inset-bottom,0px))}
.meal-edit-sheet>.wf-top{flex:none;margin-bottom:12px}.meal-edit-sheet #wfBody{display:flex;flex-direction:column;flex:1;min-height:0}.meal-edit-sheet #wfError{flex:none;margin:10px 0 0;max-height:88px;overflow:auto}.meal-edit-sheet #wfError:empty{display:none}
.me-tabs{--tab:0;position:relative;isolation:isolate;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:5px;background:#12232e;border:1px solid #3c5262;border-radius:13px;margin:0 0 12px;flex:none}
.me-tabs .me-tab-indicator{position:absolute;top:5px;bottom:5px;left:5px;width:calc((100% - 16px)/2);border:1px solid #688879;border-radius:9px;background:#3a5d56;transform:translateX(calc(var(--tab) * (100% + 6px)));transition:transform .24s linear;pointer-events:none}
.me-tabs>button{position:relative;z-index:1;background:transparent;border-color:transparent;color:#a9bdc7;padding:9px;font-size:13px;min-width:0}.me-tabs>button[aria-pressed=true]{color:#e5f7ee;font-weight:700}
.me-form{display:flex;flex:1;flex-direction:column;min-height:0}.me-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 1px 10px}.meal-edit-sheet .me-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin:5px 0 12px;gap:13px 12px}
.meal-edit-sheet .me-grid>label{min-inline-size:0;max-inline-size:100%}.meal-edit-sheet .me-grid input:not([type=hidden]),.meal-edit-sheet .me-grid select,.meal-edit-sheet .me-input-shell{inline-size:100%;max-inline-size:100%;min-inline-size:0;block-size:48px;box-sizing:border-box;border:1px solid #476373;border-radius:10px;background:#12232e;color:#eaf4f6;font-size:16px}
.meal-edit-sheet .me-grid input:not([type=hidden]),.meal-edit-sheet .me-grid select{display:block;appearance:none;-webkit-appearance:none;padding:11px 10px}.meal-edit-sheet .me-grid textarea{min-height:74px}
.meal-edit-sheet .me-input-shell{display:block;position:relative;overflow:hidden}
.meal-edit-sheet .me-date-button{width:100%!important;max-width:100%!important;min-width:0!important;height:100%!important;min-height:0!important;display:flex!important;align-items:center;justify-content:center;gap:7px;border:0!important;background:transparent!important;padding:9px 7px!important;font-size:15px!important;white-space:nowrap;box-sizing:border-box}
.meal-edit-sheet .me-date-button .v2-date-label{font-size:15px!important;min-width:0;overflow:hidden;text-overflow:ellipsis}.meal-edit-sheet .me-date-button svg{width:16px;height:16px;flex:0 0 16px}
.me-time-shell{display:flex!important;align-items:center;justify-content:space-between;padding:0 11px;gap:7px}.me-time-shell>span{font-size:16px;white-space:nowrap}.me-time-shell .me-clock{font-size:20px;color:#aac1cd}
.meal-edit-sheet .me-time-shell input[type=time]{position:absolute;inset:0;inline-size:100%;max-inline-size:100%;min-inline-size:0;block-size:100%;margin:0;opacity:0;cursor:pointer;border:0;padding:0;z-index:1;appearance:none;-webkit-appearance:none}
.me-footer{display:flex;gap:10px;flex:none;padding-top:12px;border-top:1px solid #3b5260}.me-footer>button{flex:1;min-width:0;min-height:44px}.me-footer>button.primary{flex:1.6}
.me-section-label{font-size:12px;font-weight:700;color:#b7cbd4;margin:16px 0 10px}.me-photo-note{background:#243a43;border:1px solid #415d66;border-radius:11px;padding:11px}.me-photo-empty{grid-column:1/-1;margin:4px 0 12px}.me-photo-preview{display:block;position:relative;width:100%;border:1px solid #54707e!important;padding:0!important;overflow:hidden;aspect-ratio:1;border-radius:12px!important}.me-photo-preview img{display:block;width:100%;height:100%;object-fit:cover;border-radius:0}.me-new-photo{position:relative;min-width:0}.me-new-photo .me-remove-photo{position:absolute;top:5px;right:5px;width:28px;min-height:28px;height:28px;padding:0;border-radius:50%;background:#10212be6;font-size:19px;border-color:#8ba4ad}
.me-photo-pick{margin:16px 0 10px;position:relative}.me-photo-pick label{display:block;border:1px solid #648b7d;background:#2b4b41;border-radius:12px;padding:12px;text-align:center;font-size:13px;color:#dff6e9}.me-photo-pick input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
body[data-v2-page=details] .photo-overlay{z-index:2400}
@media(max-width:350px){.meal-edit-sheet .me-date-button,.meal-edit-sheet .me-date-button .v2-date-label{font-size:13px!important}.meal-edit-sheet .me-grid{gap:12px 9px}.wf-tabs button{font-size:10px}}
@media(orientation:landscape) and (max-height:600px){.wf-sheet.meal-edit-sheet{width:min(100%,920px);height:calc(100dvh - 10px);padding:11px 16px}.meal-edit-sheet>.wf-top{margin-bottom:8px}.me-tabs{margin-bottom:8px}.me-tabs>button{min-height:32px;padding:6px}.meal-edit-sheet .me-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.me-footer{padding-top:8px}.me-footer>button{min-height:38px}.meal-edit-sheet .wf-photo-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.me-tab-indicator{transition:none}}
.meal-edit-sheet .me-date-button{gap:4px!important;padding-inline:5px!important}
@media(max-width:350px){.meal-edit-sheet .me-date-button{gap:3px!important}.meal-edit-sheet .me-date-button svg{width:14px;height:14px;flex-basis:14px}}

/* 0.1.24: keep tool dialog dimensions while changing its content. */
body[data-v2-page=details] #toolsOverlay .sheet{display:flex;flex-direction:column;height:min(760px,calc(100dvh - 26px));max-height:calc(100dvh - 26px);overflow:hidden}
body[data-v2-page=details] #toolsOverlay .sheet-head,body[data-v2-page=details] #toolsOverlay .tooltabs{flex:none}
body[data-v2-page=details] #toolsBody{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;transition:opacity .18s linear}
body[data-v2-page=details] #toolsBody.v2-loading{opacity:.55;pointer-events:none}
body[data-v2-page=details] .meal-edit-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:12px;min-height:39px;border:1px solid #6c9f8e;border-radius:11px;background:#2b4a42;color:#ddf4e9;padding:7px 14px;font-size:12px;font-weight:650;box-shadow:none}
body[data-v2-page=details] .meal-edit-trigger:active{background:#365b50}
.me-footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.me-footer>button,.me-footer>button.primary{flex:none;width:100%;min-width:0}
@media(orientation:portrait){body[data-v2-page=ai] .miniStats{gap:5px;padding-bottom:7px}body[data-v2-page=ai] .miniStat{padding:6px 7px;min-height:52px}body[data-v2-page=ai] .miniStat>.hudLabel{line-height:1.2;text-align:left;letter-spacing:0}body[data-v2-page=ai] .miniStat strong{font-size:16px;line-height:1.18;gap:2px;letter-spacing:-.023em}}

/* Centered pull prompt: no capsule. The page blurs, while the indicator stays clear. */


/* iOS native time controls must stay inside their grid tracks. */
body[data-v2-page=ai] .proposalBody,body[data-v2-page=ai] .proposalGrid,body[data-v2-page=ai] .proposalGrid>label{min-width:0;max-width:100%}
body[data-v2-page=ai] .proposalGrid>label{overflow:hidden}
body[data-v2-page=ai] .proposalBody input,body[data-v2-page=ai] .proposalBody select{display:block;box-sizing:border-box;min-inline-size:0;inline-size:100%;max-inline-size:100%;margin:0}
/* 0.1.28: use the original 38px proposal row, including iOS time; never widen grid children. */
body[data-v2-page=ai] .proposalGrid input,body[data-v2-page=ai] .proposalGrid select{height:38px;min-height:38px;max-height:38px;min-width:0;width:100%;max-width:100%;box-sizing:border-box;line-height:20px;padding:8px 9px;font-size:16px}
body[data-v2-page=ai] .proposalBody input[type=time]{appearance:none;-webkit-appearance:none;display:block;box-sizing:border-box;overflow:hidden;min-inline-size:0;inline-size:100%;max-inline-size:100%;min-height:38px;height:38px;max-height:38px;line-height:20px;padding:8px 9px;font-size:16px}
body[data-v2-page=ai] .proposalBody input[type=time]::-webkit-date-and-time-value{min-width:0;text-align:left;margin:0}
body[data-v2-page=ai] .proposalBody input[type=time]::-webkit-datetime-edit{min-width:0;padding:0}
body[data-v2-page=home] #recordOverlay .sheet{max-height:100%;overflow-y:auto;overflow-anchor:none}
body[data-v2-page=settings] .profileStat strong{font-size:15px}
@media(max-width:360px){body[data-v2-page=settings] .profileStat strong{font-size:13.5px}}
@media(orientation:landscape){body[data-v2-page=settings] .profileStat strong{font-size:13.5px}}

/* 0.1.28: the quick-entry overlay is a stationary compact dialog, not a sliding
   bottom sheet. Keep the backdrop fixed at inset:0 while iOS changes viewport. */
body[data-v2-page=home] #recordOverlay{
  position:fixed;inset:0!important;top:0!important;bottom:0!important;height:auto!important;
  display:flex;align-items:flex-start;justify-content:center;
  padding:calc(env(safe-area-inset-top,0px) + 16px) 12px 12px;
  background:rgba(3,10,16,.74);
  -webkit-backdrop-filter:blur(9px);backdrop-filter:blur(9px);
}
body[data-v2-page=home] #recordOverlay .sheet{
  width:min(100%,500px);margin:0 auto;
  border-radius:22px;border:1px solid #476071;
  padding:14px 16px 15px;
  max-height:calc(100dvh - env(safe-area-inset-top,0px) - 28px);
  overflow:auto;overscroll-behavior:contain;overflow-anchor:none;
  box-shadow:0 16px 65px #000b;transform:translate3d(0,-8px,0);
}
body[data-v2-page=home] #recordOverlay.open .sheet{transform:translate3d(0,0,0)}
body[data-v2-page=home] #recordOverlay .grabber{display:none}
body[data-v2-page=home] #recordOverlay .sheetHead{margin-bottom:11px}
body[data-v2-page=home] #recordOverlay .formLine{margin-bottom:7px}
body[data-v2-page=home] #recordOverlay .inputWrap{padding:4px 12px}
body[data-v2-page=home] #recordOverlay .inputWrap input{min-height:40px}
body[data-v2-page=home] #recordOverlay .formHint{margin:4px 0 10px;line-height:1.5}
body[data-v2-page=home] #recordOverlay .primaryBtn{height:43px}
body[data-v2-page=home] #recordOverlay .secondaryBtn{height:37px;margin-top:7px}
body[data-v2-page=home] #recordOverlay .miniTip{margin-top:7px;line-height:1.45}
/* One row of buttons on small visible viewports, without changing their actions. */
@media(max-height:680px){
 body[data-v2-page=home] #recordOverlay{padding-top:8px}
 body[data-v2-page=home] #recordOverlay .formHint{font-size:10px;margin:3px 0 6px}
 body[data-v2-page=home] #recordOverlay .miniTip{font-size:9px}
}
/* Details expansion presets are a segmented control. A selected mode is NEVER
   visually disabled; a no-data state is the only disabled condition. */
body[data-v2-page=details] .actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:4px;
  background:#233442;border:1px solid #3b4d5b;border-radius:16px;margin:0 0 12px}
body[data-v2-page=details] .actions button{min-height:36px;padding:6px 3px;background:transparent;
  color:#aabac7;border:1px solid transparent;border-radius:12px;font-weight:650;
  transition:background .18s ease,color .18s ease,border-color .18s ease}
body[data-v2-page=details] .actions button.active,
body[data-v2-page=details] .actions button[aria-pressed=true]{background:#395867;border-color:#638f9a;color:#f1faf8;
  box-shadow:inset 0 0 0 1px #496c77}
body[data-v2-page=details] .actions button:disabled{opacity:.38}
/* Analysis header follows the other pages: title -> date -> view tabs. */
body[data-v2-page=analysis] .v2-sticky-holder{height:200px}
body[data-v2-page=analysis] .v2-sticky-inner .v2-date-bar{margin-bottom:9px!important}
body[data-v2-page=analysis] .v2-sticky-inner .switch{margin:0!important;padding:3px;gap:3px;
  border-radius:15px;min-height:43px}
body[data-v2-page=analysis] .v2-sticky-inner .switch button{min-height:36px;padding:6px 4px;font-size:12px;border-radius:11px}
@media(orientation:landscape){body[data-v2-page=analysis] .v2-sticky-holder{height:200px}}

/* V2 0.1.28 — meal proposal inputs: all columns 32px, including native iOS time. */
body[data-v2-page=ai] .proposalGrid input,
body[data-v2-page=ai] .proposalGrid select,
body[data-v2-page=ai] .proposalGrid input[type=time],
body[data-v2-page=ai] .proposalBody input[type=time]{
  box-sizing:border-box!important;display:block!important;
  inline-size:100%!important;min-inline-size:0!important;max-inline-size:100%!important;
  block-size:32px!important;min-block-size:32px!important;max-block-size:32px!important;
  padding:5px 7px!important;line-height:20px!important;font-size:13.5px!important;
}
body[data-v2-page=ai] .proposalGrid>label{min-inline-size:0;max-inline-size:100%;overflow:hidden}
body[data-v2-page=ai] .proposalGrid input[type=time]::-webkit-datetime-edit{font-size:13.5px;min-width:0;padding:0}
body[data-v2-page=ai] .proposalGrid input[type=time]::-webkit-date-and-time-value{font-size:13.5px;min-width:0;text-align:left}
/* V2 0.1.28 — the sticky header has z-index:80; the dialog must be above it. */
body[data-v2-page=home] #recordOverlay{
  z-index:3200!important;
  padding:calc(env(safe-area-inset-top,0px) + 15px) 12px 12px!important;
  background:rgba(3,10,16,.74)!important;
  -webkit-backdrop-filter:blur(9px)!important;backdrop-filter:blur(9px)!important;
}
body[data-v2-page=home] #recordOverlay .sheet{
  flex:0 1 auto;
  max-height:min(420px,calc(100dvh - env(safe-area-inset-top,0px) - 30px));
  padding:13px 15px 14px;
  overflow-x:hidden;overflow-y:auto;
}
body[data-v2-page=home] #recordOverlay .sheetHead{margin-bottom:9px}
body[data-v2-page=home] #recordOverlay .formLine{margin-bottom:5px}
body[data-v2-page=home] #recordOverlay .formLine label{margin-bottom:6px}
body[data-v2-page=home] #recordOverlay .inputWrap{padding:3px 10px}
body[data-v2-page=home] #recordOverlay .inputWrap input{min-height:36px}
body[data-v2-page=home] #recordOverlay .formHint{margin:5px 0 9px}
body[data-v2-page=home] #recordOverlay .primaryBtn{height:42px}
body[data-v2-page=home] #recordOverlay .secondaryBtn{height:35px;margin-top:7px}
body[data-v2-page=home] #recordOverlay .miniTip{margin-top:6px}
/* V2 0.1.28 — a SINGLE sliding selection plate for detail expansion modes. */
body[data-v2-page=details] .actions.v2-segmented{position:relative;isolation:isolate}
body[data-v2-page=details] .actions.v2-segmented .v2-segment-indicator{
  background:#3b565f;border:1px solid #73939d;border-radius:11px;
  box-shadow:inset 0 0 0 1px #496c77;
  transition:transform .25s cubic-bezier(.2,.8,.2,1),width .25s linear,height .25s linear,opacity .14s linear;
}
body[data-v2-page=details] .actions.v2-segmented>button{
  background:transparent!important;border-color:transparent!important;box-shadow:none!important;
  transition:color .22s linear!important;
}
body[data-v2-page=details] .actions.v2-segmented>button.active,
body[data-v2-page=details] .actions.v2-segmented>button[aria-pressed=true]{color:#f1faf8!important;background:transparent!important;border-color:transparent!important;box-shadow:none!important}
body[data-v2-page=details] .actions.v2-segmented>button:disabled{opacity:.4}
/* V2 0.1.28 — summary HUD gets matching 15px top/bottom internal spacing. */
body[data-v2-page=analysis] #summary.summary{padding:15px 16px!important}

/* V2 0.1.28: keyboard docking for quick-record, preserving the stationary blur. */
body[data-v2-page=home] #recordOverlay .sheet{
  transform:translate3d(0,calc(var(--v2-record-keyboard-shift,0px) - 8px),0);
  will-change:transform;
  transition:transform .22s ease-out;
}
body[data-v2-page=home] #recordOverlay.open .sheet{
  transform:translate3d(0,var(--v2-record-keyboard-shift,0px),0);
}
@media(prefers-reduced-motion:reduce){
 body[data-v2-page=home] #recordOverlay .sheet{transition:none}
}

/* V2 0.1.30 — fixed quick-entry anchor, independent of numeric keyboard state.
   Sheet's pixel top and maximum height are captured once before focus. */
body[data-v2-page=home] #recordOverlay{
  padding:var(--v2-record-fixed-top,180px) 12px 12px!important;
  align-items:flex-start!important;
}
body[data-v2-page=home] #recordOverlay .sheet,
body[data-v2-page=home] #recordOverlay.open .sheet{
  transform:translate3d(0,0,0)!important;
  max-height:var(--v2-record-fixed-max,420px)!important;
  transition:none!important;
  will-change:auto!important;
}
/* Keep HUD legible and make real cloud changes visible for ~3 seconds. */
body[data-v2-page=home] .hero.refreshUpdated{outline:2px solid #a6dfca;outline-offset:-2px;box-shadow:0 0 0 2px #a5e5cd77,0 0 25px #97d9be70}
body[data-v2-page=home] .hero.refreshUpdated.refreshFading{outline-color:transparent;box-shadow:0 0 0 0 transparent,0 0 25px transparent;transition:outline-color 2.85s linear,box-shadow 2.85s linear}

/* 0.1.32 C revision: date fades OUT while the WHOLE status row fades IN.
   Single icon, stable grid positions for all labels, progressive hue and progress. */
body[data-v2-page=home] .v2-date-bar{position:relative!important;isolation:isolate;overflow:hidden;--v2-refresh-opacity:0;--v2-date-opacity:1;--v2-refresh-progress:0;--v2-refresh-angle:0deg;--v2-refresh-scale:.82;--v2-refresh-accent:#9bded1}
body[data-v2-page=home] .v2-date-bar>button{opacity:var(--v2-date-opacity)!important;transition:opacity .13s linear,background .2s ease,border-color .2s ease!important}
body[data-v2-page=home] .v2-refresh-surface{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:4px 9px;border-radius:inherit;pointer-events:none;opacity:var(--v2-refresh-opacity);color:#effff8;border:1px solid var(--v2-refresh-accent);background:linear-gradient(108deg,#1b3938,#234842 55%,#1b3938);box-shadow:inset 0 0 12px #8de4ca21,0 0 14px #88debf32;transition:opacity .13s linear,border-color .16s linear,background .16s linear}
body[data-v2-page=home] .v2-refresh-surface::before{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(100deg,transparent 20%,rgba(174,255,219,.15) 52%,transparent 82%);transform:translateX(calc(-110% + 170% * var(--v2-refresh-progress)))}
body[data-v2-page=home] .v2-refresh-surface::after{content:'';position:absolute;bottom:0;left:0;height:3px;width:calc(100% * var(--v2-refresh-progress));background:var(--v2-refresh-accent);box-shadow:0 0 9px var(--v2-refresh-accent);transition:background .15s linear}
/* A fixed-width centered grid avoids jumping when the six-character title changes. */
body[data-v2-page=home] .v2-refresh-core{display:flex;align-items:center;justify-content:center;gap:7px;width:max-content;max-width:100%;height:100%;position:relative;z-index:1}
body[data-v2-page=home] .v2-refresh-symbol{position:relative;width:27px;height:27px;transform:scale(var(--v2-refresh-scale));transform-origin:right center;flex:none}
body[data-v2-page=home] .v2-refresh-icon{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke:var(--v2-refresh-accent);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;transform:rotate(var(--v2-refresh-angle));transform-origin:50% 50%;transition:stroke .16s linear}
body[data-v2-page=home] .v2-refresh-copy{display:flex;position:relative;flex-direction:column;justify-content:center;align-items:center;min-width:0;width:max-content;max-width:calc(100% - 35px);gap:1px;white-space:nowrap;text-align:center}
body[data-v2-page=home] .v2-refresh-title{font-size:12.5px;line-height:17px;font-weight:750;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;width:auto}
body[data-v2-page=home] .v2-refresh-sub{position:absolute;top:18px;left:50%;transform:translateX(-50%);font-size:9px;line-height:11px;color:#b4d3cb;overflow:hidden;text-overflow:ellipsis;width:max-content;max-width:min(260px,calc(100vw - 70px))}
body[data-v2-page=home] .v2-refresh-active:not(.v2-refresh-running):not(.v2-refresh-success):not(.v2-refresh-error) .v2-refresh-sub{display:none}
body[data-v2-page=home] .v2-refresh-stage-ready{--v2-refresh-accent:#edbe84;background:#283c38}
body[data-v2-page=home] .v2-refresh-stage-ready .v2-refresh-surface{background:linear-gradient(108deg,#3a352d,#484032,#3a352d);box-shadow:inset 0 0 13px #eec58723,0 0 15px #e2bc7c3d}
body[data-v2-page=home] .v2-refresh-stage-reload{--v2-refresh-accent:#c5b5f0}
body[data-v2-page=home] .v2-refresh-stage-reload .v2-refresh-surface{background:linear-gradient(108deg,#30344b,#3e405e,#30344b);box-shadow:inset 0 0 13px #b0a0e029,0 0 15px #c4b3f044}
body[data-v2-page=home] .v2-refresh-running .v2-refresh-icon{animation:v2-date-refresh-spin .88s linear infinite}
body[data-v2-page=home] .v2-refresh-stage-reload.v2-refresh-running .v2-refresh-icon{animation-duration:.68s}
body[data-v2-page=home] .v2-refresh-success{--v2-refresh-accent:#a7eccc}
body[data-v2-page=home] .v2-refresh-success .v2-refresh-surface{background:linear-gradient(108deg,#22433c,#2b5949,#22433c)}
body[data-v2-page=home] .v2-refresh-error{--v2-refresh-accent:#e0ae93}
body[data-v2-page=home] .v2-refresh-error .v2-refresh-surface{background:#44342f}
@keyframes v2-date-refresh-spin{from{transform:rotate(var(--v2-refresh-angle))}to{transform:rotate(calc(var(--v2-refresh-angle) + 360deg))}}
@media(prefers-reduced-motion:reduce){body[data-v2-page=home] .v2-refresh-running .v2-refresh-icon{animation:none}}
/* Approved 10px gap between page title and its first row. Preserve other internal spacing. */
body[data-v2-page=home] .v2-sticky-inner .v2-unified-head,
body[data-v2-page=analysis] .v2-sticky-inner .v2-unified-head{
 margin-bottom:calc(10px - 10px * var(--collapse))!important;
}
@media(orientation:portrait){
 body[data-v2-page=home] .v2-sticky-holder{height:132px}
 body[data-v2-page=analysis] .v2-sticky-holder{height:194px}
 body[data-v2-page=details] .v2-sticky-holder{height:132px}
}
body[data-v2-page=details] .daynav{margin-top:0!important}
body[data-v2-page=details] .v2-sticky-inner .v2-unified-head{margin-bottom:10px!important}

body[data-v2-page=ai] .v2-unified-head{margin-bottom:10px!important}
body[data-v2-page=settings] .v2-unified-head{margin-bottom:10px!important}
body[data-v2-page=settings] .sectionHead:first-of-type{margin-top:0!important}

@media(orientation:portrait){
 body[data-v2-page=home] .v2-unified-head,
 body[data-v2-page=analysis] .v2-unified-head,
 body[data-v2-page=details] .v2-unified-head{margin-bottom:10px!important}
}


/* V2 0.1.38 — single semantic HUD palette, independent of page/graph. */
:root{
 --metric-intake:#E2AF91;--metric-tdee:#D78F9E;
 --metric-water:#86BEE0;--metric-steps:#BAADDA;
 --metric-weight:#B8E3D1;--metric-goal:#D0D8E0;
 --metric-protein:#94D1B8;--metric-fat:#BBA4DD;--metric-carbs:#E4B183;
}
/* Hero's signed balance keeps a separate positive/negative semantic color. */
body[data-v2-page=home] #heroIntake{color:var(--metric-intake)}
body[data-v2-page=home] #heroTdee{color:var(--metric-tdee)}
body[data-v2-page=home] .quickCard.water .valueLine strong{color:var(--metric-water)}
body[data-v2-page=home] .quickCard.steps .valueLine strong{color:var(--metric-steps)}
body[data-v2-page=home] .quickCard.weight .valueLine strong{color:var(--metric-weight)}
body[data-v2-page=home] .macroLegend .col:nth-child(1) strong{color:var(--metric-protein)}
body[data-v2-page=home] .macroLegend .col:nth-child(2) strong{color:var(--metric-fat)}
body[data-v2-page=home] .macroLegend .col:nth-child(3) strong{color:var(--metric-carbs)}
body[data-v2-page=ai] .miniStat[data-hud=intake] strong{color:var(--metric-intake)}
body[data-v2-page=ai] .miniStat[data-hud=water] strong{color:var(--metric-water)}
body[data-v2-page=ai] .miniStat[data-hud=steps] strong{color:var(--metric-steps)}
body[data-v2-page=details] .summary>div:nth-child(1) strong{color:var(--metric-intake)}
body[data-v2-page=details] .summary>div:nth-child(2) strong{color:var(--metric-water)}
body[data-v2-page=details] .summary>div:nth-child(3) strong{color:var(--text)}
body[data-v2-page=analysis][data-analysis-tab=energy] .summaryGrid>.cell:nth-child(1) strong{color:var(--metric-intake)}
body[data-v2-page=analysis][data-analysis-tab=macro] .summaryGrid>.cell:nth-child(1) strong{color:var(--metric-protein)}
body[data-v2-page=analysis][data-analysis-tab=energy] .summaryGrid>.cell:nth-child(2) strong{color:var(--metric-tdee)}
body[data-v2-page=analysis][data-analysis-tab=macro] .summaryGrid>.cell:nth-child(2) strong{color:var(--metric-fat)}
body[data-v2-page=analysis][data-analysis-tab=energy] .summaryGrid>.cell:nth-child(3) strong{color:var(--metric-goal)}
body[data-v2-page=analysis][data-analysis-tab=macro] .summaryGrid>.cell:nth-child(3) strong{color:var(--metric-carbs)}
body[data-v2-page=analysis][data-analysis-tab=energy] .twocol>.cell:first-child strong{color:var(--metric-weight)}
body[data-v2-page=settings] #tdeeVal{color:var(--metric-tdee)}
body[data-v2-page=settings] #waterGoal{color:var(--metric-water)}
body[data-v2-page=settings] #stepGoal{color:var(--metric-steps)}
body[data-v2-page=settings] #weightVal{color:var(--metric-weight)}
/* Home: true 10px date-to-first-HUD gap, without changing HUD contents. */
body[data-v2-page=home] .firstFold .dateBar{margin-bottom:10px!important}
/* Pull status is geometrically centered in the 48px date row. */
body[data-v2-page=home] .v2-refresh-core{margin-inline:auto;transform:translateX(0);justify-self:center}
/* Restore blue for reload/second-stage, preserving green & amber for earlier states. */
body[data-v2-page=home] .v2-refresh-stage-reload{--v2-refresh-accent:var(--metric-water)}
body[data-v2-page=home] .v2-refresh-stage-reload .v2-refresh-surface{
 background:linear-gradient(108deg,#22384a,#2a4c62,#22384a);
 box-shadow:inset 0 0 13px #86bee02d,0 0 15px #86bee044;
}

body[data-v2-page=analysis] .progressCell .progressNumber{color:var(--metric-progress-color,var(--text))}

/* Refresh info: center the fixed-width text region without moving its icon. */
body[data-v2-page=home] .v2-refresh-copy{align-items:center;text-align:center}
body[data-v2-page=home] .v2-refresh-title,
body[data-v2-page=home] .v2-refresh-sub{text-align:center}

/* V2 0.1.38: approved five layout coordinates, now fixed (no localStorage lab). */
:root{--v2-lab-head:5px;--v2-lab-details-upper:-5px;--v2-lab-details-lower:-10px;--v2-lab-analysis-gap:9px}
@media(orientation:portrait){
 body[data-v2-page=home] .v2-sticky-holder,
 body[data-v2-page=details] .v2-sticky-holder{height:calc(132px + var(--v2-lab-head) - 10px)!important}
 /* Analysis holder reserves ONLY the rendered fixed-header controls. */
 body[data-v2-page=analysis] .v2-sticky-holder{height:var(--v2-analysis-holder-height,165px)!important}
}
body[data-v2-page=home] .v2-sticky-inner .v2-unified-head,
body[data-v2-page=analysis] .v2-sticky-inner .v2-unified-head{margin-bottom:max(0px,calc(var(--v2-lab-head) - 10px * var(--collapse)))!important}
body[data-v2-page=details] .v2-sticky-inner .v2-unified-head{margin-bottom:var(--v2-lab-head)!important}
body[data-v2-page=ai] .v2-unified-head,
body[data-v2-page=settings] .v2-unified-head{margin-bottom:var(--v2-lab-head)!important}
body[data-v2-page=details] #summary.summary{margin-top:var(--v2-lab-details-upper)!important;margin-bottom:0!important}
body[data-v2-page=details] .v2-detail-controls{margin-top:var(--v2-lab-details-lower)!important}
body[data-v2-page=analysis] .v2-sticky-inner{padding-bottom:0!important}
body[data-v2-page=analysis] .v2-sticky-inner .v2-date-bar{margin-bottom:var(--v2-lab-analysis-gap)!important}
body[data-v2-page=analysis] #tabSwipeViewport{margin-top:var(--v2-lab-analysis-gap)!important}

/* V2 0.1.42: compact, centered segmented-control labels. */
body[data-v2-page=details] .actions>button{display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important}
body[data-v2-page=details] .v2-date-trigger{-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;touch-action:manipulation}

/* 0.1.46: one visual long-press state for date buttons in all four tabs. */
body .v2-date-bar>button.v2-date-trigger{
  transform-origin:center center!important;
  transition:transform .13s ease,background-color .13s ease,border-color .13s ease,box-shadow .13s ease!important;
  -webkit-tap-highlight-color:transparent!important;
  -webkit-touch-callout:none!important;
  -webkit-user-select:none!important;
  user-select:none!important;
}
body .v2-date-bar>button.v2-date-trigger.v2-date-holding{
  transform:scale(.955)!important;
  background:#1d333e!important;
  border-color:#6b9a91!important;
  box-shadow:inset 0 3px 12px #08141b9c!important;
}
@media(prefers-reduced-motion:reduce){body .v2-date-bar>button.v2-date-trigger{transition:none!important}}

/* V2 0.1.46: verified-meal HUD feedback, only after cloud ledger readback. */
body[data-v2-page=ai] .miniStat.v2-meal-verified-pulse{animation:v2MealVerified 550ms ease-out both;}
@keyframes v2MealVerified{0%{border-color:#324455;background:var(--card);box-shadow:0 0 0 transparent}28%{border-color:#92d9ba;background:#26473f;box-shadow:0 0 0 2px #79cba34b,0 0 16px #8bdfb94d}100%{border-color:#324455;background:var(--card);box-shadow:0 0 0 transparent}}
@media(prefers-reduced-motion:reduce){body[data-v2-page=ai] .miniStat.v2-meal-verified-pulse{animation:none;border-color:#79ba9d}}
