/* Tellaja — style, d'après la maquette du designer. */
/* ============================================================ jetons */
:root {
  --bg: #F4F3EE; --surface: #FFFFFF; --surface-2: #EDECE5; --ink: #16201B; --ink-2: #4E5A54; --ink-3: #626C67;
  --line: #E2E0D8; --field-line: #7E8782; --accent: #1A6B4B; --accent-ink: #FFFFFF; --accent-soft: #E1EEE6;
  --kcal: #B4530A; --kcal-soft: #FBEBDC; --warn: #9A5806; --warn-soft: #FCF0DA; --bad: #B42318; --bad-soft: #FBE7E4;
  --scrim: rgba(12, 18, 15, .42); --shadow: 0 1px 2px rgba(20,30,25,.06), 0 4px 16px rgba(20,30,25,.06);
  --r-sm: 10px; --r: 16px; --r-lg: 24px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1412; --surface: #171D1A; --surface-2: #212925; --ink: #E9EEEB; --ink-2: #A9B4AE; --ink-3: #7F8A85;
    --line: #2A332F; --field-line: #6B7771; --accent: #5BC796; --accent-ink: #06140D; --accent-soft: #17302A;
    --kcal: #F0A050; --kcal-soft: #35261A; --warn: #F2B04F; --warn-soft: #33281A; --bad: #F28B80; --bad-soft: #3A1F1C;
    --scrim: rgba(0,0,0,.6); --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1412; --surface: #171D1A; --surface-2: #212925; --ink: #E9EEEB; --ink-2: #A9B4AE; --ink-3: #7F8A85;
  --line: #2A332F; --field-line: #6B7771; --accent: #5BC796; --accent-ink: #06140D; --accent-soft: #17302A;
  --kcal: #F0A050; --kcal-soft: #35261A; --warn: #F2B04F; --warn-soft: #33281A; --bad: #F28B80; --bad-soft: #3A1F1C;
  --scrim: rgba(0,0,0,.6); --shadow: none; color-scheme: dark;
}

/* ============================================================ base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 1rem/1.45 var(--font); -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 18px; height: 18px; }
body { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ============================================================ barre du haut */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--s2);
  padding: calc(var(--s2) + env(safe-area-inset-top, 0px)) var(--s2) var(--s2) var(--s4);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.top h1 { font-size: 1.0625rem; font-weight: 650; margin: 0; flex: 1; letter-spacing: -.01em; }
.top .back { margin-left: calc(-1 * var(--s2)); }
.iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent;
  color: var(--ink); border-radius: 999px; cursor: pointer; }
.iconbtn:active { background: var(--surface-2); }
.wrap { padding: 0 var(--s4) var(--s6); }

/* titres */
.hello { padding: var(--s1) var(--s4) var(--s3); }
.hello .date { font-size: 0.875rem; color: var(--ink-2); }
.hello .date::first-letter { text-transform: uppercase; }
.hello h2 { font-size: 1.75rem; line-height: 1.15; margin: 2px 0 0; letter-spacing: -.02em; }
.section { display: flex; align-items: baseline; justify-content: space-between; margin: var(--s6) 0 var(--s2); }
.section h3 { font-size: 0.8125rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.section a, .linkbtn { font-size: 0.9375rem; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 10px 0; cursor: pointer; font-family: inherit; }

/* ============================================================ cartes et listes */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--s4); }
.card + .card { margin-top: var(--s3); }
.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); list-style: none; margin: 0; padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: var(--s3) var(--s4); position: relative; }
.list > .row + .row::before { content: ""; position: absolute; top: 0; left: var(--s4); right: 0; border-top: 1px solid var(--line); }
.row.tap { cursor: pointer; }
.row.tap:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 1rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t .brand { font-weight: 400; color: var(--ink-2); }
.row .s { font-size: 0.875rem; color: var(--ink-2); margin-top: 1px; }
#meal-res .row .s { white-space: normal; }
#meal-res .row { gap: var(--s2); }
.row .q { font-size: 1rem; font-weight: 600; text-align: right; white-space: nowrap; }
.row .q small { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--ink-2); }
.row .chev { color: var(--ink-3); }
.lead { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--ink-2); }
.lead.accent { background: var(--accent-soft); color: var(--accent); }
.lead.warn { background: var(--warn-soft); color: var(--warn); }
.lead.bad { background: var(--bad-soft); color: var(--bad); }

/* pastilles */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8125rem; font-weight: 600; line-height: 1;
  padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill svg { width: 14px; height: 14px; }

