
:root{--bg:#0b0c10;--bg-2:#12141b;--ink:#efe8dc;--muted:#9a9286;--card:#171a22;--line:rgba(239,232,220,.08);--rose:#d9897a;--mint:#8fbea8;--peach:#d4b483;--lav:#8aa4c7;--shadow:0 24px 60px rgba(0,0,0,.38);--radius:28px;--gold:#d4b483;--sage:#8fbea8;--on-accent:#ffffff}html{color-scheme:dark;background:var(--bg)}*{box-sizing:border-box}body{margin:0;font-family:Montserrat,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:radial-gradient(1200px 500px at 8% -10%,rgba(212,180,131,.09),transparent 50%),radial-gradient(900px 420px at 100% 0,rgba(138,164,199,.08),transparent 46%),var(--bg);color:var(--ink)}button{font:inherit}.app-shell{max-width:1220px;margin:0 auto;padding:28px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:24px}.eyebrow{margin:0 0 6px;color:var(--gold);text-transform:uppercase;letter-spacing:.14em;font-weight:800;font-size:12px}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(30px,4vw,54px);line-height:1.02;margin-bottom:0}h2{font-size:clamp(26px,3vw,42px);line-height:1.08;margin-bottom:12px}h3{font-size:22px}.pill,.ghost{border:0;border-radius:999px;padding:12px 18px;cursor:pointer;transition:.2s ease;white-space:nowrap}.pill{background:var(--gold);color:var(--on-accent);box-shadow:0 12px 25px rgba(198,165,106,.22)}.pill:hover,.ghost:hover{transform:translateY(-1px)}.ghost{background:var(--card);border:1px solid var(--line);color:var(--ink)}.hidden{display:none!important}.intro-card{display:grid;grid-template-columns:1fr auto;gap:28px;align-items:center;background:linear-gradient(135deg,#181c1a,#1e2421);border:1px solid var(--line);border-radius:var(--radius);padding:32px;box-shadow:var(--shadow);margin-bottom:24px}.intro-card p:last-child{color:var(--muted);max-width:760px}.intro-bubbles{display:flex;gap:12px}.intro-bubbles span{display:grid;place-items:center;width:74px;height:74px;border-radius:24px;background:rgba(36,40,38,.8);font-size:34px}.weekly-filter{display:flex;justify-content:space-between;gap:18px;align-items:center;background:rgba(24,28,26,.88);border:1px solid var(--line);border-radius:24px;padding:18px 20px;margin:0 0 20px;box-shadow:0 16px 42px rgba(94,68,78,.09);backdrop-filter:blur(8px)}.weekly-filter h3{margin:0 0 6px}.weekly-filter p:last-child{margin:0;color:var(--muted)}.filter-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.filter-actions select{min-width:230px;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--ink);padding:12px 16px;font:inherit;outline:none}.ration-card.pinned{outline:3px solid rgba(95,143,122,.28);box-shadow:0 24px 64px rgba(95,143,122,.2)}.pin-badge{display:inline-flex;align-items:center;gap:6px;margin-bottom:10px;border-radius:999px;background:#24312b;color:var(--sage);padding:6px 10px;font-size:13px;font-weight:800}.home-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;margin:0 0 20px}.home-action{display:flex;align-items:center;gap:14px;text-align:left;border:1px solid var(--line);border-radius:24px;background:rgba(24,28,26,.92);padding:18px 20px;color:var(--ink);box-shadow:0 16px 42px rgba(94,68,78,.09);cursor:pointer;transition:.2s ease}.home-action:hover{transform:translateY(-2px)}.home-action span{display:grid;place-items:center;width:52px;height:52px;border-radius:18px;background:#3a2c2c;font-size:28px;color:var(--rose)}.home-action strong{display:block;font-size:18px}.home-action small{display:block;color:var(--muted);margin-top:3px}.meal-heading-row{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.heart-btn{display:grid;place-items:center;min-width:54px;height:54px;border:1px solid var(--line);border-radius:50%;background:#24201f;color:var(--rose);font-size:30px;line-height:1;cursor:pointer;box-shadow:0 12px 28px rgba(183,93,115,.12);transition:.2s ease}.heart-btn:hover{transform:scale(1.04)}.heart-btn.active{background:#b75d73;color:#fff;border-color:var(--rose)}.favorites-list,.daily-plan{max-height:72vh;overflow:auto;padding:18px 22px 24px}.favorite-card,.daily-meal{display:grid;grid-template-columns:118px 1fr;gap:14px;align-items:center;border:1px solid var(--line);border-radius:22px;background:#1e2421;padding:12px;margin-bottom:12px}.favorite-card img,.daily-meal img{width:118px;height:92px;object-fit:cover;border-radius:16px}.favorite-card h3,.daily-meal h4{margin:6px 0}.favorite-card p,.daily-meal p{margin:0 0 10px;color:var(--muted)}.meal-marker{display:inline-flex;border-radius:999px;background:#24312b;color:var(--sage);padding:5px 10px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.empty-state{padding:26px;border:1px dashed var(--line);border-radius:22px;background:#1e2421;color:var(--muted)}.daily-status{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}.daily-status span{border-radius:999px;background:#3a2c2c;color:var(--ink);padding:8px 12px;font-weight:800}.daily-total{border:1px solid var(--line);border-radius:20px;background:#1e2421;padding:16px}.daily-total h4{margin:0 0 10px}.daily-meals{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:12px;margin-bottom:18px}.daily-meals .daily-meal{margin:0}
.daily-meal{
  cursor:pointer;
  transition:.2s ease;
  font:inherit;
  color:inherit;
  width:100%;
  text-align:left
}
button.daily-meal{
  border:1px solid var(--line);
  appearance:none;
  -webkit-appearance:none
}
.daily-meal:hover,.daily-meal:focus-visible{
  transform:translateY(-1px);
  border-color:#ebb7c1;
  outline:none;
  box-shadow:0 12px 28px rgba(94,68,78,.1)
}
.daily-meal-hint{
  display:inline-block;
  margin-top:6px;
  color:var(--sage);
  font-size:13px;
  font-weight:800
}
.daily-meal-detail{
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow)
}
.daily-meal-detail .meal-photo img{height:280px}
.meal-meta{margin:8px 0 0;color:var(--muted);font-size:14px}
.home-view{position:relative}
.recipe-search-wrap{
  position:absolute;
  top:0;
  right:0;
  z-index:25;
  margin:0
}
.recipe-search-trigger{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border:1px solid rgba(240,221,213,.85);
  border-radius:50%;
  background:rgba(24,28,26,.7);
  color:var(--muted);
  cursor:pointer;
  opacity:.72;
  backdrop-filter:blur(8px);
  transition:.2s ease;
  box-shadow:0 8px 20px rgba(94,68,78,.06)
}
.recipe-search-trigger:hover,
.recipe-search-wrap.is-revealed .recipe-search-trigger,
.recipe-search-wrap.is-open .recipe-search-trigger,
.recipe-search-wrap:focus-within .recipe-search-trigger{
  opacity:1;
  color:var(--ink);
  background:rgba(30,36,33,.95);
  border-color:var(--line)
}
.recipe-search-icon{width:18px;height:18px;display:block}
.recipe-search-panel{
  position:absolute;
  right:calc(100% + 10px);
  top:0;
  width:min(380px,calc(100vw - 96px));
  padding:12px;
  border:1px solid var(--line);
  border-radius:22px;
  background:rgba(24,28,26,.98);
  box-shadow:0 20px 50px rgba(94,68,78,.16);
  backdrop-filter:blur(10px);
  opacity:0;
  visibility:hidden;
  transform:translateX(14px);
  pointer-events:none;
  transition:opacity .22s ease,transform .22s ease,visibility .22s ease
}
.recipe-search-wrap.is-revealed .recipe-search-panel,
.recipe-search-wrap:focus-within .recipe-search-panel,
.recipe-search-wrap.is-open .recipe-search-panel{
  opacity:1;
  visibility:visible;
  transform:translateX(0);
  pointer-events:auto
}
.recipe-search-form{
  display:grid;
  gap:10px
}
.recipe-search-input{
  width:100%;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--card);
  color:var(--ink);
  padding:11px 14px;
  font:inherit;
  font-size:15px;
  outline:none
}
.recipe-search-input:focus{border-color:#ebb7c1;box-shadow:0 0 0 3px rgba(235,183,193,.22)}
.recipe-search-submit{
  width:100%;
  padding:11px 16px;
  font-size:15px
}
.recipe-search-suggestions{
  max-height:min(52vh,360px);
  overflow:auto;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--line)
}
.recipe-search-suggestions.hidden{display:none!important}
.search-suggest-meta{
  margin:0 2px 8px;
  color:var(--muted);
  font-size:12px;
  font-weight:700
}
.search-suggest-item{
  display:grid;
  grid-template-columns:56px 1fr;
  gap:10px;
  align-items:center;
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  background:#1e2421;
  padding:8px;
  margin-bottom:8px;
  text-align:left;
  cursor:pointer;
  color:inherit;
  font:inherit;
  transition:.2s ease
}
.search-suggest-item:last-of-type{margin-bottom:0}
.search-suggest-item:hover,.search-suggest-item:focus-visible{
  transform:translateY(-1px);
  border-color:#ebb7c1;
  outline:none;
  box-shadow:0 8px 20px rgba(94,68,78,.1)
}
.search-suggest-item img{
  width:56px;
  height:48px;
  object-fit:cover;
  border-radius:12px
}
.search-suggest-item strong{
  display:block;
  margin:5px 0 2px;
  font-size:15px;
  line-height:1.25
}
.search-suggest-meta-line{
  display:block;
  color:var(--muted);
  font-size:12px;
  line-height:1.35
}
.search-suggest-item .ingredient-match{
  display:block;
  margin-top:4px;
  font-size:12px
}
.search-suggest-more,.search-suggest-empty{
  margin:8px 2px 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.4
}
.search-suggest-empty{padding:8px 2px 2px}
.search-meta{margin:0 0 14px;color:var(--muted);font-size:13px;font-weight:700}
.ingredient-search-list{
  max-height:72vh;
  overflow:auto;
  padding:18px 22px 24px
}
.ingredient-search-meals .daily-meal h4{margin:8px 0 4px}
.ingredient-search-meals .daily-meal p{margin:0 0 6px}
.ingredient-match{
  display:block;
  color:var(--sage);
  font-size:13px;
  font-weight:700;
  line-height:1.4
}
.meal-type-badge{
  display:inline-flex;
  border-radius:999px;
  padding:5px 10px;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em
}
.meal-type-badge.type-breakfast{background:#3a2c2c;color:#8a5a44}
.meal-type-badge.type-lunch{background:#24312b;color:var(--sage)}
.meal-type-badge.type-dinner{background:#dcd7ff;color:#4f4468}
.meal-type-badge.type-snack{background:#fbcfe8;color:#7a4a62}
#dailyBackBtn.hidden,#regenerateDaily.hidden{display:none!important}
.daily-person-filter-wrap{padding:0 22px 12px;border-bottom:1px solid var(--line)}
.daily-person-filter{display:flex;gap:8px;flex-wrap:wrap}
.person-filter-btn{
  border:1px solid var(--line);
  border-radius:999px;
  background:#1e2421;
  color:var(--ink);
  padding:10px 14px;
  cursor:pointer;
  font:inherit;
  font-size:14px;
  font-weight:700;
  transition:.2s ease
}
.person-filter-btn.active{background:var(--gold);color:var(--on-accent);border-color:var(--gold)}
.person-filter-btn:hover{transform:translateY(-1px)}
.daily-meal-macro{
  display:block;
  margin:6px 0 2px;
  color:var(--sage);
  font-size:13px;
  font-weight:800
}
.daily-shopping-note{color:var(--muted);font-size:16px;font-weight:600}
.daily-scale-note{
  margin:0 0 14px;
  padding:10px 12px;
  border-radius:14px;
  background:#f7fbf8;
  border:1px solid #dceee4;
  color:var(--sage);
  font-size:13px;
  line-height:1.45
}
.daily-replace-row{
  margin:0 0 18px;
  padding:14px 16px;
  border:1px dashed #cce3d8;
  border-radius:18px;
  background:#f7fbf8
}
.daily-replace-btn{width:100%;max-width:360px}
.daily-replace-btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}
.daily-replace-hint{margin:10px 0 0;color:var(--muted);font-size:13px;line-height:1.45}
.dish-columns-1{grid-template-columns:1fr!important}
.ration-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:18px;
  align-items:stretch
}
.ration-card{
  display:flex;
  flex-direction:column;
  height:100%;
  border:0;
  text-align:left;
  background:var(--card);
  border-radius:26px;
  overflow:hidden;
  box-shadow:var(--shadow);
  cursor:pointer;
  color:inherit;
  padding:0
}
.ration-card-media{
  flex:0 0 auto;
  aspect-ratio:720/420;
  overflow:hidden;
  line-height:0;
  background:#fff7ec
}
.ration-card-media img{
  width:100%;
  height:100%;
  aspect-ratio:auto;
  display:block;
  object-fit:cover;
  object-position:center center;
  transform:scale(1.06);
  transform-origin:center center
}
.ration-card-body{
  flex:1 1 auto;
  padding:18px;
  display:flex;
  flex-direction:column
}
.ration-card-body .eyebrow{margin-top:0}
.ration-card-body h3{margin:0 0 8px}
.ration-card-body p:last-child{margin-bottom:0;color:var(--muted);line-height:1.45}
.shopping-list.compact{max-height:none;padding:0}.dialog-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.ration-view{animation:fade .25s ease}.ration-hero{display:grid;grid-template-columns:minmax(260px,420px) 1fr;gap:24px;align-items:center;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px 24px 18px 18px;box-shadow:var(--shadow);margin-bottom:20px}.ration-hero img{width:100%;border-radius:22px;object-fit:cover}.ration-hero p{color:var(--muted)}.day-tabs{display:flex;gap:10px;overflow:auto;padding:4px 0 18px}.day-tab{border:1px solid var(--line);background:var(--card);border-radius:999px;padding:10px 15px;color:var(--ink);cursor:pointer}.day-tab.active{background:#674f58;color:white;border-color:var(--ink)}.content-grid{display:grid;grid-template-columns:290px 1fr;gap:18px}.meal-panel,.meal-detail{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.meal-panel{padding:20px;height:max-content;position:sticky;top:18px}.meal-buttons{display:grid;gap:10px}.meal-btn{border:1px solid var(--line);background:#1e2421;border-radius:18px;padding:12px;text-align:left;cursor:pointer;color:var(--ink)}.meal-btn.active{background:#3a2c2c;border-color:#ebb7c1}.meal-detail{overflow:hidden}.meal-photo{position:relative;min-height:300px;background:linear-gradient(135deg,#1e2421,#2a2420)}.meal-photo img{width:100%;height:340px;object-fit:cover;display:block;position:relative;z-index:1}.meal-photo .fallback{position:absolute;inset:0;display:grid;place-items:center;font-size:70px;background:linear-gradient(135deg,#f8dfbb,#cfe8dd);z-index:0}.meal-body{padding:24px}.dish-columns{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:18px 0}.dish-card{border:1px solid var(--line);background:#1e2421;border-radius:20px;padding:16px}.dish-card h4{margin:0 0 8px}.dish-card p{color:var(--muted);line-height:1.45}.macro-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.macro{border-radius:14px;background:white;border:1px solid var(--line);padding:10px;text-align:center}.macro b{display:block;font-size:18px}.ingredients{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 22px}.chip{background:#24312b;border:1px solid #cce3d8;border-radius:999px;padding:8px 12px;color:var(--sage)}.shopping-dialog{width:min(860px,calc(100vw - 28px));border:0;border-radius:28px;padding:0;box-shadow:0 30px 90px rgba(60,40,48,.28);background:var(--card);color:var(--ink)}.shopping-dialog::backdrop{background:rgba(79,63,70,.32);backdrop-filter:blur(4px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:22px;border-bottom:1px solid var(--line)}.shopping-list{max-height:65vh;overflow:auto;padding:10px 22px 22px}.shop-row{display:grid;grid-template-columns:1fr 120px;gap:12px;padding:11px 0;border-bottom:1px solid #f4e6df}.shop-row strong{font-weight:750}.shop-row span:last-child{text-align:right;color:#6e5962;font-weight:700}@keyframes fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@media(max-width:820px){.favorite-card,.daily-meal{grid-template-columns:88px 1fr}.favorite-card img,.daily-meal img{width:88px;height:78px}.meal-heading-row{align-items:center}.weekly-filter{align-items:flex-start;flex-direction:column}.filter-actions{justify-content:flex-start}.filter-actions select{width:100%;min-width:0}.app-shell{padding:18px}.topbar{align-items:flex-start;flex-wrap:wrap}.intro-card,.ration-hero,.content-grid,.dish-columns{grid-template-columns:1fr}.meal-panel{position:static}.meal-photo img{height:250px}}

html.is-mobile{
  --radius:22px;
  --shadow:0 14px 36px rgba(94,68,78,.11);
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%
}
html.is-mobile body{
  overscroll-behavior-y:none;
  padding-bottom:env(safe-area-inset-bottom)
}
html.is-mobile .app-shell{
  max-width:none;
  padding:12px max(14px,env(safe-area-inset-right)) 20px max(14px,env(safe-area-inset-left))
}
html.is-mobile .topbar{
  display:grid;
  grid-template-columns:1fr auto;
  grid-template-areas:"nav nav" "title title";
  align-items:center;
  gap:10px 12px;
  margin-bottom:16px
}
html.is-mobile .topbar #backBtn{grid-area:nav;justify-self:start;min-height:44px;padding:10px 14px}
html.is-mobile .topbar #shoppingBtn{grid-area:nav;justify-self:end;min-height:44px;padding:10px 14px;font-size:14px}
html.is-mobile .topbar>div{grid-area:title;min-width:0}
html.is-mobile .topbar>div .eyebrow{font-size:11px;margin-bottom:4px}
html.is-mobile h1{font-size:clamp(24px,7vw,34px)}
html.is-mobile h2{font-size:clamp(22px,5.8vw,30px)}
html.is-mobile h3{font-size:19px}
html.is-mobile .intro-card{
  grid-template-columns:1fr;
  gap:16px;
  padding:20px 18px;
  margin-bottom:16px
}
html.is-mobile .intro-card h2{font-size:clamp(20px,5.4vw,26px);margin-bottom:10px}
html.is-mobile .intro-bubbles{display:none}
html.is-mobile .weekly-filter{
  flex-direction:column;
  align-items:stretch;
  gap:14px;
  padding:16px;
  margin-bottom:14px
}
html.is-mobile .filter-actions{
  flex-direction:column;
  align-items:stretch;
  width:100%
}
html.is-mobile .filter-actions select,
html.is-mobile .filter-actions .pill,
html.is-mobile .filter-actions .ghost{
  width:100%;
  min-width:0;
  min-height:48px
}
html.is-mobile .home-actions{
  grid-template-columns:1fr;
  gap:10px;
  margin-bottom:14px
}
html.is-mobile .home-action{
  min-height:64px;
  padding:14px 16px
}
html.is-mobile .ration-grid{
  grid-template-columns:1fr;
  gap:14px
}
html.is-mobile .ration-card-body{padding:16px}
html.is-mobile .ration-hero{
  grid-template-columns:1fr;
  gap:14px;
  padding:14px;
  margin-bottom:14px
}
html.is-mobile .ration-hero img{max-height:180px;object-fit:cover}
html.is-mobile .day-tabs{
  position:sticky;
  top:max(0px,env(safe-area-inset-top));
  z-index:5;
  margin:0 -14px 12px;
  padding:8px 14px 12px;
  background:linear-gradient(180deg,rgba(255,248,243,.98) 70%,rgba(255,248,243,0));
  backdrop-filter:blur(8px);
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x proximity;
  scrollbar-width:none
}
html.is-mobile .day-tabs::-webkit-scrollbar{display:none}
html.is-mobile .day-tab{
  flex:0 0 auto;
  min-width:52px;
  min-height:44px;
  padding:10px 16px;
  scroll-snap-align:center;
  font-weight:700
}
html.is-mobile .content-grid{
  grid-template-columns:1fr;
  gap:12px
}
html.is-mobile .meal-panel{
  position:static;
  padding:14px 14px 12px;
  border-radius:20px;
  box-shadow:none;
  background:rgba(255,255,255,.88)
}
html.is-mobile .meal-panel h3{
  margin:0 0 10px;
  font-size:17px
}
html.is-mobile .meal-buttons{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:4px;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
  scrollbar-width:none
}
html.is-mobile .meal-buttons::-webkit-scrollbar{display:none}
html.is-mobile .meal-btn{
  flex:0 0 auto;
  min-width:118px;
  max-width:150px;
  min-height:56px;
  padding:10px 12px;
  scroll-snap-align:start;
  white-space:normal
}
html.is-mobile .meal-btn strong{display:block;font-size:14px;margin-bottom:2px}
html.is-mobile .meal-btn span{display:block;font-size:12px;color:var(--muted);line-height:1.25}
html.is-mobile .meal-detail{border-radius:20px}
html.is-mobile .meal-photo{min-height:200px}
html.is-mobile .meal-photo img{height:220px}
html.is-mobile .meal-body{padding:16px}
html.is-mobile .meal-heading-row{align-items:flex-start;gap:12px}
html.is-mobile .heart-btn{
  min-width:48px;
  height:48px;
  font-size:26px;
  flex-shrink:0
}
html.is-mobile .dish-columns{
  grid-template-columns:1fr;
  gap:10px;
  margin:14px 0
}
html.is-mobile .macro-grid{
  grid-template-columns:repeat(2,1fr);
  gap:8px
}
html.is-mobile .macro b{font-size:16px}
html.is-mobile .chip{
  font-size:14px;
  padding:9px 12px;
  line-height:1.35
}
html.is-mobile .dish-card p{
  font-size:15px;
  line-height:1.5;
  word-break:break-word
}
html.is-mobile dialog.shopping-dialog[open]{
  display:flex;
  flex-direction:column;
  width:100vw;
  max-width:100vw;
  height:100vh;
  height:100dvh;
  max-height:100dvh;
  max-height:-webkit-fill-available;
  margin:0;
  border-radius:0;
  box-shadow:none
}
html.is-mobile .shopping-dialog::backdrop{background:rgba(79,63,70,.45)}
html.is-mobile .dialog-head{
  flex-wrap:wrap;
  align-items:flex-start;
  gap:12px;
  padding:max(16px,env(safe-area-inset-top)) 16px 14px
}
html.is-mobile .dialog-head h2{font-size:clamp(20px,5vw,26px)}
html.is-mobile .dialog-head .ghost,
html.is-mobile .dialog-head .pill{
  min-height:44px;
  padding:10px 16px
}
html.is-mobile .dialog-actions{
  width:100%;
  justify-content:stretch
}
html.is-mobile .dialog-actions .pill,
html.is-mobile .dialog-actions .ghost{
  flex:1;
  min-height:44px
}
html.is-mobile .shopping-list,
html.is-mobile .favorites-list,
html.is-mobile .daily-plan{
  max-height:none;
  flex:1;
  overflow:auto;
  padding:8px 16px max(20px,env(safe-area-inset-bottom));
  -webkit-overflow-scrolling:touch
}
html.is-mobile .shop-row{
  grid-template-columns:1fr auto;
  gap:10px;
  padding:12px 0;
  align-items:start
}
html.is-mobile .shop-row strong{font-size:15px;line-height:1.35}
html.is-mobile .shop-row span:last-child{
  font-size:14px;
  white-space:nowrap
}
html.is-mobile .favorite-card,
html.is-mobile .daily-meal{
  grid-template-columns:72px 1fr;
  gap:12px;
  padding:10px
}
html.is-mobile .favorite-card img,
html.is-mobile .daily-meal img{
  width:72px;
  height:72px
}
html.is-mobile .daily-meals{
  grid-template-columns:1fr;
  gap:10px
}
html.is-mobile .daily-status span{
  font-size:13px;
  padding:7px 10px
}
html.is-mobile .daily-person-filter-wrap{
  padding:0 16px 10px
}
html.is-mobile .home-view{padding-top:4px}
html.is-mobile .intro-card{padding-right:54px}
html.is-mobile .recipe-search-wrap{
  position:absolute;
  top:0;
  right:0
}
html.is-mobile .recipe-search-trigger{
  width:44px;
  height:44px;
  opacity:.85
}
html.is-mobile .recipe-search-wrap:hover .recipe-search-panel,
html.is-mobile .recipe-search-wrap.is-revealed .recipe-search-panel{
  opacity:0;
  visibility:hidden;
  transform:translateX(14px);
  pointer-events:none
}
html.is-mobile .recipe-search-wrap.is-open .recipe-search-panel{
  position:fixed;
  right:max(14px,env(safe-area-inset-right));
  left:max(14px,env(safe-area-inset-left));
  top:max(68px,env(safe-area-inset-top));
  width:auto;
  opacity:1;
  visibility:visible;
  transform:none;
  pointer-events:auto
}
html.is-mobile .recipe-search-input{min-height:48px;padding:12px 16px;font-size:16px}
html.is-mobile .recipe-search-submit{min-height:48px;font-size:16px}
html.is-mobile .recipe-search-suggestions{max-height:min(46vh,320px)}
html.is-mobile .search-suggest-item{grid-template-columns:52px 1fr;padding:7px}
html.is-mobile .search-suggest-item img{width:52px;height:46px}
html.is-mobile .ingredient-search-list{
  max-height:calc(100dvh - 120px);
  padding:14px 16px 20px
}
html.is-mobile .person-filter-btn{
  flex:1;
  min-width:0;
  min-height:44px;
  text-align:center;
  padding:10px 12px;
  font-size:13px
}
html.is-mobile .daily-replace-btn{max-width:none;width:100%}
html.is-mobile .daily-meal-macro{font-size:12px}
.boot-error{
  margin:20px;
  padding:20px;
  border:1px solid #ebb7c1;
  border-radius:20px;
  background:#24201f;
  color:var(--ink)
}
.boot-error p{color:var(--muted);line-height:1.5}
html.dialog-open body{overflow:hidden;touch-action:none}
html.is-mobile button,
html.is-mobile .home-action,
html.is-mobile .ration-card,
html.is-mobile .meal-btn,
html.is-mobile .day-tab,
html.is-mobile .search-suggest-item,
html.is-mobile .daily-meal{
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation
}
html.is-mobile .recipe-search-wrap:focus-within:not(.is-open) .recipe-search-panel{
  opacity:0;
  visibility:hidden;
  transform:translateX(14px);
  pointer-events:none
}
html.is-mobile .ingredient-search-list{
  flex:1;
  overflow:auto;
  -webkit-overflow-scrolling:touch
}
dialog:not([open]){display:none!important}
dialog[open]{
  display:flex;
  flex-direction:column;
  border:0;
  padding:0;
  color:var(--ink)
}

@media(max-width:768px){
  .intro-card,.ration-hero,.content-grid,.dish-columns{grid-template-columns:1fr}
  .weekly-filter{align-items:flex-start;flex-direction:column}
  .filter-actions{justify-content:flex-start;width:100%}
  .filter-actions select{width:100%;min-width:0}
  .app-shell{padding:max(12px,env(safe-area-inset-left)) max(14px,env(safe-area-inset-right))}
  .topbar{align-items:flex-start;flex-wrap:wrap}
  .meal-panel{position:static}
  .meal-photo img{height:220px}
  .favorite-card,.daily-meal{grid-template-columns:72px 1fr}
  .favorite-card img,.daily-meal img{width:72px;height:72px}
}

.day-macros{
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--line)
}
.day-macros .eyebrow{margin-bottom:10px}
.day-macros .dish-columns{
  grid-template-columns:1fr;
  gap:10px;
  margin:0
}
.day-macros .dish-card{padding:12px}
.day-macros .macro-grid{
  grid-template-columns:repeat(2,1fr);
  gap:6px
}
.day-macros .macro{padding:8px}
.day-macros .macro b{font-size:16px}
.meal-body .day-macros{margin-top:0;padding-top:0;border-top:0}

html.is-mobile .day-macros{
  margin-top:12px;
  padding-top:12px
}
html.is-mobile .day-macros .macro-grid{
  grid-template-columns:repeat(2,1fr)
}

.ghost{
  background:transparent;
  border:1px solid var(--line);
  color:var(--ink)
}
.ration-card{
  background:var(--card);
  color:var(--ink)
}
.ration-card-media{display:none}
.focus-board{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1px;
  background:var(--line);
  min-height:132px
}
.focus-cell{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:18px 8px;
  background:#141816;
  color:var(--ink)
}
.focus-cell span{font-size:28px;line-height:1}
.focus-cell b{
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--gold)
}
.card-macros{
  display:grid;
  gap:8px;
  margin-top:14px
}
.mini-macros{
  display:grid;
  grid-template-columns:auto repeat(4,1fr);
  gap:6px;
  align-items:center;
  padding:8px 10px;
  border-radius:14px;
  background:#141816;
  border:1px solid var(--line);
  font-size:12px;
  font-weight:700;
  color:var(--muted)
}
.mini-macros-name{
  color:var(--gold);
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:11px
}
.ration-head{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px 24px;
  box-shadow:var(--shadow);
  margin-bottom:16px
}
.ration-head h2{margin-bottom:8px}
.ration-head p{color:var(--muted)}
.focus-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:14px 0 18px
}
.focus-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border-radius:999px;
  background:#141816;
  border:1px solid var(--line);
  font-size:13px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em
}
.day-macros-top{
  margin-top:0;
  padding-top:0;
  border-top:0
}
.day-macros-top .dish-columns{
  grid-template-columns:1fr 1fr;
  gap:12px
}
.day-heading{
  margin:6px 0 12px;
  font-size:20px
}
.day-tabs{
  position:sticky;
  top:8px;
  z-index:8;
  display:flex;
  gap:8px;
  overflow:auto;
  padding:4px;
  margin-bottom:14px;
  background:rgba(14,17,16,.82);
  border:1px solid var(--line);
  border-radius:18px;
  backdrop-filter:blur(14px);
  scrollbar-width:none
}
.day-tabs::-webkit-scrollbar{display:none}
.day-tab{
  flex:1 1 0;
  min-width:max-content;
  border:0;
  background:transparent;
  color:var(--muted);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:800
}
.day-tab.active{
  background:var(--gold);
  color:var(--on-accent)
}
.day-tab-full{display:inline}
.day-tab-short{display:none}
.content-grid{
  display:grid;
  grid-template-columns:minmax(280px,340px) 1fr;
  gap:16px;
  align-items:start
}
.meal-panel,.meal-detail,.dish-card,.shopping-dialog,.intro-card,.weekly-filter,.home-action{
  background:var(--card);
  color:var(--ink);
  border-color:var(--line)
}
.meal-panel{
  padding:12px;
  position:sticky;
  top:76px
}
.meal-buttons{
  display:grid;
  gap:8px
}
.meal-btn{
  display:grid;
  grid-template-columns:64px 1fr;
  gap:10px;
  align-items:center;
  width:100%;
  border:1px solid var(--line);
  background:#141816;
  border-radius:16px;
  padding:8px;
  text-align:left;
  cursor:pointer;
  color:var(--ink)
}
.meal-btn img{
  width:64px;
  height:52px;
  object-fit:cover;
  border-radius:12px
}
.meal-btn-copy{display:grid;gap:2px;min-width:0}
.meal-btn-copy strong{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--gold)}
.meal-btn-copy span{
  font-size:14px;
  font-weight:700;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.meal-btn-copy small{color:var(--muted);font-size:12px}
.meal-btn.active{
  background:#24312b;
  border-color:var(--sage)
}
.chip{
  background:#24312b;
  border-color:#345045;
  color:var(--sage)
}
.macro{
  background:#141816;
  border-color:var(--line);
  color:var(--ink)
}
.filter-actions select,
.recipe-search-input{
  background:#141816;
  color:var(--ink);
  border-color:var(--line)
}
.shopping-dialog{
  background:var(--card);
  color:var(--ink)
}
.shopping-dialog::backdrop{background:rgba(8,10,9,.72)}
.boot-error{
  border-color:var(--line);
  background:var(--card)
}

@media(max-width:820px){
  .day-tab-full{display:none}
  .day-tab-short{display:inline}
  .day-macros-top .dish-columns{grid-template-columns:1fr}
}
html.is-mobile .day-tabs{
  top:0;
  margin:0 -4px 12px
}
html.is-mobile .day-tab-full{display:none}
html.is-mobile .day-tab-short{display:inline}
html.is-mobile .day-macros-top .dish-columns{grid-template-columns:1fr}
html.is-mobile .meal-panel{
  padding:8px;
  background:transparent;
  box-shadow:none;
  border:0
}
html.is-mobile .meal-buttons{
  display:grid;
  grid-template-columns:1fr;
  overflow:visible;
  gap:8px
}
html.is-mobile .meal-btn{
  min-width:0;
  max-width:none;
  min-height:64px
}
html.is-mobile .focus-board{min-height:112px}
html.is-mobile .mini-macros{
  grid-template-columns:auto repeat(2,1fr);
  font-size:11px
}

.site-chrome{
  position:sticky;
  top:0;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:10px 18px;
  padding-top:max(10px,env(safe-area-inset-top));
  padding-left:max(18px,env(safe-area-inset-left));
  padding-right:max(18px,env(safe-area-inset-right));
  border-bottom:1px solid var(--line);
  background:color-mix(in srgb,var(--bg) 78%,transparent);
  backdrop-filter:blur(18px)
}
.brand{
  display:flex;
  align-items:baseline;
  gap:8px;
  min-width:0;
  flex-wrap:wrap
}
.logo{
  font-size:18px;
  font-weight:700;
  letter-spacing:-.03em;
  line-height:1.1;
  white-space:nowrap
}
.logo em{
  font-style:italic;
  font-weight:500;
  color:var(--gold);
  padding:0 .12em
}
.brand-rest{
  display:inline-flex;
  align-items:baseline;
  gap:8px
}
.brand-sep{
  color:var(--gold);
  opacity:.7;
  font-weight:400
}
.brand-page{
  font-size:16px;
  font-weight:500;
  letter-spacing:-.02em;
  color:var(--muted);
  white-space:nowrap
}
.chrome-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0
}
.theme-toggle{
  border:1px solid var(--line);
  background:var(--bg-2);
  color:var(--ink);
  padding:7px 12px;
  font:600 11px Montserrat,sans-serif;
  border-radius:999px;
  cursor:pointer;
  letter-spacing:.04em;
  text-transform:uppercase
}
.theme-toggle:hover{border-color:var(--gold)}
.home-link{
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border:1px solid var(--line);
  border-radius:50%;
  color:var(--ink);
  background:var(--bg-2);
  text-decoration:none
}
.home-link:hover{border-color:var(--gold);color:var(--gold)}
.home-link svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linejoin:round;
  stroke-linecap:round
}

