/* Shared viewport shell: loaded last to retire conflicting legacy device/sidebar rules. */
html[data-theme] body.app-view{margin:0;min-height:100dvh}
html[data-theme] .app-view main{max-width:430px;padding:calc(92px + env(safe-area-inset-top)) 18px calc(116px + env(safe-area-inset-bottom))!important;min-height:100dvh}
html[data-theme] .app-view .app-topbar{display:flex!important;position:fixed;z-index:80;top:0;left:50%;transform:translateX(-50%);width:100%;max-width:430px;min-height:68px;margin:0;box-sizing:border-box;padding:calc(10px + env(safe-area-inset-top)) 18px 10px;gap:10px;background:var(--ff-bg);border-bottom:1px solid var(--ff-border);color:var(--ff-ink)}
.app-topbar .wordmark{display:flex;flex-direction:column;gap:2px;align-items:start;justify-content:center;padding:0;min-width:0;min-height:44px;border:0;background:none;color:var(--ff-ink);font:800 15px/1.3 system-ui;letter-spacing:1.2px;cursor:pointer}
.app-topbar .wordmark span{display:none;font-size:12px;font-weight:400;letter-spacing:0;color:var(--ff-muted)}
.app-topbar .rewards-header{margin-left:auto;gap:8px;flex-shrink:0}
.app-topbar .rewards-header button{gap:4px;font-size:13px;padding:4px;min-width:38px}
.app-topbar .rewards-header svg{width:21px;height:21px}
.app-topbar .topbar-settings{display:grid;place-items:center;flex:0 0 42px;width:42px;height:44px;padding:8px;border:1px solid var(--ff-border);border-radius:12px;background:var(--ff-soft);color:var(--ff-muted);cursor:pointer}
.topbar-settings svg{width:22px;height:22px}
.app-view button:focus-visible,.app-view a:focus-visible,.app-view input:focus-visible,.app-view select:focus-visible,.app-view textarea:focus-visible{outline:3px solid var(--ff-accent);outline-offset:3px}
html[data-theme] .app-view #bottom,html[data-theme] body[data-editing="true"] #bottom{display:flex!important;position:fixed;z-index:70;left:50%;transform:translateX(-50%);top:auto;bottom:0;width:100%;max-width:430px;flex-direction:row;align-items:center;gap:3px;padding:7px 8px max(10px,env(safe-area-inset-bottom));border:0;border-top:1px solid var(--ff-border);border-radius:0;box-sizing:border-box;background:var(--ff-bg);box-shadow:0 -10px 26px #00000008}
html[data-theme] .app-view #bottom>button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;flex:1;min-width:0;min-height:56px;padding:5px 2px;font:500 11px/1.3 system-ui;border:0;border-radius:11px;background:transparent;color:var(--ff-muted)}
html[data-theme] .app-view #bottom>button[aria-pressed="true"]{background:var(--ff-tint);color:var(--ff-accent)}
html[data-theme] .app-view #bottom>button svg{width:23px;height:23px}
html[data-theme] #bottom #more-menu{position:fixed;inset:auto 10px calc(82px + env(safe-area-inset-bottom)) auto!important;transform:none!important;margin:0;width:210px;max-width:calc(100vw - 24px);padding:7px;border:1px solid var(--ff-border);border-radius:16px;background:var(--ff-card);color:var(--ff-ink);box-shadow:0 16px 48px #0004}
html[data-theme] #bottom #more-menu button{min-height:48px;padding:10px 12px;font:500 15px/1.3 system-ui;color:var(--ff-ink);border-radius:10px}
html[data-theme] #bottom #more-menu button:hover,html[data-theme] #bottom #more-menu button:focus-visible{background:var(--ff-tint);color:var(--ff-accent)}
html[data-theme] #bottom #more-menu svg{color:var(--ff-accent);width:22px;height:22px}
html[data-theme] #screen{min-width:0;outline:none}
html[data-theme] #screen h2{font-size:27px;line-height:1.2;letter-spacing:-.5px;margin:0}
.ff-heading,.ex-heading{align-items:center;gap:10px;margin-bottom:20px}
.ff-heading>div,.ex-heading>div{min-width:0;flex:1}
.ff-heading p,.ex-heading p{margin:5px 0 0;color:var(--ff-muted);font-size:14px}
.ff-heading:has(.ff-back){flex-wrap:nowrap}
.ff-heading .ff-pet,.ex-heading .ff-pet{width:32px;height:38px;flex-shrink:0}
html[data-theme] .ff-heading .ff-back{min-width:36px;flex-basis:36px;width:36px;padding:0}
.ff-heading:has(.ff-back) .approved-demo{font-size:10px;padding:5px 7px;flex-shrink:0}
.ff-heading:has(.ff-back):has(.approved-demo) .ff-pet{display:none}
html[data-theme] .ff-card,html[data-theme] #screen .card{border-radius:16px;margin:12px 0;padding:16px}
.ff-card h3{margin:0 0 12px}
html[data-theme] #screen p{overflow-wrap:break-word}
html[data-theme] #screen input,html[data-theme] #screen select,html[data-theme] #screen textarea{box-sizing:border-box;max-width:100%;min-width:0}
html[data-theme] .app-view #message:not([hidden]){z-index:90;bottom:96px;max-height:40dvh;overflow:auto}
.sd-demo{margin:0 0 12px;font-size:11px;color:var(--ff-muted)}
html[data-theme] .sd-tabs{display:flex;gap:4px;background:var(--ff-soft);padding:4px;border:1px solid var(--ff-border);border-radius:13px;margin:0 0 18px}
html[data-theme] .sd-tabs button{flex:1;min-width:0;min-height:42px;border:0;font-size:13px;padding:8px 4px;background:transparent}
html[data-theme] .sd-tabs button[aria-pressed="true"]{background:var(--ff-accent);color:var(--ff-accent-ink)}
html[data-theme] .sd-friend-card{padding:4px 16px 14px}
.sd-friend-card .ff-between{min-height:60px;gap:12px;margin:0}
.sd-friend-card .ff-between h3{margin:0!important}
.sd-friend-card .ff-between button{font-size:13px;min-height:40px;padding:8px 12px}
.sd-friend-list{display:grid}
html[data-theme] .sd-friend-list>button{display:flex;align-items:center;gap:12px;width:100%;min-height:76px;padding:12px 0;border:0;border-bottom:1px solid var(--ff-border);border-radius:0;text-align:left;background:none}
.sd-friend-list .sd-photo{width:48px;height:48px;flex:0 0 48px;border-radius:50%;overflow:hidden}
.sd-friend-list>button>span:nth-child(2){flex:1;min-width:0}
.sd-friend-list b,.sd-friend-list small{display:block}
.sd-friend-list small{font-size:12px;margin-top:4px;color:var(--ff-muted)}
.sd-friend-list>button>span:last-child{color:var(--ff-muted);font-size:22px}
html[data-theme] .sd-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0 0}
html[data-theme] .sd-stats button{font-size:13px;min-height:44px;padding:8px 4px;background:var(--ff-soft)}
html[data-theme] .sd-challenge{background:linear-gradient(135deg,var(--ff-tint),var(--ff-card))}
.sd-challenge>p{font-size:14px;margin:0 0 14px;color:var(--ff-muted)}
.sd-challenge-summary{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sd-challenge-summary strong{font-size:34px;line-height:1.15;color:var(--ff-accent)}
.sd-challenge-summary strong small{display:block;margin-top:4px;color:var(--ff-muted);font-size:12px;font-weight:400}
.sd-challenge-summary button{font-size:13px;padding:8px 12px}
.sd-challenge>.ff-primary{width:100%;margin:6px 0 0}
.sd-week{display:flex;justify-content:space-between;gap:5px;margin:18px 0;min-width:0}
.sd-week>span{display:flex;flex-direction:column;gap:5px;align-items:center;flex:1;min-width:0;padding:7px 0;background:var(--ff-tint);border-radius:10px;font-size:17px;color:var(--approved-success)}
.sd-week .pending{color:var(--ff-muted);background:var(--ff-soft)}
.sd-week small{font-size:10px;color:var(--ff-muted)}
.sd-journey-card{display:grid;grid-template-columns:90px minmax(0,1fr);gap:14px;align-items:center}
.sd-journey-card .sd-story{width:90px;height:150px;border-radius:12px;overflow:hidden}
.sd-journey-card h3{font-size:17px!important;margin:5px 0 8px!important}
.sd-journey-card p{font-size:13px;margin:0 0 10px;color:var(--ff-muted)}
.sd-journey-card small{font-size:11px}
.sd-journey-card button{font-size:13px;min-height:42px;padding:8px 12px}
html[data-theme] .sd-profile{display:flex;align-items:center;gap:14px;padding:18px;background:var(--ff-card);border:1px solid var(--ff-border);border-radius:16px;margin:12px 0}
.sd-profile .sd-photo{width:64px;height:64px;flex:0 0 64px;border-radius:50%;overflow:hidden}
.sd-profile>div{flex:1;min-width:0}
.sd-profile h3{margin:0!important}.sd-profile p{margin:4px 0;font-size:13px}
.sd-profile>button{font-size:13px;min-height:42px;padding:8px 12px}
html[data-theme] .ff-settings-premium{margin:0 0 16px;gap:12px;padding:16px;border-radius:16px}
.ff-settings-premium>span:last-child{font-size:12px;white-space:nowrap}
.ff-settings-extra{margin-top:18px}
.ff-settings-extra .ff-card{margin-bottom:12px}
.ff-settings-list{display:grid;gap:10px;margin:12px 0}
html[data-theme] .ff-settings-list>.ff-row,html[data-theme] .ff-settings-extra>.ff-row{margin:0;min-height:68px}
html[data-theme] .ff-settings-list>.ff-secondary{display:flex;align-items:center;justify-content:space-between;text-align:left;min-height:60px;padding:12px 16px;margin:0}
.ff-settings-list>[role="switch"]::after{content:'';width:36px;height:22px;border-radius:20px;background:var(--ff-muted);box-shadow:inset 14px 0 0 var(--ff-soft);margin-left:12px;flex-shrink:0}
.ff-settings-list>[role="switch"][aria-checked="true"]::after{background:var(--ff-accent);box-shadow:inset -14px 0 0 var(--ff-accent-ink)}
.ff-settings-extra>.ff-row{margin-bottom:10px!important}
.ff-settings .ff-three,.ff-settings .ff-two{background:var(--ff-soft);border-radius:12px;padding:4px;gap:4px}
html[data-theme] .ff-settings .ff-three button,html[data-theme] .ff-settings .ff-two button{min-height:43px;border:0;font-size:14px;background:transparent}
html[data-theme] .ff-settings .ff-three button[aria-pressed="true"],html[data-theme] .ff-settings .ff-two button[aria-pressed="true"]{background:var(--ff-accent);color:var(--ff-accent-ink)}
html[data-theme] #app-menu .menu-heading{background:var(--ff-card);color:var(--ff-ink);border-color:var(--ff-border)}
@media(min-width:800px){
 html.web-layout[data-theme] .app-view main{max-width:1120px;padding:104px 28px 120px!important}
 html.web-layout[data-theme] .app-view .app-topbar{max-width:none;padding-left:max(28px,calc((100vw - 1064px)/2));padding-right:max(28px,calc((100vw - 1064px)/2));min-height:76px}
 html.web-layout .app-topbar .wordmark{font-size:20px}.web-layout .app-topbar .wordmark span{display:block}
 html.web-layout[data-theme] .app-view #bottom{width:min(680px,calc(100% - 48px));max-width:680px;bottom:14px;border:1px solid var(--ff-border);border-radius:20px;padding:8px;box-shadow:0 10px 40px #0003}
 html.web-layout[data-theme] .app-view #bottom>button{flex-direction:row;gap:10px;font-size:14px;min-height:52px}
 html.web-layout[data-theme] #bottom #more-menu{right:max(34px,calc((100vw - 660px)/2))!important;bottom:96px!important}
 html.web-layout .approved-home-grid,html.web-layout .approved-progress-grid,html.web-layout .approved-exercise-grid,html.web-layout .approved-session-grid,html.web-layout .sd-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}
 html.web-layout .sd-layout .ff-card:first-child{margin-top:0}
 html.web-layout #screen h2{font-size:32px}
 html.web-layout .ff-settings{max-width:760px;margin:0 auto;display:grid;grid-template-columns:1fr 1fr;gap:0 20px}
 html.web-layout .ff-settings>.ff-heading,html.web-layout .ff-settings>.ff-settings-premium{grid-column:1/-1}
 html.web-layout .ff-settings-list,html.web-layout .ff-settings-extra{display:block;margin-top:12px}
 html.web-layout .ff-settings-list>*{margin-bottom:10px!important}
 html.web-layout body:not([data-page="home"]):not([data-page="gym"]):not([data-page="nutrition"]):not([data-page="progress"]):not([data-page="social"]):not([data-page="settings"]):not([data-page="exercise-strength"]):not([data-page="exercise-session"]) #screen{max-width:800px;margin:0 auto}
 html.web-layout .ff-nutrition-wrap,html.web-layout #screen:has(.food-editor){max-width:none}
 html.web-layout .ff-nutrition .v4-meal-plan{display:grid;grid-template-columns:1fr 1fr;gap:12px}
 html.web-layout .v4-plan-heading,html.web-layout .v4-preview-note,html.web-layout .v4-add-plan,html.web-layout .v4-meal-plan>.ff-primary{grid-column:1/-1}
 html.web-layout .food-editor{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
 html.web-layout .food-editor>p,html.web-layout .food-editor>.measure-actions{grid-column:1/-1}
}
@media(max-width:359px){html[data-theme] .app-view main{padding:calc(88px + env(safe-area-inset-top)) 12px calc(114px + env(safe-area-inset-bottom))!important}.app-topbar .wordmark{font-size:13px}.app-topbar .rewards-header{gap:3px}.app-topbar .topbar-settings{flex-basis:36px;width:36px}html[data-theme] .app-view .app-topbar{padding-left:12px;padding-right:12px;gap:6px}html[data-theme] #screen h2{font-size:24px}.ff-heading p{font-size:13px}.sd-profile{flex-wrap:wrap}.sd-profile>button{width:100%}.sd-journey-card{grid-template-columns:76px minmax(0,1fr);gap:12px}.sd-journey-card .sd-story{width:76px}}
@media(prefers-reduced-motion:reduce){.app-view *{scroll-behavior:auto!important}}

.approved-habits-chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:9px;margin:18px 0 10px}
.approved-habits-chart>div{min-width:0;text-align:center}
.habit-bars{height:72px;display:flex;align-items:end;justify-content:center;gap:4px;border-bottom:1px solid var(--ff-border)}
.habit-bars>span{display:block;flex:1;max-width:15px;background:var(--approved-success);border-radius:3px 3px 0 0}
.habit-bars>.habit-exercise{background:var(--ff-accent)}
.approved-habits-chart small{display:block;font-size:11px;margin-top:8px;color:var(--ff-muted)}
.habit-legend{display:flex;gap:16px;margin:12px 0 20px;font-size:12px;color:var(--ff-muted)}
.habit-legend>span{display:flex;align-items:center;gap:6px}.habit-legend i{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--approved-success)}.habit-legend>span:nth-child(2) i{background:var(--ff-accent)}
.habit-bars>.habit-height-0{height:0%}
.habit-bars>.habit-height-1{height:10%}
.habit-bars>.habit-height-2{height:20%}
.habit-bars>.habit-height-3{height:30%}
.habit-bars>.habit-height-4{height:40%}
.habit-bars>.habit-height-5{height:50%}
.habit-bars>.habit-height-6{height:60%}
.habit-bars>.habit-height-7{height:70%}
.habit-bars>.habit-height-8{height:80%}
.habit-bars>.habit-height-9{height:90%}
.habit-bars>.habit-height-10{height:100%}
.approved-goal-progress{display:block;padding:18px!important}
.approved-goal-progress>div{align-items:start}
.approved-goal-progress strong{font-size:22px;margin-top:14px}
.approved-goal-progress .approved-confidence{margin-top:16px;padding:12px 0 0;border-left:0;border-top:1px solid var(--ff-border);display:flex;align-items:center;gap:8px}
.approved-goal-progress .approved-confidence span{display:flex;gap:8px;align-items:center}
.approved-goal-progress .approved-confidence small{margin:0}

