/* Lavi design CSS module 2/4. Shared surfaces, neutral UI controls, mobile dock adjustments; load immediately after calendar base.
   Keep stylesheet link order: calendar-redesign -> surfaces -> interactions -> cooking.
   Moving rules between modules requires responsive regression because order is part of the cascade. */
/* Lavi unified surfaces: first cross-section visual pass */
:root{
  --lavi-surface:#FFFFFF;
  --lavi-surface-muted:#FCFBFF;
  --lavi-surface-selected:#EEECFA;
  --lavi-border:#E9E7F2;
  --lavi-ink:#2E263D;
  --lavi-caption:#535968;
  --lavi-card-radius:20px;
  --lavi-control-radius:12px;
  --lavi-surface-shadow:0 2px 7.4px rgba(43,34,85,.07);
}
/* The day header used a 162px fixed-width capsule: reduce the width to
   the real content + the specified 7px horizontal padding. */
.lavi-calendar-shell .day-heading-row>.row{
  flex:1 1 0;
  min-width:0;
  justify-content:flex-end;
  gap:7px!important;
}
.lavi-calendar-shell .day .cal{
  flex:0 1 auto;
  width:max-content;
  max-width:calc(100% - 41px);
  min-width:0;
  height:34px;
  min-height:34px;
  padding-inline:7px;
  font:500 13px/1.3 Manrope,system-ui,sans-serif;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media(max-width:560px){
  .lavi-calendar-shell .day-heading-row>.row{flex:1 1 100%}
  .lavi-calendar-shell .day .cal{
    flex:0 1 auto;
    width:max-content;
    max-width:calc(100% - 41px);
  }
}
/* Consistent white surfaces across recipes, shopping, cooking, statistics,
   settings, and product inventory. Do not change component layout/DOM. */
#view .card:not(.metric):not(.day):not(.meal),
#view .cooking-day-section,
#view .shopping-stock-row,
#view .settings-household-card{
  background:var(--lavi-surface);
  border:1px solid var(--lavi-border);
  border-radius:var(--lavi-card-radius);
  box-shadow:var(--lavi-surface-shadow);
}
#view .card:not(.metric):not(.day):not(.meal){
  padding:20px;
}
#view .cooking-day-section{
  padding:18px 18px 12px;
}
#view .shopping-stock-row{
  padding:12px;
}
#view .settings-household-card{
  padding:14px;
}
#view .recipe.card{
  transition:box-shadow 220ms var(--lavi-nav-ease),
             border-color 220ms var(--lavi-nav-ease),
             transform 220ms var(--lavi-nav-ease);
}
@media(hover:hover) and (pointer:fine){
  #view .recipe.card:hover{
    box-shadow:0 4px 12px rgba(43,34,85,.11);
    border-color:#DDD9EC;
  }
}
/* Section typography, including headings in the statistics and settings tabs. */
#view h2{
  font-family:"Playfair Display",Georgia,serif;
  font-weight:700;
  line-height:1.35;
  color:var(--lavi-ink);
}
#view h3{color:var(--lavi-ink)}
#view p,#view .hint{color:var(--lavi-caption)}
#recipeCards > .recipe{
  min-width:0;
  overflow-wrap:anywhere;
}
#recipeCards .recipe-card-title .recipe-link{
  min-width:0;
  overflow-wrap:anywhere;
}
#view .recipe-tab-buttons,
#view .recipe-toolbar-controls,
#view .recipe-toolbar-actions,
#view .shopping-filter-switch,
#view .cooking-filters{
  gap:10px;
}
/* Inputs are visually quiet, but retain visible focus states and normal
   accessible font sizing on touch devices. */
