:root {
  --bg: #EEF2EC;
  --card: #FFFFFF;
  --card-border: rgba(255, 255, 255, .7);
  --shadow: 0 1px 2px rgba(24, 48, 32, .05), 0 8px 24px -10px rgba(24, 64, 40, .18);
  --glow1: rgba(52, 199, 89, .28);
  --glow2: rgba(255, 179, 64, .22);
  --glow3: rgba(191, 90, 242, .16);
  --glow4: rgba(10, 132, 255, .16);
  --card-press: #E5E5EA;
  --text: #000000;
  --text2: rgba(60, 60, 67, .6);
  --text3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .2);
  --fill: rgba(118, 118, 128, .12);
  --fill2: rgba(118, 118, 128, .08);
  --accent: #1F8A3B;
  --accent-fill: #34C759;
  --accent-tint: rgba(52, 199, 89, .14);
  --red: #FF3B30;
  --bar: rgba(255, 255, 255, .72);
  --sheet-bg: #F2F2F7;
  --alert-bg: rgba(242, 242, 242, .9);
  --toast-bg: rgba(30, 30, 32, .94);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07090A;
    --card: #1C1C1E;
    --card-border: rgba(255, 255, 255, .06);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .8);
    --glow1: rgba(48, 209, 88, .20);
    --glow2: rgba(255, 159, 10, .10);
    --glow3: rgba(191, 90, 242, .14);
    --glow4: rgba(10, 132, 255, .12);
    --card-press: #2C2C2E;
    --text: #FFFFFF;
    --text2: rgba(235, 235, 245, .6);
    --text3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .55);
    --fill: rgba(118, 118, 128, .24);
    --fill2: rgba(118, 118, 128, .16);
    --accent: #30D158;
    --accent-fill: #30D158;
    --accent-tint: rgba(48, 209, 88, .16);
    --red: #FF453A;
    --bar: rgba(30, 30, 32, .72);
    --sheet-bg: #1C1C1E;
    --alert-bg: rgba(40, 40, 42, .92);
    --toast-bg: rgba(58, 58, 60, .96);
  }
  .sheet .group, .sheet .field-group { background: #2C2C2E; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.29 var(--font);
  letter-spacing: -.41px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
/* fond : dégradés doux qui restent en place au défilement */
body::before {
  content: ""; position: fixed; inset: -10vh -10vw; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 38% at 8% 2%, var(--glow1), transparent 70%),
    radial-gradient(45% 32% at 100% 12%, var(--glow2), transparent 70%),
    radial-gradient(55% 40% at 95% 92%, var(--glow3), transparent 70%),
    radial-gradient(50% 38% at 0% 75%, var(--glow4), transparent 70%),
    var(--bg);
}
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
svg { display: block; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }
.hidden { display: none !important; }

/* ---------- barre du haut (titre compact au défilement) ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: calc(44px + var(--safe-t)); padding-top: var(--safe-t);
  display: flex; align-items: center; justify-content: center;
  background: transparent; transition: background .2s, box-shadow .2s;
  pointer-events: none;
}
.topbar .tb-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; }
.topbar.scrolled {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--sep);
}
.topbar.scrolled .tb-title { opacity: 1; }

main { padding: calc(var(--safe-t) + 44px) 0 calc(var(--safe-b) + 110px); max-width: 680px; margin: 0 auto; }
.tab { display: none; padding: 0 16px; }
.tab.active { display: block; animation: fadeIn .18s ease-out; }
@keyframes fadeIn { from { opacity: .4; } to { opacity: 1; } }

.large-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 2px 4px 8px; }
.large-title { font: 700 clamp(26px, 7.4vw, 34px)/1.2 var(--font-display); letter-spacing: .2px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtitle { color: var(--text2); font-size: 15px; margin: -2px 4px 14px; letter-spacing: -.24px; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; flex: none; margin-bottom: 4px;
  color: #fff; font-weight: 600; font-size: 16px; display: grid; place-items: center;
  background: var(--c, #8E8E93); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--fill); }
.avatar-btn:active { opacity: .7; }

/* ---------- groupes façon Réglages ---------- */
.sec-head { font-size: 13px; text-transform: uppercase; letter-spacing: -.08px; color: var(--text2);
  margin: 22px 16px 7px; display: flex; align-items: center; gap: 8px; }
