/* ── Дизайн-токени: «глибока зелена» (обрано 2026-06-13), фірмові — НЕ з теми Telegram ── */
:root {
  --bg: #0d1410;
  --card: #17221b;
  --text: #e9f2ea;
  --hint: #88a08e;
  --accent: #52a85c;
  --accent-text: #06130a;
  --accent2: #8fd460;
  --warn: #e8a33d;
  --bad: #e06c75;
  --radius: 16px;
}
@font-face { font-family: "Fixel"; src: url("/fonts/FixelText-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fixel"; src: url("/fonts/FixelText-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fixel"; src: url("/fonts/FixelText-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fixel Display"; src: url("/fonts/FixelDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }   /* глобальний — на нього покладаються hist-more, o-tmin-wrap тощо */
html { max-width: 100%; overflow-x: hidden; }
body {
  font-family: "Fixel", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent) 7%, var(--bg)), var(--bg)) fixed;
  color: var(--text);
  padding: 0 14px env(safe-area-inset-bottom) 14px;
  -webkit-font-smoothing: antialiased;
  max-width: 100%; overflow-x: hidden;
}
img, svg, video, canvas { max-width: 100%; }
/* нічого не може бути ширшим за екран → жодного бокового скролу */
.seg, .time-row, .macros, .tabs, .shop-item, .day-picker { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }
/* десктоп / широкий екран: центрувати в колонку, як у Telegram-панелі */
@media (min-width: 640px) {
  body { max-width: 600px; margin: 0 auto; }
  .chat-input {
    left: 50%; right: auto; transform: translateX(-50%);
    width: 100%; max-width: 600px;
  }
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 2px 10px;
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: .3px; }
.brand span { font-size: 18px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.user { font-size: 13px; color: var(--hint); }
.edit-profile { border: 0; background: var(--card); border-radius: 8px; padding: 5px 9px; font-size: 15px; cursor: pointer; line-height: 1; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px; border: 0; border-radius: 12px;
  background: var(--card); color: var(--hint); font-size: 15px; font-weight: 600;
}
.tab.active { background: var(--accent); color: var(--accent-text); }

.loading, .error { text-align: center; color: var(--hint); padding: 40px 0; }
.error { color: var(--bad); }

/* day header */
.day-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 12px; }
.day-name { font-size: 19px; font-weight: 700; }
.badge {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(82,168,92,.18); color: var(--accent);
}
.badge.training { background: rgba(235,160,60,.18); color: var(--warn); }

/* macros strip */
.macros { display: flex; gap: 8px; margin: 0 2px 16px; }
.macro {
  flex: 1; background: var(--card); border-radius: 12px; padding: 10px 8px; text-align: center;
}
.macro b { display: block; font-size: 17px; }
.macro small { color: var(--hint); font-size: 11px; }

/* meal cards */
.meal {
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px;
}
.meal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.meal-slot { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .4px; }
.meal-time { font-size: 12px; color: var(--hint); }
.meal-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.meal-kbju { font-size: 12px; color: var(--hint); margin-top: 6px; }
.meal-note {
  font-size: 12px; color: var(--hint); margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06); line-height: 1.4;
}
.photo-ph {
  height: 4px; border-radius: 4px; margin-top: 10px;
  background: linear-gradient(90deg, rgba(82,168,92,.4), transparent);
}

/* week list */
.week-day { margin-bottom: 22px; }

/* shopping list */
.shop-top {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 2px 14px;
}
.shop-top small { color: var(--hint); font-size: 12px; }
.refresh-btn {
  border: 0; border-radius: 12px; padding: 9px 14px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: var(--accent-text);
}
.refresh-btn.wide { width: 100%; margin-top: 14px; padding: 13px; }
.shop-cat { margin-bottom: 16px; }
.shop-cat-h {
  font-size: 12px; font-weight: 700; color: var(--hint);
  text-transform: uppercase; letter-spacing: .5px; margin: 0 2px 6px;
}
/* розділювач груп прийомів у дні (основні / перекуси та напої) */
.meal-group-h {
  font-size: 12px; font-weight: 700; color: var(--hint);
  text-transform: uppercase; letter-spacing: .5px;
  margin: 16px 2px 8px; padding-top: 12px;
  border-top: 1px solid var(--line, rgba(255,255,255,.07));
}
.add-meal-row { display: flex; gap: 8px; margin: 4px 0 2px; }
.add-meal-btn {
  flex: 1; padding: 10px; border-radius: 12px; cursor: pointer;
  background: var(--card); color: var(--accent);
  border: 1px dashed var(--accent); font-weight: 600; font-size: 14px;
}
.add-meal-btn:active { transform: scale(.98); }
.add-meal-btn:disabled { opacity: .6; }
.meal-del {
  background: none; border: none; color: var(--hint); cursor: pointer;
  font-size: 15px; padding: 2px 6px; line-height: 1;
}
.meal-del:active { color: var(--bad); }
.shop-item {
  display: grid; grid-template-columns: 22px 40px 1fr auto auto; align-items: center;
  column-gap: 8px; background: var(--card); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 6px;
}
.shop-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.shop-thumb { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px;
  border-radius: 8px; object-fit: cover; background: rgba(255,255,255,.05); }
.shop-thumb.ph { background: rgba(255,255,255,.04); }
.shop-name { font-size: 14px; line-height: 1.25; grid-column: 3; }
.shop-meta { grid-column: 3; font-size: 11px; color: var(--hint); }
.shop-price { grid-column: 4; grid-row: 1 / span 2; font-size: 13px; font-weight: 600; }
.shop-item.checked .shop-name { text-decoration: line-through; color: var(--hint); }

/* акції від Gemma */
.deal { display: flex; gap: 10px; align-items: center; background: rgba(235,160,60,.1);
  border: 1px solid rgba(235,160,60,.3);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: var(--text); }
.deal-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.deal-info { flex: 1; min-width: 0; }
.deal-top { font-size: 14px; }
.deal-top s { color: var(--hint); font-size: 12px; }
.deal-pct { color: var(--warn); font-weight: 700; font-size: 12px; margin-left: 4px; }
.deal-name { font-size: 13px; margin-top: 2px; }
.deal-why { font-size: 12px; color: var(--hint); margin-top: 4px; line-height: 1.35; }

/* список «треба купити» */
.wl-add { display: flex; gap: 8px; margin-bottom: 8px; }
.wl-add input { flex: 1; border: 0; border-radius: 10px; padding: 10px; background: var(--card); color: var(--text); font-size: 14px; }
.wl-add .refresh-btn { width: 44px; padding: 0; }
.wl-item { display: flex; justify-content: space-between; align-items: center; background: var(--card);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; font-size: 14px; }
.wl-item .ghost { border: 0; background: transparent; color: var(--hint); font-size: 14px; }

/* meal photo + stock badge */
.meal-photo { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; margin-top: 10px; }
.stock-badge {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(82,168,92,.2); color: var(--accent); vertical-align: middle;
}
.regen-btn {
  margin-top: 8px; border: 0; border-radius: 9px; padding: 7px 12px;
  font-size: 12px; font-weight: 600; background: rgba(255,255,255,.08); color: var(--hint);
}
.regen-btn:disabled { opacity: .7; }

/* фото-студія (модалка) */
.studio.hidden { display: none; }
.studio {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.studio-box {
  background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px);
}
.studio-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.studio-head span { font-size: 18px; font-weight: 700; }
.studio-head button { border: 0; background: var(--card); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.studio-status { color: var(--hint); font-size: 13px; margin-bottom: 10px; }
.studio-hint { color: var(--hint); font-size: 13px; padding: 20px 0; text-align: center; }
.variations { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.variation { background: var(--card); border-radius: 12px; overflow: hidden; }
.variation img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pick-btn {
  width: 100%; border: 0; padding: 9px; font-size: 13px; font-weight: 600;
  background: var(--accent); color: var(--accent-text);
}
.pick-btn:disabled { opacity: .4; }
.studio-prompt { font-size: 12px; color: var(--hint); background: var(--card); border-radius: 10px; padding: 10px; margin-bottom: 12px; line-height: 1.4; }
#studio-comments {
  width: 100%; min-height: 64px; border: 0; border-radius: 10px; padding: 10px;
  background: var(--card); color: var(--text); font-size: 14px; font-family: inherit; resize: vertical;
}
.studio-actions { display: flex; gap: 8px; margin-top: 10px; }
.studio-actions select { border: 0; border-radius: 10px; padding: 0 10px; background: var(--card); color: var(--text); font-size: 14px; }
.studio-actions .refresh-btn { flex: 1; }

/* онбординг */
#onboarding-body label { display: block; font-size: 13px; color: var(--hint); margin: 12px 2px 5px; }
#onboarding-body select, #onboarding-body input, #onboarding-body textarea {
  width: 100%; border: 0; border-radius: 10px; padding: 11px;
  background: var(--card); color: var(--text); font-size: 15px; font-family: inherit;
}
#onboarding-body textarea { min-height: 60px; resize: vertical; }
.onb-hint { color: var(--hint); font-size: 13px; line-height: 1.4; }
.onb-row { display: flex; gap: 8px; }
.onb-row > div { flex: 1; }
#onb-err, #o-err { margin-top: 8px; }
.onb-nav { display: flex; gap: 8px; margin-top: 16px; }
.onb-nav .refresh-btn { flex: 1; }
.onb-nav .regen-btn { flex: 0 0 auto; }
#onboarding-body input[type="time"] { width: 100%; }
.onb-row2 { display: flex; gap: 8px; margin-bottom: 6px; }
.onb-row2 input { flex: 1; border: 0; border-radius: 10px; padding: 10px; background: var(--card); color: var(--text); font-size: 14px; }
.onb-row2 .regen-btn { flex: 0 0 auto; }

/* ── Крок 1 редизайну: селектор тижня, профіль, порожні стани, фото ── */
.wk-selector { display: flex; gap: 6px; margin: 2px 0 12px; }
.wk-pill { flex: 1; padding: 9px 6px; border: 0; border-radius: 10px; background: var(--card);
  color: var(--hint); font-size: 13px; font-weight: 600; cursor: pointer; }
.wk-pill.active { background: var(--accent); color: var(--accent-text); }

.empty { text-align: center; color: var(--hint); padding: 32px 16px; }
.empty p { margin-bottom: 14px; line-height: 1.5; }

.prof-card { background: var(--card); border-radius: var(--radius); padding: 2px 14px; margin-bottom: 14px; }
.prof-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; }
.prof-row:last-child { border-bottom: 0; }
.prof-row span { color: var(--hint); }
.prof-row b { text-align: right; }
.prof-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--hint);
  margin: 22px 2px 8px; }
