/* Lavi design CSS module 3/4. Later cooking/settings/shopping refinements, drag and mobile interaction fixes; order is intentional.
   Keep stylesheet link order: calendar-redesign -> surfaces -> interactions -> cooking.
   Moving rules between modules requires responsive regression because order is part of the cascade. */
/* Lavi cook and settings cohesion — 2026-11-15 */
/* Dish menu: widen to preserve a single-line label beside all 17px icons. */
#view .lavi-calendar-shell .meal-card-menu > .actions-dropdown-panel{
  box-sizing:border-box;
  width:264px;
  min-width:0;
  max-width:min(264px,calc(100vw - 32px));
  padding:6px;
  background:#fff;
  border:1px solid var(--lavi-border);
  border-radius:16px;
  box-shadow:0 12px 28px rgba(43,34,85,.12);
}
#view .lavi-calendar-shell .meal-card-menu .actions-dropdown-panel > button{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:42px;
  padding:10px 12px;
  white-space:normal;
  overflow-wrap:normal;
  border-radius:10px;
}
#view .lavi-calendar-shell .meal-card-menu .actions-dropdown-panel > button .lavi-menu-icon{
  display:block;
  width:17px;
  height:17px;
  flex:0 0 17px;
  object-fit:contain;
}
/* Cooking: week selection sits in the upper-right header like the Week page;
   all actions and cards share the new surface, border and typography. */