#view input:not([type="checkbox"]):not([type="radio"]),
#view select,
#view textarea,
#modalroot input:not([type="checkbox"]):not([type="radio"]),
#modalroot select,
#modalroot textarea{
  box-sizing:border-box;
  background:var(--lavi-surface);
  border:1px solid var(--lavi-border);
  border-radius:var(--lavi-control-radius);
  color:var(--lavi-ink);
  box-shadow:none;
}
#view input:focus-visible,
#view select:focus-visible,
#view textarea:focus-visible,
#modalroot input:focus-visible,
#modalroot select:focus-visible,
#modalroot textarea:focus-visible{
  outline:2px solid #A59BDE;
  outline-offset:2px;
}
#view label{color:var(--lavi-caption)}
#view .pill,
#view .cooktag{
  background:var(--lavi-surface-selected);
  color:#535968;
  border-radius:9px;
}
#view .nutrition-metric,
#view .shopping-stock-metric,
#view .cooking-page-summary{
  background:#F5F3FC;
  border-color:var(--lavi-border);
  color:var(--lavi-caption);
  border-radius:12px;
}
#view .nutrition-metric small,
#view .shopping-stock-metric small{
  color:var(--lavi-caption);
}
#view .nutrition-metric strong,
#view .shopping-stock-metric strong{
  color:var(--lavi-ink);
}
#view .progress,
#view .waterbar{background:var(--lavi-surface-selected)}
#view .progress > div,
#view .waterbar > div{background:#A99BDD}
#view button.secondary,
#modalroot button.secondary{
  background:var(--lavi-surface-selected);
  color:var(--lavi-ink);
}
#view button.outline,
#modalroot button.outline{
  background:#fff;
  color:var(--lavi-ink);
  border:1px solid var(--lavi-border);
}
#view button.danger,
#modalroot button.danger{
  color:#9D4663;
  background:#FFF0F3;
}
#view button:not(.outline):not(.secondary):not(.danger):not(.recipe-link):not(.icon-square):not(.mini):not(.lavi-week-choice):not(.lavi-cook-action),
#modalroot button:not(.outline):not(.secondary):not(.danger):not(.icon-square):not(.mini){
  background:#D8D4FF;
  color:var(--lavi-ink);
}
#view button:not(.recipe-link):focus-visible,
#modalroot button:focus-visible{
  outline:2px solid #8272CC;
  outline-offset:2px;
}
@media(hover:hover) and (pointer:fine){
  #view button.secondary:hover,
  #modalroot button.secondary:hover,
  #view button.outline:hover,
  #modalroot button.outline:hover{background:#F5F3FC}
}
#modalroot .modal,
body > .modalwrap .modal{
  background:#fff;
  border:1px solid var(--lavi-border);
  border-radius:20px;
  box-shadow:0 12px 35px rgba(43,34,85,.14);
}
#modalroot .modal h2,
body > .modalwrap .modal h2{
  font-family:"Playfair Display",Georgia,serif;
  font-weight:700;
  color:var(--lavi-ink);
}
@media(max-width:720px){
  #view .card:not(.metric):not(.day):not(.meal){padding:14px}
  #view .cooking-day-section{padding:12px}
  #view .shopping-stock-row{padding:10px}
}
@media(prefers-reduced-motion:reduce){
  #view .recipe.card{transition:none}
}

/* Week calendar controls are not generic primary actions. */
#view .lavi-calendar-shell .dayactions button{
  background:#fff;
  color:var(--lavi-ink);
  border:1px solid var(--lavi-border);
}
#view .lavi-week-overview-layout .lavi-cook-action{background:var(--lavi-active)}
#view .lavi-calendar-shell .meal-actions>.icon-square,
#view .lavi-calendar-shell .meal-card-menu>summary{
  background:#fff;
  border:0;
}


/* Mobile polish: floating navigation, calmer controls and stacked cooking prompt */
/* Token overrides stay local to Lavi's visual layer; semantic meal-category
   colors remain the deliberately distinct user-approved palette. */
:root{
  --lavi-nav-floating-shadow:0 8px 24px rgba(43,34,85,.10);
  --lavi-soft-hover:#F5F3FC;
  --lavi-dock-bg:#FFFFFF;
}
.lavi-week-choice.active{
  background:var(--lavi-surface-selected);
  color:var(--lavi-ink);
}
/* Keep nested action menus on the white surface, not the global primary
   button color. Destructive actions use red TEXT only at rest. */