/* Editor controls must not inherit legacy full-width button margins. */
html[data-theme] .food-editor #food-form{display:flex;flex-direction:column;gap:10px;padding:16px}
html[data-theme] .food-editor #food-form>*{margin:0}
html[data-theme] .food-editor #food-form>label{margin-top:4px}
html[data-theme] .food-editor #food-form>.primary{margin-top:4px}
html[data-theme] .food-editor .approved-food-picker button{margin:0;min-height:44px}
html[data-theme] .food-editor .approved-food-picker .ff-tabs{padding:4px;gap:4px;min-height:0}
html[data-theme] .food-editor .approved-food-picker .ff-tabs>button{min-height:42px;padding:8px}
html[data-theme] .food-editor .approved-food-select{padding:8px;gap:10px}
html[data-theme] .food-editor .approved-food-select .approved-art{width:58px;height:58px;flex:0 0 58px}
html[data-theme] .food-editor .approved-food-choice{min-height:0}
html[data-theme] .food-editor .approved-food-choice button[data-food="favorite"]{padding:8px;width:44px;min-width:44px}
html[data-theme] .food-editor .approved-food-choice b{font-size:14px}
html[data-theme] .food-editor .sr-only{margin:-1px!important}
html[data-theme] .food-editor .small{font-size:12px;line-height:1.4}
html[data-theme] .food-editor .approved-portions button{margin:0}