#view .cooking-page{
  gap:14px;
  color:var(--lavi-ink);
}
#view .cooking-page-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
}
#view .cooking-page-intro{
  min-width:0;
  flex:1 1 320px;
}
#view .cooking-page-header h2{
  margin:0 0 5px;
  font-family:"Playfair Display",Georgia,serif;
  font-weight:700;
  color:var(--lavi-ink);
}
#view .cooking-page-header p{
  color:var(--lavi-caption);
  margin:0;
  max-width:650px;
  font-size:13px;
}
#view .cooking-header-actions{
  display:flex;
  flex:0 1 auto;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
  margin-left:auto;
  min-width:0;
}
#view .cooking-header-actions .lavi-week-selector{
  margin:0;
  box-sizing:border-box;
}
#view .cooking-header-actions .lavi-week-choice{
  min-height:42px;
  color:var(--lavi-ink);
}
#view .cooking-header-actions .lavi-week-choice.active{
  color:var(--lavi-ink);
  background:var(--lavi-surface-selected);
}
#view .cooking-header-actions .cooking-shopping-link{
  min-height:42px;
  border:1px solid var(--lavi-border);
  color:var(--lavi-ink);
  background:#fff!important;
  border-radius:12px;
  font:600 13px/1.3 Manrope,system-ui,sans-serif;
}
#view .cooking-filters{
  display:flex;
  justify-content:flex-end;
  align-items:flex-end;
  gap:10px;
  min-width:0;
}
#view .cooking-filters .cook-filter{
  display:grid;
  gap:6px;
  min-width:190px;
  width:min(220px,100%);
  color:var(--lavi-caption);
}
#view .cooking-filters .cook-filter-label{
  font:500 12px/1.3 Manrope,system-ui,sans-serif;
  color:var(--lavi-caption);
}
#view .cooking-day-filter{
  position:relative;
  width:100%;
  min-width:0;
}
#view .cooking-day-filter > summary{
  box-sizing:border-box;
  width:100%;
  min-height:42px;
  height:42px;
  padding:0 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:#fff;
  color:var(--lavi-ink);
  border:1px solid var(--lavi-border);
  border-radius:12px;
  font:600 13px/1.3 Manrope,system-ui,sans-serif;
}
#view .cooking-day-filter > summary:hover{
  background:var(--lavi-surface-muted);
  border-color:#DCD8EB;
}
#view .cooking-day-filter .lavi-dropdown-arrow{
  flex:none;
  display:block;
  width:8px;
  height:5px;
  object-fit:contain;
  transition:transform .18s ease;
}
#view .cooking-day-filter[open] .lavi-dropdown-arrow{
  transform:rotate(180deg);
}
#view .cooking-day-filter > .actions-dropdown-panel{
  box-sizing:border-box;
  right:0;
  left:auto;
  width:100%;
  min-width:190px;
  max-width:min(260px,calc(100vw - 40px));
  max-height:min(360px,65vh);
  overflow:auto;
  background:#fff;
  border:1px solid var(--lavi-border);
  border-radius:16px;
  box-shadow:0 12px 28px rgba(43,34,85,.12);
  padding:6px;
}
#view .cooking-day-filter > .actions-dropdown-panel > button{
  min-height:40px;
  padding:8px 12px;
  color:var(--lavi-ink);
  background:transparent!important;
  border:0;
  border-radius:9px;
  font:500 13px/1.35 Manrope,system-ui,sans-serif;
}
#view .cooking-day-filter > .actions-dropdown-panel > button.is-current{
  color:var(--lavi-ink);
  font-weight:700;
  background:transparent!important;
}
#view .cooking-day-filter > .actions-dropdown-panel > button:hover,
#view .cooking-day-filter > .actions-dropdown-panel > button:focus-visible{
  background:var(--lavi-soft-hover)!important;
}
#view .cooking-page .cooking-page-summary{
  box-sizing:border-box;
  background:var(--lavi-surface-selected);
  border:0;
  border-radius:12px;
  color:var(--lavi-caption);
  font-size:13px;
  padding:10px 14px;
  margin:0;
}
#view .cooking-page .cooking-page-summary strong{color:var(--lavi-ink)}
#view .cooking-day-section{
  background:#fff;
  border:1px solid var(--lavi-border);
  border-radius:20px;
  box-shadow:var(--lavi-surface-shadow);
}
#view .cooking-day-section .cookheading{
  background:var(--lavi-surface-selected);
  color:var(--lavi-ink);
  border-radius:12px;
  font-family:Manrope,system-ui,sans-serif;
  font-size:14px;
  font-weight:700;
}
#view .cooking-page .cook-grid .cookrow{
  background:var(--lavi-surface-muted);
  border:1px solid var(--lavi-border);
  border-radius:14px;
  box-shadow:none;
  color:var(--lavi-ink);
}
#view .cooking-page .cookrow.cook-dragging{opacity:.5}
#view .cooking-page .cookrow:hover{
  background:#fff;
  border-color:var(--lavi-border);
  box-shadow:0 3px 12px rgba(43,34,85,.10);
}
#view .cooking-page .cook-card-top .hint,
#view .cooking-page .cook-card-progress,
#view .cooking-page .cook-card-amount > .hint{
  color:var(--lavi-caption);
}
#view .cooking-page .cook-card-simple .recipe-link{
  color:var(--lavi-ink);
  font-weight:700;
}
#view .cooking-page .cook-card-amount strong{
  color:var(--lavi-ink);
}
#view .cooking-page .cook-card-top .cookcount,
#view .cooking-page .cook-card-days .cooktag{
  background:var(--lavi-surface-selected);
  border:0;
  border-radius:9px;
  color:var(--lavi-caption);
}
#view .cooking-page .cooking-drop-targets{
  border:1px dashed var(--lavi-border);
  background:var(--lavi-surface-muted);
  border-radius:14px;
  padding:12px;
}
#view .cooking-page .cooking-compact-drop{
  border:1px solid var(--lavi-border);
  background:#fff;
  border-radius:10px;
  color:var(--lavi-caption);
}
#view .cooking-page .cooking-compact-drop.cook-drop-target,
#view .cooking-day-section.cook-drop-target{
  background:var(--lavi-surface-selected);
  border-color:#BEB4E6;
  color:var(--lavi-ink);
}
#view .cooking-page .cook-card-actions .cook-card-menu > summary{
  display:grid;
  place-items:center;
  box-sizing:border-box;
  height:42px;
  min-height:42px;
  width:42px;
  min-width:42px;
  padding:0;
  border:0;
  border-radius:12px;
  background:#fff;
  box-shadow:none;
}
#view .cooking-page .cook-card-menu > summary > img{
  display:block;
  width:10px;
  height:9px;
}
#view .cooking-page .cook-card-actions .cook-card-menu > summary:hover{
  background:#fff;
  box-shadow:var(--lavi-surface-shadow);
}
#view .cooking-page .cook-card-menu > .actions-dropdown-panel{
  box-sizing:border-box;
  width:256px;
  min-width:0;
  max-width:min(256px,calc(100vw - 36px));
  padding:6px;
  border:1px solid var(--lavi-border);
  border-radius:16px;
  background:#fff;
  box-shadow:0 12px 28px rgba(43,34,85,.12);
}
#view .cooking-page .cook-card-menu .actions-dropdown-panel > button{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  min-height:42px;
  border:0;
  border-radius:9px;
  background:transparent!important;
  color:var(--lavi-ink);
  text-align:left;
  font:500 13px/1.35 Manrope,system-ui,sans-serif;
}
#view .cooking-page .cook-card-menu .actions-dropdown-panel > button:hover,
#view .cooking-page .cook-card-menu .actions-dropdown-panel > button:focus-visible{
  background:var(--lavi-soft-hover)!important;
}
#view .cooking-page .cook-card-menu .lavi-menu-icon{
  display:block;
  width:17px;
  height:17px;
  flex:0 0 17px;
  object-fit:contain;
}
/* Profiles, generation and data controls share one rhythm and palette. */
#view > .settings-layout{
  gap:16px;
  min-width:0;
}
#view .settings-layout > .settings-preferences-slot{
  grid-column:1/-1;
  min-width:0;
}
#view .settings-layout .settings-card{
  padding:clamp(16px,2.5vw,28px);
  border:1px solid var(--lavi-border);
  border-radius:18px;
  background:#fff;
  color:var(--lavi-ink);
  box-shadow:none;
  overflow-wrap:anywhere;
}
#view .settings-layout .settings-card h2{
  margin:0;
  font-size:clamp(19px,2vw,23px);
  line-height:1.3;
}
#view .settings-layout .settings-card p{
  margin:6px 0 0;
  color:var(--lavi-caption);
  font-size:14px;
  line-height:1.55;
}
#view .settings-layout .settings-profile-header > div{
  min-width:0;
}
#view .settings-layout .settings-profile-header > button{
  max-width:100%;
  white-space:normal;
}
#view .settings-layout .settings-profile-note{
  margin:10px 0 18px;
}
#view .settings-layout .settings-person-card,
#view .settings-layout .settings-household-card{
  min-width:0;
  padding:clamp(12px,2vw,18px);
  border:1px solid var(--lavi-border);
  border-radius:14px;
  background:var(--lavi-surface-muted);
  box-shadow:none;
}
#view .settings-layout .settings-household-card{
  background:#fff;
}
#view .settings-layout .settings-household-heading{
  margin:24px 0 12px;
}
#view .settings-layout .settings-household-card > h3{
  margin:0 0 12px;
}
#view .settings-layout .settings-food-preferences-grid{
  margin-top:16px;
}
#view .settings-layout .settings-food-preferences-grid h3 label{
  color:var(--lavi-ink);
  font:inherit;
}
#view .settings-layout .settings-person-card label,
#view .settings-layout .settings-household-card label{
  color:var(--lavi-caption);
  font-size:13px;
}
#view .settings-layout .settings-person-fields{
  grid-template-columns:minmax(0,225px) minmax(0,145px);
}
#view .settings-layout :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not([type="file"]){
  min-height:42px;
  max-width:100%;
  background:#fff;
  border:1px solid var(--lavi-border);
  border-radius:12px;
  color:var(--lavi-ink);
}
#view .settings-layout :is(input,select,textarea):focus-visible{
  outline:2px solid #8272CC;
  outline-offset:1px;
}
#view .settings-layout input[hidden]{
  display:none;
}
#view .settings-layout .settings-pref-add{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}
#view .settings-layout .settings-pref-add input{
  max-width:none;
}
#view .settings-layout .pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  max-width:100%;
  background:var(--lavi-surface-selected);
  color:var(--lavi-caption);
  border-radius:10px;
  white-space:normal;
  overflow-wrap:anywhere;
}
#view .settings-layout .pill > span{
  min-width:0;
}
#view .settings-layout .settings-water-field{
  max-width:160px;
  margin:0 0 12px;
}
#view .settings-layout .settings-water-field input{
  width:100%;
}
#view .settings-layout input[type="checkbox"]{
  accent-color:#7162BF;
}
#view .settings-layout .equipment-grid{
  gap:8px 12px;
}
#view .settings-layout .equipment-grid .checkline{
  min-width:0;
}
#view .settings-layout .settings-actions,
#view .settings-layout .settings-save{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-top:14px;
}
#view .settings-layout .settings-save{
  border-top:1px solid var(--lavi-border);
  padding-top:14px;
}
#view .settings-layout #settings-saved{
  font-size:13px;
  color:var(--lavi-caption);
}
#view .settings-layout button:not(.mini){
  min-height:42px;
  max-width:100%;
  padding:8px 14px;
  border-radius:12px;
  font-size:13px;
  line-height:1.35;
}
#view .settings-layout button.secondary{
  background:var(--lavi-surface-selected);
  color:var(--lavi-ink);
}
#view .settings-layout button.outline{
  background:#fff;
  color:var(--lavi-ink);
  border:1px solid var(--lavi-border);
}
@media(hover:hover) and (pointer:fine){
  #view .settings-layout button.secondary:hover,
  #view .settings-layout button.outline:hover{
    background:#E8E4FD;
  }
}
@media(max-width:460px){
  #view > .settings-layout{gap:12px}
  #view .settings-layout .settings-profile-header{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    justify-items:start;
    gap:10px;
  }
  #view .settings-layout .settings-person-fields{
    grid-template-columns:minmax(0,1fr) minmax(0,116px);
  }
  #view .settings-layout .settings-actions > button,
  #view .settings-layout .settings-save > button{
    flex:1 1 100%;
  }
}
@media(max-width:360px){
  #view .settings-layout .settings-person-fields{
    grid-template-columns:minmax(0,1fr);
  }
}