.sec-head .num { font-variant-numeric: tabular-nums; min-width: 20px; height: 20px; border-radius: 7px;
  background: var(--cc, var(--fill)); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid;
  place-items: center; padding: 0 5px; box-shadow: 0 2px 6px -2px var(--cc, transparent); }
.sec-head .lbl { color: var(--text); opacity: .62; font-weight: 600; }
.sec-hint { font-size: 13px; color: var(--text2); margin: -2px 16px 8px; letter-spacing: -.08px; }
.sec-head .count { margin-left: auto; text-transform: none; }
.group { background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border: .5px solid var(--card-border); }
.sheet .group { box-shadow: none; border: 0; border-radius: 12px; }
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--inset, 16px); height: .5px; background: var(--sep); }
.row .body { flex: 1; min-width: 0; padding: 11px 0; cursor: pointer; }
.row .name { overflow-wrap: anywhere; }
.row .meta { font-size: 13px; color: var(--text2); margin-top: 2px; display: flex; align-items: center; gap: 5px; letter-spacing: -.08px; }
.row .meta .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.row.tap:active, .row .body:active { background: transparent; }
.row.pressable:active { background: var(--card-press); }
.qty { flex: none; font-size: 15px; color: var(--text2); background: var(--fill2); border-radius: 8px; padding: 2px 8px; font-variant-numeric: tabular-nums; }

/* article de la liste */
.item { --inset: 52px; transition: opacity .25s; }
.check { flex: none; width: 26px; height: 26px; border-radius: 50%; position: relative;
  border: 2px solid var(--c, var(--text3)); display: grid; place-items: center; transition: background .18s, border-color .18s, transform .12s; }