.ex-unconfigured{padding:24px 18px;border:1px solid var(--ff-border);border-radius:16px;background:var(--ff-card);text-align:center}.ex-unconfigured b{font-size:22px;color:var(--ff-accent)}.ex-unconfigured p{font-size:14px;color:var(--ff-muted);margin:8px 0 0}

.ex-week-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;text-align:center;margin:18px 0}.ex-week-summary b,.ex-week-summary small{display:block}.ex-week-summary b{font-size:28px;color:var(--ff-accent)}.ex-week-summary small{font-size:12px;color:var(--ff-muted)}.approved-week-grid>div>.ff-card>button{width:100%;margin:8px 0 0}
@media(min-width:800px){html.web-layout .approved-week-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}}
html[data-theme] #app-menu .billing-choice{background:var(--ff-soft);border-color:var(--ff-border)}
html[data-theme] #app-menu .billing-choice button{background:none;color:var(--ff-muted);font-size:13px;min-height:44px}
html[data-theme] #app-menu .billing-choice button[aria-pressed="true"]{background:var(--ff-accent);color:var(--ff-accent-ink);box-shadow:none}
html[data-theme] #app-menu .pricing-stack section{background:var(--ff-soft);border-color:var(--ff-border);border-radius:16px;padding:18px}
html[data-theme] #app-menu .pricing-stack h3,html[data-theme] #app-menu .premium-price strong{color:var(--ff-ink)}
html[data-theme] #app-menu .premium-plan{background:var(--ff-tint);border-color:var(--ff-accent);box-shadow:none}
html[data-theme] #app-menu .premium-kicker,html[data-theme] #app-menu .premium-plan li::before,html[data-theme] #app-menu #billing-detail{color:var(--ff-accent)}
html[data-theme] #app-menu .premium-plan li,html[data-theme] #app-menu p,html[data-theme] #app-menu small,html[data-theme] #app-menu .current-plan,html[data-theme] #app-menu .price-anchor,html[data-theme] #app-menu #annual-reference,html[data-theme] #app-menu .premium-price span{color:var(--ff-muted)}
html[data-theme] #app-menu .price-anchor span{color:var(--ff-accent);background:var(--ff-soft)}
html[data-theme] #app-menu .menu-primary{background:var(--ff-accent);color:var(--ff-accent-ink);border:0;min-height:48px;font-size:15px}
html[data-theme] #app-menu .premium-plan ul{font-size:14px;line-height:1.5}
html[data-theme] #app-menu .menu-heading button{min-width:44px;min-height:44px}