#view .settings-layout .settings-data{grid-column:1/-1}
#view .settings-layout .settings-section-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px 20px;
}
#view .settings-layout .settings-data .settings-section-row{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--lavi-border);
}
#view .settings-layout .settings-section-row :is(h3,.settings-actions,.settings-field-title){margin:0}
#view .settings-layout #settings-logout[hidden]{display:none}
@media(max-width:600px){
  #view .settings-layout .settings-section-row{flex-direction:column;align-items:stretch}
  #view .settings-layout .settings-section-row > button{align-self:start}
}
#view .settings-layout .settings-profile-header{margin-bottom:16px}
#view .settings-layout :is(.settings-people-grid,.settings-household-grid,.settings-food-preferences-grid){align-items:stretch}
#view .settings-layout .settings-people-grid,
#view .settings-layout .settings-household-grid{
  grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));
}
#view .settings-layout .settings-person-fields{
  grid-template-columns:minmax(0,3fr) minmax(0,2fr);
}
#view .settings-layout .settings-pref-add{max-width:none}
#view .settings-layout .settings-person-restrictions{
  padding-top:16px;
  border-top:1px solid var(--lavi-border);
}
#view .settings-layout .settings-field-title,
#view .settings-layout .settings-partner-action{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px 8px;
}
#view .settings-layout .settings-field-title{min-height:28px;margin-bottom:6px}
#view .settings-layout .settings-field-title :is(h3,label){margin:0;font-weight:650}
#view .settings-layout .settings-help{min-width:0}
#view .settings-layout .settings-help[open]{flex-basis:100%}
#view .settings-layout .settings-help summary{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:50%;
  color:#585073;
  cursor:pointer;
  list-style:none;
}
#view .settings-layout .settings-help summary::-webkit-details-marker{display:none}
#view .settings-layout .settings-help summary span{
  display:grid;
  place-items:center;
  width:17px;
  height:17px;
  border:1px solid currentColor;
  border-radius:50%;
  font:700 11px/1 Manrope,sans-serif;
}
#view .settings-layout .settings-help p,
#modalroot .prepared-help p{
  margin:4px 0 0;
  padding:10px 12px;
  border-radius:10px;
  background:#eeecfa;
  color:#494356;
  font:500 13px/1.5 Manrope,sans-serif;
}
#view .settings-layout .settings-food-preferences-grid .settings-pref-chips{margin:12px 0 0}
#view .settings-layout .settings-pref-chips:empty{display:none}
#view .settings-layout .settings-pref-chips .pill{
  padding:3px;
  gap:4px;
  font:550 13px/1.4 Manrope,sans-serif;
  color:#443c54;
}
#view .settings-layout .settings-pref-chips .pill > span{padding-inline-start:6px}
#view .settings-layout .pill button.icon-square{
  box-sizing:border-box;
  display:grid;
  place-items:center;
  flex:0 0 28px;
  width:28px;
  min-width:28px;
  max-width:28px;
  height:28px;
  min-height:28px;
  max-height:28px;
  margin:0;
  padding:0;
  background:transparent;
}
#view .settings-food-preferences .settings-pref-chips .pill button.icon-square{border-radius:7px}
#view .settings-layout .pill button.icon-square:hover{background:#d8d4ff}
#view .settings-layout label[for="newDrink"]{display:block;margin-bottom:6px;font-weight:650}
#modalroot .prepared-dialog{display:grid;gap:16px;overflow-wrap:anywhere}
#modalroot .prepared-dialog .lavi-dialog-titlebar{margin:0}
#modalroot .prepared-dish,
#modalroot .prepared-fields label{
  display:grid;
  gap:4px;
  min-width:0;
  margin:0;
  font:500 13px/1.45 Manrope,sans-serif;
  color:#535968;
}
#modalroot .prepared-dish{
  padding:12px 14px;
  background:#eeecfa;
  border-radius:12px;
}
#modalroot .prepared-dish strong,
#modalroot .prepared-fields strong{font-size:16px;color:#30293d}
#modalroot .prepared-fields{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));
  gap:10px;
}
#modalroot .prepared-fields label{
  padding:12px;
  border:1px solid #e9e7f2;
  border-radius:12px;
  background:#fcfbff;
}
#modalroot .prepared-fields label span:last-of-type{margin-top:8px}
#modalroot .prepared-fields input{width:100%;margin:0}
#modalroot .prepared-help summary{width:fit-content;cursor:pointer;font:600 13px/1.5 Manrope,sans-serif;color:#585073}
#modalroot .prepared-actions{gap:8px;padding-top:12px;border-top:1px solid #e9e7f2}
@media(max-width:460px){
  #modalroot .prepared-actions button:first-child{flex-basis:100%}
  #modalroot .prepared-actions button{flex:1 1 auto}
}

@media(max-width:1000px){
  #view .cooking-page-header{
    flex-direction:column;
    align-items:stretch;
  }
  #view .cooking-header-actions{
    justify-content:flex-end;
    width:100%;
    margin-left:0;
  }
}
@media(max-width:720px){
  #view .cooking-page-header{gap:12px}
  #view .cooking-header-actions{
    justify-content:flex-end;
    flex-wrap:wrap;
    gap:8px;
  }
  #view .cooking-header-actions .lavi-week-selector{
    flex:1 1 220px;
    min-width:0;
  }
  #view .cooking-header-actions .cooking-shopping-link{
    flex:0 1 auto;
  }
  #view .cooking-filters .cook-filter{
    width:min(220px,100%);
    min-width:175px;
  }
}
@media(max-width:390px){
  #view .cooking-header-actions .cooking-shopping-link{
    flex:1 1 100%;
  }
}
@media(prefers-reduced-motion:reduce){
  #view .cooking-day-filter .lavi-dropdown-arrow{transition:none}
}



/* Navigation SVG sizing and subtle calendar drag treatment — 2026-11-16 */
/* Only the generator SVG gets the requested 21×22px inner size.
   Normal navigation artwork retains its previous sizing rules; do not alter
   the 48/54px button surfaces or the mobile responsive icon sizes. */
.sidebar .lavi-desktop-nav .nav-generator > .nav-icon,
.sidebar .lavi-mobile-nav .nav-generator > .nav-icon{
  width:21px!important;
  height:22px!important;
  object-fit:contain;
}
/* No shifting margins or transforms during hover: the nearest insertion
   position is now calculated directly from pointer Y, including day gaps. */
#view .lavi-calendar-shell .meal[draggable]{
  transition:opacity 160ms ease,box-shadow 340ms ease;
}
#view .lavi-calendar-shell .meal.meal-dragging{
  opacity:.7;
  filter:none;
  transform:none;
  box-shadow:inset 0 0 0 1px #DAD5ED;
  cursor:grabbing;
}
#view .lavi-calendar-shell .meal.meal-drop-before,
#view .lavi-calendar-shell .meal.meal-drop-after{
  margin-top:0!important;
  margin-bottom:10px!important;
  transform:none!important;
}
#view .lavi-calendar-shell .meal.meal-drop-before::before,
#view .lavi-calendar-shell .meal.meal-drop-after::after{
  content:"";
  position:absolute;
  z-index:2;
  left:8%;
  width:84%;
  height:4px;
  border:0;
  border-radius:999px;
  background:#A99BDD;
  box-shadow:0 0 0 5px rgba(169,155,221,.15);
  pointer-events:none;
}
#view .lavi-calendar-shell .meal.meal-drop-before::before{top:-7px}
#view .lavi-calendar-shell .meal.meal-drop-after::after{bottom:-7px}
.lavi-meal-drag-preview{
  position:fixed;
  z-index:9999;
  top:-1000px;
  left:-1000px;
  display:inline-flex;
  align-items:center;
  box-sizing:border-box;
  width:max-content;
  min-width:100px;
  max-width:230px;
  min-height:42px;
  padding:10px 14px;
  border:1px solid #E9E7F2;
  border-radius:12px;
  background:#FCFBFF;
  color:#2E263D;
  box-shadow:0 8px 20px rgba(43,34,85,.12);
  font:600 13px/1.35 Manrope,system-ui,sans-serif;
  white-space:normal;
  overflow-wrap:anywhere;
  pointer-events:none;
}
@media(prefers-reduced-motion:reduce){
  #view .lavi-calendar-shell .meal[draggable]{transition:none}
}