html[data-theme="light"]{
  color-scheme:light;
  --bg:#f3eee4;
  --bg-2:#e7dfd0;
  --ink:#1c1915;
  --muted:#6f675c;
  --card:#fffaf2;
  --line:rgba(28,25,21,.1);
  --gold:#9a7040;
  --sage:#3f7a62;
  --rose:#b85a4c;
  --mint:#3f7a62;
  --peach:#9a7040;
  --lav:#4d6f94;
  --shadow:0 24px 60px rgba(80,60,40,.12);
  --on-accent:#ffffff
}
html[data-theme="light"] .intro-card{
  background:linear-gradient(135deg,#fffaf2,#f6efe3)
}
html[data-theme="light"] .intro-bubbles span,
html[data-theme="light"] .weekly-filter,
html[data-theme="light"] .home-action,
html[data-theme="light"] .favorite-card,
html[data-theme="light"] .daily-meal,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .daily-total,
html[data-theme="light"] .dish-card,
html[data-theme="light"] .meal-btn,
html[data-theme="light"] .search-suggest-item,
html[data-theme="light"] .focus-cell,
html[data-theme="light"] .mini-macros,
html[data-theme="light"] .focus-pill,
html[data-theme="light"] .filter-actions select,
html[data-theme="light"] .ghost,
html[data-theme="light"] .meal-panel,
html[data-theme="light"] .meal-detail,
html[data-theme="light"] .ration-head,
html[data-theme="light"] .shopping-dialog{
  background:var(--card);
  color:var(--ink)
}
html[data-theme="light"] .focus-board{
  background:rgba(28,25,21,.08)
}
html[data-theme="light"] .focus-cell b,
html[data-theme="light"] .mini-macros-name{
  color:var(--gold)
}
html[data-theme="light"] .mini-macros{
  color:var(--muted);
  border-color:var(--line)
}
html[data-theme="light"] .filter-actions select{
  border:1px solid var(--line);
  color:var(--ink);
  color-scheme:light
}
html[data-theme="light"] .filter-actions select option{
  background:#fffaf2;
  color:#1c1915
}
html[data-theme="light"] .day-tabs{
  background:rgba(255,250,242,.92)
}
html[data-theme="light"] .home-action span,
html[data-theme="light"] .daily-status span,
html[data-theme="light"] .heart-btn{
  background:#f3e4d8
}
html[data-theme="light"] .pin-badge,
html[data-theme="light"] .meal-marker,
html[data-theme="light"] .chip{
  background:#e7f0ea;
  color:var(--sage)
}
html[data-theme="light"] .macro{
  background:#fff;
  color:var(--ink)
}
html[data-theme="light"] .pill{color:var(--on-accent)}
html[data-theme="light"] .shop-row{border-bottom-color:rgba(28,25,21,.08)}
html[data-theme="light"] .shop-row span:last-child{color:var(--muted)}
html[data-theme="light"] .day-tab.active{background:var(--gold);color:var(--on-accent);border-color:var(--gold)}
html[data-theme="light"] .meal-btn.active{background:#f3e4d8;border-color:var(--gold)}
html[data-theme="light"] .recipe-search-trigger,
html[data-theme="light"] .recipe-search-panel{
  background:rgba(255,250,242,.92)
}

html.is-mobile .site-chrome{
  padding:10px 12px;
  padding-top:max(10px,env(safe-area-inset-top))
}
html.is-mobile .brand-page{font-size:14px}
html.is-mobile .theme-toggle{
  min-height:40px;
  padding:8px 12px;
  font-size:12px
}
.home-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin:0 0 20px
}
@media (max-width:980px){
  .home-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:560px){
  .home-actions{grid-template-columns:1fr}
}
.weekly-filter{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(280px,1fr);
  gap:18px;
  align-items:center
}
.weekly-filter .filter-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:10px;
  align-items:center;
  width:100%
}
.weekly-filter .filter-actions select{
  min-width:0;
  width:100%
}
@media (max-width:820px){
  .weekly-filter{grid-template-columns:1fr}
  .weekly-filter .filter-actions{grid-template-columns:1fr}
}


/* —— Studio / schedules / editing —— */
.schedule-markers{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:0 0 18px
}
.schedule-pill{
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-rows:auto auto;
  column-gap:10px;
  row-gap:2px;
  align-items:center;
  min-width:min(100%,240px);
  flex:1;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid var(--line);
  background:linear-gradient(160deg,rgba(36,40,38,.92),rgba(24,28,26,.96));
  box-shadow:0 10px 28px rgba(0,0,0,.18)
}
.schedule-pill i{
  grid-row:1 / span 2;
  font-style:normal;
  font-size:22px;
  opacity:.9
}
.schedule-pill b{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--gold)
}
.schedule-pill em{
  font-style:normal;
  color:var(--ink);
  font-size:13px;
  line-height:1.35;
  font-weight:600
}
.schedule-pill.cook{border-color:rgba(143,190,168,.28)}
.schedule-pill.eat{border-color:rgba(212,180,131,.28)}
.edit-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 18px;
  padding:12px;
  border-radius:20px;
  border:1px dashed rgba(212,180,131,.35);
  background:rgba(212,180,131,.06)
}
.edit-toolbar .edit-action{
  min-height:42px;
  padding:10px 14px;
  font-weight:700;
  font-size:13px
}
html.edit-mode .meal-detail{
  outline:1px solid rgba(212,180,131,.22);
  box-shadow:0 0 0 1px rgba(212,180,131,.08), var(--shadow)
}
.home-action.active,
#toggleEditModeBtn.active{
  outline:2px solid rgba(212,180,131,.45);
  background:rgba(212,180,131,.1)
}
.ration-head-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px
}
.ration-head-copy{min-width:0;flex:1}
.ration-edit-toggle{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:12px;
  text-align:left;
  max-width:min(280px,100%);
  min-height:64px;
  padding:12px 16px;
  border:1px solid rgba(212,180,131,.28);
  border-radius:22px;
  background:linear-gradient(145deg,rgba(58,44,44,.96),rgba(36,28,26,.98));
  color:#fff;
  box-shadow:0 14px 34px rgba(0,0,0,.22);
  cursor:pointer;
  transition:.2s ease
}
.ration-edit-toggle > span:first-child{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:14px;
  background:rgba(255,255,255,.12);
  font-size:22px;
  flex:0 0 auto
}
.ration-edit-toggle-copy{
  display:grid;
  gap:2px;
  min-width:0
}
.ration-edit-toggle strong{
  display:block;
  font-size:15px;
  line-height:1.2;
  color:#fff
}
.ration-edit-toggle small{
  display:block;
  color:rgba(255,255,255,.78);
  font-size:12px;
  line-height:1.3
}
.ration-edit-toggle:hover{
  transform:translateY(-1px);
  border-color:rgba(212,180,131,.55)
}
.ration-edit-toggle.active{
  background:linear-gradient(145deg,var(--gold),#b8894f);
  border-color:transparent;
  box-shadow:0 14px 34px rgba(198,165,106,.32);
  color:var(--on-accent)
}
.ration-edit-toggle.active > span:first-child{
  background:rgba(255,255,255,.2);
  color:#fff
}
.ration-edit-toggle.active strong,
.ration-edit-toggle.active small{
  color:#fff
}
html[data-theme="light"] .ration-edit-toggle{
  background:linear-gradient(145deg,#9a7040,#7d5a32);
  border-color:rgba(154,112,64,.35);
  color:#fff
}
html[data-theme="light"] .ration-edit-toggle strong,
html[data-theme="light"] .ration-edit-toggle small{
  color:#fff
}
html[data-theme="light"] .ration-edit-toggle.active{
  background:linear-gradient(145deg,#b8894f,#9a7040)
}
.studio-dialog{width:min(720px,96vw)}
.studio-scroll{max-height:72vh;overflow:auto;padding:8px 22px 24px}
.studio-layout{display:grid;gap:18px;padding:8px 22px 24px}
.studio-form{display:grid;gap:14px}
.studio-form h3{margin:0}
.studio-lead{margin:0;color:var(--muted);line-height:1.45}
.studio-hint{margin:0;color:var(--muted);font-size:13px;line-height:1.4}
.field{display:grid;gap:6px}
.field span{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--gold);font-weight:700}
.field input,
.field select,
.field textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--bg-2);
  color:var(--ink);
  padding:12px 14px;
  font:inherit;
  outline:none
}
.field textarea{resize:vertical;min-height:84px}
.field input:focus,
.field select:focus,
.field textarea:focus{border-color:rgba(212,180,131,.55);box-shadow:0 0 0 3px rgba(212,180,131,.12)}
.macro-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px
}
.macro-fields.ranges{grid-template-columns:repeat(2,minmax(0,1fr))}
.studio-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:4px}
.users-list{display:grid;gap:10px}
.studio-card{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border-radius:20px;
  border:1px solid var(--line);
  background:linear-gradient(145deg,rgba(36,40,38,.9),rgba(23,26,34,.95))
}
.studio-card h3{margin:0 0 6px;font-size:18px}
.studio-card p{margin:0;color:var(--muted);font-size:13px;line-height:1.4}
.balance-preview{
  display:grid;
  gap:10px;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid rgba(143,190,168,.28);
  background:rgba(143,190,168,.08)
}
.balance-preview.empty{
  color:var(--muted);
  border-style:dashed;
  background:transparent
}
.balance-preview > div{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.balance-preview span{color:var(--muted);font-size:13px}
.balance-preview strong{font-size:14px}
.editor-toast{
  position:fixed;
  left:50%;
  bottom:28px;
  transform:translateX(-50%) translateY(20px);
  z-index:80;
  max-width:min(520px,92vw);
  padding:14px 18px;
  border-radius:999px;
  background:#1c211e;
  color:var(--ink);
  border:1px solid var(--line);
  box-shadow:0 18px 40px rgba(0,0,0,.35);
  opacity:0;
  pointer-events:none;
  transition:.28s ease;
  font-weight:700;
  font-size:14px;
  text-align:center
}
.editor-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.editor-toast.ok{border-color:rgba(143,190,168,.45)}
.editor-toast.err{border-color:rgba(217,137,122,.5)}
html[data-theme="light"] .schedule-pill,
html[data-theme="light"] .studio-card,
html[data-theme="light"] .balance-preview{
  background:rgba(255,250,242,.92)
}
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea{
  background:#fffdf8
}
html[data-theme="light"] .editor-toast{background:#fffdf8;color:#2a241c}
@media (max-width:768px){
  .schedule-pill{min-width:100%}
  .macro-fields{grid-template-columns:1fr}
  .edit-toolbar{position:sticky;top:0;z-index:4;backdrop-filter:blur(10px)}
}

/* —— Responsive: laptop / tablet / phone —— */
@media (max-width:1100px){
  .content-grid{grid-template-columns:minmax(220px,280px) 1fr}
}
@media (max-width:980px){
  .ration-head{padding:18px 18px}
  .ration-edit-toggle{max-width:min(260px,46vw)}
}
@media (max-width:900px){
  .content-grid{grid-template-columns:1fr}
  .meal-panel{
    position:static;
    padding:12px
  }
  .meal-buttons{
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding-bottom:4px;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x mandatory;
    scrollbar-width:none
  }
  .meal-buttons::-webkit-scrollbar{display:none}
  .meal-btn{
    flex:0 0 min(78%,280px);
    max-width:280px;
    scroll-snap-align:start
  }
}
@media (max-width:720px){
  .ration-head-row{
    flex-direction:column;
    align-items:stretch
  }
  .ration-edit-toggle{
    width:100%;
    max-width:none
  }
  .home-actions{grid-template-columns:1fr}
  .topbar{
    flex-wrap:wrap;
    gap:12px
  }
  .studio-dialog{width:min(96vw,720px)}
  .studio-scroll,
  .studio-layout{padding-left:16px;padding-right:16px}
  .dialog-head{
    flex-wrap:wrap;
    gap:10px
  }
  .edit-toolbar{
    gap:6px;
    padding:10px
  }
  .edit-toolbar .edit-action{
    flex:1 1 calc(50% - 6px);
    min-width:0;
    text-align:center
  }
}
@media (max-width:560px){
  .home-action{
    min-height:62px;
    padding:14px 16px
  }
  .ration-edit-toggle{
    min-height:58px;
    padding:11px 14px;
    border-radius:18px
  }
  .ration-edit-toggle > span:first-child{
    width:38px;
    height:38px;
    font-size:20px
  }
  .ration-edit-toggle strong{font-size:14px}
}
html.is-mobile .ration-edit-toggle{
  width:100%;
  max-width:none
}
html.is-mobile .ration-head-row{
  flex-direction:column;
  align-items:stretch
}
html.is-mobile .edit-toolbar .edit-action{
  flex:1 1 calc(50% - 6px)
}