.check::after { content: ""; position: absolute; inset: -10px; }
.check:active { transform: scale(.88); }
.check .ic { width: 15px; height: 15px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.item.checked .check { background: var(--accent-fill); border-color: var(--accent-fill); }
.item.checked .check .ic { opacity: 1; transform: none; }
.item.checked .name { color: var(--text2); text-decoration: line-through; text-decoration-color: var(--text3); }
.item.leaving { overflow: hidden; transition: height .28s ease, opacity .2s, min-height .28s ease; opacity: 0; }
.who { font-weight: 500; }
.item .meta .rec-tag { color: var(--text2); }

/* résumé en haut de la liste */
.summary { display: flex; align-items: center; gap: 16px; padding: 16px 18px; color: #fff; position: relative; overflow: hidden; border: 0;
  background: linear-gradient(135deg, #3DD36B 0%, #1DB954 45%, #0E9A6A 100%);
  box-shadow: 0 14px 30px -14px rgba(18, 150, 80, .75), 0 2px 4px rgba(18, 120, 60, .15); }
.summary::after { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%); pointer-events: none; }
.ring { width: 62px; height: 62px; flex: none; position: relative; }
.ring svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.ring .bgc { stroke: rgba(255,255,255,.25); }
.ring .fgc { stroke: #fff; transition: stroke-dashoffset .5s ease; }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font: 700 21px var(--font-display); font-variant-numeric: tabular-nums; }
.summary h2 { margin: 0; font: 700 18px var(--font-display); letter-spacing: -.2px; }
.summary p { margin: 2px 0 0; font-size: 14px; color: rgba(255,255,255,.85); letter-spacing: -.15px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; position: relative; z-index: 1; }
.pchip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #fff; background: rgba(255,255,255,.2); border-radius: 20px; padding: 3px 9px 3px 4px; letter-spacing: -.08px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pchip .dot { box-shadow: 0 0 0 1.5px rgba(255,255,255,.9); }
.dot { width: 16px; height: 16px; border-radius: 50%; background: var(--c); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; letter-spacing: 0; }

.empty { text-align: center; padding: 56px 24px 24px; color: var(--text2); }
.empty .art { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 26px; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; }
.empty .art .ic { width: 50px; height: 50px; stroke-width: 1.6; }
.empty h3 { color: var(--text); font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 280px; font-size: 15px; }

/* ---------- boutons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; border-radius: 12px; font-weight: 600; font-size: 17px; transition: opacity .15s, transform .1s; }
.btn:active { opacity: .75; transform: scale(.985); }
.btn-primary { background: linear-gradient(180deg, #3FD46E, #22B455); color: #fff; box-shadow: 0 8px 18px -10px rgba(20, 160, 70, .9), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-tinted { background: var(--accent-tint); color: var(--accent); }
.btn-plain { color: var(--accent); }
.btn.sm { min-height: 36px; font-size: 15px; border-radius: 18px; width: auto; padding: 0 16px; }
.btn[disabled] { opacity: .4; }
.link { color: var(--accent); font-size: 17px; padding: 8px 0; }
.link.strong { font-weight: 600; }
.row-btn { width: 100%; text-align: left; color: var(--accent); min-height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 10px; position: relative; }
.row-btn:active { background: var(--card-press); }
.row-btn + .row-btn::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--sep); }
.row-btn.danger { color: var(--red); }
.row-btn .ic { width: 20px; height: 20px; }

/* ---------- ajouter ---------- */
.add-card { background: var(--card); border-radius: 20px; padding: 6px; position: relative; box-shadow: var(--shadow); border: .5px solid var(--card-border); }
.fix { display: flex; align-items: center; gap: 8px; margin: -2px 12px 8px; font-size: 14px; letter-spacing: -.15px; flex-wrap: wrap; }
.fix:empty { display: none; }
.fix .fix-txt { color: var(--text2); }
.fix .fix-txt b { color: var(--text); font-weight: 600; }
.fix button { color: var(--accent); font-size: 14px; margin-left: auto; }
.spark.sm { width: 20px; height: 20px; border-radius: 6px; }
.spark.sm .ic { width: 12px; height: 12px; }
.add-input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 20px; padding: 14px 12px 10px; letter-spacing: -.45px; }
.add-input::placeholder { color: var(--text3); }
.add-opts { display: flex; gap: 8px; padding: 2px 6px 10px; flex-wrap: wrap; }
.pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--fill2); color: var(--text); font-size: 15px; letter-spacing: -.24px; max-width: 100%; }
.pill .ic { width: 16px; height: 16px; color: var(--text2); flex: none; }
.pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill select { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; -webkit-appearance: none; appearance: none; }
.pill.auto { background: var(--accent-tint); }
.pill.auto .ic { color: var(--accent); }
.qty-input { width: 112px; height: 34px; border: 0; outline: 0; border-radius: 17px; background: var(--fill2); padding: 0 12px; font-size: 16px; }
.qty-input::placeholder { color: var(--text2); }
.add-card .btn { margin: 0; }
.ac { margin: 0 6px 6px; border-radius: 10px; overflow: hidden; background: var(--fill2); }
.ac:empty { display: none; }
.ac button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 10px 12px; font-size: 16px; position: relative; }
.ac button + button::before { content: ""; position: absolute; top: 0; left: 12px; right: 0; height: .5px; background: var(--sep); }
.ac button:active { background: var(--fill); }
.ac small { color: var(--text2); font-size: 13px; white-space: nowrap; }
.ac b { font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border-radius: 18px; background: var(--card); font-size: 15px; letter-spacing: -.24px; transition: transform .1s, background .15s; box-shadow: var(--shadow); border: .5px solid var(--card-border); }
.chip .ic { width: 16px; height: 16px; color: var(--accent); stroke-width: 2.6; }
.chip:active { transform: scale(.95); background: var(--card-press); }
.chip.added { background: var(--accent-tint); color: var(--accent); }
.hint { color: var(--text2); font-size: 13px; margin: 8px 16px 0; letter-spacing: -.08px; line-height: 1.38; }
.del-btn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text2); flex: none; }
.del-btn:active { background: var(--fill); }
.del-btn .ic { width: 16px; height: 16px; stroke-width: 2.4; }