/* The week slider is an independent GPU-composited pill, rather than a
   full-document View Transition. Text stays stable while the accent moves. */
.lavi-week-selector{position:relative;isolation:isolate}
.lavi-week-selector .lavi-week-choice{position:relative;z-index:1}
.lavi-week-selector .lavi-week-choice.active{
  background:#EEECFA;
  color:#2E263D;
}
.lavi-week-selector.lavi-week-has-slider .lavi-week-choice.active,
#view .cooking-header-actions .lavi-week-selector.lavi-week-has-slider .lavi-week-choice.active{
  background:transparent!important;
}
.lavi-week-selector .lavi-week-slider{
  position:absolute;
  z-index:0;
  display:block;
  border-radius:10px;
  background:#EEECFA;
  pointer-events:none;
  transform-origin:left center;
  will-change:transform;
}
@media(hover:hover) and (pointer:fine){
  .lavi-week-selector .lavi-week-choice:not(.active):hover{
    background:transparent!important;
    color:#2E263D!important;
    filter:none;
  }
}
/* Avoid overriding the active pill in the cooking-page header. */
#view .cooking-header-actions .lavi-week-choice.active{background:#EEECFA}

/* Day actions: fit full captions and match the darker copy icon. */
#view .lavi-calendar-shell .day-actions-menu > .actions-dropdown-panel{
  width:max-content;
  min-width:230px;
  max-width:min(280px,calc(100vw - 32px));
}
#view .lavi-calendar-shell .day-actions-menu .actions-dropdown-panel > button{
  white-space:nowrap;
}
#view .lavi-calendar-shell .day-actions-menu .actions-dropdown-panel > button:first-child .lavi-menu-icon{
  filter:brightness(0) saturate(100%) invert(16%) sepia(12%) saturate(1089%) hue-rotate(217deg) brightness(94%);
}

/* Cooking day choice aligns with the section heading instead of taking a row. */
#view .cooking-page-header{
  align-items:center;
  gap:12px 20px;
}
#view .cooking-page-header .cooking-filters{
  flex:0 0 auto;
  margin-left:auto;
  align-items:center;
}
#view .cooking-page-header .cook-filter{
  width:220px;
  min-width:190px;
}
@media(max-width:720px){
  #view .cooking-page-header{flex-direction:row;align-items:center;gap:10px}
  #view .cooking-page-header .cooking-page-intro{flex:1 1 180px}
  #view .cooking-page-header .cooking-filters{flex:0 1 190px;margin-left:auto}
  #view .cooking-page-header .cook-filter{min-width:140px;width:100%}
}
@media(max-width:480px){
  #view .cooking-page-header{align-items:stretch}
  #view .cooking-page-header .cooking-filters{flex:1 1 100%;justify-content:flex-start;margin-left:0}
  #view .cooking-page-header .cook-filter{width:min(220px,100%)}
}

/* Shopping controls: two compact opposing groups, separate person selector. */
#view .shopping-stock-panel .shopping-filter-layout{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px 20px;
  margin:18px 0 12px;
  min-width:0;
}
#view .shopping-stock-panel .shopping-filter-layout > .shopping-filter-switch,
#view .shopping-stock-panel .shopping-filter-layout > .shopping-scope-switch{
  display:inline-flex;
  flex:0 1 auto;
  width:max-content;
  max-width:100%;
  margin:0;
  padding:4px;
  gap:4px;
}
#view .shopping-stock-panel .shopping-filter-layout > .shopping-scope-switch{margin-left:auto}
#view .shopping-stock-panel .shopping-filter-layout button{
  white-space:nowrap;
  padding:9px 13px;
  min-height:40px;
}
#view .shopping-stock-panel .shopping-person-toolbar{
  justify-content:flex-start;
  margin:0 0 12px;
}
#view .shopping-stock-panel .shopping-stock-title{
  font:700 15px/1.4 Manrope,system-ui,sans-serif;
  color:var(--lavi-ink);
}
#view .shopping-stock-panel .shopping-stock-head > button{
  box-sizing:border-box;
  height:34px;
  min-height:34px;
  padding:5px 12px;
  font:600 12px/1.2 Manrope,system-ui,sans-serif;
  border-radius:11px;
}
#view .shopping-stock-panel .shopping-stock-metric{
  box-sizing:border-box;
  padding:10px;
}
#view .shopping-stock-panel .shopping-stock-metric small{
  line-height:1.25;
}
#view .shopping-stock-panel .shopping-stock-metric strong{
  line-height:1.25;
}
@media(hover:hover) and (pointer:fine){
  #view .lavi-calendar-shell .meal .icon-square:hover,
  #view .lavi-calendar-shell .meal .icon-square:active{
    background:#fff!important;
    color:var(--lavi-ink)!important;
  }
}
@media(max-width:850px){
  #view .shopping-stock-panel .shopping-filter-layout{
    align-items:flex-start;
    flex-direction:column;
  }
  #view .shopping-stock-panel .shopping-filter-layout > .shopping-scope-switch{margin-left:0}
}
@media(max-width:560px){
  #view .shopping-stock-panel .shopping-filter-layout > .shopping-filter-switch,
  #view .shopping-stock-panel .shopping-filter-layout > .shopping-scope-switch{
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #view .shopping-stock-panel .shopping-filter-layout button{
    white-space:normal;
    padding:8px 7px;
  }
  #view .shopping-stock-panel .shopping-stock-head{
    grid-template-columns:minmax(0,1fr) auto;
  }
  #view .shopping-stock-panel .shopping-stock-head > button{
    padding:5px 8px;
    font-size:11px;
  }
}

/* The two cards sharing the insertion boundary separate by 6px each.
   Transforms keep the rest of the column in place (no stray lower gap). */
#view .lavi-calendar-shell .day > .meal.meal-drop-upper,
#view .lavi-calendar-shell .day > .meal.meal-drop-before,
#view .lavi-calendar-shell .day > .meal.meal-drop-after{
  margin-top:0!important;
  margin-bottom:0!important;
}
#view .lavi-calendar-shell .day > .meal.meal-drop-upper,
#view .lavi-calendar-shell .day > .meal.meal-drop-after{
  transform:translateY(-6px)!important;
}
#view .lavi-calendar-shell .day > .meal.meal-drop-before{
  transform:translateY(6px)!important;
}
@media(hover:hover) and (pointer:fine){
  #view .lavi-calendar-shell .day > .meal:not(.meal-dragging):hover{
    transform:none;
  }
}
/* Edit and options never change their white surface on hover.
   Only a subtle, neutral shadow appears. */
