/* =================================================================
   Feed Me — Feuille de style
   Local-first, zéro dépendance. Thème sombre par défaut + thème clair.
   Mobile-first, responsive, transitions fluides.
   ================================================================= */

/* ---------- Design tokens ---------- */
:root {
  --green-400: #34d399;
  --green-500: #10b981;
  --green-600: #059669;
  --amber-400: #fbbf24;
  --rose-500: #f43f5e;
  --blue-400: #60a5fa;

  /* Thème sombre (par défaut) */
  --bg: #0b0f14;
  --bg-soft: #0f151c;
  --surface: #141c25;
  --surface-2: #1a2430;
  --surface-3: #223040;
  --border: #25313f;
  --border-strong: #33465a;
  --text: #eaf1f8;
  --text-soft: #b3c0cf;
  --text-mute: #7e8da0;
  --accent: var(--green-400);
  --accent-strong: var(--green-500);
  --accent-contrast: #042016;
  --danger: #fb7185;
  --warn: var(--amber-400);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(52, 211, 153, 0.28);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --maxw: 1080px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="light"] {
  --bg: #f4f7f9;
  --bg-soft: #eef2f5;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --surface-3: #eef3f7;
  --border: #e1e8ee;
  --border-strong: #cdd8e1;
  --text: #102030;
  --text-soft: #3c4d5d;
  --text-mute: #6b7c8c;
  --accent: var(--green-600);
  --accent-strong: var(--green-500);
  --accent-contrast: #ffffff;
  --danger: #e11d48;
  --shadow: 0 12px 30px -16px rgba(16, 38, 58, 0.35);
  --shadow-sm: 0 1px 3px rgba(16, 38, 58, 0.08), 0 6px 16px -8px rgba(16, 38, 58, 0.16);
  --ring: 0 0 0 3px rgba(5, 150, 105, 0.22);
  /* Couleurs « moment » assombries pour rester lisibles sur fond clair (AA) */
  --blue-400: #2563eb;
  --amber-400: #b45309;
  --border: #dbe3ea;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%), var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
a { color: var(--accent); }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Layout shell ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 12px 18px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.02em; }
.brand__logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(145deg, var(--accent-strong), var(--green-600));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand__name { font-size: 17px; }
.brand__name small { display: block; font-size: 11px; font-weight: 500; color: var(--text-mute); letter-spacing: .04em; text-transform: uppercase; }
.topbar__spacer { flex: 1; }

.statuspill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  padding: 6px 11px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  white-space: nowrap;
}
.statuspill .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--text-mute); }
.statuspill[data-state="saved"] .dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.statuspill[data-state="unsaved"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.statuspill[data-state="unsaved"] .dot { background: var(--warn); animation: pulse 1.6s ease-in-out infinite; }
.statuspill[data-state="empty"] { color: var(--text-mute); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--b); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .08s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn--primary {
  background: linear-gradient(145deg, var(--accent-strong), var(--green-600));
  border-color: transparent; color: var(--accent-contrast);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { filter: brightness(1.06); background: linear-gradient(145deg, var(--accent-strong), var(--green-600)); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); border-color: var(--danger); }
.btn--sm { padding: 7px 11px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn--block { width: 100%; }
/* Taille de base des icônes SVG — sans ça, un SVG sans dimensions s'affiche énorme */
.ico { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.iconbtn .ico { width: 20px; height: 20px; }
.btn .ico { width: 17px; height: 17px; flex: none; }

.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); cursor: pointer; transition: all .18s ease;
}
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.iconbtn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Tabs (desktop) ---------- */
.tabs {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 16px 18px 0;
}
.tabs__nav {
  display: flex; gap: 6px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-sm);
}
.tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 14px; border-radius: 10px; border: none; cursor: pointer;
  background: transparent; color: var(--text-soft); font-size: 14px; font-weight: 600;
  transition: all .18s ease; position: relative;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--accent-contrast); background: linear-gradient(145deg, var(--accent-strong), var(--green-600)); box-shadow: var(--shadow-sm); }
html[data-theme="light"] .tab[aria-selected="true"] { color: #fff; }
.tab:focus-visible { outline: none; box-shadow: var(--ring); }
.tab .ico { width: 18px; height: 18px; flex: none; }
.tab__count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--text) 12%, transparent); color: inherit;
}
.tab[aria-selected="true"] .tab__count { background: rgba(0,0,0,.22); }
.tab__label--full { display: inline; }

/* ---------- Main ---------- */
.main { flex: 1; max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 22px 18px 120px; }
.view { animation: fade .35s ease; }
.view[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; letter-spacing: -.02em; }
.section-head .sub { color: var(--text-mute); font-size: 13.5px; }
.section-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card__pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid--2 { grid-template-columns: 1fr 1fr; } }