/* ============================================================ boutons */
.btn { font: inherit; font-size: 1rem; font-weight: 650; border: 0; border-radius: 14px; min-height: 52px; padding: 0 var(--s5);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn:active { filter: brightness(.92); transform: scale(.99); }
.btn.block { width: 100%; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.plain { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.sm { min-height: 44px; font-size: 0.9375rem; padding: 0 var(--s4); border-radius: 12px; }
.btn[disabled] { background: var(--surface-2); color: var(--ink-2); cursor: default; }
.bar-actions { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 6; padding: var(--s3) var(--s4);
  margin: var(--s4) calc(-1 * var(--s4)) 0; background: linear-gradient(to top, var(--bg) 70%, transparent); display: flex; gap: var(--s2); }
.bar-actions .btn { flex: 1; }
.bar-actions .btn.plain { flex: 0 0 auto; }

/* ============================================================ champs */
.field { display: block; margin: 0 0 var(--s4); }
.field > span { display: block; font-size: 0.875rem; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.input, textarea.input { font: inherit; width: 100%; color: var(--ink); background: var(--surface); min-height: 52px;
  border: 1.5px solid var(--field-line); border-radius: 14px; padding: 13px 14px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { resize: none; line-height: 1.5; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search .input { padding-left: 44px; background: var(--surface-2); border-color: var(--field-line); }
.hint { font-size: 0.875rem; color: var(--ink-2); margin: var(--s2) 0 0; }
.chips { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin: var(--s3) calc(-1 * var(--s4)) 0; padding: 0 var(--s4) 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font: inherit; font-size: 0.9375rem; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { font-size: 0.8125rem; color: var(--ink-3); }
.chip.on .n { color: inherit; opacity: .7; }
.toggle { display: flex; align-items: center; gap: var(--s3); min-height: 52px; font-size: 0.9375rem; cursor: pointer; }
.toggle input { appearance: none; width: 48px; height: 30px; border-radius: 999px; background: var(--field-line); position: relative; flex: none; cursor: pointer; margin: 0; transition: background .2s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); }
.toggle small { display: block; color: var(--ink-2); font-size: 0.8125rem; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { font: inherit; font-size: 0.9375rem; font-weight: 550; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow); }

/* pas à pas (quantités) */
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 12px; height: 44px; }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; border-radius: 12px; }
.stepper button:active { background: var(--line); }
.stepper output { min-width: 64px; text-align: center; font-weight: 650; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

/* ============================================================ jauges */
.hero { padding: var(--s5) var(--s4) var(--s4); }
.hero .lead-txt { font-size: 0.9375rem; color: var(--ink-2); margin: 0 0 var(--s4); }
.hero .lead-txt b { color: var(--ink); }
.rings { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.ring { text-align: center; }
.ring .dial { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.ring svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring .track { stroke: var(--surface-2); }
.ring .val { stroke-linecap: round; }
.ring.p .val { stroke: var(--accent); }
.ring.k .val { stroke: var(--kcal); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; }
.ring .big { font-size: 1.875rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.ring .big small { font-size: 0.9375rem; font-weight: 650; letter-spacing: 0; }
.ring .lbl { font-size: 0.78125rem; line-height: 1.2; color: var(--ink-2); margin: 4px auto 0; max-width: 84px; }
.ring .of { font-size: 0.875rem; color: var(--ink-2); margin-top: var(--s2); }
.ring .of b { color: var(--ink); }
.minor { display: flex; justify-content: center; gap: var(--s5); font-size: 0.875rem; color: var(--ink-2); margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.minor b { color: var(--ink); font-weight: 600; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.meter.k i { background: var(--kcal); }
.mini-bars { display: grid; gap: var(--s3); }
.mini-bars .l { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 6px; color: var(--ink-2); }
.mini-bars .l b { color: var(--ink); }

/* barre « ajouter » de l'accueil */
.quick { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 56px; padding: 0 var(--s2) 0 var(--s4);
  border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); border: 0; font: inherit; color: var(--ink-3); cursor: pointer; text-align: left; margin-top: var(--s3); }
.quick > span:not(.go) { flex: 1; font-size: 1rem; }
.quick .go { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }

/* suggestions */
.idea { display: flex; gap: var(--s3); align-items: flex-start; }
.idea p { margin: 0; font-size: 0.9375rem; }
.idea .s { color: var(--ink-2); font-size: 0.875rem; margin-top: 2px; }

/* repas du jour */
.meal .time { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); width: 44px; flex: none; align-self: flex-start; padding-top: 2px; }
.meal .t { white-space: normal; font-weight: 500; }

/* ============================================================ lignes à vérifier */
.check-row { padding: var(--s3) var(--s4); position: relative; }
.list > .check-row + .check-row::before { content: ""; position: absolute; top: 0; left: var(--s4); right: 0; border-top: 1px solid var(--line); }
.check-row .head { display: flex; gap: var(--s3); align-items: flex-start; }
.check-row .raw { font: 0.78125rem/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink-3); letter-spacing: .02em; margin-bottom: 4px; }
.check-row .name { font-size: 1rem; font-weight: 600; }
.check-row .name .brand { font-weight: 400; color: var(--ink-2); }
.check-row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s3); margin-top: 6px; font-size: 0.875rem; color: var(--ink-2); }
.check-row .meta b { color: var(--ink); font-weight: 600; }
.check-row .price { font-weight: 650; font-size: 1rem; white-space: nowrap; }
.check-row.todo { background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.check-row .fix { display: flex; gap: var(--s2); margin-top: var(--s3); }
.check-row .fix .btn { flex: 1; white-space: nowrap; }
.check-row .fix .btn.plain { flex: 0 0 auto; }
.src { display: inline-flex; align-items: center; gap: 4px; }
.src svg { width: 15px; height: 15px; }

.banner { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r); font-size: 0.9375rem; }
.banner.warn { background: var(--warn-soft); color: var(--ink); }
.banner.warn svg { color: var(--warn); }
.banner.info { background: var(--accent-soft); }
.banner.info svg { color: var(--accent); }
.banner p { margin: 0; }
.banner .s { font-size: 0.875rem; color: var(--ink-2); margin-top: 2px; }

.summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.summary .store { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.summary .s { font-size: 0.875rem; color: var(--ink-2); }
.summary .tot { text-align: right; font-size: 1.25rem; font-weight: 700; }
.steps { display: flex; gap: 6px; margin: var(--s3) 0 0; }
.steps i { flex: 1; height: 4px; border-radius: 9px; background: var(--line); }
.steps i.on { background: var(--accent); }

/* courses */
.cb { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--ink-3); display: grid; place-items: center; flex: none; color: transparent; }
.row.done .cb { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.row.done .t, .row.done .q { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.progress { display: flex; align-items: center; gap: var(--s3); font-size: 0.875rem; color: var(--ink-2); margin: var(--s4) 0 0; }
.progress .meter { flex: 1; }

/* ============================================================ navigation */
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 560px); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; background: var(--surface);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabs button { font: inherit; font-size: 0.71875rem; font-weight: 550; border: 0; background: none; color: var(--ink-2); min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; cursor: pointer; }
.tabs button.on { color: var(--accent); font-weight: 700; }
.tabs .add { align-self: center; }
.tabs .add span { width: 54px; height: 44px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.tabs .add svg { width: 26px; height: 26px; stroke-width: 2.2; }

/* ============================================================ feuille du bas */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; left: 50%; bottom: 0; width: min(100%, 560px); z-index: 31; background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 8px var(--s4) calc(var(--s5) + env(safe-area-inset-bottom));
  transform: translate(-50%, 105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); max-height: 88vh; max-height: calc(88dvh - var(--kb, 0px)); overflow-y: auto; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto var(--s3); }
.sheet h2 { font-size: 1.25rem; margin: 0 0 var(--s1); letter-spacing: -.01em; }
.sheet .sub { color: var(--ink-2); font-size: 0.875rem; margin: 0 0 var(--s4); }
body.sheet-open .scrim { opacity: 1; pointer-events: auto; }
.sheet.open { transform: translate(-50%, 0); }
.action { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 64px; padding: var(--s2) 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-top: 1px solid var(--line); }
.action:first-of-type { border-top: 0; }
.action .main b { display: block; font-size: 1rem; font-weight: 600; }
.action .main span { font-size: 0.875rem; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); text-align: center; background: var(--surface-2); border-radius: 14px; padding: var(--s3) var(--s2); margin-bottom: var(--s4); }
.kv b { display: block; font-size: 1.0625rem; }
.kv span { font-size: 0.75rem; color: var(--ink-2); }
.formrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 60px; border-top: 1px solid var(--line); }
.formrow:first-of-type { border-top: 0; }
.formrow .l { font-size: 1rem; }
.formrow .l small { display: block; color: var(--ink-2); font-size: 0.8125rem; }

/* ============================================================ états */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(min(100%, 560px) - 32px);
  z-index: 25; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 6px 6px 6px 16px; display: flex; align-items: center; gap: var(--s3); font-size: 0.9375rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast svg { color: var(--accent-soft); }
.toast p { flex: 1; margin: 0; padding: 8px 0; }
.toast button { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; min-height: 44px; padding: 0 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.toast[hidden] { display: none; }
.skel { background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sh 1.3s linear infinite; border-radius: 8px; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .sheet, .scrim { transition: none; } }
.empty { text-align: center; padding: var(--s8) var(--s4); }
.empty .lead { margin: 0 auto var(--s3); width: 56px; height: 56px; border-radius: 18px; }
.empty b { display: block; font-size: 1.0625rem; margin-bottom: 4px; }
.empty p { color: var(--ink-2); margin: 0 0 var(--s4); font-size: 0.9375rem; }
.reading { text-align: center; padding: var(--s6) var(--s4); }
.reading .ticket-anim { width: 64px; height: 80px; margin: 0 auto var(--s4); border-radius: 8px; background: var(--surface-2); position: relative; overflow: hidden; }
.reading .ticket-anim::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--accent); top: 0; animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { to { top: 77px; } }
.legend { font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: var(--s6) 0 var(--s2); }
/* ============================================================ compléments appli */
[hidden] { display: none !important; }
a { color: var(--accent); }
h2.title { font-size: 1.375rem; margin: var(--s2) 0 var(--s3); letter-spacing: -.01em; }
.stack > * + * { margin-top: var(--s3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.inline { display: flex; align-items: center; gap: var(--s2); }
.inline .input { flex: 1; min-width: 0; }
.inline .u { color: var(--ink-2); font-size: 0.9375rem; min-width: 2.5em; }
.muted { color: var(--ink-2); font-size: 0.875rem; }
.row .t.tw { white-space: normal; }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.spin { display: inline-block; width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: rot .8s linear infinite; vertical-align: -4px; }
@keyframes rot { to { transform: rotate(360deg); } }
.skel-row { height: 60px; border-radius: 0; }
.skel-card { height: 140px; margin-bottom: var(--s3); border-radius: var(--r); }
.login { padding-top: var(--s6); }
.login .logo { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -.03em; margin: 0 0 var(--s2); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 10px 6px; border-top: 1px solid var(--line); }
th { color: var(--ink-2); font-weight: 600; border-top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; }
.cap { width: 5.5em; min-height: 40px; padding: 6px 8px; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sheet .close { position: absolute; right: 8px; top: 6px; }
.offline { margin: var(--s2) 0; }
.row .q.warn { color: var(--warn); }
.stepper output { cursor: text; }
.sheet:not(.open) { visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s .28s; }
.seg.four { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.row .s:empty { display: none; }

/* ============================================================ passe de design 2 */
/* Jetons d'élévation : ombre en clair, liseré en sombre (pas d'ombre visible sur fond noir). */
:root { --edge: transparent; --sheet-bg: var(--surface); --tabs-bg: var(--surface); --ease: cubic-bezier(.2,.8,.2,1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --surface: #161C19; --surface-2: #222A26; --line: #2B3430; --edge: rgba(255,255,255,.055);
    --sheet-bg: #1B221F; --tabs-bg: #141A17; --accent-soft: #163128; --warn-soft: #30261A; --amber: #F2B04F; --amber-soft: #33281A; }
}
:root[data-theme="dark"] { --surface: #161C19; --surface-2: #222A26; --line: #2B3430; --edge: rgba(255,255,255,.055);
  --sheet-bg: #1B221F; --tabs-bg: #141A17; --accent-soft: #163128; --warn-soft: #30261A; --amber: #F2B04F; --amber-soft: #33281A; }
.card, .list, .quick { box-shadow: var(--shadow), inset 0 0 0 1px var(--edge); }

/* Lignes : une seule graisse forte par ligne (la quantité), le nom en medium. */
.row .t { font-weight: 500; letter-spacing: -.005em; }
.row .q { font-weight: 650; }
.row .lead.cat { width: 36px; height: 36px; border-radius: 11px; }
.row .lead.cat svg { width: 20px; height: 20px; }
.list > .row.has-lead + .row::before, .list > .row + .row.has-lead::before { left: 64px; }

/* Barre du haut : grand titre dans la page, petit titre qui apparaît au défilement. */
.top { transition: box-shadow .2s; }
.top.big h1 { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.top.big.stuck h1 { opacity: 1; transform: none; }
.top.stuck { box-shadow: 0 1px 0 var(--line); }
.head { padding: var(--s1) 0 var(--s2); }
.head .eyebrow { font-size: 0.875rem; color: var(--ink-2); }
.head .eyebrow::first-letter { text-transform: uppercase; }
.head h2 { font-size: 1.875rem; line-height: 1.12; margin: 2px 0 0; letter-spacing: -.025em; font-weight: 750; }
.head .facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s3); }
.hello { padding: var(--s1) 0 var(--s3) !important; }
.hello h2 { font-size: 1.875rem; letter-spacing: -.025em; font-weight: 750; }

/* Entrée des écrans : fondu court ; écran « poussé » : léger glissement depuis la droite. */
#view.enter { animation: viewIn .24s var(--ease); }
#view.enter.push { animation-name: viewPush; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes viewPush { from { opacity: 0; transform: translateX(18px); } }

/* Retour au toucher. */
.chip, .action, .quick, .tabs button, .iconbtn, .seg button, .stepper button, .cb, .row.tap { transition: transform .12s, background-color .15s, color .15s; }
.chip:active, .quick:active { transform: scale(.97); }
.action:active { background: var(--surface-2); }
.tabs button:active svg { transform: scale(.88); }
.iconbtn:active { transform: scale(.92); }
.row.tap:active { background: var(--surface-2); }
.list .row.tap:active { transform: none; }
.cb { transition: background-color .15s, border-color .15s, transform .2s var(--ease); }
.row.done .cb { animation: pop .28s var(--ease); }
@keyframes pop { 40% { transform: scale(1.18); } }
.row.done .t, .row.done .q { transition: color .2s; }

/* Onglets : pastille derrière l'icône active, fond translucide. */
.tabs { background: var(--tabs-bg); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.tabs button svg { box-sizing: border-box; width: 52px; max-width: 100%; height: 28px; padding: 3px 15px; border-radius: 999px; transition: background-color .2s, transform .12s; }
.tabs button.on svg { background: var(--accent-soft); }
.tabs .add span { box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.tabs .add svg { width: 26px; height: 26px; padding: 0; background: none !important; }

/* Anneaux et barres qui se remplissent à l'arrivée. */
.ring .val { stroke-dasharray: 364.4; stroke-dashoffset: var(--off, 364.4); animation: ringIn 1s var(--ease); }
@keyframes ringIn { from { stroke-dashoffset: 364.4; } }
.meter i { transform-origin: left; animation: grow .8s var(--ease); }
@keyframes grow { from { transform: scaleX(0); } }
.ring .big svg { width: 34px; height: 34px; stroke-width: 2.4; color: var(--accent); }
.hero .lead-txt { font-size: 1rem; }

/* Repas du jour : vide accueillant. */
.empty-line { display: flex; align-items: center; gap: var(--s3); }
.empty-line p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }

/* Repas : nom sur toute la largeur, macros et pas à pas en dessous. */
.mrow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name name" "meta step"; align-items: center; column-gap: var(--s2); row-gap: 6px; padding: var(--s3) var(--s2) var(--s3) var(--s4); position: relative; }
.list > .mrow + .mrow::before { content: ""; position: absolute; top: 0; left: var(--s4); right: 0; border-top: 1px solid var(--line); }
.mrow .nm { grid-area: name; font-size: 1rem; font-weight: 550; cursor: pointer; min-width: 0; padding-right: 40px; }
.mrow .nm .brand { font-weight: 400; color: var(--ink-2); }
.mrow .rm { position: absolute; top: 4px; right: 4px; color: var(--ink-3); }
.mrow .mt { grid-area: meta; font-size: 0.875rem; color: var(--ink-2); min-width: 0; }
.mrow .mt b { color: var(--ink); font-weight: 600; }
.mrow .stepper { grid-area: step; margin-right: var(--s2); }
.mrow.todo { background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.mrow.todo .mt { color: var(--warn); }
.cost-card .big-cost { font-size: 1.625rem; font-weight: 750; letter-spacing: -.02em; }

/* Fiche produit : colonne de contrôles de même largeur, unité dans le contrôle. */
.sheet .sub2 { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--s4); }
.qty-hero { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border-radius: 18px; padding: var(--s3) var(--s3) var(--s3) var(--s4); margin-bottom: var(--s2); }
.qty-hero .l { font-size: 0.9375rem; color: var(--ink-2); }
.qty-hero .stepper { background: var(--sheet-bg); height: 48px; }
.ctl { width: 196px; flex: none; }
.stepper.wide { width: 196px; justify-content: space-between; }
.stepper .val { display: flex; align-items: baseline; justify-content: center; gap: 4px; flex: 1; min-width: 0; }
.stepper .val input { width: 3.6ch; min-width: 0; border: 0; background: transparent; text-align: right; font: inherit; font-weight: 700; font-size: 1.0625rem; color: var(--ink); padding: 0; -moz-appearance: textfield; }
.stepper .val input::-webkit-inner-spin-button, .stepper .val input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .val .u { font-size: 0.875rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unitbox { display: flex; align-items: center; height: 44px; border-radius: 12px; background: var(--surface-2); padding: 0 14px; gap: 6px; box-shadow: inset 0 0 0 1px var(--field-line); }
.unitbox input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ink); text-align: right; padding: 0; outline: none; }
.unitbox .u { color: var(--ink-2); font-size: 0.875rem; }
.unitbox:focus-within { box-shadow: 0 0 0 2px var(--accent); }
input.datebox { height: 44px; min-height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--field-line); padding: 0 12px; font: inherit; font-weight: 600; color: var(--ink); width: 196px; }
.sheet .formrow { min-height: 64px; }
.sheet details.more { margin-top: var(--s4); border-top: 1px solid var(--line); }
.sheet details.more summary { color: var(--ink); justify-content: space-between; list-style: none; min-height: 56px; }
.sheet details.more summary::-webkit-details-marker { display: none; }
.sheet details.more summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.sheet details.more[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.sheet details.more summary small { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.8125rem; }

/* Feuille du bas : plus présente, se ferme en glissant vers le bas. */
.sheet { background: var(--sheet-bg); box-shadow: 0 -10px 40px rgba(0,0,0,.18), inset 0 1px 0 var(--edge); transition: transform .34s var(--ease); touch-action: pan-y; }
.sheet.dragging { transition: none; }
.sheet .grab { margin-top: 2px; width: 44px; cursor: grab; }
.sheet h2 { padding-right: 44px; font-size: 1.3125rem; letter-spacing: -.015em; }
body.sheet-open { overflow: hidden; }
.scrim { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); transition: opacity .3s; }

/* Toast : arrive par le bas ; erreurs en rouge doux. */
.toast:not([hidden]) { animation: toastIn .3s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } }
.toast.err svg { color: #F28B80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast.err svg { color: #B42318; } }
:root[data-theme="dark"] .toast.err svg { color: #B42318; }

/* Squelettes adaptés à chaque écran. */
.skel-line { height: 14px; border-radius: 7px; }
.skel-title { height: 30px; width: 62%; border-radius: 9px; margin-top: 8px; }
.skel-hero { border-radius: var(--r); background: var(--surface); padding: var(--s5) var(--s4); box-shadow: var(--shadow), inset 0 0 0 1px var(--edge); margin-top: var(--s3); }
.skel-hero .rings { margin-top: var(--s4); }
.skel-circle { width: 132px; height: 132px; border-radius: 50%; margin: 0 auto; -webkit-mask: radial-gradient(circle, transparent 54px, #000 55px); mask: radial-gradient(circle, transparent 54px, #000 55px); }
.skel-chip { width: 84px; height: 40px; border-radius: 999px; flex: none; }
.skel-list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow), inset 0 0 0 1px var(--edge); overflow: hidden; }
.skel-list .r { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); min-height: 60px; }
.skel-list .r + .r { border-top: 1px solid var(--line); }
.skel-list .r .b { flex: 1; display: grid; gap: 7px; }
.skel-sq { width: 36px; height: 36px; border-radius: 11px; flex: none; }
.skel-q { width: 52px; height: 16px; border-radius: 8px; }
.skel-bar { height: 52px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) {
  #view.enter, .ring .val, .meter i, .toast:not([hidden]), .row.done .cb { animation: none !important; }
}

/* Ticket : crayon dans l'en-tête plutôt qu'un long lien. */
.summary .edit { margin: -8px -8px -8px 0; color: var(--ink-2); }
.summary .who { min-width: 0; }
.summary .store { display: flex; align-items: center; gap: 6px; }

/* Stock et Courses : en-tête avec chiffres clés. */
.stat-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84375rem; font-weight: 600; padding: 7px 11px; border-radius: 999px; background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.stat-pill b { color: var(--ink); }
.stat-pill.warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.stat-pill.warn b, .stat-pill.bad b { color: inherit; }
.stat-pill.bad { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.stat-pill svg { width: 15px; height: 15px; }
.head.with-ring { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.cart-ring { position: relative; width: 60px; height: 60px; flex: none; }
.cart-ring .mini-ring { width: 60px; height: 60px; }
.cart-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.875rem; font-weight: 700; }
.cart-sub { font-size: 0.875rem; color: var(--ink-2); margin: var(--s2) 0 0; }
.cart-card { display: flex; align-items: center; gap: var(--s4); }
.mini-ring { width: 52px; height: 52px; flex: none; transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke-width: 6; }
.mini-ring .track { stroke: var(--line); }
.mini-ring .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .4s var(--ease); }
.cart-card b { font-size: 1.0625rem; display: block; }
.cart-card span { font-size: 0.875rem; color: var(--ink-2); }

/* Profil : avatar. */
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 1.375rem; font-weight: 750; flex: none; }
.me-head { display: flex; align-items: center; gap: var(--s4); padding: var(--s2) 0 var(--s1); }
.me-head h2 { font-size: 1.5rem; margin: 0; letter-spacing: -.02em; }
.me-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 0.875rem; }

/* Feuille « Ajouter » : seule l'action la plus fréquente en vert. */
.action .lead { background: var(--surface-2); color: var(--ink-2); }
.action.primary .lead { background: var(--accent-soft); color: var(--accent); }
.action .chev { color: var(--ink-3); margin-left: auto; }
.unitbox input::placeholder { font-weight: 400; color: var(--ink-3); }

/* ============================================================ scanner de codes-barres */
body.scanning { overflow: hidden; }
.scan { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan.nocam video { display: none; }
.scan-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.scan-top b { flex: 1; font-size: 1.0625rem; }
.scan-top .iconbtn { color: #fff; }
.scan-frame { position: absolute; z-index: 1; left: 50%; top: 38%; width: min(78vw, 340px); aspect-ratio: 16 / 10; transform: translate(-50%, -50%);
  border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); outline: 3px solid rgba(255,255,255,.9); outline-offset: -3px; }
.scan-frame i { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent);
  animation: scanline 1.8s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 18%; } to { top: 82%; } }
.scan.hit .scan-frame { animation: hitflash .45s ease-out; }
@keyframes hitflash { 0% { outline-color: var(--accent); outline-width: 6px; } 100% { outline-color: rgba(255,255,255,.9); outline-width: 3px; } }
.scan.nocam .scan-frame { display: none; }
.scan-panel { position: relative; z-index: 2; margin-top: auto; background: var(--surface); color: var(--ink); border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; max-width: 560px; width: 100%; align-self: center; }
.scan-status { margin: 0; font-size: 0.9375rem; display: flex; gap: 8px; align-items: center; line-height: 1.35; }
.scan-status.ok { color: var(--accent); font-weight: 600; }
.scan-status.warn { color: var(--warn); }
.scan-status .brand { color: var(--ink-2); font-weight: 400; }
.scan-list:empty { display: none; }
.scan-list { display: grid; gap: 2px; background: var(--surface-2); border-radius: 14px; padding: 6px 12px; }
.scan-item { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.9375rem; }
.scan-item + .scan-item { border-top: 1px solid var(--line); }
.scan-item .brand { color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .scan-frame i { animation: none; } .scan.hit .scan-frame { animation: none; } }

/* photo du ticket */
.tk-thumb { display: flex; align-items: center; gap: 12px; margin-top: 12px; width: 100%; border: 0; background: var(--surface-2); border-radius: 12px;
  padding: 6px; font: inherit; color: var(--ink-2); cursor: pointer; text-align: left; }
.tk-thumb img { width: 44px; height: 56px; object-fit: cover; border-radius: 8px; }
.tk-full { width: 100%; border-radius: 12px; display: block; }

/* ============================================================ page de présentation */
body.pitch-mode .top { display: none; }
body.pitch-mode { padding-bottom: 24px; }
.pitch { padding: calc(28px + env(safe-area-inset-top, 0px)) 0 16px; }
.pitch .logo { font-size: 1.25rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em; margin: 0 0 20px; }
.pitch h1 { font-size: clamp(2rem, 9vw, 2.75rem); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 14px; }
.pitch .lede { font-size: 1.0625rem; color: var(--ink-2); margin: 0 0 22px; line-height: 1.5; }
.pitch > .btn { margin-bottom: 28px; }
.pitch-feats { display: grid; gap: 10px; }
.pf { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.pf b { display: block; font-size: 1rem; margin-bottom: 2px; }
.pf p { margin: 0; font-size: 0.90625rem; color: var(--ink-2); line-height: 1.45; }
@media (min-width: 520px) { .pitch-feats { grid-template-columns: 1fr 1fr; } }
.pitch-note { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); font-size: 0.90625rem; }
.pitch-note svg { color: var(--accent); }
.pitch-note p { margin: 0; }
.pitch-form { margin-top: 8px; scroll-margin-top: 16px; }
.pitch-form h2 { font-size: 1.375rem; margin: 0 0 6px; letter-spacing: -.01em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rq-out { margin: 10px 0 0; color: var(--warn); font-size: 0.875rem; min-height: 1em; }
.pitch-ok { text-align: center; padding: 12px 0; }
.pitch-ok .lead { margin: 0 auto 10px; width: 56px; height: 56px; border-radius: 18px; }
.pitch-ok h2 { margin: 0 0 6px; }
.pitch-ok p { margin: 0; color: var(--ink-2); }
/* fiche produit dans le scanner */
.scan-card { display: grid; gap: 10px; background: var(--surface-2); border-radius: 16px; padding: 14px; }
.sc-name { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; }
.sc-name .brand { font-weight: 400; color: var(--ink-2); }
.sc-sub { font-size: 0.875rem; color: var(--ink-2); line-height: 1.4; }
.sc-sub b { color: var(--ink); }
.scan-card .seg { background: var(--surface); }
.scan-card .seg button.on { background: var(--accent-soft); color: var(--accent); }
.sc-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.sc-actions .btn[data-a=""] { min-height: 44px; color: var(--ink-2); }
.scan-type[hidden] { display: none !important; }
/* dépenses : barres par catégorie */
.bars { display: grid; gap: 14px; }
.bar-row .bl { display: flex; justify-content: space-between; font-size: 0.9375rem; margin-bottom: 6px; }
.bar-row .bl span::first-letter { text-transform: uppercase; }
.bar-row .track { position: relative; height: 12px; border-radius: 99px; background: var(--surface-2); }
.bar-row .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); }
.bar-row .track u { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink-3); text-decoration: none; }
.stat-pill:not(.warn):not(.bad) { background: var(--accent-soft); color: var(--accent); }
/* idée de repas */
.idea-head { display: flex; gap: 12px; align-items: flex-start; }
.idea-head b { display: block; font-size: 1rem; }
.idea-head p { margin: 4px 0 12px; font-size: 0.875rem; color: var(--ink-2); }
.idea-card { border: 1.5px solid var(--accent-soft); }
.idea-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.idea-title { font-size: 1.1875rem; line-height: 1.25; margin: 10px 0 0; letter-spacing: -.01em; }
.idea-items { list-style: none; padding: 0; margin: 0; background: var(--surface-2); border-radius: 12px; }
.idea-items li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; font-size: 0.9375rem; }
.idea-items li + li { border-top: 1px solid var(--line); }
.idea-items .brand { color: var(--ink-2); }
.idea-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 4px; font-size: 0.875rem; color: var(--ink-2); }
.idea-stats b { color: var(--ink); }
.idea-steps { margin: 6px 0 0; }
.idea-steps summary { min-height: 40px; font-size: 0.9375rem; color: var(--accent); }
.idea-steps p { margin: 0 0 6px; font-size: 0.90625rem; color: var(--ink-2); }
.idea-actions { display: flex; gap: 8px; margin-top: 10px; }
.idea-actions .btn { flex: 1; }
.idea-actions .btn.plain { flex: 0 0 auto; }
.sc-wrong { justify-self: center; font-size: 0.875rem; padding: 4px 0 0; }
/* présentation : demande en un champ, nouveautés */
.pitch-ask .inline .btn { flex: none; }
.pitch-ask .pitch-ok { text-align: left; display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.pitch-ask .pitch-ok .lead { margin: 0; width: 44px; height: 44px; border-radius: 14px; }
.pitch-ask .pitch-ok p { margin: 2px 0 0; font-size: 0.875rem; }
.pf.new { border: 1.5px solid var(--accent-soft); }
.new-tag { margin-bottom: 6px; font-size: 0.75rem; padding: 4px 9px; }
.pitch .section { margin-top: 8px; }
/* historique */
.h-kv { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
.cal { padding: 12px; }
.cal-h, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-h span { font-size: 0.75rem; color: var(--ink-3); font-weight: 600; padding-bottom: 4px; }
.cal-d { font: inherit; border: 0; background: var(--surface-2); border-radius: 10px; min-height: 48px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; color: var(--ink); cursor: pointer; }
.cal-d .n { font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-d.fut { opacity: .35; cursor: default; }
.cal-d .dots { display: flex; gap: 3px; height: 7px; }
.cal-d .dots i, .cal-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dots i.ok, .cal-legend i.ok { background: var(--accent); }
.dots i.mid { background: var(--ink-3); }
.dots i.over { background: var(--kcal); }
.dots i.buy, .cal-legend i.buy { background: var(--warn); border-radius: 2px; }
.cal-legend { font-size: 0.75rem; display: inline-flex; gap: 5px; align-items: center; }
.cal-legend i { margin-left: 6px; }
.spend-bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 6px; }
.spend-bar i { display: block; height: 100%; border-radius: 4px; background: var(--warn); }
#h-next[disabled] { opacity: .3; }
.stepper.wide .val input { min-width: 4.5ch; }
.avatar.sm { width: 40px; height: 40px; font-size: 1rem; flex: none; display: grid; place-items: center; }
/* installer l'appli */
.install-card { margin-top: 12px; border: 1.5px solid var(--accent-soft); }
.install-card .idea-head p { margin-bottom: 8px; }
.ins { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.ins-step { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-size: 0.9375rem; }
.ins-n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 750; flex: none; }
.ins-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); vertical-align: middle; color: #0a84ff; margin: 0 2px; }
.ins-ic svg { width: 20px; height: 20px; }
.ins-arrow { text-align: center; color: var(--accent); transform: rotate(-90deg); animation: insb 1.2s ease-in-out infinite alternate; margin-top: 4px; }
@keyframes insb { to { transform: rotate(-90deg) translateX(-8px); } }
@media (prefers-reduced-motion: reduce) { .ins-arrow { animation: none; } }

/* ---- plat pris dehors ---- */
.dish-drop { display: grid; place-items: center; gap: 6px; width: 100%; aspect-ratio: 4 / 3; max-height: 280px; border: 1.5px dashed var(--line); border-radius: 18px; background: var(--surface-2); color: var(--ink); cursor: pointer; padding: 0; overflow: hidden; font: inherit; }
.dish-drop .lead { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.dish-drop b { font-size: 1rem; }
.dish-drop.has { border-style: solid; }
.dish-drop img { width: 100%; height: 100%; object-fit: cover; }
.dish-head { display: grid; grid-template-columns: 76px 1fr; gap: var(--s3); align-items: center; margin-top: 8px; }
.dish-head > img, .dish-head > .lead { width: 76px; height: 76px; border-radius: 16px; object-fit: cover; }
.dish-head > .lead { display: grid; place-items: center; background: var(--surface-2); }
.dish-head > div { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.dish-name { font-weight: 650; font-size: 1rem; width: 100%; resize: none; line-height: 1.3; min-height: 0; }
.dish-thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; }
.dish-big { width: 100%; max-height: 260px; object-fit: cover; border-radius: 16px; margin-bottom: var(--s3); }
.dish-anim { width: 120px; height: 120px; border-radius: 28px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); margin: 0 auto 16px; animation: dishPulse 1.4s ease-in-out infinite; }
.dish-anim img { width: 100%; height: 100%; object-fit: cover; }
@keyframes dishPulse { 50% { transform: scale(.94); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .dish-anim { animation: none; } }
.hyp { margin-top: 12px; }
.hyp ul { margin: 8px 0; padding-left: 18px; display: grid; gap: 4px; font-size: 0.875rem; }
.hyp p { margin: 0; font-size: 0.8125rem; }
.usual { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 46%); gap: var(--s2); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.usual-card { scroll-snap-align: start; display: grid; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 10px; font: inherit; color: var(--ink); cursor: pointer; }
.usual-card img, .usual-card .lead { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }
.usual-card b { font-size: 0.875rem; line-height: 1.25; }
.usual-card span { font-size: 0.78125rem; color: var(--ink-2); }
.cal-d .dots i.out, .cal-legend i.out { background: transparent; box-shadow: inset 0 0 0 1.6px var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- bienvenue, mode, objectifs ---- */
.welcome { max-width: 520px; margin: 0 auto; padding: 24px 0 40px; display: grid; gap: 12px; }
.welcome .logo { margin: 0; }
.welcome .title { margin: 0; }
.welcome .muted { margin: 0 0 8px; }
.mode-card { display: grid; grid-template-columns: 48px 1fr auto; gap: var(--s3); align-items: center; text-align: left; width: 100%; padding: var(--s4); background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; color: var(--ink); font: inherit; cursor: pointer; margin-bottom: 10px; }
.mode-card .lead { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mode-card b { display: block; font-size: 1rem; margin-bottom: 3px; }
.mode-card small { display: block; font-size: 0.84375rem; color: var(--ink-2); line-height: 1.35; }
.mode-card.on { border-color: var(--accent); }
.mode-card:active { transform: scale(.99); }
.choices { display: grid; gap: 8px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.choices.two .choice span, .choices.three .choice span { text-align: center; padding: 12px 6px; }
.choice b { display: block; font-size: 0.9375rem; }
.choice small { display: block; font-size: 0.78125rem; color: var(--ink-2); margin-top: 2px; line-height: 1.3; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fs { border: 0; padding: 0; margin: 4px 0 0; min-width: 0; }
.fs legend { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.goal-card { margin-top: 4px; }
.big-num { font-size: 1.25rem; font-weight: 700; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: 12px; }
.quick-tile { display: grid; gap: 10px; justify-items: start; text-align: left; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font: inherit; cursor: pointer; }
.quick-tile .lead { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.quick-tile b { font-size: 0.90625rem; line-height: 1.25; }
.month-card { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; cursor: pointer; }
.month-card .s { font-size: 0.8125rem; color: var(--ink-2); }

.ins-ios .ins-step { align-items: flex-start; }
.ins-ios .ins-step > div { min-width: 0; flex: 1; }
.ins-shot { display: block; width: 100%; max-width: 360px; margin-top: 10px; border-radius: 12px; background: #111; }

/* ---- Journée : jour par jour ---- */
.day-nav { display: flex; align-items: center; gap: 2px; margin-left: -10px; }
.day-nav .date { margin: 0; }
.day-nav .iconbtn { width: 44px; height: 44px; color: var(--ink-2); }
.day-nav .iconbtn:disabled { opacity: .25; }
.day-back { border: 0; cursor: pointer; margin-top: 8px; padding: 8px 12px; font: inherit; font-size: 0.8125rem; font-weight: 600; }

/* ============================================================ v2 : police, en-tête, barre de saisie, accueil */
@font-face { font-family: Jakarta; src: url(fonts/plus-jakarta-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Jakarta; src: url(fonts/plus-jakarta-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Jakarta; src: url(fonts/plus-jakarta-sans-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
:root { --display: Jakarta, var(--font); --amber: #9A4A06; --amber-soft: #FAE9D3; }
h1, h2, h3, .title2, .state, .big .n, .mo-t, .sec2, .head h2, .sh-t, #sheet h2 { font-family: var(--display); }
.chip { min-height: 44px; } .seg button { min-height: 44px; } .linkbtn { min-height: 44px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* en-tête : marque + bêta, Avis toujours visible, pastille profil */
.top { padding-right: var(--s3); }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.1875rem; letter-spacing: -.4px; color: var(--accent); display: flex; align-items: center; gap: 7px; flex: 1; }
.beta { font-family: var(--font); font-size: 0.65625rem; font-weight: 750; letter-spacing: .6px; text-transform: uppercase; color: var(--amber); background: var(--amber-soft); border-radius: 6px; padding: 3px 6px; }
.top:not(.pushed) h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top.pushed .brand { display: none; } .top.pushed h1 { display: block; }
.top.big h1, .top.big.stuck h1 { opacity: 1; transform: none; }
.avis { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border: 4px solid transparent; background-clip: padding-box; box-shadow: inset 0 0 0 1px var(--line); border-radius: 22px; background-color: var(--surface); color: var(--ink); font: inherit; font-size: 0.875rem; font-weight: 650; cursor: pointer; flex: none; }
.avis svg { width: 16px; height: 16px; color: var(--accent); }
.avis[hidden], .me-btn[hidden] { display: none; }
.me-btn { width: 44px; height: 44px; border-radius: 50%; border: 4px solid transparent; background-clip: padding-box; background-color: var(--accent-soft); color: var(--accent); font: inherit; font-weight: 750; font-size: 0.9375rem; cursor: pointer; flex: none; position: relative; }

/* 4 onglets */
.tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.full .tabs, body.full .dock { display: none !important; }

/* barre de saisie */
body.has-dock { padding-bottom: calc(200px + env(safe-area-inset-bottom)); }
.dock { position: fixed; left: 50%; transform: translateX(-50%); width: min(100%, 560px); z-index: 19; bottom: calc(64px + env(safe-area-inset-bottom));
  padding: 8px 12px 8px; background: linear-gradient(to bottom, transparent, var(--bg) 26%); }
.dock[hidden] { display: none; }
.dock-chips { margin: 0 0 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.dock-chips[hidden] { display: none; }
.dock-chips .chip { background: var(--surface); border: 1px solid var(--line); gap: 6px; }
.dock-chips .chip svg { width: 15px; height: 15px; color: var(--accent); }
.dock-bar { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 6px; background: var(--surface); border-radius: 28px; box-shadow: 0 6px 22px rgba(24,33,29,.10), 0 0 0 1px var(--line); }
.dock-bar input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--ink); outline: none; }
.dock-plus, .dock-send { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.dock-plus { background: var(--surface-2); color: var(--ink); } .dock-send { background: var(--accent); color: var(--accent-ink); }

/* accueil */
.day-nav { display: flex; align-items: center; gap: 0; margin: 2px 0 0 -14px; }
.day-nav .date { font-size: 0.90625rem; font-weight: 600; color: var(--ink-2); } .day-nav .date::first-letter, .sec2::first-letter { text-transform: uppercase; }
.day-nav .iconbtn { color: var(--ink-3); } .day-nav .iconbtn:disabled { opacity: .25; }
.day-back { border: 5px solid transparent; background-clip: padding-box; min-height: 44px; margin-left: auto; padding: 4px 12px; font: inherit; font-size: 0.8125rem; font-weight: 650; cursor: pointer; }
.hero2 { margin-top: 6px; }
.hero2 .eyebrow { font-size: 0.9375rem; font-weight: 600; color: var(--ink-2); }
.big { display: flex; align-items: baseline; gap: 8px; margin-top: -2px; }
.big .n { font-weight: 800; font-size: 5rem; line-height: 1; letter-spacing: -4px; }
.big .u { font-size: 1.3125rem; font-weight: 700; color: var(--ink-2); }
.and { font-size: 1.3125rem; font-weight: 500; margin-top: 2px; } .and b { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--accent); letter-spacing: -.6px; }
.hero2 .bars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.hero2 .bl { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--ink-2); margin-bottom: 5px; } .hero2 .bl b { color: var(--ink); font-weight: 650; }
.tr { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; } .tr i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.hero2 .k .tr i { background: var(--kcal); }
.sec2 { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.125rem; letter-spacing: -.3px; margin: 22px 0 6px; min-height: 44px; }
.sec2 span { font-family: var(--font); font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.tl { display: grid; position: relative; } .tl::before { content: ""; position: absolute; left: 53px; top: 14px; bottom: 14px; width: 1.5px; background: var(--line); }
.tl-r { display: grid; grid-template-columns: 44px 20px minmax(0, 1fr) auto; align-items: center; min-height: 48px; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.tl-r time { font-size: 0.875rem; color: var(--ink-3); font-weight: 600; } .tl-r .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); justify-self: center; z-index: 1; }
.tl-r .dot.out { background: var(--kcal); }
.tl-r b { font-weight: 600; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; } .tl-r span { color: var(--ink-2); font-size: 0.875rem; white-space: nowrap; }
.empty-mini { margin: 0; }
.watch { display: grid; } .w-r { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; min-height: 46px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; padding: 0; cursor: pointer; }
.w-r .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); } .w-r .dot.bad { background: var(--bad); }
.w-r b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .w-r span { color: var(--ink-2); font-size: 0.875rem; }
.moment { margin-top: 16px; border-radius: 22px; } .moment-ai { margin-top: 16px; width: 100%; display: flex; gap: 10px; align-items: center; min-height: 56px; border: 0; font: inherit; color: var(--ink); cursor: pointer; }
.moment-ai svg:first-child { color: var(--accent); } .moment-ai b { flex: 1; text-align: left; }
.mo-eye { display: flex; align-items: center; gap: 7px; font-size: 0.78125rem; font-weight: 750; letter-spacing: .6px; text-transform: uppercase; color: var(--accent); }
.mo-eye .dots { margin-left: auto; display: flex; gap: 5px; } .mo-eye .dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); } .mo-eye .dots i.on { width: 16px; background: var(--accent); }
.mo-t { font-weight: 800; font-size: 1.1875rem; line-height: 1.2; margin-top: 8px; letter-spacing: -.3px; } .mo-m { font-size: 0.875rem; color: var(--ink-2); margin-top: 4px; }
.mo-a { display: flex; gap: 8px; margin-top: 12px; }
.mo-chips { margin-top: 10px; gap: 5px; } .mo-chips .chip { font-size: 0.8125rem; padding: 0 8px; } .idea-card > .mo-chips:first-child, .card > .mo-chips:first-child { margin-top: 0; }
.mo-go { margin-top: 12px; } #idea-box > .card { margin-top: 16px; }
.first { margin-top: 16px; padding: 6px 14px; } .first-h { font-family: var(--display); font-weight: 800; font-size: 1rem; margin: 8px 0 2px; }
.fs-r { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; width: 100%; min-height: 54px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; padding: 0; cursor: pointer; }
.fs-r + .fs-r { border-top: 1px solid var(--line); } .fs-r.ok b { color: var(--ink-3); text-decoration: line-through; } .fs-r b { font-weight: 600; }

/* éléments partagés */
.lead.g { background: var(--accent-soft); color: var(--accent); } .lead.r { background: var(--bad-soft); color: var(--bad); }
.title2 { font-weight: 800; font-size: 2rem; letter-spacing: -1.2px; margin: 4px 0 0; line-height: 1.05; }
.state { font-weight: 800; font-size: 2rem; line-height: 1.08; letter-spacing: -1px; margin: 8px 0 4px; }
.state em { font-style: normal; color: var(--kcal); } .state em.r { color: var(--bad); } .state.small { font-size: 1.625rem; margin-top: 18px; }
.card.list2 { padding: 2px 6px 2px 14px; margin-top: 14px; }
.row2 { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 58px; width: 100%; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; padding: 6px 0; }
.row2 + .row2 { border-top: 1px solid var(--line); } .row2.tap { cursor: pointer; } .row2 > div:only-of-type:not(.lead) { grid-column: 2; }
.row2 b { display: block; font-weight: 650; } .row2 small { display: block; color: var(--ink-2); font-size: 0.875rem; }
.list2 .row2:not(:has(.lead)) { grid-template-columns: minmax(0, 1fr) auto; }
.act { min-height: 40px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--surface-2); font: inherit; font-weight: 650; font-size: 0.875rem; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; position: relative; }
.act::after { content: ""; position: absolute; inset: -4px 0; } .act.g { background: var(--accent-soft); color: var(--accent); } .act svg { width: 15px; height: 15px; }
.card.shop2 { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; margin-top: 14px; }
.ring2 { width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(var(--accent) 0 var(--p), var(--surface-2) 0); display: grid; place-items: center; }
.ring2 span { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 0.8125rem; font-weight: 750; }
.shop2 b { display: block; } .shop2 small { color: var(--ink-2); font-size: 0.875rem; }
.mini { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 8px; padding: 0 6px; border: 0; background: none; font: inherit; color: var(--ink-2); font-size: 0.9375rem; cursor: pointer; }
.mini b { color: var(--ink); } .mini svg:last-child { margin-left: auto; }
.glabel { font-size: 0.78125rem; font-weight: 750; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2); margin: 18px 0 8px; }
.tiles { display: grid; gap: 9px; } .tiles.c2 { grid-template-columns: 1fr 1fr; } .tiles.c3 { grid-template-columns: repeat(3, 1fr); }
.tile.flat { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px; border-radius: 18px; border: 0; background: var(--surface); font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.c3 .tile.flat { flex-direction: column; align-items: flex-start; min-height: 96px; } .tile.flat b { font-weight: 650; font-size: 0.9375rem; line-height: 1.2; }
.tile .ic { width: 40px; height: 40px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }

/* stock : tuiles avec jauge */
.grid2t { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pt { position: relative; min-height: 108px; border-radius: 20px; background: var(--surface); padding: 12px 13px 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.pt .nm { font-weight: 650; font-size: 0.9375rem; line-height: 1.2; } .pt .nm span { font-weight: 400; color: var(--ink-2); }
.pt .bt { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.pt .q { font-family: var(--display); font-weight: 800; font-size: 1.3125rem; letter-spacing: -.6px; } .pt .au { font-size: 0.84375rem; font-weight: 650; color: var(--accent); text-align: right; }
.pt .lvl { position: absolute; left: 13px; right: 13px; bottom: 11px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.pt .lvl::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--l); background: var(--accent); border-radius: 3px; }
.pt.a { background: color-mix(in srgb, var(--kcal-soft) 70%, var(--surface)); } .pt.a .au { color: var(--kcal); } .pt.a .lvl::after { background: var(--kcal); }
.pt.e { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bad); } .pt.e .q, .pt.e .au { color: var(--bad); }

/* ticket */
.okbox { margin-top: 14px; } .okbox summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border-radius: 18px; background: var(--surface); cursor: pointer; list-style: none; }
.okbox summary::-webkit-details-marker { display: none; } .okbox summary svg { color: var(--accent); } .okbox summary span { margin-left: auto; color: var(--accent); font-weight: 650; font-size: 0.875rem; }
.okbox[open] summary { margin-bottom: 8px; }

/* courses : mode magasin */
body.full .wrap { padding-bottom: 120px; }
.mag-top { display: flex; align-items: center; gap: 10px; min-height: 48px; } .mag-top .muted:first-of-type { margin-left: auto; }
.prog2 .n { font-family: var(--display); font-weight: 800; font-size: 3.5rem; letter-spacing: -3px; line-height: 1; } .prog2 .n small { font-size: 1.625rem; color: var(--ink-3); letter-spacing: -1px; }
.prog2 + .tr { margin: 10px 0 4px; }
.aisle2 { font-size: 0.78125rem; font-weight: 750; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2); margin: 18px 0 6px; }
.card.list3 { padding: 0 14px; }
.li2 { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 58px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; padding: 0; cursor: pointer; }
.li2 + .li2 { border-top: 1px solid var(--line); } .li2 b { font-size: 1.09375rem; font-weight: 650; } .li2 .num { font-weight: 700; font-size: 0.96875rem; }
.cb2 { width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--ink-3); } .li2.checking .cb2 { background: var(--accent); border-color: var(--accent); }
.basket2 { margin-top: 16px; } .basket2 summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 16px; background: var(--surface-2); cursor: pointer; list-style: none; }
.basket2 summary::-webkit-details-marker { display: none; } .basket2 p { color: var(--ink-2); margin: 10px 4px; }
.done-all { display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 650; color: var(--accent); margin: 22px 0; }
.mag-foot { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, 560px); padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 30%); z-index: 15; }
.mag-foot .btn { min-height: 54px; border-radius: 17px; font-size: 1.03125rem; }

/* Fiche repas : détail des produits, stock consommé, répartition du coût */
.kv-tap { font: inherit; color: inherit; background: none; border: 0; padding: 0; border-radius: 10px; cursor: pointer; }
.kv-tap.on { background: var(--surface); }
.mdl { list-style: none; margin: 0 0 var(--s4); padding: 0; }
.mdl li { display: flex; gap: var(--s3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mdl li:last-child { border-bottom: 0; }
.mdl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mdl-t span { font-size: 0.875rem; color: var(--ink-2); }
.mdl-t small { font-size: 0.8125rem; color: var(--ink-3); }
.mdl-c { display: none; flex: none; width: 76px; text-align: right; font-weight: 600; }
.mdl-c small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--ink-3); }
.mdl-c i { display: block; height: 4px; border-radius: 2px; background: var(--accent); margin: 4px 0 0 auto; }
.show-cost .mdl-c { display: block; }

/* Demande d'accord (au-dessus de tout, y compris du scanner) */
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center;
  padding: var(--s4) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); }
.modal-card { background: var(--surface); color: var(--ink); border-radius: 20px; padding: var(--s5); width: 100%; max-width: 480px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.modal-card h2 { margin: 0 0 var(--s2); font-size: 1.25rem; }
.modal-card p { margin: 0 0 var(--s3); }
.modal-card a { color: var(--accent); font-weight: 600; }

/* Présentation : en-tête avec connexion, écrans de démonstration */
.pitch-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.pitch-top .logo { margin: 0; }
.pitch-shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; margin: 0 0 12px; scrollbar-width: none; }
.pitch-shots::-webkit-scrollbar { display: none; }
.pitch-shots img { flex: none; width: min(62%, 230px); height: auto; border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, .08); scroll-snap-align: start; background: var(--surface); }
.pitch-chips { margin: 0; flex-wrap: wrap; }
.pitch-chips .chip { cursor: default; background: var(--surface); border: 1px solid var(--line); }