#view .lavi-calendar-shell .meal-actions > .icon-square,
#view .lavi-calendar-shell .meal-card-menu > summary,
#view .lavi-calendar-shell .day-actions-menu > summary{
  transition:box-shadow 260ms ease,background-color 260ms ease;
}
@media(hover:hover) and (pointer:fine){
  #view .lavi-calendar-shell .meal-actions > .icon-square:hover,
  #view .lavi-calendar-shell .meal-card-menu > summary:hover,
  #view .lavi-calendar-shell .day-actions-menu > summary:hover{
    background:#fff!important;
    box-shadow:0 2px 7px rgba(43,34,85,.09)!important;
  }
}
#view .lavi-calendar-shell .actions-dropdown-panel > button:not(.danger):hover,
#view .lavi-calendar-shell .actions-dropdown-panel > button:not(.danger):focus-visible{
  background:#EEECFA!important;
}
#view .lavi-calendar-shell .day > .meal[draggable]{
  transition:transform 230ms cubic-bezier(.22,1,.36,1),
             box-shadow 300ms ease,
             opacity 160ms ease;
}
#view .lavi-calendar-shell .day > .meal.meal-dragging{
  transform:none!important;
}
/* Coherent icon/edit/option interactions on both pastel meals and white cards.
   Retain the original icon sizes and outlines; never tint action backgrounds. */
#view .lavi-calendar-shell .meal-actions > .icon-square,
#view .lavi-calendar-shell .meal-card-menu > summary,
#view .lavi-calendar-shell .day-actions-menu > summary,
#view .cooking-page .cook-card-actions .cook-card-menu > summary,
#view .shopping-stock-panel .shopping-stock-head > button{
  background:#fff!important;
  color:var(--lavi-ink)!important;
  box-shadow:none;
  transition:box-shadow 260ms ease;
}
@media(hover:hover) and (pointer:fine){
  #view .lavi-calendar-shell .meal-actions > .icon-square:hover,
  #view .lavi-calendar-shell .meal-card-menu > summary:hover,
  #view .lavi-calendar-shell .day-actions-menu > summary:hover,
  #view .cooking-page .cook-card-actions .cook-card-menu > summary:hover,
  #view .shopping-stock-panel .shopping-stock-head > button:hover{
    background:#fff!important;
    color:var(--lavi-ink)!important;
    box-shadow:0 2px 7px rgba(43,34,85,.09)!important;
  }
}
/* Selection uses the generator's lavender, throughout profile pickers. */
#view .week-person-switch > button:not(.outline),
#lavi-profile-switch-slot .week-person-switch > button:not(.outline),
#view .shopping-stock-panel .shopping-person-toolbar button:not(.outline){
  background:#D8D4FF!important;
  border-color:#D8D4FF!important;
  color:var(--lavi-ink)!important;
}
#view .shopping-stock-panel .shopping-toolbar-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px 20px;
  margin:10px 0 18px;
  min-width:0;
}
#view .shopping-stock-panel .shopping-toolbar-meta .shopping-stock-summary{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  flex:0 1 auto;
  align-items:center;
  gap:5px 16px;
  padding:9px 13px;
  margin:0;
  background:#EEECFA;
  color:var(--lavi-ink);
  border-radius:12px;
  font-size:12px;
  line-height:1.3;
}
#view .shopping-stock-panel .shopping-toolbar-meta .shopping-stock-summary span{
  white-space:nowrap;
}
#view .shopping-stock-panel .shopping-toolbar-meta .shopping-person-toolbar{
  display:flex;
  align-items:center;
  flex:0 1 auto;
  justify-content:flex-end;
  margin:0 0 0 auto;
  gap:7px;
}
#view .shopping-stock-panel .shopping-toolbar-meta .shopping-person-toolbar > .row{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
@media(max-width:750px){
  #view .shopping-stock-panel .shopping-toolbar-meta{
    flex-wrap:wrap;
  }
  #view .shopping-stock-panel .shopping-toolbar-meta .shopping-stock-summary{
    flex:1 1 100%;
    width:100%;
  }
  #view .shopping-stock-panel .shopping-toolbar-meta .shopping-person-toolbar{
    margin-left:auto;
  }
}
@media(max-width:440px){
  #view .shopping-stock-panel .shopping-toolbar-meta .shopping-stock-summary span{
    white-space:normal;
  }
}
@media(prefers-reduced-motion:reduce){
  #view .lavi-calendar-shell .day > .meal{transition:none!important}
  #view .lavi-calendar-shell .day > .meal:hover{transform:none!important}
}

/* Centered insertion guide: detached from the moving meal cards so its
   midpoint remains exact at every card gap and responsive breakpoint. */
#view .lavi-calendar-shell .day{position:relative}
#view .lavi-calendar-shell .day > .lavi-meal-drop-guide{
  position:absolute;
  z-index:9;
  left:12%;
  right:12%;
  height:4px;
  margin-top:-2px;
  border-radius:999px;
  background:#A99BDD;
  box-shadow:0 0 0 5px rgba(169,155,221,.12);
  pointer-events:none;
}
#view .lavi-calendar-shell .day:has(> .lavi-meal-drop-guide) .meal.meal-drop-before::before,
#view .lavi-calendar-shell .day:has(> .lavi-meal-drop-guide) .meal.meal-drop-after::after{
  opacity:0;
}
/* Retina fallback is only for iOS Home Screen web-app mode.
   External SVG stays in Safari, where it is already pixel-sharp. */
.sidebar .lavi-logo-wordmark-bitmap{display:none}
@media(max-width:720px){
  html.lavi-installed-web-app .sidebar .lavi-logo-wordmark{display:none!important}
  html.lavi-installed-web-app .sidebar .lavi-logo-wordmark-bitmap{
    display:block;
    flex:0 0 60px;
    width:60px;
    height:33px;
    min-width:60px;
    max-width:60px;
    object-fit:contain;
    transform:none!important;
    filter:none!important;
    opacity:1;
    will-change:auto;
  }
}
/* Keep desktop/tablet branding unchanged, but isolate mobile lettering from
   the flower's Gaussian-blurred inner-shadow filter. This avoids Safari
   compositing the letter paths into the small filtered SVG surface. */
.sidebar .lavi-logo-wordmark{display:none}
@media(max-width:720px){
  .sidebar .logo{gap:7.5px}
  .sidebar .logo > picture{display:block;flex:0 0 34.5px;width:34.5px;height:33px}
  .sidebar .brand-wordmark{
    display:block;
  }
  .sidebar .lavi-logo-wordmark{
    display:block;
    flex:0 0 60px;
    width:60px;
    height:33px;
    max-width:none;
    object-fit:contain;
    transform:none!important;
    filter:none!important;
  }
}
/* Mobile dock: browser chrome already reserves bottom space on iOS.
   Keep the approved raised placement for the Home Screen shortcut, and
   lower Safari/other browser navigation independently. */