html[data-theme] .app-view .app-topbar{opacity:1!important}
html[data-theme] #screen button{text-decoration:none}

/* Secondary screens use the same compact blue controls as the approved boards. */
:root[data-theme="light"]{--ff-accent:#0868df;--ff-accent-ink:#fff}
html[data-theme] #screen button.primary{background:var(--ff-accent);color:var(--ff-accent-ink);border-color:var(--ff-accent)}
html[data-theme] #screen .meal-tabs button[aria-pressed="true"]{background:var(--ff-accent);color:var(--ff-accent-ink);border-color:var(--ff-accent)}
html[data-theme] body[data-page="food"] #screen button:not(.primary){background:var(--ff-card);color:var(--ff-ink);border-color:var(--ff-border)}
html[data-theme] body[data-page="food"] #screen button[aria-pressed="true"]{background:var(--ff-accent);color:var(--ff-accent-ink)}
html[data-theme] .ff-settings>.ff-card{display:flex;align-items:center;gap:12px;padding:12px;margin:10px 0}
html[data-theme] .ff-settings>.ff-card h3{flex:1;margin:0;font-size:15px}
.ff-settings>.ff-card>.ff-three,.ff-settings>.ff-card>.ff-two{flex:1.8;gap:4px}
html[data-theme] #screen .ff-settings>.ff-card{padding:12px;min-height:0}
html[data-theme] #screen .ff-settings>.ff-card>.ff-three,html[data-theme] #screen .ff-settings>.ff-card>.ff-two{margin:0}
html[data-theme] #screen .ff-settings-list{padding:0;border:0;background:none}
html[data-theme] .ff-settings>.ff-card button{font-size:12px;min-height:44px;padding:8px 5px;margin:0}
html[data-theme] .ff-settings .ff-row{min-height:66px;padding:10px 12px;margin:8px 0}
html[data-theme] .ff-settings-list>button.ff-secondary{width:100%;text-align:left;margin:8px 0;padding:12px}
html[data-theme] .ff-settings-extra>.ff-card{display:flex;align-items:center;gap:12px;padding:12px}
html[data-theme] .ff-settings-extra>.ff-card h3{flex:1;margin:0;font-size:15px}
html[data-theme] .ff-settings-extra>.ff-card button{font-size:13px;min-height:44px;margin:0}
html[data-theme] .ex-filters{gap:4px;margin:12px 0}
html[data-theme] .ex-filters button{font-size:13px;padding:8px 5px;min-width:0;flex:1}
html[data-theme] .ex-routine-card{display:grid;grid-template-columns:96px minmax(0,1fr);gap:14px;padding:12px}
.ex-routine-card>.approved-art{width:96px!important;height:110px!important;border-radius:10px;overflow:hidden;align-self:center}
html[data-theme] .ex-routine-card h3{font-size:16px;margin:0 0 5px}
.ex-routine-card p{font-size:13px;color:var(--ff-muted);margin:0 0 10px}
html[data-theme] .ex-routine-card button{font-size:13px;min-height:44px;margin:0;padding:8px 12px}
html[data-theme] .ex-detail-ring{margin:12px 0}
html[data-theme] .ex-detail-ring .ex-ring{width:124px;height:124px;margin:0 auto}
html[data-theme] .ex-detail-ring .ex-ring b{font-size:24px}
html[data-theme] .ex-heading .ff-pet{display:none}
.ex-cardio-preview{margin:14px 0;border-radius:12px;overflow:hidden}.ex-cardio-preview>.approved-art{display:block;width:100%!important;height:150px!important}
html[data-theme] .food-editor .approved-food-picker{display:flex;flex-direction:column;gap:8px;margin:5px 0}
html[data-theme] .food-editor .approved-food-picker>*:not(.sr-only){margin:0!important}
.approved-food-results{max-height:218px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ff-border) var(--ff-bg)}
html[data-theme] .food-editor .approved-food-results .approved-food-choice{margin:0 0 6px}
html[data-theme] .food-editor .approved-food-select{padding:6px;gap:8px}
html[data-theme] .food-editor .approved-food-select .approved-art{width:48px;height:48px;flex-basis:48px}
html[data-theme] .food-editor .approved-food-choice b{font-size:13px}
html[data-theme] .food-editor #food-form{gap:7px;padding:12px}
html[data-theme] .food-editor #food-form>button.primary{margin:0}
html[data-theme] .food-editor #food-form .approved-details>summary{min-height:44px;padding:10px 0}
html[data-theme] .food-editor #food-form .approved-details{padding:0 12px}
@media(max-width:359px){.ff-settings>.ff-card>.ff-three,.ff-settings>.ff-card>.ff-two{flex:2}.ff-settings>.ff-card h3{font-size:13px!important}.ex-routine-card{grid-template-columns:76px minmax(0,1fr)!important;gap:10px!important}.ex-routine-card>.approved-art{width:76px!important;height:100px!important}}

/* Large /app views frame the shared app; small devices keep the normal viewport. */
.device-preview-frame{display:none;pointer-events:none}
html.device-embed{scrollbar-width:none}
html.device-embed .approved-food-results{max-height:192px}
html[data-theme] .food-notice:empty{display:none}
html[data-theme] #screen .food-editor{margin:0!important}
html[data-theme] .food-editor .approved-food-choice b{line-height:1.2}
html.device-embed .food-editor #food-form>button.primary{position:fixed;z-index:75;left:50%;transform:translateX(-50%);bottom:84px;margin:0!important;width:calc(100% - 36px);max-width:394px;box-shadow:0 0 0 8px var(--ff-bg),0 -8px 24px #0002}
html.device-embed body[data-editing="true"] main{padding-bottom:180px!important}
html.device-embed .food-editor #food-form{display:grid;grid-template-columns:minmax(0,1fr) auto;padding-top:10px}
html.device-embed .food-editor #food-form>h3{grid-column:1;font-size:16px}
html.device-embed .food-editor #food-form>p.small{grid-column:2;grid-row:1;align-self:center;font-size:11px}
html.device-embed .food-editor #food-form>.approved-portions,html.device-embed .food-editor #food-form>.approved-details,html.device-embed .food-editor #food-form>button{grid-column:1/-1}
@media(min-width:600px) and (min-height:600px){
 html.device-embed{--preview-top:max(24px,calc((100dvh - 940px)/2));--preview-bottom:var(--preview-top)}
 html.device-embed body.app-view{background:radial-gradient(ellipse at top,#243e57,#07121d 72%);overflow:hidden}
 html.device-embed .device-preview-frame{display:block;position:fixed;z-index:100;top:var(--preview-top);bottom:var(--preview-bottom);left:50%;transform:translateX(-50%);width:454px;border:12px solid #080d12;border-radius:48px;background:transparent;box-sizing:border-box;box-shadow:0 0 0 2px #8496a6,0 0 0 5px #142333,0 24px 70px #0006;pointer-events:none}
 html.device-embed .device-preview-frame::before{content:"";position:absolute;inset:32px 0 20px;background:transparent;border-radius:0;pointer-events:none}
 .device-preview-status{display:flex;align-items:center;justify-content:space-between;position:absolute;top:0;left:0;right:0;height:32px;padding:0 23px;border-radius:32px 32px 0 0;background:var(--ff-bg);color:var(--ff-ink);font:600 12px/1 system-ui}
 .device-preview-island{width:110px;height:23px;background:#080d12;border-radius:20px}
 .device-preview-home{position:absolute;bottom:0;left:0;right:0;height:20px;background:var(--ff-bg);border-radius:0 0 32px 32px}
 .device-preview-home::after{content:"";display:block;width:110px;height:4px;margin:8px auto;background:var(--ff-ink);border-radius:4px}
 html.device-embed .app-view main{position:fixed;top:calc(var(--preview-top) + 44px);bottom:calc(var(--preview-bottom) + 32px);left:calc(50% - 215px);transform:none;width:430px;max-width:430px;min-height:0;overflow:auto;background:var(--ff-bg);scrollbar-width:thin;scrollbar-color:var(--ff-border) var(--ff-bg);padding-top:92px!important;padding-bottom:116px!important}
 html.device-embed .app-view .app-topbar{top:calc(var(--preview-top) + 44px);width:430px;z-index:110}
 html.device-embed .app-view #bottom{bottom:calc(var(--preview-bottom) + 32px);width:430px;z-index:110}
 html.device-embed .app-view #message:not([hidden]){bottom:calc(var(--preview-bottom) + 116px);max-width:390px}
 html.device-embed .food-editor #food-form>button.primary{bottom:calc(var(--preview-bottom) + 116px)}
 html.device-embed dialog{max-width:390px;max-height:calc(100dvh - 2 * var(--preview-top) - 100px)}
}

/* Approved Nutrition proposal: shared semantics, desktop composition, mobile fallback. */
.nutrition-add-top,.nutrition-details{display:none}
html[data-theme] .nutrition-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
html[data-theme] .nutrition-title-row .ff-pet{position:static;width:30px;height:36px;flex:none}
html[data-theme] .nutrition-title-row .approved-demo{margin:0;position:static}
html[data-theme] .ff-nutrition .nutrition-heading>div{padding-right:0}
html[data-theme] .ff-nutrition .v4-nutrition-tabs{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px!important;align-items:center}
.ff-nutrition .v4-nutrition-tabs>.v4-tabs{order:0}
.ff-nutrition .v4-nutrition-tabs>.v4-kit{order:1}
.nutrition-day-nav{order:2;grid-column:1/-1;display:flex;gap:12px;align-items:center;justify-content:center}
html[data-theme] .nutrition-day-nav>button{width:44px;min-height:44px;padding:4px;font-size:25px}
.nutrition-day-nav label{position:relative;display:flex;align-items:center;justify-content:center;min-height:44px;font-size:14px;flex:1;max-width:230px}
.nutrition-day-nav input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.nutrition-day-nav label:focus-within{outline:2px solid var(--ff-accent);outline-offset:2px;border-radius:8px}
.nutrition-meal-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:6px}
.nutrition-meal-meta>small{font-size:12px;color:var(--ff-muted)}
.nutrition-meal-status{font-size:11px;color:var(--ff-ink);background:var(--ff-soft);border:1px solid var(--ff-border);padding:3px 7px;border-radius:20px}
html[data-theme] .v4-meal-info>.nutrition-estimate{margin-top:6px;font-size:11px!important}
html[data-theme] .v4-planned-meal[data-status="eaten"] .nutrition-meal-status{color:var(--approved-success)}
@media(min-width:800px){
 html.web-layout[data-theme] body[data-page="nutrition"] main{max-width:1240px;padding-top:112px!important}
 html.web-layout[data-theme] body[data-page="nutrition"] .app-topbar{padding-left:max(28px,calc((100vw - 1184px)/2));padding-right:max(28px,calc((100vw - 1184px)/2))}
 html.web-layout[data-theme] .ff-nutrition .nutrition-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:20px}
 html.web-layout[data-theme] .nutrition-title-row h2{font-size:34px!important}
 html.web-layout[data-theme] .ff-nutrition .nutrition-heading p{font-size:16px;margin:6px 0 0}
 html.web-layout[data-theme] .nutrition-add-top{display:block;flex:none;width:auto!important;min-height:48px;padding:10px 22px;margin:0!important;font-size:16px!important}
 html.web-layout[data-theme] .ff-nutrition .v4-nutrition-tabs{grid-template-columns:230px minmax(0,1fr) auto!important;gap:20px!important;margin-bottom:18px}
 html.web-layout[data-theme] .ff-nutrition .v4-tabs button{font-size:15px!important;min-height:44px}
 html.web-layout[data-theme] .nutrition-day-nav{order:1;grid-column:auto;justify-content:start}
 html.web-layout[data-theme] .nutrition-day-nav label{flex:none;min-width:180px;font-size:15px}
 html.web-layout[data-theme] .ff-nutrition .v4-nutrition-tabs>.v4-kit{order:2;width:145px!important;min-height:44px;gap:12px;font-size:14px!important}
 html.web-layout[data-theme] .ff-nutrition .v4-nutrition-progress:not(.v4-nutrition-macros){position:relative;min-height:54px!important;margin:0 0 24px!important;padding:12px 16px!important}
 html.web-layout[data-theme] .ff-nutrition .v4-nutrition-progress:not(.v4-nutrition-macros) .v4-meal-ring{width:auto!important;height:auto!important;flex:1!important}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-ring>svg{display:none}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-ring>div{position:static;inset:auto;transform:none;display:flex;align-items:center;flex-direction:row;justify-content:flex-start!important;gap:8px;font-size:16px}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-ring b{font-size:18px!important}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-ring small{font-size:15px!important}
 html.web-layout[data-theme] .ff-nutrition .v4-ring-icon{display:flex!important;margin-right:6px;color:var(--ff-accent)}
 html.web-layout[data-theme] .ff-nutrition .v4-ring-icon svg{width:23px;height:23px}
 html.web-layout[data-theme] .nutrition-details{display:block;position:absolute;right:12px;top:6px;font-size:14px!important;min-height:42px;background:transparent!important;border:0!important;color:var(--ff-accent)!important}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-plan{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
 html.web-layout[data-theme] .v4-plan-heading{margin:0!important;align-items:center;min-height:48px}
 html.web-layout[data-theme] .v4-plan-heading h3{font-size:21px!important}
 html.web-layout[data-theme] .v4-yesterday-plan{font-size:14px!important;min-height:44px!important;padding:8px 12px!important}
 html.web-layout[data-theme] .v4-preview-note{font-size:13px!important;padding:0!important;background:none!important;border:0!important;margin:0 0 2px!important}
 html.web-layout[data-theme] .ff-nutrition .v4-planned-meal{grid-template-columns:132px minmax(0,1fr) 20px!important;gap:12px!important;padding:12px;min-height:216px;align-items:start;box-sizing:border-box;margin:0}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-photo{width:132px!important;height:190px!important;grid-row:1/3;align-self:stretch;border-radius:12px!important}
 html.web-layout[data-theme] .v4-meal-photo .approved-art{width:100%;height:100%;border-radius:inherit}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-info>b{font-size:18px!important;line-height:1.3}
 html.web-layout[data-theme] .nutrition-meal-meta>small{font-size:13px}
 html.web-layout[data-theme] .nutrition-meal-status{font-size:12px;padding:3px 8px}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-info>.nutrition-estimate{font-size:13px!important;line-height:1.4;margin:8px 0}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-info .v4-portion{min-height:40px!important;background:var(--ff-soft)!important;border:1px solid var(--ff-border)!important;font-size:14px!important;padding:8px!important}
 html.web-layout[data-theme] .v4-meal-actions{grid-column:2/4;align-self:end;min-width:0}
 html.web-layout[data-theme] .v4-meal-actions button{min-height:44px!important;font-size:15px!important;margin:0!important}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-menu{grid-column:3;grid-row:1;justify-self:end}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-menu>summary{min-width:20px;min-height:44px}
 html.web-layout[data-theme] .v4-planned-macros,html.web-layout[data-theme] .v4-meal-estimate{grid-column:1/-1;font-size:13px!important}
 html.web-layout[data-theme] .ff-nutrition .v4-meal-plan>.ff-primary{display:none}
 html.web-layout[data-theme] .nutrition-metrics{margin:0 0 20px}
}
@media(min-width:1200px){html.web-layout[data-theme] .ff-nutrition .v4-meal-plan{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:359px){html[data-theme] .ff-nutrition .v4-nutrition-tabs{grid-template-columns:minmax(0,1fr) 100px!important}html[data-theme] .ff-nutrition .v4-kit{width:100px!important}.nutrition-title-row{gap:7px}.nutrition-meal-meta{gap:4px}.nutrition-meal-status{font-size:10px}}

@media(min-width:800px){html.web-layout[data-theme] .ff-nutrition .v4-add-plan{justify-self:start;width:auto!important;min-height:44px;font-size:14px;padding:8px 14px;margin:0!important}html.web-layout[data-theme] .ff-nutrition .v4-meal-menu>summary{display:flex;align-items:center;justify-content:center;padding:0!important}}

@media(min-width:800px){html.web-layout[data-theme] .ff-nutrition .v4-nutrition-progress:not(.v4-nutrition-macros) .v4-meal-ring .v4-ring-icon svg{display:block!important}html.web-layout[data-theme] .ff-nutrition .v4-yesterday-plan{max-width:none;white-space:nowrap}}

html[data-theme] .ff-nutrition .v4-kit{max-width:none!important}
@media(min-width:800px){html.web-layout[data-theme] .ff-nutrition .v4-kit{background:transparent!important;border:0!important;color:var(--ff-ink)!important;justify-content:flex-end;padding:0!important}html.web-layout[data-theme] .ff-nutrition .v4-kit>span:first-child{white-space:nowrap}html.web-layout[data-theme] .ff-nutrition .v4-toggle{display:block;width:36px;min-width:36px;height:20px;border-radius:20px;background:var(--ff-accent);position:relative;flex:none}html.web-layout[data-theme] .ff-nutrition .v4-toggle::after{content:'';position:absolute;width:14px;height:14px;top:3px;right:3px;left:auto;background:var(--ff-accent-ink);border-radius:50%}html.web-layout[data-theme] .ff-nutrition .v4-toggle.off{background:var(--ff-muted)}html.web-layout[data-theme] .ff-nutrition .v4-toggle.off::after{left:3px;right:auto}}

@media(min-width:800px){html.web-layout[data-theme] .ff-nutrition .v4-tabs button,html.web-layout[data-theme] .ff-nutrition .v4-kit,html.web-layout[data-theme] .nutrition-day-nav button{margin:0!important}html.web-layout[data-theme] .ff-nutrition .v4-meal-plan{margin:0!important;gap:12px 18px}html.web-layout[data-theme] .ff-nutrition .v4-nutrition-progress:not(.v4-nutrition-macros){margin-bottom:12px!important}html.web-layout[data-theme] .ff-nutrition .v4-plan-heading{min-height:44px}html.web-layout[data-theme] .ff-nutrition .v4-planned-meal{margin-bottom:0!important}}

/* Accessible activity choices and approved upper-body session composition. */
html[data-theme] .accessible-exercise-grid{display:grid;gap:14px}
html[data-theme] .accessible-session-card{display:grid;grid-template-columns:105px minmax(0,1fr);gap:14px;padding:14px!important;margin:0!important}
html[data-theme] .accessible-session-card .session-choice-art{width:105px;height:190px;border-radius:14px}
html[data-theme] .accessible-session-card h3{font-size:21px;line-height:1.25;margin:8px 0}
html[data-theme] .accessible-session-card p{font-size:13px;line-height:1.4;margin:8px 0}
html[data-theme] .accessible-session-card button{width:100%;min-height:48px;margin:6px 0 0!important}
html[data-theme] .accessible-activity-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
html[data-theme] .accessible-activity-choice{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px!important;margin:0!important;white-space:normal;text-align:center;min-width:0}
html[data-theme] .accessible-activity-choice .approved-art{width:80px;height:80px;border-radius:16px}
html[data-theme] .accessible-activity-choice strong{font-size:17px;line-height:1.3}
html[data-theme] .accessible-activity-choice>span{color:var(--ff-muted);font-size:13px}
html[data-theme] .accessible-plan-details{margin:0!important}
html[data-theme] .accessible-session-heading{position:relative}
html[data-theme] .accessible-session-heading .ff-heading{padding-right:58px!important}
html[data-theme] .accessible-session-heading .ff-heading h2{font-size:21px!important;line-height:1.25}
html[data-theme] .accessible-session-heading .approved-demo,html[data-theme] .accessible-session-heading .ff-pet{display:none}
html[data-theme] .accessible-session-heading [data-session-pause]{position:absolute;right:0;top:5px;min-width:54px;min-height:48px;width:auto;border-radius:24px;margin:0!important;padding:8px!important;font-size:13px!important;color:var(--ff-ink)!important;background:var(--ff-soft)!important;border:2px solid var(--ff-accent)!important}
html[data-theme] .accessible-live-session{gap:12px!important}
html[data-theme] .accessible-live-session .session-step{margin:0 0 10px;font-size:14px;color:var(--ff-muted)}
html[data-theme] .accessible-live-session .approved-technique-card{grid-template-columns:135px minmax(0,1fr)!important;gap:12px!important;padding:12px!important;margin:0 0 12px!important}
html[data-theme] .accessible-live-session .approved-technique-card>.approved-art{width:135px!important;height:162px!important;border-radius:12px}
html[data-theme] .accessible-live-session .approved-technique-card h3{font-size:18px!important;line-height:1.25;margin:0 0 8px!important}
html[data-theme] .accessible-live-session .approved-technique-card p{font-size:13px!important;line-height:1.45;margin:0 0 6px}
html[data-theme] .accessible-live-session .approved-technique-card button{font-size:14px;min-height:44px;background:transparent!important;color:var(--ff-accent)!important;border:0!important;padding:0!important}
html[data-theme] .accessible-live-session .approved-set-card{padding:10px!important;margin:0!important}
html[data-theme] .accessible-live-session table{width:100%;table-layout:fixed;text-align:center}
html[data-theme] .accessible-live-session caption{text-align:left;font-size:13px;margin-bottom:8px}
html[data-theme] .accessible-live-session th,html[data-theme] .accessible-live-session td{padding:7px 4px!important;font-size:14px!important;text-align:center}
html[data-theme] .accessible-live-session th{font-size:12px!important}
html[data-theme] .accessible-live-session td small{display:block;font-size:10px;overflow-wrap:anywhere}
html[data-theme] .accessible-live-session input{width:100%;min-width:0;box-sizing:border-box;min-height:44px;text-align:center;padding:6px 2px!important;font-size:16px!important}
html[data-theme] .session-current-set{background:var(--ff-soft)}
html[data-theme] .session-future-set{color:var(--ff-muted)}
html[data-theme] .accessible-live-session .approved-time{margin-top:8px;padding-top:8px;font-size:14px}
html[data-theme] .accessible-live-session .approved-time strong{font-size:18px}
html[data-theme] .session-primary-actions>button{width:100%;min-height:48px;margin:0 0 10px!important}
html[data-theme] .session-primary-actions [data-session-rest]{text-align:left;background:var(--ff-soft)!important}
html[data-theme] .session-primary-actions [data-ex="pain"]{border-color:var(--ff-accent)!important}
html[data-theme] .session-primary-actions [data-ex="finish"]{background:transparent!important;color:var(--ff-accent)!important;border:0!important}
html[data-theme] .session-extras{margin:6px 0 12px}
html[data-theme] .session-extras summary{min-height:44px;display:flex;align-items:center;font-size:14px;cursor:pointer}
@media(max-width:359px){html[data-theme] .accessible-session-card{grid-template-columns:78px minmax(0,1fr);gap:10px}html[data-theme] .accessible-session-card .session-choice-art{width:78px;height:180px}html[data-theme] .accessible-session-card h3{font-size:19px}html[data-theme] .accessible-live-session .approved-technique-card{grid-template-columns:110px minmax(0,1fr)!important;gap:8px!important}html[data-theme] .accessible-live-session .approved-technique-card>.approved-art{width:110px!important;height:145px!important}}
@media(min-width:800px){html.web-layout[data-theme] .accessible-exercise-grid{grid-template-columns:1fr 1fr;align-items:start}html.web-layout[data-theme] .accessible-session-card{grid-column:1;grid-row:1/3;grid-template-columns:150px minmax(0,1fr)}html.web-layout[data-theme] .accessible-session-card .session-choice-art{width:150px;height:230px}html.web-layout[data-theme] .accessible-activity-choices{grid-column:2}html.web-layout[data-theme] .accessible-live-session{grid-template-columns:1.15fr 1fr!important}}
html[data-text-size="large"] .accessible-session-card h3,html[data-text-size="large"] .accessible-activity-choice strong{font-size:23px!important}

html[data-theme] .accessible-session-heading [data-session-pause]{width:50px;min-width:50px;height:50px;font-size:23px!important;line-height:1;border-radius:50%}
html[data-theme] .accessible-session-card h3{font-size:21px!important}
