/* Lavi design CSS module 1/4: foundation, navigation and calendar layout.
   Ordered continuation: lavi-redesign-surfaces.css, lavi-redesign-interactions.css,
   lavi-redesign-cooking.css. Preserve this order to retain the approved cascade. */
/* Lavi calendar redesign / desktop icon rail and mobile bottom navigation.
   Visual layer only; data, Cloudflare APIs, auth and meal logic remain unchanged. */
:root{
  --bg:#FCFBFF;
  --line:#E9E7F2;
  --dark:#2E263D;
  --muted:#535968;
  --lavi-shadow:0 2px 7.4px rgba(43,34,85,.07);
  --lavi-active:#EEECFA;
  --lavi-generator:#D8D4FF;
  --lavi-generator-hover:#C9C5EE;
  --lavi-nav-gradient:linear-gradient(45deg,#FDFCFE 0%,#FCF8FE 100%);
  --lavi-nav-ease:cubic-bezier(.22,1,.36,1);
}
body{background:var(--bg);color:var(--dark);font-family:Manrope,system-ui,-apple-system,"Segoe UI",sans-serif}
h1,h2,h3{color:var(--dark)}
.main{max-width:none}
.top small,.hint,.metric small{color:var(--muted)}
.top #title{
  font-family:"Playfair Display",Georgia,serif;
  font-size:28px;font-weight:900;line-height:42px;letter-spacing:-1px;color:var(--dark);
}
.top small{font-size:12px;line-height:18.8px;letter-spacing:-.01em}
.cloud-panel,.card.metric,.lavi-week-selector{
  background:#fff;border:1px solid var(--line);box-shadow:var(--lavi-shadow);
}
.card.metric{border-radius:20px;padding:16px 20px}
.card.metric small{font-size:12px;line-height:18.8px}
.card.metric .num{font-size:24px;line-height:1.5;color:var(--dark);letter-spacing:-.025em}
.week-person-switch{justify-content:flex-end;gap:10px;margin:-7px 0 20px}
.week-person-switch button{min-height:44px}
.week-metrics{grid-template-columns:minmax(0,300px) minmax(0,270px);gap:12px;align-items:stretch}
.week-metrics .metric-water{display:flex;align-items:center;gap:14px}
.metric-water-icon{display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:10px;background:#EEECFA}
.metric-water-icon img{width:26px;height:26px;object-fit:contain}
.metric-water-content{min-width:0}
.metric-water .num{white-space:nowrap}
.lavi-week-selector{border-radius:15px;padding:5px;background:#fff;gap:4px}
.lavi-week-choice{color:var(--muted);border-radius:10px}
/* Consistent inactive week-label ink after moving to compact two-card overview. */
#view .lavi-week-selector .lavi-week-choice:not(.active){color:#535968}
.lavi-week-choice.active{background:#F5F3F7;box-shadow:none;color:var(--dark)}
.lavi-week-choice:focus-visible{outline:2px solid #7766C6;outline-offset:2px}
.cloud-panel{margin:0 0 16px;border-radius:16px;width:max-content;max-width:100%;padding:8px 12px}
.cloud-panel strong{font-weight:600}
.sidebar{background:var(--bg);border-color:var(--line)}
.nav button:focus-visible,.nav-extra>summary:focus-visible{outline:2px solid #7766C6;outline-offset:2px}
.week-toolbar{border-color:var(--line)}
.nav-icon{display:block;flex:none;width:26px;height:26px;object-fit:contain}
.nav-generator{appearance:none}
.nav-generator .nav-icon{pointer-events:none}
.sidebar .brand-wordmark{display:block;object-fit:contain}
.lavi-desktop-nav,.lavi-mobile-nav{display:none}

/* The previous cloud controls were moved out of the sidebar into main.
   Recovery remains available when writes are blocked. */
body.cloud-locked .main{pointer-events:auto;opacity:1}
body.cloud-locked .main > :not(.cloud-panel){pointer-events:none;opacity:.6}

/* Desktop Figma rail: 76px panel, 48px controls, 26px glyphs, 47px
   clear distance between consecutive 26px glyphs (48px target + 25px gap). */
@media(min-width:1200px){
  /* Keep navigation and calendar inside one centered desktop canvas. */
  .app{
    width:100%;
    max-width:1920px;
    margin:0 auto;
    padding:0 35px;
    grid-template-columns:76px minmax(0,1fr);
    column-gap:35px;
  }
  .sidebar{
    position:sticky;z-index:30;top:22px;align-self:start;margin:16px 0 0;
    padding:25px 0 20px;width:76px;min-height:0;
    border:1px solid var(--line);border-radius:21px;
    background-color:var(--bg);background-image:var(--lavi-nav-gradient);
    box-shadow:0 2px 7.4px rgba(43,34,85,.07);
  }
  .sidebar .logo{padding:0 0 20px;display:flex;justify-content:center;align-items:center}
  .sidebar .brand-wordmark{width:40px;height:50px}
  .sidebar #nav{display:block}
  .sidebar #nav > button,.sidebar #nav > .nav-extra{display:none!important}
  .sidebar .lavi-desktop-nav{display:flex;flex-direction:column;align-items:center;gap:25px}
  .sidebar .lavi-desktop-nav > button,
  .sidebar .lavi-desktop-nav > .nav-extra > summary{
    display:flex;align-items:center;justify-content:center;
    width:48px;height:48px;min-width:48px;min-height:48px;max-width:48px;
    padding:0;margin:0;border:0;border-radius:12px;
    background:transparent;color:#483F7C;
    transition:background-color 260ms var(--lavi-nav-ease),color 260ms var(--lavi-nav-ease),box-shadow 260ms var(--lavi-nav-ease);
  }
  .sidebar .lavi-desktop-nav > .nav-extra{width:48px;min-width:48px}
  .sidebar .lavi-desktop-nav .nav-caption{display:none}
  .sidebar .lavi-desktop-nav .nav-glyph{width:auto;min-width:0;font-size:21px;line-height:1}
  .sidebar .lavi-desktop-nav > button.active,
  .sidebar .lavi-desktop-nav > .nav-extra > summary.active{background:var(--lavi-active);color:var(--dark)}
  .sidebar .lavi-desktop-nav > button:hover:not(.active):not(.nav-generator),
  .sidebar .lavi-desktop-nav > .nav-extra > summary:hover:not(.active){background:var(--lavi-active)}
  .sidebar .lavi-desktop-nav > .nav-generator{
    position:relative;isolation:isolate;
    background:var(--lavi-generator)!important;color:var(--dark)!important;
    margin:18px 0!important;
  }
  .sidebar .lavi-desktop-nav > .nav-generator:hover{background:var(--lavi-generator-hover)!important}
  .sidebar .lavi-desktop-nav > .nav-generator::before,
  .sidebar .lavi-desktop-nav > .nav-generator::after{
    content:"";position:absolute;left:-14px;width:76px;height:1px;
    background:var(--line);pointer-events:none;
  }
  .sidebar .lavi-desktop-nav > .nav-generator::before{top:-18px}
  .sidebar .lavi-desktop-nav > .nav-generator::after{bottom:-18px}
  .sidebar .lavi-desktop-nav > .nav-extra > .nav-extra-links{
    left:calc(100% + 8px);right:auto;top:0;width:195px;display:grid;gap:2px;
  }
  .sidebar .lavi-desktop-nav .nav-extra-links .nav-caption{display:inline}
  .sidebar .lavi-desktop-nav .nav-extra-links button{
    display:flex;justify-content:flex-start;align-items:center;
    width:100%;height:auto;min-height:42px;padding:9px 12px;gap:8px
  }
  .sidebar .side-note,.sidebar .nav-secondary-title{display:none}
  .main{padding:34px 0 40px;max-width:none;width:100%;min-width:0;margin:0}
  .top{margin-bottom:16px}
  .lavi-week-selector-wrap{display:flex;justify-content:flex-end;margin:-5px 0 16px}
}

/* Medium widths keep the pre-existing top navigation; only the intended
   small-screen layout moves controls to the bottom. */
@media(min-width:721px) and (max-width:1199px){
  .main{max-width:100%}
  .week-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sidebar .brand-wordmark{width:85px;height:auto}
}
@media(max-width:720px){
  .app{display:block;padding-bottom:calc(85px + env(safe-area-inset-bottom,0px))}
  .sidebar{
    position:relative;z-index:10;display:block;width:100%;min-height:0;
    margin:0;padding:14px 16px 10px;border:0;border-bottom:1px solid var(--line);
    background:var(--bg);border-radius:0;
  }
  .sidebar .logo{margin:0;padding:0;display:flex;align-items:center;justify-content:flex-start}
  .sidebar .brand-wordmark{width:102px;height:33px;max-width:100%}
  .sidebar .side-note{display:none}
  .sidebar #nav{position:static;padding:0;margin:0;overflow:visible}
  .sidebar #nav > button,.sidebar #nav > .nav-extra{display:none!important}
  .sidebar .lavi-mobile-nav{
    display:grid;grid-template-columns:repeat(6,minmax(0,1fr));
    gap:2px;position:fixed;z-index:110;left:0;right:0;bottom:0;
    padding:8px max(8px,env(safe-area-inset-right,8px))
      calc(8px + env(safe-area-inset-bottom,0px))
      max(8px,env(safe-area-inset-left,8px));
    background:var(--lavi-nav-gradient);border-top:1px solid var(--line);
    box-shadow:0 -4px 15px rgba(43,34,85,.06);
  }
  .sidebar .lavi-mobile-nav > button,
  .sidebar .lavi-mobile-nav > .nav-extra > summary{
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:2px;width:100%;height:54px;min-height:54px;padding:4px 0;
    border-radius:12px;border:0;background:transparent;color:#483F7C;
    font-size:10px;line-height:1.15;text-align:center;
    transition:background-color 260ms var(--lavi-nav-ease),color 260ms var(--lavi-nav-ease),box-shadow 260ms var(--lavi-nav-ease);
  }
  .sidebar .lavi-mobile-nav > .nav-extra{min-width:0;width:100%}
  .sidebar .lavi-mobile-nav .nav-icon{width:24px;height:24px}
  .sidebar .lavi-mobile-nav .nav-glyph{font-size:24px;line-height:24px;min-width:0}
  .sidebar .lavi-mobile-nav .nav-caption{display:block;font-size:10px;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .sidebar .lavi-mobile-nav > button.active,
  .sidebar .lavi-mobile-nav > .nav-extra > summary.active{background:var(--lavi-active);color:var(--dark)}
  .sidebar .lavi-mobile-nav > .nav-generator{background:var(--lavi-generator)!important;color:var(--dark)!important}
  .sidebar .lavi-mobile-nav > .nav-generator:hover{background:var(--lavi-generator-hover)!important}
  .sidebar .lavi-mobile-nav > .nav-extra > .nav-extra-links{
    display:grid;gap:2px;position:absolute;bottom:calc(100% + 12px);top:auto;left:auto;right:0;
    width:min(220px,calc(100vw - 16px));max-height:min(380px,calc(100dvh - 110px));
    overflow-y:auto;background:#fff;border:1px solid var(--line);
    box-shadow:0 8px 25px rgba(43,34,85,.14);
  }
  .sidebar .lavi-mobile-nav .nav-extra-links button{
    display:flex;align-items:center;justify-content:flex-start;flex-direction:row;
    width:100%;min-height:44px;padding:10px;gap:8px;text-align:left;
  }
  .sidebar .lavi-mobile-nav .nav-extra-links .nav-caption{font-size:12px;white-space:normal;overflow:visible}
  .main{padding:20px 12px 30px;max-width:100%;min-width:0}
  .top #title{font-size:26px;line-height:1.4}
  .cloud-panel{width:100%}
  .card.metric{padding:13px 12px}
  .card.metric .num{font-size:18px}
  .week-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lavi-week-selector-wrap{margin:0 0 14px}
}
@media(max-width:390px){
  .sidebar .lavi-mobile-nav .nav-caption{font-size:9px}
  .sidebar .lavi-mobile-nav .nav-icon{width:22px;height:22px}
  .sidebar .lavi-mobile-nav > button,.sidebar .lavi-mobile-nav > .nav-extra > summary{height:51px;min-height:51px}
}

/* Avoid duplicated generator entry on the new desktop and mobile navigation. */
@media(min-width:1200px), (max-width:720px){.top > button{display:none!important}}

/* Keep SVG paths unchanged on hover; only surface color animates. */
.sidebar .lavi-desktop-nav > button.active .nav-icon,
.sidebar .lavi-mobile-nav > button.active .nav-icon{
  animation:lavi-active-icon-enter 230ms ease-out both;
}
@keyframes lavi-active-icon-enter{
  from{opacity:.5}
  to{opacity:1}
}
@media(prefers-reduced-motion:reduce){
  .sidebar .lavi-desktop-nav > button,
  .sidebar .lavi-desktop-nav > .nav-extra > summary,
  .sidebar .lavi-mobile-nav > button,
  .sidebar .lavi-mobile-nav > .nav-extra > summary{
    transition:none;
  }
  .sidebar .lavi-desktop-nav .nav-icon,
  .sidebar .lavi-mobile-nav .nav-icon{animation:none!important}
}

/* Figma week typography and faded grid, stage 2.
   Keep the provided artwork behind the UI: no additional DOM or scrolling. */
.main{
  background-image:url("/assets/lavi-setka.svg?v=1");
  background-position:left top;
  background-size:1465px 371px;
  background-repeat:no-repeat;
}
.lavi-week-selector-wrap{isolation:isolate}
.lavi-week-selector{
  display:flex;
  align-items:stretch;
  flex-wrap:nowrap;
  width:max-content;
  max-width:100%;
  gap:4px;
  padding:5px;
  border:1px solid #E9E7F2;
  border-radius:15px;
  background:#fff;
  box-shadow:0 2px 7.4px rgba(43,34,85,.07);
}
.lavi-week-choice{
  min-width:0;
  padding:9px 12px;
  border:0;
  border-radius:10px;
  background:transparent;
  box-shadow:none;
  color:#535968;
  font-family:Manrope,system-ui,-apple-system,"Segoe UI",sans-serif;
  font-weight:600;
  line-height:19.5px;
  letter-spacing:-.01em;
  white-space:nowrap;
  text-align:center;
  transition:background-color 240ms cubic-bezier(.22,1,.36,1),color 240ms cubic-bezier(.22,1,.36,1);
}
.lavi-week-choice.active{
  color:#2E263D;
  font-weight:700;
  background:#F5F3F7;
  box-shadow:none;
}
@media(hover:hover) and (pointer:fine){
  .lavi-week-choice:not(.active):hover{
    background:#EEECFA;
    filter:none;
    color:#535968;
  }
}
.lavi-week-choice:focus-visible{outline:2px solid #7766C6;outline-offset:2px}
@media(min-width:1200px){
  .main{position:relative}
  .lavi-week-selector-wrap{
    position:absolute;
    z-index:2;
    top:35px;
    right:0;
    margin:0;
  }
}
@media(min-width:721px) and (max-width:1199px){
  .main{background-size:1100px auto}
}
@media(max-width:720px){
  .main{
    background-size:732.5px 185.5px;
    background-position:center top;
  }
  .lavi-week-selector-wrap{
    position:static;
    margin:0 0 14px;
    width:100%;
  }
}
@media(max-width:560px){
  .lavi-week-selector{
    width:100%;
    justify-content:space-between;
    gap:2px;
    padding:4px;
  }
  .lavi-week-choice{
    flex:1 1 0;
    padding:8px 4px;
    font-size:11px;
    line-height:16px;
    letter-spacing:-.01em;
    white-space:normal;
    overflow-wrap:anywhere;
  }
}
@media(prefers-reduced-motion:reduce){
  .lavi-week-choice{transition:none}
}

/* Clearly identify the isolated, in-memory preview: it is not cloud-saved. */
.cloud-panel:has(.lavi-design-demo-notice){
  background:#fff;
  padding:9px 14px;
  border:1px solid #E9E7F2;
}
.lavi-design-demo-notice{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:4px 12px;
  font:500 12px/1.55 Manrope,system-ui,sans-serif;
  color:#535968;
}
.lavi-design-demo-notice strong{font-weight:700;color:#2E263D}

/* Figma's calendar starts directly with the profile switcher and metrics. */
.cloud-panel > strong{display:none}
@media(min-width:1200px){.week-person-switch{margin:5px 0 22px}}
@media(max-width:720px){.week-person-switch{margin:0 0 14px;gap:6px;flex-wrap:wrap}.week-person-switch button{min-height:40px}}


/* Figma calendar day columns and meal cards — 2026-11-15. */
/* The complete calendar uses the available content width rather than an inner
   capped layout; the original 7/4/2-column breakpoints stay in control. */
.lavi-calendar-shell{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  margin-top:20px;
  padding:20px;
  background:rgba(252,251,255,.88);
  border:1px solid var(--line);
  border-radius:28px;
  box-shadow:var(--lavi-shadow);
}
.lavi-week-overview-layout .week-toolbar{
  margin:0 0 18px;
  min-width:0;
}
.lavi-week-overview-layout .week-toolbar h2{
  margin:0 0 4px;
  font-family:"Playfair Display",Georgia,serif;
  font-size:21px;
  line-height:1.3;
  color:var(--dark);
}
.lavi-week-overview-layout .week-toolbar .hint{
  margin:0;
  font-size:12px;
  line-height:1.45;
  color:#535968;
}
.lavi-calendar-shell .days{
  display:grid;
  min-width:0;
  gap:12px;
  align-items:stretch;
  margin:0;
}
.lavi-calendar-shell .day{
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
  padding:10px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--lavi-shadow);
}
.lavi-calendar-shell .day-heading-row{
  justify-content:space-between;
  gap:5px;
  margin:0;
}
.lavi-calendar-shell .day-heading-row>.row{
  flex:0 1 auto;
  flex-wrap:nowrap;
}
.lavi-calendar-shell .day .heading{
  flex:none;
  margin:0;
  font-size:14px;
  font-weight:700;
  color:var(--dark);
}
.lavi-calendar-shell .day .cal{
  min-height:28px;
  padding:5px 7px;
  background:#EEECFA;
}
.lavi-calendar-shell .day-actions-menu>summary{
  display:flex;
  align-items:center;
  justify-content:center;
  flex:none;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
}
.lavi-calendar-shell .day>.meal{
  box-sizing:border-box;
  flex:none;
  position:relative;
  min-width:0;
  margin:0;
  padding:10px;
  border:0;
  border-radius:14px;
  background:#ECE8F3;
  color:var(--dark);
  font-size:12px;
}
.lavi-calendar-shell .meal:has(.meal-category.meal-breakfast){background:#F3F2E8}
.lavi-calendar-shell .meal:has(.meal-category.meal-snack){background:#E8EEF3}
.lavi-calendar-shell .meal:has(.meal-category.meal-salad){background:#EDF3E8}
.lavi-calendar-shell .meal:has(.meal-category.meal-main){background:#ECE8F3}
.lavi-calendar-shell .meal:has(.meal-category.meal-dessert){background:#F3E8F2}
.lavi-calendar-shell .meal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:nowrap;
  gap:8px;
  min-height:21px;
  margin-bottom:8px;
}
.lavi-calendar-shell .meal em.meal-category{
  box-sizing:border-box;
  display:inline-flex!important;
  align-items:center;
  max-width:100%;
  margin:0;
  padding:4px 6px;
  background:#FCFBFF;
  color:#535968;
  font:500 11px/1.2 Manrope,system-ui,sans-serif;
  text-transform:none;
  white-space:normal;
}
.lavi-calendar-shell .meal-lock-indicator{
  box-sizing:border-box;
  display:grid;
  place-items:center;
  flex:0 0 22px;
  width:22px;
  height:22px;
  border-radius:6px;
  background:#FCFBFF;
}
.lavi-calendar-shell .meal-lock-indicator img{
  display:block;
  width:14px;
  height:13px;
  object-fit:contain;
}
.lavi-calendar-shell .meal .recipe-link{
  display:block;
  width:100%;
  min-height:17px;
  padding:0;
  margin:0 0 8px;
  color:var(--dark);
  font:700 12px/1.4 Manrope,system-ui,sans-serif;
  text-align:left;
  overflow-wrap:anywhere;
}
.lavi-calendar-shell .meal-serving,
.lavi-calendar-shell .meal-portion-details{
  box-sizing:border-box;
  min-width:0;
  margin:0;
  padding:8px 0 0;
  border-top:1px solid rgba(0,0,0,.04);
}
.lavi-calendar-shell .meal-serving{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  line-height:1.35;
}
.lavi-calendar-shell .meal-serving span:first-child,
.lavi-calendar-shell .meal-portion-detail>span{
  color:#535968;
  font-size:11px;
  font-weight:400;
}
.lavi-calendar-shell .meal-serving span:last-child{
  flex:none;
  color:var(--dark);
  font-size:11px;
  font-weight:500;
  text-align:right;
  white-space:nowrap;
}
.lavi-calendar-shell .meal-portion-details{
  display:grid;
  gap:6px;
}
.lavi-calendar-shell .meal .meal-portion-detail>strong{
  color:var(--dark);
  font-size:11px;
}
.lavi-calendar-shell .meal-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:nowrap;
  min-width:0;
  gap:6px;
  margin-top:8px;
}
.lavi-calendar-shell .meal .meal-kcal{
  box-sizing:border-box;
  max-width:100%;
  min-height:28px;
  margin:0;
  padding:6px 8px;
  border:0;
  border-radius:8px;
  font:600 11px/1.15 Manrope,system-ui,sans-serif;
  white-space:nowrap;
}
.lavi-calendar-shell .meal-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:nowrap;
  gap:8px;
  min-width:0;
  margin-left:auto;
}
.lavi-calendar-shell .meal-actions>.icon-square,
.lavi-calendar-shell .meal-card-menu>summary{
  box-sizing:border-box;
  display:grid;
  place-items:center;
  flex:0 0 34px;
  width:34px;
  min-width:34px;
  max-width:34px;
  height:34px;
  min-height:34px;
  max-height:34px;
  padding:0;
  background:#fff;
  border:0;
  border-radius:10px;
  color:var(--dark);
  box-shadow:none;
  transition:box-shadow 220ms var(--lavi-nav-ease);
}
.lavi-calendar-shell .meal-card-menu>summary img{
  width:10px;
  height:9px;
}
.lavi-calendar-shell .meal-actions>.icon-square img{
  width:14px;
  height:14px;
}
.lavi-calendar-shell .meal .meal-card-menu>summary:hover,
.lavi-calendar-shell .meal-actions>.icon-square:hover{
  background:#fff;
  border:0;
  box-shadow:var(--lavi-shadow);
}
.lavi-calendar-shell .dayactions{
  display:block;
  margin-top:auto;
}
.lavi-calendar-shell .dayactions button{
  width:100%;
  min-height:34px;
  padding:6px 9px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--dark);
  font-size:11px;
  font-weight:600;
}
.metric-water-icon img{width:17px;height:17px;object-fit:contain}
@media(max-width:1450px){
  .lavi-calendar-shell{padding:16px}
}
@media(max-width:720px){
  .lavi-calendar-shell{padding:12px;border-radius:22px;margin-top:14px}
  .lavi-week-overview-layout .week-toolbar{gap:10px;margin-bottom:14px}
  .lavi-calendar-shell .day{padding:8px;border-radius:16px}
  .lavi-calendar-shell .meal-footer{flex-wrap:wrap}
  .lavi-calendar-shell .meal-actions{margin-left:auto}
}
@media(max-width:560px){
  /* Two visible phone columns need a compact two-row day heading; keep the
     34px menu target rather than squeezing it outside the day card. */
  .lavi-calendar-shell .day-heading-row{flex-wrap:wrap}
  .lavi-calendar-shell .day .cal{
    min-width:0;
    white-space:normal;
    text-align:center;
  }
}
@media(max-width:390px){
  .lavi-calendar-shell{padding:9px}
}
@media(prefers-reduced-motion:reduce){
  .lavi-calendar-shell .meal,
  .lavi-calendar-shell .meal-actions>.icon-square,
  .lavi-calendar-shell .meal-card-menu>summary{transition:none}
}

/* Compact Sunday reminder and Figma toolbar refinement / 2026-11-15 */
/* Sunday reminder and profile switch share one row, eliminating the old
   banner + profile + .section stack of vertical margins. */
.lavi-week-overview-bar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:12px;
  min-width:0;
  margin:0 0 14px;
}
.lavi-week-overview-bar .week-person-switch{
  margin:0 0 0 auto;
}
.lavi-week-overview-bar + .week-metrics{
  margin-top:0;
}
.lavi-week-overview-bar .lavi-sunday-hint{
  box-sizing:border-box;
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px 10px;
  width:max-content;
  max-width:100%;
  margin:0;
  padding:6px 7px 6px 12px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fff;
  box-shadow:var(--lavi-shadow);
  color:var(--dark);
  font:500 12px/1.4 Manrope,system-ui,sans-serif;
}
.lavi-week-overview-bar .lavi-sunday-hint strong{
  color:var(--dark);
  font-weight:700;
}
.lavi-week-overview-bar .lavi-sunday-hint button{
  box-sizing:border-box;
  min-height:32px;
  margin:0;
  padding:7px 10px;
  background:var(--lavi-active);
  color:var(--dark);
  border:0;
  border-radius:9px;
  font:700 12px/1.3 Manrope,system-ui,sans-serif;
  transition:background-color 220ms var(--lavi-nav-ease);
}
@media(hover:hover) and (pointer:fine){
  .lavi-week-overview-bar .lavi-sunday-hint button:hover{background:#E2DFF6}
}
.lavi-calendar-shell .meal .recipe-link{
  font-size:13px;
  line-height:1.4;
}
.lavi-week-overview-layout .week-toolbar-actions{
  gap:12px;
}
.lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action,
.lavi-week-overview-layout .week-actions-menu>summary{
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:none;
  gap:12px;
  min-height:48px;
  margin:0;
  padding:10px 16px;
  border-radius:12px;
  color:var(--dark);
  font:700 14px/1.3 Manrope,system-ui,sans-serif;
  white-space:nowrap;
}
.lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action{
  background:var(--lavi-active);
  border:1px solid transparent;
  transition:background-color 220ms var(--lavi-nav-ease);
}
.lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action img{
  display:block;
  flex:none;
  width:22px;
  height:22px;
  object-fit:contain;
}
.lavi-week-overview-layout .week-actions-menu>summary{
  background:#fff;
  border:1px solid var(--line);
  transition:background-color 220ms var(--lavi-nav-ease),border-color 220ms var(--lavi-nav-ease);
}
.lavi-week-overview-layout .week-actions-menu .lavi-dropdown-arrow{
  display:block;
  flex:none;
  width:8px;
  height:5px;
  object-fit:contain;
  transition:transform 220ms var(--lavi-nav-ease);
}
.lavi-week-overview-layout .week-actions-menu[open] .lavi-dropdown-arrow{
  transform:rotate(180deg);
}
@media(hover:hover) and (pointer:fine){
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action:hover{background:#E2DFF6}
  .lavi-week-overview-layout .week-actions-menu>summary:hover{background:#FAF9FE;border-color:#DEDCEB}
}
@media(max-width:720px){
  .lavi-week-overview-bar{gap:10px;margin-bottom:12px}
  .lavi-week-overview-bar .lavi-sunday-hint{font-size:12px}
  .lavi-week-overview-layout .week-toolbar-actions{
    justify-content:flex-start;
    gap:8px;
  }
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action,
  .lavi-week-overview-layout .week-actions-menu>summary{
    min-height:42px;
    padding:9px 11px;
    font-size:12px;
    gap:8px;
  }
}
@media(max-width:390px){
  .lavi-week-overview-bar .lavi-sunday-hint{width:100%;justify-content:space-between}
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action img{width:19px;height:19px}
}
@media(prefers-reduced-motion:reduce){
  .lavi-week-overview-bar .lavi-sunday-hint button,
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action,
  .lavi-week-overview-layout .week-actions-menu>summary,
  .lavi-week-overview-layout .week-actions-menu .lavi-dropdown-arrow{
    transition:none;
  }
}

/* Week status, Sunday count and day header alignment — 2026-11-15 */
.lavi-status-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px 16px;
  min-width:0;
  margin:0 0 16px;
}
.lavi-status-row .cloud-panel{
  margin:0;
  flex:0 1 auto;
}
#lavi-profile-switch-slot{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex:0 1 auto;
  min-width:0;
  margin-left:auto;
}
#lavi-profile-switch-slot[hidden]{display:none!important}
#lavi-profile-switch-slot .week-person-switch{
  justify-content:flex-end;
  margin:0;
}
.lavi-status-row + #view .week-metrics{
  margin-top:0;
}
body.cloud-locked .main > .lavi-status-row{
  pointer-events:auto;
  opacity:1;
}
body.cloud-locked #lavi-profile-switch-slot{
  pointer-events:none;
  opacity:.6;
}
.lavi-week-overview-layout .lavi-cook-group{
  gap:8px;
}
.lavi-week-overview-layout .lavi-cook-group .lavi-sunday-hint{
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  flex:0 1 auto;
  width:max-content;
  max-width:100%;
  min-height:34px;
  margin:0;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#FCFBFF;
  color:#535968;
  box-shadow:none;
  font:500 12px/1.35 Manrope,system-ui,sans-serif;
  white-space:normal;
}
.lavi-week-overview-layout .lavi-cook-group .lavi-sunday-hint strong{
  color:#535968;
  font-weight:600;
}
.lavi-calendar-shell .day-heading-row>.row{
  flex:1 1 auto;
  gap:6px!important;
}
.lavi-calendar-shell .day .cal{
  box-sizing:border-box;
  padding:5px 6px;
  border-radius:9px;
  font-size:11px;
  line-height:1.25;
  font-variant-numeric:tabular-nums;
}
.lavi-calendar-shell .day-actions-menu{
  width:34px;
  height:34px;
}
.lavi-calendar-shell .day-actions-menu>summary{
  box-sizing:border-box;
  width:34px;
  min-width:34px;
  max-width:34px;
  height:34px;
  min-height:34px;
  max-height:34px;
  padding:0;
}
.lavi-calendar-shell .day-actions-menu>summary img{
  display:block;
  width:10px;
  height:9px;
  object-fit:contain;
}
@media(max-width:900px){
  .lavi-status-row{gap:10px;margin-bottom:14px}
  #lavi-profile-switch-slot .week-person-switch{gap:6px}
}
@media(max-width:560px){
  .lavi-status-row{align-items:flex-start}
  #lavi-profile-switch-slot{width:100%;justify-content:flex-start;margin-left:0}
  #lavi-profile-switch-slot .week-person-switch{justify-content:flex-start}
  .lavi-calendar-shell .day .cal{
    max-width:calc(100% - 40px);
  }
  .lavi-week-overview-layout .lavi-cook-group .lavi-sunday-hint{
    font-size:11px;
  }
}

/* Aligned desktop canvas and uniform text action sizing / 2026-11-15 */
/* 42px default is for text actions. Icon-only calendar controls retain their
   dedicated 34px targets; the vertical icon navigation keeps its 48px targets. */
:root{
  --lavi-text-action-height:42px;
  --lavi-text-action-padding:15px;
  --lavi-text-action-gap:10px;
  --lavi-week-action-width:180px;
}
body button:not(.recipe-link){
  box-sizing:border-box;
  min-height:var(--lavi-text-action-height);
  padding-left:var(--lavi-text-action-padding);
  padding-right:var(--lavi-text-action-padding);
  column-gap:var(--lavi-text-action-gap);
  font-size:13px;
}
/* Maintain Figma 34x34 controls and compact cloud refresh button. */
body button.icon-square,
body .cloud-compact-row button.secondary{
  min-height:34px;
  padding:0;
}
body .cloud-compact-row button.secondary{
  min-height:30px;
  width:30px;
  height:30px;
}
#lavi-profile-switch-slot .week-person-switch button{
  font-size:13px;
}
.lavi-week-choice{
  min-height:42px;
  font-size:13px;
}
.lavi-week-overview-layout .week-toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
}
.lavi-week-overview-layout .week-toolbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:var(--lavi-text-action-gap);
  min-width:0;
  width:auto;
}
.lavi-week-overview-layout .lavi-cook-group{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:var(--lavi-text-action-gap);
  min-width:0;
}
.lavi-week-overview-layout .lavi-cook-group .lavi-sunday-hint,
.lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action,
.lavi-week-overview-layout .week-actions-menu>summary{
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:var(--lavi-week-action-width);
  min-width:var(--lavi-week-action-width);
  max-width:var(--lavi-week-action-width);
  height:var(--lavi-text-action-height);
  min-height:var(--lavi-text-action-height);
  max-height:var(--lavi-text-action-height);
  gap:var(--lavi-text-action-gap);
  margin:0;
  padding:0 var(--lavi-text-action-padding);
  font-size:13px;
  line-height:1.3;
  text-align:center;
  white-space:nowrap;
}
.lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action{
  padding:0 var(--lavi-text-action-padding);
}
.lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action img{
  width:20px;
  height:20px;
}
.lavi-week-overview-layout .lavi-cook-group .lavi-sunday-hint{
  font-size:12px;
  font-weight:600;
}
.lavi-week-overview-layout .week-actions-menu .lavi-dropdown-arrow{
  position:relative;
  top:1px;
  align-self:center;
  margin:0;
}
.lavi-calendar-shell .dayactions button{
  min-height:42px;
  padding:0 15px;
  font-size:13px;
}
@media(min-width:721px) and (max-width:1420px){
  .lavi-week-overview-layout .week-toolbar{
    grid-template-columns:1fr;
    justify-items:stretch;
  }
  .lavi-week-overview-layout .week-toolbar-actions{justify-content:flex-end}
}
@media(max-width:720px){
  .lavi-week-overview-layout .week-toolbar{display:flex;align-items:flex-start;flex-wrap:wrap}
  .lavi-week-overview-layout .week-toolbar-actions{justify-content:flex-start;width:100%;gap:10px}
  .lavi-week-overview-layout .lavi-cook-group{gap:10px}
  .lavi-week-overview-layout .lavi-cook-group .lavi-sunday-hint,
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action,
  .lavi-week-overview-layout .week-actions-menu>summary{
    min-height:42px;
    height:42px;
    max-height:42px;
    padding:0 15px;
    font-size:13px;
  }
}
@media(max-width:450px){
  .lavi-week-overview-layout .lavi-cook-group .lavi-sunday-hint,
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action,
  .lavi-week-overview-layout .week-actions-menu>summary{
    width:min(180px,100%);
    min-width:0;
    max-width:180px;
    flex:1 1 160px;
  }
  .lavi-week-overview-layout .week-actions-menu{flex:0 1 180px;min-width:0}
}

/* Preserve readable 44px popover actions on touch devices. */
body .actions-dropdown-panel button{
  min-height:44px;
  padding:10px 12px;
  font-size:13px;
  white-space:normal;
  overflow-wrap:anywhere;
}

/* Final Figma refinements: day header, meal badges and profile switch. */
/* A 35px edge at ordinary desktop widths, and a shared centered canvas on
   ultrawide displays. The rail and its week are never centered separately. */
@media(min-width:1200px){
  .app{max-width:1920px}
}
/* Keep the 13px full-length daily kcal label legible rather than squeezing
   seven columns to the point where the controls would overlap. */
@media(min-width:1200px) and (max-width:1699px){
  .lavi-calendar-shell .days{grid-template-columns:repeat(4,minmax(0,1fr))}
}
.lavi-calendar-shell .day-heading-row{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:nowrap;
  gap:7px;
  min-width:0;
}
.lavi-calendar-shell .day-heading-row .heading{
  flex:0 0 auto;
  font-size:13px;
  line-height:1.3;
}
.lavi-calendar-shell .day-heading-row>.row{
  display:flex;
  align-items:center;
  width:auto;
}
.lavi-calendar-shell .day .cal{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 1 162px;
  width:162px;
  max-width:162px;
  padding:0 7px;
  white-space:nowrap;
  color:#483F7C;
}
.lavi-calendar-shell .day-actions-menu{
  flex:0 0 34px;
  min-width:34px;
}
.lavi-calendar-shell .meal .meal-kcal{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:none;
  width:max-content;
  height:22px;
  min-height:22px;
  max-height:22px;
  padding:0 7px;
  border-radius:7px;
  font:600 12px/1.15 Manrope,system-ui,sans-serif;
  color:#FCFBFF;
  background:#202122;
}
.lavi-calendar-shell .meal em.meal-category{
  font-size:12px;
  line-height:1.2;
  padding:3px 6px;
  border-radius:6px;
}
.lavi-calendar-shell .meal-serving span:first-child,
.lavi-calendar-shell .meal-serving span:last-child,
.lavi-calendar-shell .meal-portion-detail>span,
.lavi-calendar-shell .meal .meal-portion-detail>strong{
  font-size:12px;
}
/* Active profile matches the pale selected-week palette, not the legacy
   saturated purple button background. */
#lavi-profile-switch-slot .week-person-switch{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}
#lavi-profile-switch-slot .week-person-switch button{
  height:42px;
  min-height:42px;
  margin:0;
  padding:0 15px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--dark);
  font:600 13px/1.3 Manrope,system-ui,sans-serif;
  box-shadow:none;
  transition:background-color 220ms var(--lavi-nav-ease),
             border-color 220ms var(--lavi-nav-ease);
}
#lavi-profile-switch-slot .week-person-switch button:not(.outline){
  background:var(--lavi-active);
  border-color:var(--lavi-active);
  font-weight:700;
}
@media(hover:hover) and (pointer:fine){
  #lavi-profile-switch-slot .week-person-switch button:hover{background:#F5F3FC}
  #lavi-profile-switch-slot .week-person-switch button:not(.outline):hover{background:#E3E0F7}
}
#lavi-profile-switch-slot .week-person-switch button:focus-visible{
  outline:2px solid #7766C6;
  outline-offset:2px;
}
@media(max-width:560px){
  .lavi-calendar-shell .day-heading-row{flex-wrap:wrap;gap:6px}
  .lavi-calendar-shell .day-heading-row>.row{
    flex:1 1 100%;
    width:100%;
    justify-content:space-between;
    gap:7px!important;
  }
  .lavi-calendar-shell .day .cal{
    flex:1 1 auto;
    width:auto;
  }
  #lavi-profile-switch-slot .week-person-switch{gap:7px}
}
@media(prefers-reduced-motion:reduce){
  #lavi-profile-switch-slot .week-person-switch button{transition:none}
}