@media(max-width:720px){
  .app{padding-bottom:calc(122px + env(safe-area-inset-bottom,0px))}
  .sidebar .lavi-mobile-nav{
    left:max(22px,calc(14px + env(safe-area-inset-left,0px)));
    right:max(22px,calc(14px + env(safe-area-inset-right,0px)));
    bottom:calc(8px + env(safe-area-inset-bottom,0px));
  }
  html.lavi-installed-web-app .sidebar .lavi-mobile-nav{
    bottom:calc(22px + env(safe-area-inset-bottom,0px));
    left:max(24px,calc(16px + env(safe-area-inset-left,0px)));
    right:max(24px,calc(16px + env(safe-area-inset-right,0px)));
  }
}
@media(max-width:720px) and (display-mode:standalone){
  .sidebar .lavi-mobile-nav{
    bottom:calc(22px + env(safe-area-inset-bottom,0px));
    left:max(24px,calc(16px + env(safe-area-inset-left,0px)));
    right:max(24px,calc(16px + env(safe-area-inset-right,0px)));
  }
}
/* The cooking options control needs a clearly visible outline against its
   near-white card; preserve the approved 42px size and white-on-hover behavior. */
#view .cooking-page .cook-card-actions .cook-card-menu > summary{
  border:1px solid #DDD9EB;
  background:#fff!important;
  color:var(--lavi-ink)!important;
  box-shadow:0 1px 3px rgba(43,34,85,.035);
}
@media(hover:hover) and (pointer:fine){
  #view .cooking-page .cook-card-actions .cook-card-menu > summary:hover{
    border-color:#DDD9EB;
    background:#fff!important;
    box-shadow:0 2px 7px rgba(43,34,85,.09)!important;
  }
}
@media(prefers-reduced-motion:reduce){
  .lavi-week-selector .lavi-week-slider{display:none}
}

/* Two-person portions: compact translucent rows follow each meal category.
   The lock uses the same SVG as the header lock, never a platform emoji. */
#view .lavi-calendar-shell .meal-portion-details{
  display:grid;
  gap:5px;
  min-width:0;
  padding:8px 0 0;
  margin:0;
  border-top:1px solid rgba(46,38,61,.07);
}
#view .lavi-calendar-shell .meal-portion-detail{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  min-width:0;
  min-height:32px;
  box-sizing:border-box;
  padding:6px 8px;
  border:1px solid rgba(46,38,61,.045);
  border-radius:9px;
  background:rgba(255,255,255,.52);
  line-height:1.25;
}
#view .lavi-calendar-shell .meal-portion-detail.is-locked{
  background:rgba(255,255,255,.70);
}
#view .lavi-calendar-shell .meal-portion-detail .meal-portion-person{
  min-width:0;
  color:#535968;
  font:500 11px/1.25 Manrope,system-ui,sans-serif;
  overflow-wrap:anywhere;
}
#view .lavi-calendar-shell .meal .meal-portion-detail > .meal-portion-amount{
  display:inline-flex;
  flex:none;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  min-width:0;
  color:#2E263D;
  font:650 11px/1.25 Manrope,system-ui,sans-serif;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
#view .lavi-calendar-shell .meal-portion-lock{
  display:inline-flex;
  flex:none;
  align-items:center;
  justify-content:center;
  width:15px;
  height:15px;
  font-size:0;
  vertical-align:middle;
}
#view .lavi-calendar-shell .meal-portion-lock img{
  display:block;
  width:14px;
  height:13px;
  object-fit:contain;
}
@media(max-width:390px){
  #view .lavi-calendar-shell .meal-portion-detail{gap:4px;padding:5px 6px}
  #view .lavi-calendar-shell .meal .meal-portion-detail > .meal-portion-amount{gap:3px;font-size:10.5px}
}


/* Cooking card menus on phones: anchor to the visible viewport, never to the
   narrow first card column. All choices remain readable and scrollable. */
@media(max-width:720px){
  #view .cooking-page .cook-card-menu[open] > .actions-dropdown-panel{
    position:fixed!important;
    right:auto;
    bottom:auto;
    z-index:280;
    box-sizing:border-box;
    width:min(256px,calc(100vw - 24px));
    max-width:calc(100vw - 24px);
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    border-radius:15px;
  }
  #view .cooking-day-section:has(.cook-card-menu[open]),
  #view .cooking-page .cookrow:has(.cook-card-menu[open]){
    position:relative;
    z-index:260;
  }
  /* Keep the supplied vector logo at its native on-screen dimensions;
     no CSS transform, shadow or bitmap upscaling. */
  .sidebar .brand-wordmark{
    width:34.5px;
    height:33px;
    max-width:none;
    filter:none!important;
    transform:none!important;
    object-fit:contain;
  }
}

/* Tablet layout audit (721–900px): the legacy grid used 240px + a min-content
   main column, allowing week selectors and product panels to enlarge the page.
   Contain the content track and give meal cards usable width. */
@media(min-width:721px) and (max-width:900px){
  .app{grid-template-columns:240px minmax(0,1fr)}
  .main{min-width:0;max-width:100%;width:100%}
  .lavi-week-selector-wrap{width:100%;min-width:0}
  .lavi-week-selector{width:100%;min-width:0}
  .lavi-week-choice{
    flex:1 1 0;
    min-width:0;
    white-space:normal;
    overflow-wrap:anywhere;
    font-size:11px;
    line-height:1.3;
    padding:8px 5px;
  }
  #view .lavi-calendar-shell .days{grid-template-columns:repeat(2,minmax(0,1fr))}
  #view .shopping-stock-panel{min-width:0;max-width:100%}
  #view .shopping-stock-panel .shopping-filter-layout{min-width:0;max-width:100%;flex-wrap:wrap}
  .recipe-toolbar .recipe-filter-fields{left:auto;right:0}
}

/* Lavi mobile ergonomics — invisible touch slop, not larger visible buttons.
   Existing 34px controls, icon sizes and approved surface colors stay intact. */
@media(max-width:720px) and (pointer:coarse){
  #view .lavi-calendar-shell .meal-actions > .icon-square,
  #view .lavi-calendar-shell .meal-card-menu > summary,
  #view .lavi-calendar-shell .day-actions-menu > summary,
  #view .shopping-stock-panel .shopping-stock-head > button,
  #view .cooking-page .cook-card-actions .cook-card-menu > summary,
  #view .shopping-stock-panel .shopping-person-toolbar button{
    position:relative;
    isolation:isolate;
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }
  /* Pseudoelements belong to the interactive element: their area receives taps.
     Limit side expansion on adjacent 34px meal controls to avoid collisions. */
  #view .lavi-calendar-shell .meal-actions > .icon-square::before,
  #view .lavi-calendar-shell .meal-card-menu > summary::before{
    content:"";
    position:absolute;
    inset:-5px -4px;
    background:transparent;
    border-radius:14px;
  }
  #view .lavi-calendar-shell .day-actions-menu > summary::before{
    content:"";
    position:absolute;
    inset:-5px;
    background:transparent;
    border-radius:15px;
  }
  #view .shopping-stock-panel .shopping-stock-head > button::before{
    content:"";
    position:absolute;
    inset:-5px 0;
    background:transparent;
    border-radius:13px;
  }
  #view .cooking-page .cook-card-actions .cook-card-menu > summary::before{
    content:"";
    position:absolute;
    inset:-4px;
    background:transparent;
    border-radius:13px;
  }
  #view .shopping-stock-panel .shopping-person-toolbar button::before{
    content:"";
    position:absolute;
    inset:-1px -4px;
    background:transparent;
    border-radius:13px;
  }
  /* Menus must have true 44px rows, including the last item next to the edge. */
  #view .lavi-calendar-shell .actions-dropdown-panel > button,
  #view .cooking-page .cook-card-menu > .actions-dropdown-panel > button{
    box-sizing:border-box;
    min-height:44px;
    touch-action:manipulation;
  }
  /* Preserve visual button sizes while avoiding sticky iOS hover highlights. */
  #view .lavi-calendar-shell .meal-actions > .icon-square:active,
  #view .lavi-calendar-shell .meal-card-menu > summary:active,
  #view .lavi-calendar-shell .day-actions-menu > summary:active,
  #view .cooking-page .cook-card-actions .cook-card-menu > summary:active,
  #view .shopping-stock-panel .shopping-stock-head > button:active{
    background:#fff!important;
    color:var(--lavi-ink)!important;
  }
}
/* Shared dialog details. Specialized widths, editor grids and cooking layout
   still belong to their existing component rules. */