.regen-btn.wide { width: 100%; margin-top: 10px; padding: 12px; }

/* фото страви — більше, по центру, не обрізає важливе (п.3) */
.meal-photo { height: auto; aspect-ratio: 16 / 9; object-position: center; }
.recipe-photo { max-height: none; height: auto; aspect-ratio: 16 / 9; object-position: center; }

/* ── Онбординг 2.0 (сегменти, пікер часу, прогрес, адаптив) ── */
.onb-progress { height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin: 2px 2px 10px; }
.onb-progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.onb-step-lbl { color: var(--hint); font-size: 13px; margin: 0 2px 4px; }
.lbl-opt { color: var(--hint); font-weight: 400; font-size: 11px; }

/* живий пошук міста (кастомний, бо datalist у Telegram не фільтрує) */
.city-wrap { position: relative; }
.city-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 5;
  background: var(--card); border-radius: 10px; margin-top: 4px; max-height: 230px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.city-opt { padding: 11px 12px; font-size: 15px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.05); }
.city-opt:last-child { border-bottom: 0; }
.city-opt:active { background: rgba(255,255,255,.08); }
.city-opt.muted { color: var(--hint); cursor: default; }

/* сегмент-контрол — кнопки замість select */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-opt {
  flex: 1 1 auto; border: 1px solid rgba(255,255,255,.08);
  background: var(--card); color: var(--text); border-radius: 12px;
  padding: 12px 12px; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.2;
  transition: background .15s, border-color .15s; -webkit-tap-highlight-color: transparent;
}
.seg-opt.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* кастомний пікер часу (нативний type=time ламається в Telegram на macOS) */
.time-list { display: flex; flex-direction: column; gap: 8px; }
.time-row { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 8px 12px; }
.time-lbl { flex: 1; font-size: 14px; color: var(--hint); }
#onboarding-body .time-row select {
  width: auto; flex: 0 0 auto; padding: 8px 10px; font-size: 17px; font-weight: 600;
  border: 0; border-radius: 10px; background: var(--bg); color: var(--text);
  -webkit-appearance: none; appearance: none; text-align: center; min-width: 60px;
}
.time-colon { font-weight: 700; color: var(--hint); }