.muted { color: var(--text-mute); }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 30px 22px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: all .2s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); outline: none; }
.dropzone.is-drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, var(--surface-2)); transform: scale(1.005); }
.dropzone__icon { font-size: 34px; margin-bottom: 8px; }
.dropzone__title { font-weight: 700; font-size: 16px; }
.dropzone__hint { color: var(--text-mute); font-size: 13px; margin-top: 4px; }

/* ---------- Prompt box ---------- */
.promptbox { position: relative; }
.promptbox textarea {
  width: 100%; min-height: 230px; resize: vertical;
  background: var(--bg-soft); color: var(--text-soft);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
}
.promptbox textarea:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.promptbox__bar { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.stat__num { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stat__lbl { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

/* ---------- Planning ---------- */
.day { margin-bottom: 14px; }
.day__head {
  display: flex; align-items: center; gap: 10px; padding: 4px 2px 10px;
}
.day__name { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.day__name.is-today { color: var(--accent); }
.day__badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-contrast); background: var(--accent); padding: 2px 8px; border-radius: 99px; }
.day__line { flex: 1; height: 1px; background: var(--border); }
.day__grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .day__grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Aujourd'hui (en exergue sur l'accueil) ---------- */
.today {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: var(--radius); padding: 16px; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.today__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.today__badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--accent-contrast);
  background: var(--accent); padding: 5px 11px; border-radius: 99px;
}
html[data-theme="light"] .today__badge { color: #fff; }
.today__day { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.today__grid { display: grid; gap: 12px; }
@media (min-width: 620px) { .today__grid { grid-template-columns: 1fr 1fr; } }

.meal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px; display: flex; flex-direction: column; gap: 11px; transition: all .2s ease;
  position: relative; overflow: hidden;
}
.meal::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--moment-color, var(--text-mute)); opacity: .85; }
.meal[data-moment="Midi"] { --moment-color: var(--amber-400); }
.meal[data-moment="Soir"] { --moment-color: var(--blue-400); }
.meal.is-done { opacity: .62; }
.meal.is-done .meal__name { text-decoration: line-through; text-decoration-color: var(--text-mute); }
.meal.is-cheat::before { background: linear-gradient(var(--rose-500), var(--amber-400)); }
.meal__top { display: flex; align-items: flex-start; gap: 10px; }
.meal__moment { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--moment-color, var(--text-mute)); }
.meal__name { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.meal__meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-mute); font-size: 12.5px; margin-top: 3px; }
.meal__meta .chip { display: inline-flex; align-items: center; gap: 5px; }
.meal__meta .ico { width: 14px; height: 14px; }
.tag-cheat { color: var(--rose-500); font-weight: 700; }
.meal__check { margin-left: auto; }
.meal__ings { font-size: 12.5px; color: var(--text-soft); }
.meal__ings summary { cursor: pointer; color: var(--text-mute); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.meal__ings summary::-webkit-details-marker { display: none; }
.meal__ings summary::before { content: "›"; display: inline-block; transition: transform .2s ease; font-size: 16px; }
.meal__ings[open] summary::before { transform: rotate(90deg); }
.meal__ings summary:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.meal__ings ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.meal__ings li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.meal__ings li.is-basic { color: var(--text-mute); }
.meal__ings li .q { color: var(--text-mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meal__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.meal__actions .btn { flex: 1; }

/* round check — dans la liste de courses, le label couvre la case + le nom
   (nom accessible + grande cible tactile : cliquer le nom coche l'article) */
.rcheck { display: flex; align-items: center; gap: 12px; cursor: pointer; flex: 1; min-width: 0; }
.rcheck input { position: absolute; opacity: 0; width: 0; height: 0; }
.rcheck__box {
  width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--border-strong);
  display: grid; place-items: center; transition: all .18s ease; color: transparent;
}
.rcheck input:checked + .rcheck__box { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-contrast); }
.rcheck input:focus-visible + .rcheck__box { box-shadow: var(--ring); }
.rcheck__box svg { width: 15px; height: 15px; }

/* ---------- Semaine prochaine (aperçu) ---------- */
.next-week { margin-top: 2px; }
.next-week__summary { cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 8px; padding: 8px 2px; list-style: none; }
.next-week__summary::-webkit-details-marker { display: none; }
.next-week__summary::after { content: "›"; font-size: 18px; transition: transform .2s ease; color: var(--text-mute); }
.next-week[open] .next-week__summary { color: var(--text); }
.next-week[open] .next-week__summary::after { transform: rotate(90deg); }
.next-week__summary:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.next-week .meal { opacity: .9; }

/* ---------- Courses ---------- */
.courses-layout { display: grid; gap: 16px; }
.progressbar { height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progressbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--green-400)); border-radius: 99px; transition: width .4s ease; }
.rayon { margin-bottom: 8px; }
.rayon__head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 8px; position: sticky; top: 56px; z-index: 20; background: var(--bg); border-radius: 10px; }
.rayon__emoji { font-size: 18px; }
.rayon__name { font-weight: 800; font-size: 14px; letter-spacing: -.01em; }
.rayon__count { font-size: 12px; color: var(--text-mute); }
.rayon__copyall { margin-left: auto; }
.rayon__price { font-size: 12.5px; font-weight: 700; color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* Budget estimé */
.budget { margin-bottom: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 75%); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.budget__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.budget__label { font-weight: 700; font-size: 14px; }
.budget__total { font-weight: 800; font-size: 22px; color: var(--accent); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ing-row__price { color: var(--accent); font-weight: 600; }
.ing-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; transition: all .18s ease;
}
.ing-row:hover { border-color: var(--border-strong); }
.ing-row.is-checked { opacity: .5; background: var(--surface-2); }
.ing-row.is-checked .ing-row__name { text-decoration: line-through; }
.ing-row__name { display: block; font-weight: 600; font-size: 14.5px; }
.ing-row__qty { display: block; color: var(--text-mute); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ing-row__main { display: block; flex: 1; min-width: 0; }
.ing-row__actions { display: flex; gap: 8px; align-items: center; }
.copybtn { position: relative; }
.copybtn.copied { color: var(--accent); border-color: var(--accent); }

.basics-note {
  font-size: 12.5px; color: var(--text-mute); padding: 12px 14px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  display: flex; gap: 10px; align-items: flex-start;
}

/* ---------- Historique ---------- */
.hist-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px;
}
.hist-row__date {
  flex: none; width: 54px; text-align: center; line-height: 1.1;
}
.hist-row__date .d { font-size: 19px; font-weight: 800; }
.hist-row__date .m { font-size: 11px; text-transform: uppercase; color: var(--text-mute); letter-spacing: .04em; }
.hist-row__name { font-weight: 600; }
.hist-row__moment { font-size: 12px; color: var(--text-mute); }
.hist-row__ago { margin-left: auto; font-size: 12px; color: var(--text-mute); white-space: nowrap; }
.hist-row.is-old { border-style: dashed; opacity: .7; }
.hist-group-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); margin: 16px 2px 8px; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-mute); }
.empty__icon { font-size: 46px; margin-bottom: 12px; }
.empty__title { font-size: 17px; font-weight: 700; color: var(--text); }
.empty__text { font-size: 13.5px; margin: 6px auto 18px; max-width: 380px; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 80; left: 50%; bottom: 92px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw;
}
@media (min-width: 760px) { .toasts { bottom: 24px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
  padding: 11px 16px; border-radius: 99px; box-shadow: var(--shadow); font-size: 13.5px; font-weight: 600;
  animation: toastin .3s cubic-bezier(.2,.9,.3,1.3);
}
.toast.out { animation: toastout .25s ease forwards; }
.toast__ico { width: 18px; height: 18px; }
.toast--ok .toast__ico { color: var(--green-400); }
.toast--info .toast__ico { color: var(--blue-400); }
.toast--warn .toast__ico { color: var(--warn); }
.toast--err .toast__ico { color: var(--danger); }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  display: none; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); border-top: 1px solid var(--border);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
.bottomnav__inner { display: flex; max-width: 520px; margin: 0 auto; width: 100%; }
.bnav {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; padding: 6px 2px; border-radius: 12px;
  color: var(--text-mute); font-size: 10.5px; font-weight: 600; transition: color .18s ease;
}
.bnav .ico { width: 22px; height: 22px; }
.bnav[aria-selected="true"] { color: var(--accent); }
.bnav:focus-visible { outline: none; box-shadow: var(--ring); }
.bnav__dot { width: 6px; height: 6px; border-radius: 99px; background: transparent; transition: background-color .18s ease; }
.bnav[aria-selected="true"] .bnav__dot { background: var(--accent); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(3,7,12,.6);
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px);
  animation: fade .2s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 420px; width: 100%; padding: 22px;
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { color: var(--text-soft); font-size: 14px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- Misc helpers ---------- */
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.kbd { font-family: var(--mono); font-size: 11px; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 6px; padding: 1px 6px; }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; font-weight: 600; padding: 0; }

/* ---------- Responsive switches ---------- */
@media (max-width: 759px) {
  .tabs { display: none; }
  .bottomnav { display: block; }
  .main { padding-bottom: 110px; }
  .section-head h2 { font-size: 19px; }
  .meal__actions { flex-direction: column; }
  .meal__actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