#modalroot .modal{
  min-width:0;
  max-width:100%;
  color:var(--lavi-ink);
  overflow-wrap:anywhere;
}
#modalroot .modalwrap{
  background:rgba(38,31,56,.34);
}
#modalroot .modal .lavi-dialog-titlebar{
  align-items:flex-start;
  gap:12px;
  margin-bottom:16px;
}
#modalroot .modal .lavi-dialog-titlebar > div{
  min-width:0;
}
#modalroot .modal .lavi-dialog-titlebar h2{
  flex:1;
  min-width:0;
  margin:0;
  font-size:clamp(19px,2.4vw,25px);
  line-height:1.26;
}
#modalroot .modal .lavi-dialog-titlebar .hint{
  margin:4px 0;
}
#modalroot .modal .lavi-dialog-titlebar > button.icon-square{
  flex-shrink:0;
  background:var(--lavi-surface-muted);
  color:var(--lavi-ink);
  border-color:var(--lavi-border);
}
#modalroot .modal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea){
  max-width:100%;
  border-color:var(--lavi-border);
}
#modalroot .modal :is(input,select,textarea):focus-visible{
  outline:2px solid #8272CC;
  outline-offset:1px;
}
#modalroot .modal .backup-history-list{
  display:grid;
  gap:10px;
}
#modalroot .modal .backup-history-item{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:14px;
  background:var(--lavi-surface-muted);
  border:1px solid var(--lavi-border);
  border-radius:14px;
}
#modalroot .modal .backup-history-item :is(h3,p){
  margin:0;
}
#modalroot .modal .backup-history-item button{
  min-height:42px;
  white-space:normal;
}
@media(max-width:480px){
  #modalroot .modal .lavi-dialog-titlebar{
    gap:8px;
    margin-bottom:12px;
  }
  #modalroot .modal .backup-history-item{
    grid-template-columns:minmax(0,1fr);
  }
  #modalroot .modal .meal-edit-dialog .meal-edit-actions{
    display:grid;
    grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);
  }
  #modalroot .modal .meal-edit-dialog .meal-edit-actions > button{
    white-space:normal;
  }
}

/* Scrollable editor/modal surface keeps the final action above the iOS
   home indicator and remains usable when dynamic browser chrome changes. */
@media(max-width:720px){
  #modalroot .modalwrap{
    box-sizing:border-box;
    padding:12px 12px calc(12px + env(safe-area-inset-bottom,0px));
    min-height:0;
  }
  #modalroot .modalwrap > .modal{
    box-sizing:border-box;
    max-height:min(92dvh,calc(100dvh - 24px - env(safe-area-inset-bottom,0px)));
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
}



/* Experimental phone meal mosaic (PR #73): one DAY per calendar row,
   two independent columns INSIDE the day. CSS multicolumn keeps the exact
   existing meal DOM order, onclick indices, menu controls and desktop DnD.
   Unlike grid, each card ends after its own content: a two-line recipe does
   not increase the height of a neighboring short-title card.
   Note: visually read down the left column, then down the right column. */
@media (min-width:360px) and (max-width:720px){
  #view .lavi-calendar-shell .days{
    grid-template-columns:minmax(0,1fr);
  }
  #view .lavi-calendar-shell .day{
    display:block;
    column-count:2;
    column-gap:8px;
    column-fill:balance;
  }
  #view .lavi-calendar-shell .day > .day-heading-row,
  #view .lavi-calendar-shell .day > .dayactions,
  #view .lavi-calendar-shell .day > .hint{
    column-span:all;
  }
  #view .lavi-calendar-shell .day > .day-heading-row{
    margin-bottom:9px;
  }
  #view .lavi-calendar-shell .day > .meal{
    display:inline-block;
    vertical-align:top;
    width:100%;
    max-width:100%;
    height:auto;
    margin:0 0 8px;
    break-inside:avoid;
    -webkit-column-break-inside:avoid;
  }
  #view .lavi-calendar-shell .day > .dayactions{
    margin-top:2px;
  }
  /* The desktop's full-width between-card guide has no meaningful midpoint
     when two mobile columns are not aligned. Individual card cues remain. */
  #view .lavi-calendar-shell .lavi-meal-drop-guide{display:none}
}
/* Smallest phones cannot fit the calorie label and two action controls
   comfortably in two half-width cards. Show the same compact design with
   full-width cards there, without changing the desktop calendar. */
@media(max-width:359px){
  #view .lavi-calendar-shell .days{grid-template-columns:minmax(0,1fr)}
}


/* Week overview / 2026-11-18
   Metrics and cooking/week controls share their lower edge ABOVE the outlined
   calendar. The duplicate calendar heading remains removed. */