/* модалка онбордингу: картка по центру (десктоп) / майже повний екран (телефон) */
@media (min-width: 640px) {
  #onboarding { align-items: center; }
  #onboarding .studio-box { border-radius: 18px; max-width: 480px; max-height: 88vh; }
}
@media (max-width: 639px) {
  #onboarding .studio-box { max-height: 94vh; min-height: 72vh; }
}

/* банери масштабу / комори */
.hh-banner { background: var(--card); border-radius: 10px; padding: 9px 12px; margin-bottom: 10px; font-size: 14px; }
.pantry-note { color: var(--hint); font-size: 13px; margin-bottom: 10px; }

/* комора (Кухня) */
.pantry-add { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pantry-add select { flex: 1; border: 0; border-radius: 10px; padding: 10px; background: var(--card); color: var(--text); font-size: 14px; }
.pantry-add input { width: 80px; border: 0; border-radius: 10px; padding: 10px; background: var(--card); color: var(--text); font-size: 14px; }
.pantry-add .refresh-btn { width: 44px; padding: 0; }
.pantry-unit { color: var(--hint); font-size: 13px; min-width: 24px; }

/* чат-консультант */
.chat-log { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 90px; min-height: 60vh; }
.bubble { max-width: 85%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.bubble.user { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--card); border-bottom-left-radius: 4px; }
.bubble.typing { color: var(--hint); font-style: italic; }
.bubble.error { background: rgba(224,108,117,.15); color: var(--bad); }
.chat-input {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px;
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px);
  background: var(--bg); border-top: 1px solid rgba(255,255,255,.07);
}
.chat-input textarea {
  flex: 1; border: 0; border-radius: 18px; padding: 10px 14px; resize: none;
  background: var(--card); color: var(--text); font-size: 15px; font-family: inherit; max-height: 120px;
}
.chat-input .refresh-btn { border-radius: 50%; width: 44px; height: 44px; padding: 0; font-size: 16px; flex-shrink: 0; }

/* ── Кухня 2.0: статус-стрічка, картки з фото і прогрес-баром, чіпси, шторки ── */
.kit-strip { background: var(--card); border-radius: var(--radius); padding: 12px 14px;
  font-size: 14px; margin-bottom: 12px; }
.kit-strip .warn { color: var(--warn); font-weight: 600; }

.inv { display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: var(--radius); padding: 10px; margin-bottom: 8px; }
.inv.st-done, .inv.st-exp { opacity: .75; }
.inv-tap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.inv-tap[data-rcode] { cursor: pointer; }
.inv-photo { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.inv-photo.ph { background: rgba(255,255,255,.05); }
.inv-main { flex: 1; min-width: 0; }
.inv-name { font-size: 15px; font-weight: 600; line-height: 1.25; }
.inv-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08);
  margin: 6px 0 4px; overflow: hidden; }
.inv-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.st-low .inv-bar i { background: var(--warn); }
.st-exp .inv-bar i, .st-done .inv-bar i { background: var(--bad); }
.inv-meta { font-size: 11px; color: var(--hint); }
.st-low .inv-st { color: var(--warn); }
.st-exp .inv-st, .st-done .inv-st { color: var(--bad); }
.inv-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.inv-actions button {
  border: 0; border-radius: 8px; padding: 7px 9px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.07); color: var(--text);
}
.inv-actions button:disabled { opacity: .4; }
.inv-actions .ghost { background: transparent; color: var(--hint); }

.pan-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card);
  border-radius: 999px; padding: 7px 11px; font-size: 13px; }
.chip button { border: 0; background: transparent; color: var(--hint); font-size: 12px;
  padding: 0; line-height: 1; }
.chip-add { background: rgba(82,168,92,.15); color: var(--accent); font-weight: 600;
  border: 0; cursor: pointer; }

.kit-hist-h { display: flex; justify-content: space-between; align-items: center; }
.ghost-link { border: 0; background: transparent; color: var(--accent); font-size: 12px;
  font-weight: 600; padding: 0; }

.cook-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  max-height: 48vh; overflow-y: auto; margin-bottom: 12px; }
.cook-card { background: var(--card); border-radius: 12px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; }
.cook-card.sel { border-color: var(--accent); }
.cook-card img, .cook-ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  display: block; background: rgba(255,255,255,.04); }
.cook-name { font-size: 13px; font-weight: 600; padding: 8px 9px 2px; line-height: 1.25; }
.cook-meta { font-size: 11px; color: var(--hint); padding: 0 9px 9px; }
.cook-row { display: flex; gap: 8px; }
.cook-row input {
  width: 72px; padding: 10px; border-radius: 10px; border: 0;
  background: var(--card); color: var(--text); font-size: 15px; text-align: center;
}
.cook-row .refresh-btn { flex: 1; }
.cook-row .regen-btn:disabled { opacity: .4; }

/* клікабельні страви → картка рецепта */
.meal-title.tappable { cursor: pointer; }
.tap-hint { color: var(--hint); font-weight: 400; }