#view .actions-dropdown-panel > button,
#modalroot .actions-dropdown-panel > button,
.sidebar .nav-extra-links > button{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  min-width:0;
  min-height:44px;
  padding:10px 12px;
  border:0;
  border-radius:9px;
  background:transparent!important;
  color:var(--lavi-ink);
  font:500 13px/1.35 Manrope,system-ui,sans-serif;
  text-align:left;
  box-shadow:none;
  transition:background-color 180ms ease;
}
#view .actions-dropdown-panel > button.danger,
#modalroot .actions-dropdown-panel > button.danger{color:#A34862}
#view .actions-dropdown-panel > button:hover,
#view .actions-dropdown-panel > button:focus-visible,
#view .actions-dropdown-panel > button:active,
#modalroot .actions-dropdown-panel > button:hover,
#modalroot .actions-dropdown-panel > button:focus-visible,
#modalroot .actions-dropdown-panel > button:active,
.sidebar .nav-extra-links > button:hover,
.sidebar .nav-extra-links > button:focus-visible,
.sidebar .nav-extra-links > button:active{
  background:var(--lavi-soft-hover)!important;
}
#view .actions-dropdown-panel > button.danger:hover,
#view .actions-dropdown-panel > button.danger:focus-visible,
#modalroot .actions-dropdown-panel > button.danger:hover,
#modalroot .actions-dropdown-panel > button.danger:focus-visible{
  background:#FFF0F3!important;
}
#view .actions-dropdown-panel,
#modalroot .actions-dropdown-panel{
  background:#fff;
  border:1px solid var(--lavi-border);
  border-radius:16px;
  box-shadow:0 10px 25px rgba(43,34,85,.12);
  padding:6px;
  gap:2px;
}
.lavi-menu-icon{
  display:block;
  flex:0 0 17px;
  width:17px;
  height:17px;
  object-fit:contain;
}
#view .actions-dropdown-divider,
#modalroot .actions-dropdown-divider{
  height:1px;
  background:var(--lavi-border);
  margin:5px 8px;
}
/* Preserve existing grouping; the synthetic cooking reminder becomes a full
   row only on narrow viewports. */
@media(min-width:721px){
  .lavi-week-overview-layout .week-toolbar-actions > .lavi-sunday-hint{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:42px;
    padding:0 12px;
    border:1px solid var(--lavi-border);
    background:var(--lavi-surface-muted);
    border-radius:12px;
    color:var(--lavi-caption);
    font:600 12px/1.35 Manrope,system-ui,sans-serif;
  }
  .lavi-week-overview-layout .week-toolbar-actions > .lavi-sunday-hint strong{font-weight:600}
}
/* Scoped shopping colors: no legacy purple or pink selection state. */
#view .shopping-stock-panel .shopping-scope-switch,
#view .shopping-stock-panel .shopping-filter-switch{
  background:var(--lavi-surface-muted);
  border:1px solid var(--lavi-border);
  border-radius:14px;
  padding:4px;
  gap:6px;
}
#view .shopping-stock-panel .shopping-scope-switch button,
#view .shopping-stock-panel .shopping-filter-switch button{
  min-height:42px;
  border:0;
  border-radius:10px;
  background:transparent!important;
  box-shadow:none;
  color:var(--lavi-caption);
  font:600 13px/1.35 Manrope,system-ui,sans-serif;
}
#view .shopping-stock-panel .shopping-scope-switch button.active,
#view .shopping-stock-panel .shopping-filter-switch button.active{
  background:var(--lavi-surface-selected)!important;
  color:var(--lavi-ink);
  font-weight:700;
}
#view .shopping-stock-panel .shopping-stock-toolbar > .row > button{
  min-height:42px;
  border:1px solid var(--lavi-border);
  border-radius:12px;
  background:#fff!important;
  color:var(--lavi-ink);
  font:600 13px/1.3 Manrope,system-ui,sans-serif;
}
#view .shopping-stock-panel .shopping-stock-toolbar > .row > button:not(.outline){
  border-color:var(--lavi-surface-selected);
  background:var(--lavi-surface-selected)!important;
}
#view .shopping-stock-panel .shopping-stock-summary{
  display:flex;
  gap:8px 18px;
  flex-wrap:wrap;
  padding:12px 14px;
  border:0;
  border-radius:14px;
  background:var(--lavi-surface-muted);
  color:var(--lavi-caption);
  font-size:12px;
}
#view .shopping-stock-panel .shopping-stock-summary strong{color:var(--lavi-ink)}
#view .shopping-stock-panel .shopping-stock-metric,
#view .shopping-stock-panel .shopping-stock-row.is-stocked .shopping-stock-metric.buy{
  background:var(--lavi-surface-muted);
  color:var(--lavi-caption);
  border:0;
}
#view .shopping-stock-panel .shopping-stock-metric.buy{
  background:var(--lavi-surface-selected);
}
#view .shopping-stock-panel .shopping-stock-row.is-stocked{
  background:#fff;
}
/* Small-screen navigation is a self-contained floating dock, with six equal
   icon slots and visual labels hidden (all controls keep aria-label/title). */
@media(max-width:720px){
  .app{
    padding-bottom:calc(112px + env(safe-area-inset-bottom,0px));
  }
  .sidebar .lavi-mobile-nav{
    box-sizing:border-box;
    position:fixed;
    z-index:140;
    left:max(16px,env(safe-area-inset-left,16px));
    right:max(16px,env(safe-area-inset-right,16px));
    bottom:calc(12px + env(safe-area-inset-bottom,0px));
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    align-items:center;
    justify-items:stretch;
    gap:0;
    width:auto;
    height:72px;
    padding:8px 7px;
    border:1px solid var(--lavi-border);
    border-radius:24px;
    background:var(--lavi-dock-bg);
    box-shadow:var(--lavi-nav-floating-shadow);
  }
  .sidebar .lavi-mobile-nav > button,
  .sidebar .lavi-mobile-nav > .nav-extra > summary{
    display:grid;
    place-items:center;
    width:100%;
    min-width:0;
    height:54px;
    min-height:54px;
    margin:0;
    padding:0;
    gap:0;
    border:0;
    border-radius:16px;
    background:transparent;
    color:var(--lavi-ink);
    box-shadow:none;
  }
  .sidebar .lavi-mobile-nav .nav-icon{width:26px;height:26px}
  .sidebar .lavi-mobile-nav .nav-glyph{font-size:27px;line-height:1;min-width:0}
  .sidebar .lavi-mobile-nav > button > .nav-caption,
  .sidebar .lavi-mobile-nav > .nav-extra > summary > .nav-caption{
    display:none!important;
  }
  .sidebar .lavi-mobile-nav > button.active,
  .sidebar .lavi-mobile-nav > .nav-extra > summary.active,
  .sidebar .lavi-mobile-nav > .nav-generator{
    background:var(--lavi-surface-selected)!important;
    color:var(--lavi-ink)!important;
  }
  .sidebar .lavi-mobile-nav > .nav-generator:hover,
  .sidebar .lavi-mobile-nav > button:hover,
  .sidebar .lavi-mobile-nav > .nav-extra > summary:hover{
    background:var(--lavi-soft-hover)!important;
  }
  .sidebar .lavi-mobile-nav > .nav-extra{position:relative;width:100%;min-width:0}
  .sidebar .lavi-mobile-nav > .nav-extra > .nav-extra-links{
    bottom:calc(100% + 16px);
    right:0;
    left:auto;
    width:min(245px,calc(100vw - 32px));
    max-height:min(350px,calc(100dvh - 148px));
    border:1px solid var(--lavi-border);
    border-radius:16px;
    background:#fff;
    box-shadow:var(--lavi-nav-floating-shadow);
  }
  /* Give the water icon and label more room than the calorie total.
     Keep the two metrics in one row without touching their values or state. */
  #view .lavi-week-overview-layout > .week-metrics{
    grid-template-columns:minmax(0,45fr) minmax(0,55fr);
  }
  .week-metrics .card.metric:not(.metric-water) .num{
    font-size:clamp(12px,3.35vw,18px);
    white-space:nowrap;
  }
  .week-metrics .metric-water{
    grid-column:auto;
    width:100%;
    min-width:0;
    justify-content:flex-start;
    gap:8px;
  }
  .week-metrics .metric-water-icon{
    flex:0 0 30px;
    width:30px;
    height:30px;
  }
  .week-metrics .metric-water-icon img{
    width:17px;
    height:17px;
  }
  .week-metrics .card.metric .num{
    font-size:clamp(13px,3.6vw,18px);
  }
  @media(max-width:359px){
    .week-metrics .card.metric{padding:12px 9px}
    .week-metrics .metric-water{gap:4px}
    .week-metrics .metric-water-icon{
      flex-basis:25px;
      width:25px;
      height:25px;
    }
    .week-metrics .card.metric .num{font-size:13px}
  }
  .lavi-week-overview-layout .week-toolbar-actions{
    box-sizing:border-box;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
    gap:10px;
    width:100%;
    min-width:0;
  }
  .lavi-week-overview-layout .week-toolbar-actions > .lavi-sunday-hint{
    box-sizing:border-box;
    grid-column:1/-1;
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:0;
    width:100%;
    min-height:43px;
    padding:10px 12px;
    border:1px solid var(--lavi-border);
    border-radius:12px;
    background:var(--lavi-surface-muted);
    color:var(--lavi-caption);
    text-align:center;
    font:600 13px/1.35 Manrope,system-ui,sans-serif;
  }
  .lavi-week-overview-layout .week-toolbar-actions > .lavi-sunday-hint strong{font-weight:600}
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-group{
    grid-column:1;
    width:100%;
    min-width:0;
    margin:0;
    gap:0;
  }
  .lavi-week-overview-layout .week-toolbar-actions .week-actions-menu{
    grid-column:2;
    min-width:0;
    width:100%;
    margin:0;
  }
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action,
  .lavi-week-overview-layout .week-toolbar-actions .week-actions-menu>summary{
    display:flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    flex:1 1 auto;
    width:100%;
    min-width:0;
    max-width:none;
    height:50px;
    min-height:50px;
    max-height:50px;
    margin:0;
    padding:0 9px;
    gap:8px;
    border-radius:12px;
    font:700 13px/1.22 Manrope,system-ui,sans-serif;
    white-space:normal;
    text-align:center;
  }
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action img{
    width:20px;height:20px;flex:none;
  }
  .lavi-week-overview-layout .week-toolbar-actions .week-actions-menu>summary .lavi-dropdown-arrow{
    flex:none;
    position:relative;
    top:1px;
  }
  #view .shopping-stock-panel .shopping-scope-switch,
  #view .shopping-stock-panel .shopping-filter-switch{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
  }
  #view .shopping-stock-panel .shopping-scope-switch button,
  #view .shopping-stock-panel .shopping-filter-switch button{
    min-width:0;
    padding:8px;
    white-space:normal;
    text-align:center;
  }
}
@media(max-width:390px){
  .sidebar .lavi-mobile-nav > button,
  .sidebar .lavi-mobile-nav > .nav-extra > summary{
    height:54px;
    min-height:54px;
  }
  .lavi-week-overview-layout .week-toolbar-actions{gap:8px}
  .lavi-week-overview-layout .week-toolbar-actions .lavi-cook-action,
  .lavi-week-overview-layout .week-toolbar-actions .week-actions-menu>summary{
    padding:0 6px;
    gap:6px;
    font-size:12px;
  }
}
@media(prefers-reduced-motion:reduce){
  #view .actions-dropdown-panel > button,
  #modalroot .actions-dropdown-panel > button,
  .sidebar .nav-extra-links > button{transition:none}
}


/* Shared legacy accent cleanup: selected tabs and cooking annotations */
:root{
  --accent:#D8D4FF;
  --soft:#F5F3FC;
}
#view .recipe-tab-buttons > button:not(.outline){
  background:var(--lavi-surface-selected);
  color:var(--lavi-ink);
}
#view .recipe-tab-buttons > button.outline{
  background:#fff;
  border:1px solid var(--lavi-border);
  color:var(--lavi-ink);
}
#view .recipe-eligibility-mark,
#view .batch,
#view .cooktag,
#view .cooking-page-summary{
  background:var(--lavi-surface-selected);
  color:var(--lavi-caption);
}
#view .cooking-page-summary strong{color:var(--lavi-ink)}
#view .shopping-stock-row .pantry-match-note,
#view .shopping-ambiguous-note{
  border-color:var(--lavi-border);
  background:var(--lavi-surface-muted);
  color:var(--lavi-caption);
}
/* Never suppress visible menu focus; keyboard and touch need feedback. */
#view .actions-dropdown-panel > button:focus-visible,
#modalroot .actions-dropdown-panel > button:focus-visible{
  outline:2px solid #8272CC;
  outline-offset:-2px;
}


/* Mobile day header, detached dock selections and tighter cooking spacing — 2026-11-15 */
@media(max-width:720px){
  /* Explicit separation between the generation action and the selected page.
     Equal icon slots are preserved even at 320px. */
  .sidebar .lavi-mobile-nav{
    gap:6px;
  }
  .sidebar .lavi-mobile-nav > .nav-generator{
    background:#D8D4FF!important;
    color:var(--lavi-ink)!important;
  }
  .sidebar .lavi-mobile-nav > .nav-generator:hover{
    background:#C9C5EE!important;
  }
  .sidebar .lavi-mobile-nav > button.active:not(.nav-generator),
  .sidebar .lavi-mobile-nav > .nav-extra > summary.active{
    background:#EEECFA!important;
  }
  /* Fix the excessive space below the calendar helper text and between
     the full-width Sunday count and its actions. */
  .lavi-week-overview-layout .week-toolbar{
    gap:7px;
    margin-bottom:12px;
  }
  .lavi-week-overview-layout .week-toolbar > div:first-child > .hint{
    margin:4px 0 0;
  }
  .lavi-week-overview-layout .week-toolbar-actions{
    column-gap:10px;
    row-gap:7px;
  }
  .lavi-week-overview-layout .week-toolbar-actions > .lavi-sunday-hint{
    min-height:40px;
    padding:8px 12px;
  }
  /* Two-line day headers: weekday and options on row one; daily kcal label
     on its own complete row. No DOM duplication or disappearing data. */
  .lavi-calendar-shell .day-heading-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) 34px;
    grid-template-rows:34px auto;
    align-items:center;
    column-gap:6px;
    row-gap:8px;
    flex-wrap:initial;
    width:100%;
    min-width:0;
  }
  .lavi-calendar-shell .day-heading-row > .heading{
    grid-column:1;
    grid-row:1;
    min-width:0;
  }
  .lavi-calendar-shell .day-heading-row > .row{
    display:contents;
  }
  .lavi-calendar-shell .day-heading-row .day-actions-menu{
    grid-column:2;
    grid-row:1;
    justify-self:end;
    align-self:center;
    width:34px;
    height:34px;
  }
  .lavi-calendar-shell .day-heading-row .cal{
    grid-column:1/-1;
    grid-row:2;
    justify-self:stretch;
    display:flex;
    width:100%;
    min-width:0;
    max-width:100%;
    height:34px;
    min-height:34px;
    padding:0 6px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    text-align:center;
    font-size:clamp(10px,3.4vw,13px);
  }
}
@media(max-width:390px){
  .lavi-week-overview-layout .week-toolbar-actions{column-gap:8px;row-gap:7px}
  .sidebar .lavi-mobile-nav{gap:5px}
}


/* Selective Figma refinements: mobile profiles, calendar rhythm, meal hover */
/* The outer calendar panel keeps its border and rounded corners, but unlike
   the day cards it is intentionally FLAT. */
#view .lavi-calendar-shell{
  box-shadow:none;
  padding:20px;
}
/* With the redundant calendar title removed, the toolbar only contains
   the cooking and week-actions controls. Keep them right-aligned on desktop. */
#view .lavi-week-overview-layout .week-toolbar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  margin:0 0 12px;
}
#view .lavi-week-overview-layout .week-toolbar h2{
  margin:0 0 3px;
}
#view .lavi-week-overview-layout .week-toolbar .hint{
  margin:0;
}
/* Meal hover stays still: only a faint neutral outline fades in. */
#view .lavi-calendar-shell .day > .meal{
  border:0;
  outline:0;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,0);
  transform:none;
  transition:box-shadow 340ms ease;
}
@media(hover:hover) and (pointer:fine){
  #view .lavi-calendar-shell .day > .meal:hover{
    border:0;
    outline:0;
    box-shadow:inset 0 0 0 1px rgba(0,0,0,.04);
  }
}
/* This placeholder stays empty on desktop; the switcher lives beside the
   cloud status there. Only mobile displays it above the calendar. */
#view .lavi-week-profile-row{display:none}
@media(max-width:720px){
  #view .lavi-calendar-shell{
    padding:12px;
  }
  #view .lavi-week-overview-layout .week-toolbar{
    margin-bottom:12px;
  }
  #view .lavi-week-profile-row{
    display:flex;
    justify-content:stretch;
    align-items:center;
    width:100%;
    min-width:0;
    margin:12px 0 10px;
  }
  #view .lavi-week-profile-row .week-person-switch{
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:nowrap;
    gap:7px;
    width:100%;
    min-width:0;
    margin:0;
  }
  #view .lavi-week-profile-row .week-person-switch button{
    box-sizing:border-box;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:1 1 0;
    min-width:0;
    min-height:42px;
    height:42px;
    padding:0 8px;
    margin:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    border:1px solid var(--lavi-border);
    border-radius:12px;
    background:#fff;
    color:var(--lavi-ink);
    box-shadow:none;
    font:600 13px/1.3 Manrope,system-ui,sans-serif;
  }
  #view .lavi-week-profile-row .week-person-switch button:not(.outline){
    background:var(--lavi-surface-selected)!important;
    border-color:var(--lavi-surface-selected);
    color:var(--lavi-ink);
    font-weight:700;
  }
  #view .lavi-week-profile-row + .lavi-calendar-shell{
    margin-top:0;
  }
}
@media(max-width:390px){
  #view .lavi-week-profile-row .week-person-switch button{padding:0 6px}
}
@media(prefers-reduced-motion:reduce){
  #view .lavi-calendar-shell .day > .meal{transition:none}
}





/* Five-second recovery for destructive actions. On phones this floats above
   the fixed navigation dock, including the standalone iOS safe area. */
#lavi-undo-toast{
  position:fixed;
  left:50%;
  bottom:24px;
  transform:translateX(-50%);
  z-index:10050;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  width:max-content;
  max-width:calc(100vw - 32px);
  min-height:50px;
  padding:4px 5px 4px 14px;
  border:1px solid #E9E7F2;
  border-radius:14px;
  background:#FCFBFF;
  box-shadow:0 10px 32px rgba(46,38,61,.16);
  color:#2E263D;
  font:500 13px/1.4 Manrope,system-ui,sans-serif;
}
#lavi-undo-toast .lavi-undo-message{min-width:0}
#lavi-undo-toast button{
  flex:none;
  box-sizing:border-box;
  min-height:42px;
  margin:0;
  padding:8px 13px;
  border:0;
  border-radius:10px;
  background:#EEECFA;
  color:#514589;
  font:700 13px/1.3 Manrope,system-ui,sans-serif;
  cursor:pointer;
}
#lavi-undo-toast button:focus-visible{
  outline:2px solid #7766C6;
  outline-offset:2px;
}
@media(hover:hover) and (pointer:fine){
  #lavi-undo-toast button:hover{background:#D8D4FF}
}
@media(max-width:720px){
  #lavi-undo-toast{bottom:calc(105px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:380px){
  #lavi-undo-toast{width:calc(100vw - 32px)}
}


/* One compact bookmark in the existing recipe header; other recipe cards
   retain their previously approved dimensions and action layout. */
#modalroot .recipe-detail-head > .lavi-recipe-detail-tools{
  display:flex;
  flex:0 0 auto;
  align-items:flex-start;
  gap:6px;
  min-width:0;
}
#modalroot .lavi-later-bookmark{
  display:grid;
  place-items:center;
  box-sizing:border-box;
  flex:0 0 38px;
  width:38px;
  height:38px;
  min-height:38px;
  margin:0;
  padding:0;
  border:1px solid #E9E7F2;
  border-radius:10px;
  background:#fff;
  color:#535968;
  box-shadow:none;
  cursor:pointer;
}
#modalroot .lavi-later-bookmark.is-active{
  background:#EEECFA;
  border-color:#D8D4FF;
  color:#6659A5;
}
#modalroot .lavi-later-bookmark.is-active svg{
  fill:#D8D4FF;
}
#modalroot .lavi-later-bookmark:focus-visible,
#view .lavi-cooking-tabs button:focus-visible,
#view .lavi-later-card button:focus-visible{
  outline:2px solid #7766C6;
  outline-offset:2px;
}
/* Unscheduled ideas: never change existing cooking card or mobile dock CSS. */
#view .lavi-cooking-tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:5px;
  width:min(430px,100%);
  max-width:100%;
  padding:5px;
  border:1px solid #E9E7F2;
  border-radius:14px;
  background:#fff;
  box-sizing:border-box;
}
#view .lavi-cooking-tabs > button{
  min-width:0;
  min-height:40px;
  padding:8px 10px;
  margin:0;
  border:0;
  border-radius:10px;
  background:transparent;
  box-shadow:none;
  color:#535968;
  font:600 13px/1.3 Manrope,system-ui,sans-serif;
  white-space:normal;
}
#view .lavi-cooking-tabs > button.is-active{
  background:#EEECFA;
  color:#2E263D;
}
#view .lavi-cooking-later{min-width:0;display:grid;gap:14px}
#view .lavi-cooking-later-intro{min-width:0}
#view .lavi-cooking-later-intro h2{
  font-family:"Playfair Display",Georgia,serif;
  font-size:22px;
  color:#2E263D;
  line-height:1.35;
  margin:0 0 6px;
}
#view .lavi-cooking-later-intro p{
  max-width:660px;
  font:400 12px/1.55 Manrope,system-ui,sans-serif;
  color:#535968;
  margin:0;
}
#view .lavi-later-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  min-width:0;
}
#view .lavi-later-card{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
  padding:14px;
  border:1px solid #E9E7F2;
  border-radius:14px;
  background:#fff;
  box-shadow:var(--lavi-shadow);
}
#view .lavi-later-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  min-width:0;
}
#view .lavi-later-card-name{flex:1 1 auto;min-width:0}
#view .lavi-later-category{
  display:block;
  font-size:11px;
  line-height:1.4;
  color:#535968;
  margin-bottom:5px;
}
#view .lavi-later-card-icon{
  display:grid;
  place-items:center;
  flex:0 0 26px;
  width:26px;
  height:26px;
  border-radius:8px;
  background:#EEECFA;
  font-size:14px;
  color:#6659A5;
}
#view .lavi-later-name{
  display:block;
  width:100%;
  min-width:0;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
  text-align:left;
  font:650 13px/1.4 Manrope,system-ui,sans-serif;
  color:#2E263D;
  overflow-wrap:anywhere;
  cursor:pointer;
}
#view .lavi-later-unavailable{
  margin:0;
  color:#8B6478;
  font-size:11px;
  line-height:1.5;
}
#view .lavi-later-card-actions{
  display:flex;
  gap:8px;
  margin-top:auto;
  min-width:0;
}
#view .lavi-later-card-actions button{
  flex:1 1 0;
  min-width:0;
  min-height:40px;
  padding:8px 7px;
  margin:0;
  font:600 12px/1.3 Manrope,system-ui,sans-serif;
  white-space:normal;
}
#view .lavi-later-empty{padding:22px}
#view .lavi-later-empty h3{margin:0 0 8px}
#view .lavi-later-empty p{color:#535968;font-size:13px}
@media(max-width:1100px){
  #view .lavi-later-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:650px){
  #view .lavi-later-grid{grid-template-columns:minmax(0,1fr)}
  #view .lavi-later-card{padding:12px}
  #view .lavi-cooking-tabs{width:100%}
}
@media(hover:hover) and (pointer:fine){
  #modalroot .lavi-later-bookmark:hover,
  #view .lavi-cooking-tabs>button:hover,
  #view .lavi-later-card-actions button:hover{background:#F5F3FC}
}

/* Profile names may be longer than the legacy two-person buttons. */
.shopping-person-toolbar,
.shopping-person-toolbar .row,
.shopping-person-toolbar button {
  min-width: 0;
  max-width: 100%;
}
.shopping-person-toolbar button {
  white-space: normal;
  overflow-wrap: anywhere;
}