#view .lavi-week-overview-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  column-gap:16px;
  row-gap:12px;
  min-width:0;
  margin:0 0 18px;
}
#view .lavi-week-overview-layout > .week-metrics{
  margin:0;
  width:max-content;
  max-width:100%;
}
#view .lavi-week-overview-layout > .week-toolbar{
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  min-width:0;
  margin:0;
  padding:0;
}
#view .lavi-week-overview-layout .week-toolbar-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  flex-wrap:wrap;
  width:max-content;
  max-width:100%;
  gap:10px;
}
#view .lavi-week-overview-layout ~ .lavi-calendar-shell{
  margin-top:0;
}
@media(max-width:1399px){
  #view .lavi-week-overview-layout{
    grid-template-columns:minmax(0,1fr);
  }
  #view .lavi-week-overview-layout > .week-toolbar{
    justify-content:flex-end;
  }
}
@media(max-width:720px){
  #view .lavi-week-overview-layout{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:12px;
    margin-bottom:12px;
  }
  #view .lavi-week-overview-layout > .week-metrics{
    width:100%;
    max-width:100%;
    gap:10px;
  }
  #view .lavi-week-overview-layout > .lavi-week-profile-row{
    width:100%;
    margin:0;
  }
  /* A single profile card, aligned to the week and metric cards.
     Native select retains iOS/Android accessibility, with Lavi's own arrow. */
  #view .lavi-week-profile-row .lavi-mobile-profile-picker{
    box-sizing:border-box;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    width:100%;
    min-width:0;
    min-height:52px;
    overflow:hidden;
    padding:4px 5px 4px 12px;
    border:1px solid var(--line);
    border-radius:15px;
    background:#fff;
    color:var(--muted);
    font:500 13px/1.35 Manrope,system-ui,sans-serif;
    box-shadow:var(--lavi-shadow);
  }
  #view .lavi-mobile-profile-picker > span{
    flex:1 1 0;
    min-width:0;
  }
  #view .lavi-mobile-profile-picker > select{
    box-sizing:border-box;
    -webkit-appearance:none;
    appearance:none;
    flex:0 1 52%;
    width:52%;
    min-width:0;
    max-width:100%;
    min-height:44px;
    margin:0;
    padding:0 30px 0 12px;
    border:1px solid transparent;
    border-radius:10px;
    background-color:var(--lavi-active);
    background-image:url("/assets/icons/arrow.svg");
    background-repeat:no-repeat;
    background-position:right 12px center;
    background-size:8px 5px;
    color:var(--dark);
    font:600 16px/1.25 Manrope,system-ui,sans-serif;
    text-overflow:ellipsis;
    overflow:hidden;
    box-shadow:none;
  }
  #view .lavi-mobile-profile-picker > select:focus-visible{
    outline:2px solid #7766C6;
    outline-offset:1px;
  }
  #view .lavi-week-overview-layout > .week-toolbar{
    margin:0;
  }
  #view .lavi-week-overview-layout > .week-metrics .card.metric{
    min-width:0;
  }
  #view .week-metrics .metric-water .num{
    white-space:normal;
    overflow-wrap:normal;
  }
  #view .lavi-week-overview-layout > .week-toolbar{
    width:100%;
  }
  #view .lavi-week-overview-layout .week-toolbar-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
    justify-content:stretch;
    gap:10px;
    width:100%;
  }
  /* Keep the existing mobile two-button layout and the Sunday reminder row. */
  #view .lavi-week-overview-layout .week-toolbar-actions > .lavi-sunday-hint{
    grid-column:1/-1;
  }
  #view .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-group{
    grid-column:1;
  }
  #view .lavi-week-overview-layout .week-toolbar-actions .week-actions-menu{
    grid-column:2;
  }
}
/* Accessible full date ranges on desktop, concise week names on the phone.
   This affects all shared week selectors, including the cooking page. */
.lavi-week-choice-compact{display:none}
@media(max-width:720px){
  .lavi-week-choice-full{display:none}
  .lavi-week-choice-compact{display:inline}
}

/* Mobile section heading: one existing cloud panel, moved without recreating
   its controls or changing sync state. Recovery and sign-in remain full width. */
@media(max-width:720px){
  .main > .top.lavi-mobile-status{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,45%);
    align-items:end;
    gap:10px;
    margin-bottom:14px;
    min-width:0;
  }
  .top.lavi-mobile-status > div:first-child{
    min-width:0;
    overflow-wrap:anywhere;
  }
  .main > .lavi-status-row.lavi-status-relocated{display:none}
  .top.lavi-mobile-status > .cloud-panel{
    justify-self:end;
    align-self:end;
    box-sizing:border-box;
    width:max-content;
    max-width:100%;
    min-width:0;
    margin:0;
    padding:6px 8px;
    border-radius:12px;
    background:#fff;
    border:1px solid var(--line);
    box-shadow:none;
  }
  .top.lavi-mobile-status .lavi-design-demo-notice{
    justify-content:flex-end;
    text-align:right;
    font-size:11px;
    line-height:1.35;
  }
  .top.lavi-mobile-status .cloud-compact-row{
    gap:4px;
    min-width:0;
  }
  .top.lavi-mobile-status .cloud-compact-row #cloud-status{
    min-width:0;
    min-height:26px;
    padding:4px 6px;
    font-size:11px;
    line-height:1.25;
    overflow-wrap:anywhere;
  }
  .top.lavi-mobile-status .cloud-compact-row button.secondary{
    flex:0 0 30px;
    width:30px;
    min-width:30px;
    height:30px;
  }
  /* No narrow column for login or recovery warnings / actions. */
  .top.lavi-mobile-status:has(> .cloud-panel :is(a:not(.lavi-design-demo-notice a),.cloud-recovery-options,#cloud-status[data-state="error"])){
    grid-template-columns:minmax(0,1fr);
  }
  .top.lavi-mobile-status > .cloud-panel:has(a:not(.lavi-design-demo-notice a),.cloud-recovery-options,#cloud-status[data-state="error"]){
    width:100%;
    padding:10px 12px;
    justify-self:stretch;
  }
  .top.lavi-mobile-status .cloud-compact-row #cloud-status[data-state="error"]{
    font-size:12px;
    line-height:1.35;
  }
  /* Preserve login and recovery interactivity when the rest of the app is locked. */
  body.cloud-locked .main > .top.lavi-mobile-status{
    pointer-events:auto;
    opacity:1;
  }
  body.cloud-locked .top.lavi-mobile-status > :not(.cloud-panel){
    pointer-events:none;
    opacity:.6;
  }
}

/* Read-only restore preview. Keep the same surface tokens as backup history. */
#modalroot .backup-restore-dialog{min-width:0}
#modalroot .backup-profile-groups{display:grid;gap:8px;margin:12px 0}
#modalroot :is(.backup-profile-group,.backup-profile-note){
  box-sizing:border-box;min-width:0;padding:12px;
  border:1px solid var(--lavi-border,#E9E7F2);border-radius:14px;background:#FCFBFF;
}
#modalroot .backup-profile-group.restore{background:#EEECFA}
#modalroot .backup-profile-group h3{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  margin:0 0 6px;font-size:13px;font-weight:650;line-height:1.4;
}
#modalroot .backup-profile-group h3 span{
  flex:none;display:grid;place-items:center;min-width:24px;height:24px;
  padding:0 6px;border-radius:8px;background:var(--lavi-lime,#E6FDA8);color:var(--lavi-lime-ink,#465340);font-size:12px;
}
#modalroot .backup-profile-group ul{list-style:none;padding:0;margin:0;display:grid;gap:4px}
#modalroot .backup-profile-group li{font-size:13px;overflow-wrap:anywhere}
#modalroot :is(.backup-profile-group,.backup-profile-note) p{margin:4px 0 0;overflow-wrap:anywhere}
#modalroot .backup-preview-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:16px}
#modalroot .backup-preview-actions button{min-width:0;min-height:44px;white-space:normal}
#modalroot .backup-preview-actions button:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:360px){#modalroot .backup-preview-actions{grid-template-columns:1fr}}

.cloud-panel:has(.lavi-design-demo-notice){width:fit-content;max-width:100%;overflow:visible}
.lavi-design-demo-notice.actions-dropdown{display:block;position:relative}
.lavi-design-demo-notice > summary{cursor:pointer;list-style:none}
.lavi-design-demo-notice > .actions-dropdown-panel{left:0;right:auto;min-width:180px;z-index:60}
.week-person-switch > button{max-width:16em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.cloud-panel .lavi-design-demo-notice.actions-dropdown > summary{
 display:block;min-height:0;width:auto;height:auto;padding:0;border:0;background:transparent;
 color:inherit;font:inherit;box-shadow:none
}