/* картка рецепта (модалка) */
.recipe-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.recipe-kbju { font-size: 14px; font-weight: 600; }
.recipe-meta { font-size: 12px; color: var(--hint); margin-bottom: 10px; }
.recipe-sec { margin-top: 12px; }
.recipe-sec h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--hint); margin: 0 0 6px; }
.recipe-steps { margin: 0; padding-left: 20px; }
.recipe-steps li { font-size: 14px; line-height: 1.5; margin-bottom: 6px; }

/* сторінка очікування схвалення */
.gate { text-align: center; padding: 40px 20px; }
.gate h3 { font-size: 20px; margin-bottom: 8px; }
.gate p { color: var(--hint); line-height: 1.5; }

/* вибір дня (Сьогодні) */
.day-picker { display: flex; gap: 6px; margin: 2px 0 14px; }
.day-pill { flex: 1; padding: 8px 0; border: 0; border-radius: 10px; background: var(--card);
  color: var(--hint); font-size: 13px; font-weight: 600; position: relative; }
.day-pill.active { background: var(--accent); color: var(--accent-text); }
.day-pill.today:not(.active)::after { content: "•"; position: absolute; top: 1px; right: 6px; color: var(--accent); }

/* історія їжі (без іконки: заголовок на всю ширину, час праворуч) */
.hist-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  background: var(--card); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; font-size: 14px; }
.hist-time { font-size: 12px; color: var(--hint); }
.hist-note { grid-column: 1 / -1; font-size: 12px; color: var(--hint); margin-top: 2px; }

/* чернетка меню */
.draft-head { background: rgba(82,168,92,.12); border: 1px solid rgba(82,168,92,.3);
  border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.draft-head b { display: block; margin-bottom: 8px; }
.draft-actions { display: flex; gap: 8px; }
.draft-actions .refresh-btn { flex: 1; }
.draft-warn { font-size: 12px; color: var(--warn); margin-bottom: 12px; line-height: 1.4; }

/* кнопка прибрати позицію списку */
.shop-del { grid-column: 5; grid-row: 1 / span 2; border: 0; background: transparent;
  color: var(--hint); font-size: 13px; padding: 4px 2px; cursor: pointer; }

/* вподобання (Консультант) */
.prefs-bar:not(:empty) { margin-bottom: 10px; }
.prefs-title { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--hint); margin-bottom: 6px; }
.prefs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pref-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--card);
  border-radius: 999px; padding: 5px 6px 5px 10px; font-size: 13px; }
.pref-chip button { border: 0; background: transparent; color: var(--hint); font-size: 12px; cursor: pointer; padding: 0 2px; }

/* кнопка заміни страви */
.meal-top-right { display: inline-flex; align-items: center; gap: 8px; }
.swap-btn { border: 0; background: rgba(255,255,255,.08); color: var(--hint);
  border-radius: 8px; padding: 3px 7px; font-size: 12px; cursor: pointer; }
.swap-btn:disabled { opacity: .6; }

/* зірки-оцінка */
.stars { display: flex; gap: 4px; }
.star { border: 0; background: transparent; font-size: 24px; line-height: 1;
  color: rgba(255,255,255,.18); cursor: pointer; padding: 0; }
.star.on { color: #f5c518; }

/* відгук + доопрацювання страви */
#recipe-fb textarea { width: 100%; min-height: 64px; border: 0; border-radius: 10px;
  padding: 10px; background: var(--card); color: var(--text); font-size: 14px; resize: vertical; }
.fb-actions { display: flex; gap: 8px; margin-top: 8px; }
.fb-actions .refresh-btn { flex: 1; }
.fb-actions .regen-btn { margin-top: 0; }
.fb-hist { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.fb-item { background: var(--card); border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.4; }
.fb-stars { color: #f5c518; }
.fb-at { color: var(--hint); font-size: 11px; margin-top: 3px; }
.pers-badge { color: var(--accent); font-weight: 600; }

/* ── Кроки 2-5: командна стрічка ШІ, режими тижня, DiffCard ── */
.cmd-spacer { height: 84px; }
.cmd-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 8px 14px calc(env(safe-area-inset-bottom) + 8px); z-index: 30; }
.cmd-reply { background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  font-size: 13px; line-height: 1.45; color: var(--text); max-height: 30vh; overflow-y: auto; white-space: pre-wrap; }
.cmd-row { display: flex; gap: 8px; }
.cmd-row input { flex: 1; border: 0; border-radius: 18px; padding: 11px 14px;
  background: var(--card); color: var(--text); font-size: 15px; }
.cmd-row .refresh-btn { border-radius: 50%; width: 44px; height: 44px; padding: 0; flex-shrink: 0; font-size: 18px; }
@media (min-width: 640px) {
  .cmd-bar { left: 50%; right: auto; transform: translateX(-50%); width: 100%; max-width: 600px; }
}

.mode-banner { border-radius: 10px; padding: 9px 12px; margin-bottom: 10px; font-size: 13px; }
.mode-banner.draft { background: rgba(82,168,92,.12); color: var(--accent); border: 1px solid rgba(82,168,92,.3); }
.mode-banner.archived { background: var(--card); color: var(--hint); }
.view-actions { display: flex; gap: 8px; margin: 14px 0 4px; }
.view-actions .refresh-btn { flex: 1; padding: 12px; }
.view-actions .refresh-btn.wide { width: 100%; }

.diff-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.diff-card { background: var(--bg); border-radius: 16px; padding: 18px; width: 100%; max-width: 420px;
  max-height: 86vh; overflow-y: auto; }
.diff-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.diff-old { color: var(--hint); text-decoration: line-through; }
.diff-arrow { color: var(--accent); }
.diff-reason { font-size: 14px; line-height: 1.45; margin-bottom: 8px; }
.diff-kbju { font-size: 13px; color: var(--hint); margin-bottom: 14px; }
.diff-actions { display: flex; flex-direction: column; gap: 8px; }
.diff-actions .refresh-btn, .diff-actions .regen-btn { width: 100%; padding: 12px; margin: 0; }

/* картка ШІ-плану (фінал онбордингу) */
.coach-h { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--hint); margin-bottom: 6px; }
.coach-kbju { font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 12px; }
.coach-sum { font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
.coach-adv { margin: 0 0 14px; padding-left: 18px; }
.coach-adv li { font-size: 14px; line-height: 1.45; margin-bottom: 6px; }
.coach-adv li::marker { color: var(--accent); }
.diff-card .refresh-btn { width: 100%; padding: 12px; margin-top: 4px; }

/* ════════ Фаза A+B: фірмовий шар — градієнти, типографіка, рух (2026-06-13) ════════ */

/* типографіка */
.brand { font-family: "Fixel Display", "Fixel", sans-serif;
  background: linear-gradient(110deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.day-name, .studio-head span { font-family: "Fixel Display", "Fixel", sans-serif; }

/* градієнтні акценти */
.refresh-btn, .pick-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--accent-text); border: 0;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.tab.active, .wk-pill.active, .day-pill.active, .seg-opt.on {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--accent-text); border-color: transparent;
}
.inv-bar i { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.st-low .inv-bar i { background: linear-gradient(90deg, var(--warn), #f2c14e); }
.st-exp .inv-bar i, .st-done .inv-bar i { background: var(--bad); }
.macro b { color: var(--accent2); }
.chip-add { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent2); }

/* тонкі межі карток — глибина без шуму */
.meal, .inv, .kit-strip, .prof-card, .macro, .cook-card, .deal, .wl-item, .chip, .cmd-bar {
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
}
.cook-card.sel { border-color: var(--accent); }

/* скелетони замість «Завантаження…» */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel { height: 84px; border-radius: var(--radius); margin-bottom: 10px;
  background: linear-gradient(100deg, var(--card) 40%,
    color-mix(in srgb, var(--card) 82%, white) 50%, var(--card) 60%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel.sm { height: 40px; }

/* поява контенту */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#content > * { animation: fadeUp .18s ease both; }

/* шторки — виїзд знизу + затемнення */
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.studio { animation: fadeIn .18s ease; }
.studio-box { animation: sheetUp .22s cubic-bezier(.2,.8,.3,1); }

/* тактильність — натиск */
button, .tab, .chip, .day-pill, .wk-pill, .cook-card, .inv-tap, .seg-opt {
  transition: transform .12s ease, opacity .12s ease;
}
button:active, .tab:active, .chip-add:active, .day-pill:active, .wk-pill:active,
.cook-card:active, .seg-opt:active { transform: scale(.96); }

/* чекбокс списку — анімований страйк */
.shop-name { position: relative; }
.shop-name::after { content: ""; position: absolute; left: 0; top: 55%; height: 1.5px;
  width: 0; background: var(--hint); transition: width .25s ease; }
.shop-item.checked .shop-name { text-decoration: none; color: var(--hint); }
.shop-item.checked .shop-name::after { width: 100%; }

/* прогрес-бари плавні */
.inv-bar i { transition: width .4s ease; }

/* ── Онбординг 3.0: великі поля, зведення-редактор, пікери (2026-06-13) ── */
#onboarding-body input, #onboarding-body select, #onboarding-body textarea {
  font-size: 16px; padding: 14px; border-radius: 12px;   /* 16px = без авто-зуму iOS */
}
#onboarding-body textarea { min-height: 84px; }
#onboarding-body label { font-size: 14px; margin: 16px 2px 7px; }
.onb-nav { gap: 10px; }
.onb-nav .refresh-btn, .onb-nav .regen-btn { padding: 14px; font-size: 15px; }

/* кнопка-поле «обери зі списку» (місто/адреса) */
.pick-field {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 12px; padding: 14px; color: var(--text); font-size: 15px; text-align: left;
}
.pick-field:disabled { opacity: .45; }
.pick-ch { color: var(--hint); font-size: 17px; }

/* зведення-редактор профілю */
.onb-sec {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 12px; padding: 14px; margin-bottom: 8px; color: var(--text); font-size: 15px;
}
.onb-sec-t { font-weight: 600; flex-shrink: 0; min-width: 96px; }
.onb-sec-v { flex: 1; color: var(--hint); font-size: 13px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

/* шторка-список з пошуком */
.sheet-search {
  width: 100%; padding: 13px; border: 0; border-radius: 10px;
  background: var(--card); color: var(--text); font-size: 16px; margin-bottom: 8px;
}
.sheet-list { max-height: 55vh; overflow-y: auto; }
.sheet-row {
  width: 100%; display: block; text-align: left; background: transparent; border: 0;
  color: var(--text); font-size: 15px; padding: 13px 10px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.sheet-row:active { background: rgba(255,255,255,.06); }

/* ── Фаза D: швидкі дії, бюджет, дії агента, фоновий банер, секції профілю ── */
.quick-act { display: flex; gap: 8px; margin-top: 10px; }
.quick-act button {
  flex: 1; border: 0; border-radius: 10px; padding: 9px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent2);
}
.quick-act .ghost { background: rgba(255,255,255,.06); color: var(--hint); }
.quick-act .marked { flex: 1; text-align: center; font-size: 13px; color: var(--hint); padding: 9px; }

.shop-budget { flex: 1; min-width: 0; margin-right: 12px; }
.bud-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 7px; }
.bud-bar i { display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s ease; }
.bud-bar i.over { background: linear-gradient(90deg, var(--warn), var(--bad)); }

.act-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.act-chip { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent2); }

.gen-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 14px); z-index: 60;
  max-width: min(92vw, 560px); display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px; padding: 10px 16px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: fadeUp .2s ease;
}
.gen-banner.tappable { cursor: pointer; color: var(--accent2); font-weight: 600; }
.spin { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.15); border-top-color: var(--accent2);
  animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.sheet-text { font-size: 14px; line-height: 1.5; padding: 4px 2px 8px; }
.prof-text { padding: 13px 14px; font-size: 14px; line-height: 1.45; }
.muted-i { color: var(--hint); font-style: italic; }
.sec-hint { color: var(--hint); font-size: 12px; line-height: 1.4; margin: -2px 2px 8px; }

/* ── Фідбек-раунд 2: чат у шапці, видалення історії, комора 2.0 ── */
.hdr-chat { border: 0; border-radius: 50%; width: 38px; height: 38px; font-size: 17px;
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.hist-del { grid-column: 3; border: 0; background: transparent; color: var(--hint);
  font-size: 12px; padding: 2px 4px; }
.hist-row { grid-template-columns: 1fr auto auto; }
.row-unit { float: right; color: var(--hint); font-size: 12px;
  background: rgba(255,255,255,.06); border-radius: 6px; padding: 2px 7px; }
.pan-row { display: flex; justify-content: space-between; align-items: center; }
.pan-custom { color: var(--accent2); font-weight: 600; }
.pan-unit-in { width: 110px; border: 0; border-radius: 10px; padding: 10px;
  background: var(--card); color: var(--text); font-size: 15px; }

/* комора картками з фото товарів + шапка чату з виходом */
.pan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pan-card { position: relative; background: var(--card); border-radius: 12px; padding: 8px;
  text-align: center; border: 1px solid color-mix(in srgb, var(--text) 6%, transparent); }
.pan-img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px;
  background: rgba(255,255,255,.05); display: block; }
.pan-img.ph::after { content: "🧺"; display: grid; place-items: center; height: 100%; font-size: 26px; }
.pan-name { font-size: 12px; font-weight: 600; line-height: 1.2; margin-top: 6px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pan-qty { font-size: 11px; color: var(--hint); margin-top: 2px; }
.pan-del { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 50%;
  width: 20px; height: 20px; font-size: 10px; background: rgba(0,0,0,.45); color: var(--text); }
.pan-add-card { display: grid; place-items: center; gap: 2px; font-size: 22px; cursor: pointer;
  color: var(--accent2); background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); min-height: 120px; }
.pan-add-card span { font-size: 12px; font-weight: 600; }
.chat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chat-top .regen-btn { margin-top: 0; }
.chat-title { font-weight: 700; font-size: 15px; }

/* календар харчування */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-nav .regen-btn { margin-top: 0; width: 42px; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head span { text-align: center; font-size: 11px; color: var(--hint); padding: 4px 0; }
.cal-day { position: relative; aspect-ratio: 1; border: 0; border-radius: 10px;
  background: var(--card); color: var(--text); font-size: 14px; }
.cal-day.has { background: color-mix(in srgb, var(--accent) 14%, var(--card)); font-weight: 600; }
.cal-day.today { outline: 1.5px solid var(--accent2); }
.cal-day.sel { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-text); }
.cal-dots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; gap: 3px; justify-content: center; }
.cal-dots b { width: 5px; height: 5px; border-radius: 50%; display: block; }
.d-ok { background: var(--accent2); } .d-skip { background: var(--warn); } .d-cook { background: #7ab8e0; }
.cal-day.sel .cal-dots b { background: var(--accent-text); }
.cal-evts { margin-top: 6px; max-height: 32vh; overflow-y: auto; }

/* вибір фото товару для свого продукту в коморі */
.pan-photos { margin-bottom: 10px; }
.pan-photo-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pan-photo { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 10px; padding: 2px;
  border: 2px solid transparent; background: var(--card); cursor: pointer; }
.pan-photo img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.pan-photo.sel { border-color: var(--accent); }

/* ── Чат-оверлей: «Назад» завжди видно, скролиться лише лог ── */
.chatov { position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; flex-direction: column; padding: 10px 14px 0; animation: fadeIn .15s ease; }
.chatov.hidden { display: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; flex-shrink: 0; }
.chat-head .regen-btn { margin-top: 0; width: 42px; font-size: 16px; }
.chat-title { font-weight: 700; font-size: 16px; font-family: "Fixel Display", "Fixel", sans-serif; }
.chatov .prefs-bar { flex-shrink: 0; }
.chatov .chat-log { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 12px; }
.chatov .chat-input { position: static; flex-shrink: 0; border-top: 1px solid rgba(255,255,255,.07);
  padding: 10px 0 calc(env(safe-area-inset-bottom) + 10px); background: var(--bg); }

/* SVG-іконки */
.ic, .ic-sm, .ic-btn, .ic-strip { display: inline-flex; vertical-align: -2px; }
.ic svg { width: 16px; height: 16px; }
.ic-sm svg { width: 13px; height: 13px; }
.ic-btn svg { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }
.ic-strip svg { width: 28px; height: 28px; color: var(--hint); flex-shrink: 0; }
.hdr-chat svg { width: 19px; height: 19px; color: var(--accent2); display: block; margin: auto; }
.ghost-link .ic-sm { margin-right: 2px; }

/* порожні стани Кухні */
.kit-strip.empty { display: flex; align-items: center; gap: 12px; }
.kit-strip.empty b { font-size: 14px; }
.strip-sub { color: var(--hint); font-size: 12px; }
.pan-add-line { width: 100%; border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent2);
  border-radius: 12px; padding: 13px; font-size: 14px; font-weight: 600; }
.pan-add-card { min-height: 0; aspect-ratio: 1; font-size: 20px; }
.cook-cta { display: flex; align-items: center; justify-content: center; margin-top: 18px; }

/* великі картки вибору фото продукту + ШІ-пакшот */
.pan-pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-height: 46vh; overflow-y: auto; }
.pan-pick { background: #fff; border: 2px solid transparent; border-radius: 12px;
  padding: 6px 6px 8px; text-align: center; cursor: pointer; }
.pan-pick img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.pan-pick-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 11px; line-height: 1.25; color: #2a2e26; margin-top: 4px; }
.pan-pick-meta { display: block; font-size: 10px; color: #8a8f85; margin-top: 1px; }
.pan-pick.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