/* ---------- chaque semaine ---------- */
.lead { color: var(--text2); font-size: 15px; margin: -2px 4px 16px; letter-spacing: -.24px; line-height: 1.4; }
.lead b { color: var(--text); font-weight: 600; }
.rec { --inset: 16px; }
.rec.paused .name { color: var(--text2); }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 1px 6px; letter-spacing: 0; }
.badge.on { background: var(--accent-tint); color: var(--accent); }
.badge.off { background: var(--fill); color: var(--text2); }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .25s cubic-bezier(.3, .7, .4, 1.1); }
.switch input:checked + span { background: var(--accent-fill); }
.switch input:checked + span::after { transform: translateX(20px); }

.ai-card { position: relative; border-radius: 18px; padding: 14px 16px 14px; margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); border: .5px solid var(--card-border);
  background: linear-gradient(135deg, rgba(10,132,255,.10), rgba(191,90,242,.12) 55%, rgba(255,55,95,.10)), var(--card); }
.ai-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); margin-bottom: 6px; letter-spacing: -.08px; }
.ai-head b { color: var(--text); font-size: 15px; letter-spacing: -.24px; }
.spark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #0A84FF, #BF5AF2 60%, #FF375F); flex: none; }
.spark .ic { width: 16px; height: 16px; }
.ai-card p { margin: 0 0 12px; font-size: 16px; line-height: 1.38; letter-spacing: -.32px; }
.ai-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-actions .link { font-size: 15px; margin-left: auto; color: var(--text2); }

/* ---------- barre d'onglets ---------- */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 28px)); z-index: 30; display: flex; justify-content: space-around;
  bottom: max(12px, calc(var(--safe-b) - 10px)); height: 62px; padding: 0 6px; border-radius: 31px; background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border: .5px solid var(--card-border); box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .28), 0 1px 3px rgba(0, 0, 0, .06); }
.tabbar button { border-radius: 26px; margin: 5px 0; transition: background .2s, color .2s; }
.tabbar button.active { background: var(--accent-tint); }
.tabbar button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #8E8E93; font-size: 10px; font-weight: 500; letter-spacing: .1px; position: relative; padding-top: 2px; }
.tabbar button .ic { width: 26px; height: 26px; stroke-width: 1.9; }
.tabbar button.active { color: var(--accent); }
.tabbar button.active .ic { stroke-width: 2.3; }
.tabbar .badge-n { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; letter-spacing: 0; }
.tabbar .badge-n:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 4px; left: calc(50% + 9px); }