/* Accueil « stock seulement » */
.day-nav.solo { margin-left: 0; }
.state-sub { margin: 0 0 6px; color: var(--ink-2); font-size: 0.9375rem; }
.state-sub .linkbtn { padding: 0; min-height: 44px; font-size: 0.9375rem; }
.tiles.start3 { margin-top: 14px; }

/* Interrupteur (case « Essentiel ») */
.sw { position: relative; display: inline-block; width: 52px; height: 32px; flex: none; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sw span { position: absolute; inset: 0; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--field-line); transition: background-color .15s; pointer-events: none; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.sw input:checked + span { background: var(--accent); border-color: var(--accent); }
.sw input:checked + span::after { transform: translateX(20px); }
.sw input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================ accessibilité et petits écrans */
/* Appli iPhone : la taille du texte suit le réglage du téléphone (1rem reste 16px au réglage par défaut, voir app.js). */
html.shell { font: -apple-system-body; }
html.shell .beta { display: none; }
/* Anneau de focus lisible en clair comme en sombre ; pas d'anneau sur les titres qui reçoivent le focus par programme. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.dock-bar:focus-within { box-shadow: 0 6px 22px rgba(24,33,29,.10), 0 0 0 2px var(--accent); }
.dock-bar input:focus-visible { outline: none; }
/* Barre du bas : les puces se replient au défilement vers le bas (et d'office sur un écran bas). */
.dock.chips-off .dock-chips { display: none; }
/* Feuille du bas au-dessus du clavier (--kb : hauteur du clavier, posée par app.js). */
.sheet { bottom: var(--kb, 0px); }
/* Titres de feuille : 3 lignes au plus, le reste au toucher. */
.sheet h2.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; cursor: pointer; }
.sheet h2.clamp.open { display: block; }
/* Courses : la ligne entière est une case à cocher. */
.row.cbrow { padding: 0; }
.cbrow .cbtn { display: flex; align-items: center; gap: var(--s3); flex: 1; min-width: 0; min-height: 60px; padding: var(--s3) var(--s4); border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cbrow .cbtn:active { background: var(--surface-2); }
.cbrow .cbtn:focus-visible, .row[role="button"]:focus-visible { outline-offset: -3px; border-radius: 12px; }
.cbtn .main, .cbtn .s { display: block; }
.cbrow > .iconbtn { margin-right: var(--s2); }
.cbrow .t { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
/* Présentation et connexion : langues */
.lang-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0 0; }
.lang-row .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pitch-where { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }
/* Texte agrandi ou zoom : l'en-tête et les onglets tiennent sur la largeur. */
.brand { min-width: 0; }
.tabs button { overflow-wrap: anywhere; text-align: center; line-height: 1.15; }
@media (max-width: 300px) {
  .avis span { display: none; }
  .avis { padding: 0 10px; }
  .brand { font-size: 1rem; gap: 4px; }
  .top { padding-left: var(--s3); gap: var(--s1); }
  .tabs button svg { padding: 3px 0; width: 100%; }
  .big .n { letter-spacing: -2px; }
  .tl-r b { white-space: normal; }
  .head.with-ring { flex-wrap: wrap; }
}
/* En-tête trop étroit (texte agrandi) : « Avis » se réduit à son icône, puis la pastille bêta se cache. */
.top.tight .avis span { display: none; }
.top.tight .avis { padding: 0 10px; }
.top.tight2 .beta { display: none; }
/* Grilles qui rétrécissent avec le texte agrandi ou le zoom. */
.grid2t { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pt .nm, .fs-r b, .row2 b, .tile.flat b, .w-r b { overflow-wrap: anywhere; }
.pt .bt { flex-wrap: wrap; } .pt .q { white-space: nowrap; }
.fs-r { grid-template-columns: 36px minmax(0, 1fr) auto; }
.hero2 .big { flex-wrap: wrap; } .big .n { font-size: min(5rem, 25vw); }
/* En-tête : boutons de 44 px, hauteur totale inchangée (56 px). */
.top, .top.big { align-items: center; margin-top: 0; padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
.hero2, #s-list { container-type: inline-size; }
@container (max-width: 17em) {
  .hero2 .bars, .grid2t { grid-template-columns: 1fr; }
}
/* Boutons de la carte du moment : passent à la ligne quand la place manque. */
.mo-a, .idea-actions { flex-wrap: wrap; }
.mo-a .btn, .idea-actions .btn { flex: 1 1 auto; }
/* Le fond en dégradé de la barre de saisie laisse passer les touchers. */
.dock { pointer-events: none; } .dock > * { pointer-events: auto; }
/* La barre de saisie se pose juste au-dessus des onglets, quelle que soit leur hauteur (texte agrandi) : --tabs-h vient d'app.js. */
.dock { bottom: var(--tabs-h, calc(64px + env(safe-area-inset-bottom))); }
/* Écran bas (iPhone SE…) : barres du bas plus compactes, cibles toujours de 44 px au moins. */
@media (max-height: 699px) {
  .tabs { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .tabs button { min-height: 46px; gap: 1px; }
  .dock { padding-bottom: 4px; bottom: var(--tabs-h, calc(55px + env(safe-area-inset-bottom))); }
}

/* Fini / Jeté côte à côte (accueil du mode stock) ; pesée dans Suivi. */
.acts { display: flex; gap: 6px; }
.card.wcard { margin-top: 14px; }
.w-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.w-top b { font-weight: 650; } .w-top .num { font-size: 1.25rem; font-weight: 700; }
.wcurve { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.wcurve polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wcurve circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.wcurve .base { stroke: var(--line); stroke-width: 1; }
.wcurve text { fill: var(--ink-2); font-size: 0.6875rem; font-variant-numeric: tabular-nums; }
.w-in { display: flex; gap: var(--s2); margin-top: 10px; }
.w-in .unitbox { flex: 1; min-width: 0; } .w-in .btn { flex: none; width: auto; }
.list2 .row2:not(:has(.lead)) > div:only-of-type { grid-column: 1; }   /* ligne sans pastille (Comptes → Usage) : le texte reste à gauche */
