/* The app fills the viewport; cards belong to content, not the outer shell. */
html,body { margin:0; min-height:100%; background:#f6f8f3; }
html { overscroll-behavior:none; }
#food-rhythm { max-width:520px; margin:0 auto; }
#food-rhythm .fr-phone { min-height:100dvh; border:0; border-radius:0; box-shadow:none; overflow:visible; padding-top:env(safe-area-inset-top); }
#food-rhythm .fr-main { min-height:0; }
#food-rhythm .fr-nav { bottom:env(safe-area-inset-bottom,0px); width:min(496px,100vw); }
#food-rhythm .fr-details-language { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; }
#food-rhythm .fr-details-content { min-height:0; }
#food-rhythm .fr-goals-hero,#food-rhythm .fr-details-hero { overflow:visible; }
#food-rhythm .fr-details-mascot { right:26px; }
#food-rhythm .fr-goals-mascot { right:24px; }
#food-rhythm .fr-profile-mascot { right:20px; }
/* Extra SVG drawing space keeps the animated leaf inside its canvas on iOS. */
#food-rhythm .fr-choice-mascot .fr-mascot-canvas { width:124%; max-width:none; height:auto; margin:-48% -12% -10%; overflow:visible; }
#food-rhythm .fr-goals-new .fr-error:empty { display:none; }
#food-rhythm input[aria-invalid=true] { outline:2px solid var(--fr-tongue); }

html.fr-home-locked,html.fr-home-locked body { height:100%; overflow:hidden; overscroll-behavior:none; }
#food-rhythm.fr-is-day .fr-phone { height:100dvh; min-height:0; overflow:hidden; }
#food-rhythm.fr-is-day .fr-main { height:100%; padding:14px 16px calc(88px + env(safe-area-inset-bottom)); }
#food-rhythm .fr-diary { position:relative; height:100%; display:flex; flex-direction:column; gap:8px; min-height:0; }
#food-rhythm .fr-diary-heading { flex:none; height:48px; }
#food-rhythm .fr-diary-heading h1 { font-size:30px; }
#food-rhythm .fr-calendar-toggle { width:44px; height:44px; }
#food-rhythm .fr-calendar-area { position:relative; z-index:4; flex:none; background:#f6f8f3; touch-action:none; border-radius:0 0 22px 22px; }
#food-rhythm .fr-week { margin:0; height:56px; max-height:56px; }
#food-rhythm .fr-week .fr-date { min-height:50px; padding:5px 0; }
#food-rhythm .fr-calendar-handle { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; width:100%; height:32px; border:0; background:transparent; color:var(--fr-muted); touch-action:none; }
#food-rhythm .fr-calendar-handle>span { width:34px; height:4px; border-radius:8px; background:color-mix(in srgb,var(--fr-leaf) 28%,white); }
#food-rhythm .fr-calendar-handle small { font-size:9px; line-height:12px; }
#food-rhythm .fr-calendar-open .fr-calendar-area { position:absolute; top:56px; left:0; right:0; box-shadow:0 14px 24px #163d3220; padding:0 6px 6px; }
#food-rhythm .fr-calendar-open .fr-week { height:0; max-height:0; }
#food-rhythm .fr-calendar-open .fr-dashboard { opacity:.22; pointer-events:none; margin-top:96px; }
#food-rhythm .fr-calendar-reveal { transition:grid-template-rows .25s,opacity .25s,transform .25s; }
#food-rhythm .fr-calendar { row-gap:2px; margin-top:8px; }
#food-rhythm .fr-calendar .fr-date { height:38px; min-height:38px; width:38px; }
#food-rhythm .fr-month-head { margin:4px 0; }
#food-rhythm .fr-dashboard { display:flex; flex-direction:column; gap:10px; flex:1; min-height:0; touch-action:none; transition:opacity .2s; }
#food-rhythm .fr-diary-stats { flex:1.25; min-height:0; display:flex; flex-direction:column; justify-content:center; padding:12px; }
#food-rhythm .fr-energy-ring { flex:none; width:clamp(104px,20dvh,170px); height:clamp(104px,20dvh,170px); margin:0 auto 10px; padding:8px; background:conic-gradient(var(--fr-leaf) 0 var(--fr-fill),#e8eee5 var(--fr-fill) 100%); }
#food-rhythm .fr-energy-core strong { font-size:34px; }
#food-rhythm .fr-diary-metrics { flex:1; grid-auto-rows:minmax(0,1fr); gap:10px; min-height:0; margin:0; }
#food-rhythm .fr-diary-metrics:empty { display:none; }
#food-rhythm .fr-diary-extra { min-height:0; padding:10px; grid-template-columns:34px minmax(0,1fr); gap:8px; }
#food-rhythm .fr-extra-icon { width:34px; height:34px; }
#food-rhythm .fr-diary-extra strong { font-size:16px; }
#food-rhythm .fr-diary-extra .fr-meter { margin-top:6px; }
#food-rhythm .macro__value { font-size:15px; }
#food-rhythm .fr-family-pager { flex:none; display:flex; flex-direction:column; align-items:center; gap:0; }
#food-rhythm .fr-family-pager>span { color:var(--fr-leaf); font-size:12px; font-weight:650; }
#food-rhythm .fr-family-pager>div { display:flex; }
#food-rhythm .fr-family-dot { width:34px; height:26px; display:grid; place-items:center; border:0; background:transparent; }
#food-rhythm .fr-family-dot span { width:7px; height:7px; border-radius:8px; background:color-mix(in srgb,var(--fr-leaf) 22%,white); transition:width .2s,background .2s; }
#food-rhythm .fr-family-dot[aria-pressed=true] span { width:20px; background:var(--fr-leaf); }
#food-rhythm .fr-meals-link { flex:none; min-height:32px; border:0; border-radius:12px; background:white; color:var(--fr-leaf); font-size:13px; font-weight:650; }
#food-rhythm.fr-is-meals .fr-main { padding-bottom:110px; }
@media(max-height:720px) {
  #food-rhythm.fr-is-day .fr-main { padding-top:8px; padding-bottom:calc(82px + env(safe-area-inset-bottom)); }
  #food-rhythm .fr-diary { gap:5px; }
  #food-rhythm .fr-dashboard { gap:7px; }
  #food-rhythm .fr-energy-ring { width:104px; height:104px; margin-bottom:5px; padding:6px; }
  #food-rhythm .fr-energy-core strong { font-size:29px; }
  #food-rhythm .fr-diary-stats { padding:8px 10px; }
  #food-rhythm .macro__value { font-size:13px; margin-top:3px; }
  #food-rhythm .macro__track { margin-top:5px; }
  #food-rhythm .fr-diary-extra { padding:7px; gap:6px; }
  #food-rhythm .fr-extra-title { font-size:12px; }
  #food-rhythm .fr-diary-extra strong { font-size:14px; margin-top:0; }
  #food-rhythm .fr-diary-extra small { font-size:9px; min-height:10px; margin:0; }
  #food-rhythm .fr-calendar .fr-date { height:34px; min-height:34px; width:34px; }
}
@media(prefers-reduced-motion:reduce) {
  #food-rhythm .fr-calendar-reveal,#food-rhythm .fr-dashboard,#food-rhythm .fr-family-dot span { transition:none; }
}