/* ---------- feuilles (sheets) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.32); opacity: 0; transition: opacity .25s; }
.backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 680px; margin: 0 auto; max-height: calc(100vh - var(--safe-t) - 24px);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--sheet-bg); border-radius: 13px 13px 0 0; padding: 0 16px calc(var(--safe-b) + 20px);
  transform: translateY(100%); transition: transform .34s cubic-bezier(.2, .9, .25, 1); box-shadow: 0 -10px 40px rgba(0,0,0,.15); }
.sheet.show { transform: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--text3); margin: 6px auto 0; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; margin: 0 -16px 8px; padding: 0 16px; background: var(--sheet-bg); }
.sheet-head b { font-weight: 600; font-size: 17px; text-align: center; }
.sheet-head .left { justify-self: start; }
.sheet-head .right { justify-self: end; }
.sheet .group { margin-bottom: 22px; }
.sheet .sec-head { margin-top: 0; }
.field { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--sep); }
.field > span { flex: none; width: 96px; color: var(--text); }
.field input, .field select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; text-align: right; padding: 12px 0; color: var(--text2); -webkit-appearance: none; appearance: none; }
.field input:focus { color: var(--text); }
.field select { direction: rtl; text-align-last: right; cursor: pointer; }
.field select option { direction: ltr; }
.field .chev { width: 14px; height: 14px; color: var(--text3); stroke-width: 2.6; flex: none; margin-left: -6px; }
.field.toggle span { flex: 1; width: auto; }
.foot { color: var(--text2); font-size: 13px; margin: -14px 16px 22px; letter-spacing: -.08px; }
.foot b { font-weight: 600; }

.profile-top { text-align: center; padding: 8px 0 22px; }
.profile-top .big { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 10px; background: var(--c); color: #fff; font: 600 34px var(--font-display); display: grid; place-items: center; }
.profile-top h2 { margin: 0; font: 700 24px var(--font-display); }
.profile-top p { margin: 4px 0 0; color: var(--text2); font-size: 15px; }

/* ---------- alerte façon iOS ---------- */
.alert-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.3); opacity: 0; transition: opacity .2s; }
.alert-wrap.show { opacity: 1; }
.alert { width: 290px; border-radius: 16px; overflow: hidden; text-align: center; background: var(--alert-bg);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); transform: scale(1.12); transition: transform .25s cubic-bezier(.2, .9, .3, 1.2); }
.alert-wrap.show .alert { transform: none; }
.alert .a-body { padding: 20px 16px 16px; }
.alert .spark { width: 44px; height: 44px; border-radius: 13px; margin: 0 auto 10px; }
.alert .spark .ic { width: 24px; height: 24px; }
.alert h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.alert p { margin: 0; font-size: 13px; line-height: 1.38; letter-spacing: -.08px; }
.alert button { display: block; width: 100%; min-height: 44px; font-size: 17px; color: var(--accent); border-top: .5px solid var(--sep); }
.alert button.strong { font-weight: 600; }
.alert button.muted { color: var(--text2); }
.alert button:active { background: var(--fill); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(max(12px, calc(var(--safe-b) - 10px)) + 74px); z-index: 70; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 14px; background: var(--toast-bg); color: #fff; font-size: 15px; letter-spacing: -.24px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25); transition: opacity .2s, transform .25s cubic-bezier(.2, .9, .3, 1.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { color: #6FE38E; font-weight: 600; flex: none; }

.offline { position: fixed; top: calc(var(--safe-t) + 50px); left: 50%; transform: translateX(-50%); z-index: 40; background: var(--toast-bg); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 14px; display: none; }
.offline.show { display: block; }

/* ---------- connexion ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px); text-align: center; }
.login .logo { width: 92px; height: 92px; border-radius: 22px; box-shadow: 0 10px 30px rgba(52,199,89,.35); margin-bottom: 18px; }
.login h1 { font: 700 30px var(--font-display); margin: 0; letter-spacing: .3px; }
.login .sub { color: var(--text2); margin: 6px 0 30px; font-size: 16px; }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 340px; }
.who-btn { background: var(--card); box-shadow: var(--shadow); border: .5px solid var(--card-border); border-radius: 20px; padding: 18px 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; transition: transform .1s; }
.who-btn:active { transform: scale(.96); }
.who-btn .av { width: 56px; height: 56px; border-radius: 50%; background: var(--c); color: #fff; font: 600 24px var(--font-display); display: grid; place-items: center; }
.pw-box { width: 100%; max-width: 340px; }
.pw-box .av { width: 72px; height: 72px; border-radius: 50%; background: var(--c); color: #fff; font: 600 30px var(--font-display); display: grid; place-items: center; margin: 0 auto 10px; }
.pw-box h2 { margin: 0 0 18px; font-size: 22px; }
.pw-input { width: 100%; height: 50px; border-radius: 14px; border: 0; outline: 0; background: var(--card); box-shadow: var(--shadow); padding: 0 16px; font-size: 17px; margin-bottom: 12px; text-align: center; }
.pw-err { color: var(--red); font-size: 14px; min-height: 20px; margin: -4px 0 8px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }


