:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --text: #16201d;
  --muted: #5b6863;
  --line: #dde3e0;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --danger: #b42318; --danger-bg: #fdecea;
  --warn: #9a5b00;   --warn-bg: #fff4de;
  --ok: #1d7a3e;     --ok-bg: #e7f6ec;
  --unk: #4a5560;    --unk-bg: #eceff2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1413; --surface: #171e1c; --surface-2: #1f2826; --text: #e8eeec; --muted: #9aa8a3; --line: #2b3633;
    --brand: #2dd4bf; --brand-ink: #062522;
    --danger: #ff8a80; --danger-bg: #3a1614; --warn: #ffc163; --warn-bg: #362710;
    --ok: #6ee7a0; --ok-bg: #12301f; --unk: #b8c2cc; --unk-bg: #232a31;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
h1 { font-size: 1.4rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .3rem; }
p { margin: .4rem 0; }
a { color: var(--brand); }
.muted { color: var(--muted); font-size: .92rem; }
.small { font-size: .85rem; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; display: flex; gap: 8px; align-items: center; }
#view { max-width: 720px; margin: 0 auto; padding: 16px; outline: none; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px;
  text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; text-align: center; line-height: 1.15;
}
.tabbar a span { font-size: 1.35rem; line-height: 1.2; }
.tabbar a[aria-current="page"] { color: var(--brand); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

button, .btn {
  font: inherit; font-weight: 600; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); padding: 11px 16px; cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--danger); }
button.block { width: 100%; }
button:disabled { opacity: .5; cursor: default; }
.chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; font-size: .9rem; background: var(--surface-2); }

input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), textarea, select {
  font: inherit; font-weight: 400; width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
label.field { display: block; font-weight: 600; font-size: .92rem; }
label.field > input, label.field > textarea, label.field > select { margin-top: 4px; font-weight: 400; }

/* Grille d'allergènes */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.aitem { position: relative; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); cursor: pointer; display: flex; gap: 8px; align-items: flex-start; min-height: 56px; }
.aitem input { position: absolute; opacity: 0; pointer-events: none; }
.aitem .em { font-size: 1.3rem; line-height: 1.2; }
.aitem .lb { font-size: .9rem; font-weight: 600; }
.aitem.on { border-color: var(--danger); background: var(--danger-bg); }
.aitem:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.sevtoggle { margin-top: 6px; font-size: .78rem; padding: 4px 8px; min-height: 28px; border-radius: 999px; }
.sevtoggle.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.trtoggle { margin-top: 6px; font-size: .78rem; padding: 4px 8px; min-height: 28px; border-radius: 999px; }
.trtoggle.on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--surface-2); }
.pill.sev { background: var(--danger); color: #fff; }

/* Scanner */
#reader { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; background: #000; display: none; }
#reader.on { display: block; aspect-ratio: 4 / 3; }
#reader video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 5%; right: 5%; top: 25%; bottom: 25%; border: 3px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
.scan-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; animation: scanpulse 1.4s ease-in-out infinite; }
@keyframes scanpulse { 50% { opacity: .35; } }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.verdict { border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border: 2px solid; }
.verdict .big { font-size: 1.25rem; font-weight: 800; display: flex; gap: 10px; align-items: center; }
.verdict.danger { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.verdict.traces { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.verdict.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.verdict.unknown { background: var(--unk-bg); border-color: var(--unk); color: var(--unk); }
.verdict ul { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--text); }
.product { display: flex; gap: 12px; align-items: flex-start; }
.product img { width: 72px; height: 72px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
mark { background: var(--danger); color: #fff; border-radius: 3px; padding: 0 2px; }
.ingredients { font-size: .92rem; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.danger { background: var(--danger); } .dot.traces { background: var(--warn); } .dot.ok { background: var(--ok); } .dot.unknown { background: var(--unk); }

/* Restaurants */
#map { height: 260px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 12px; z-index: 0; }
.resto { display: flex; gap: 12px; align-items: flex-start; }
.resto .dist { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.status-safe { color: var(--ok); } .status-careful { color: var(--warn); } .status-avoid { color: var(--danger); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button.on[data-v="safe"] { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.seg button.on[data-v="careful"] { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.seg button.on[data-v="avoid"] { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.tabs2 button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* Carte allergie */
.acard { background: #fff; color: #111; border: 3px solid #b42318; border-radius: 18px; padding: 20px; }
.acard h2 { margin-top: 0; color: #b42318; font-size: 1.3rem; }
.acard .who { font-size: 1.1rem; font-weight: 700; }
.acard ul.al { list-style: none; padding: 0; margin: 12px 0; }
.acard ul.al li { font-size: 1.15rem; font-weight: 700; padding: 8px 0; border-bottom: 1px dashed #ddd; display: flex; justify-content: space-between; gap: 8px; }
.acard .tag { background: #b42318; color: #fff; border-radius: 6px; font-size: .75rem; padding: 2px 6px; align-self: center; }
.acard .emerg { background: #fdecea; border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-weight: 600; }
.acard ol { padding-left: 1.2rem; }
.fullscreen-card { position: fixed; inset: 0; z-index: 100; background: #fff; overflow: auto; padding: 16px; }
.fullscreen-card .acard { font-size: 1.1rem; max-width: 720px; margin: 0 auto; }

.notice { background: var(--warn-bg); color: var(--text); border-left: 4px solid var(--warn); padding: 10px 12px; border-radius: 8px; font-size: .9rem; }
.empty { text-align: center; padding: 28px 12px; }
.empty .em { font-size: 2.6rem; }

#toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; opacity: 0; transition: .2s; pointer-events: none; z-index: 200; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

dialog { border: none; border-radius: 18px; padding: 0; width: min(560px, calc(100% - 24px)); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .dlg { padding: 18px; }

@media print {
  .topbar, .tabbar, .noprint { display: none !important; }
  body { padding: 0; background: #fff; }
  .acard { break-inside: avoid; }
}

/* ---------- Espace restaurateurs & page publique ---------- */
body.pro { padding-bottom: 24px; }
.pro-main { max-width: 820px; }
.demo-banner { background: var(--warn-bg); color: var(--text); text-align: center; font-size: .85rem; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.hero { padding: 12px 0; }
.hero h1 { font-size: 1.7rem; line-height: 1.2; }
.checks { padding-left: 0; list-style: none; }
.checks li { padding: 6px 0 6px 28px; position: relative; }
.checks li::before { content: '✓'; position: absolute; left: 4px; color: var(--ok); font-weight: 800; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.partner { background: var(--brand); color: var(--brand-ink); }
.tabs3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.tabs3 button { padding: 10px 6px; font-size: .9rem; }
.tabs3 button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.dish h3 { margin: 0; }
.dish.off { opacity: .6; }
.al-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.al-chip { display: inline-flex; gap: 4px; align-items: center; font-size: .8rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); }
.al-chip.contains { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.al-chip.traces { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.al-chip.removable { background: var(--surface-2); color: var(--text); }
.chip.danger { color: var(--danger); }
.al-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 6px; }
.al-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.al-row:last-child { border-bottom: none; }
.al-name { flex: 1 1 180px; font-size: .9rem; font-weight: 600; }
.seg4 { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; }
.seg4 button { min-height: 36px; padding: 4px 9px; font-size: .8rem; border-radius: 8px; }
.seg4 button.on[data-v=""] { background: var(--surface-2); border-color: var(--muted); }
.seg4 button.on[data-v="contains"] { background: var(--danger); color: #fff; border-color: var(--danger); }
.seg4 button.on[data-v="traces"] { background: var(--warn); color: #fff; border-color: var(--warn); }
.seg4 button.on[data-v="removable"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dish.v-ok { border-left: 5px solid var(--ok); }
.dish.v-adaptable { border-left: 5px solid var(--brand); }
.dish.v-traces { border-left: 5px solid var(--warn); }
.dish.v-no { border-left: 5px solid var(--danger); opacity: .75; }
.verdict-line { margin: 6px 0 0; font-size: .92rem; }
.poster { background: #fff; color: #111; border: 2px dashed #bbb; border-radius: 16px; padding: 24px; text-align: center; max-width: 420px; margin: 16px auto 0; }
.poster .qr svg { width: 230px; height: 230px; }
.poster .p-top { font-size: 1.4rem; font-weight: 800; color: #b42318; margin: 0 0 10px; }
.poster .p-main { font-size: 1.1rem; }
.poster .p-name { font-weight: 700; margin-top: 12px; }
.poster .p-foot { color: #0f766e; font-weight: 700; font-size: .85rem; }
@media print {
  body.print-poster * { visibility: hidden; }
  body.print-poster .poster, body.print-poster .poster * { visibility: visible; }
  body.print-poster .poster { position: absolute; left: 0; right: 0; top: 0; border: none; }
  .demo-banner { display: none; }
}
label.row { flex-wrap: nowrap; align-items: flex-start; }
label.row > input[type=checkbox] { flex: none; width: 20px; height: 20px; margin-top: 2px; }
@media (max-width: 520px) { #who .muted { display: none; } }
.pw { display: flex; gap: 6px; margin-top: 4px; }
.pw input { flex: 1; }
.pw .chip { min-height: 44px; }
dialog .tabs2 button { font-size: .9rem; padding: 10px 6px; }

input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.version { text-align: center; color: var(--muted); font-size: .75rem; margin: 24px 0 8px; }
label.field input:not([type=checkbox]), label.field textarea, label.field select { font-weight: 400; }
label.field .pw { font-weight: 400; }

/* ---------- Administration (v10) ---------- */
.admin-main { max-width: 900px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 1.5rem; }
.stats span { font-size: .78rem; color: var(--muted); }
.stats .hot { border-color: var(--warn); background: var(--warn-bg); }
.tabs4 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0; }
.tabs4 button { padding: 10px 4px; font-size: .85rem; }
.tabs4 button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pill.off { background: var(--surface-2); color: var(--muted); }
.pill.code { background: #fff4de; color: #7a4a00; font-family: ui-monospace, monospace; }
a.chip.btn { text-decoration: none; }
table.kv { border-collapse: collapse; width: 100%; font-size: .9rem; margin: 8px 0; }
table.kv th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 10px 4px 0; width: 90px; vertical-align: top; }
table.kv td { padding: 4px 0; }
.letter { background: #fff; color: #111; border: 1px solid #ddd; border-radius: 12px; padding: 28px; margin-bottom: 16px; }
.letter h2 { margin: 6px 0 2px; font-size: 1.4rem; }
.letter .l-brand { color: #0f766e; font-weight: 800; margin: 0; }
.letter .l-code { display: flex; gap: 20px; align-items: center; background: #f3f7f6; border-radius: 12px; padding: 16px; margin: 16px 0 8px; }
.letter .l-code p { margin: 4px 0; }
.letter .qr svg { width: 150px; height: 150px; display: block; }
.letter .code-big { font-family: ui-monospace, monospace; font-size: 1.8rem; font-weight: 800; letter-spacing: .08em; color: #0f766e; }
.choice { display: grid; gap: 12px; }
.choice .card h3 { margin-top: 0; }
@media (max-width: 560px) { .letter .l-code { flex-direction: column; align-items: flex-start; } .tabs4 { grid-template-columns: 1fr 1fr; } }
@media print {
  body.admin .topbar, body.admin .stats, body.admin .tabs4, body.admin h1, body.admin .version, body.admin .demo-banner { display: none !important; }
  .letter { border: none; page-break-after: always; margin: 0; }
}
.claim-box { border-color: var(--brand); }

/* ---------- v13 : accueil, assistant, compte, favoris ---------- */
body.focus .tabbar, body.focus #profileSwitch { display: none; }
body.focus { padding-bottom: 24px; }
.avatar-btn, .avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; text-decoration: none; flex: none; }
.avatar-btn.on { outline: 3px solid var(--brand); outline-offset: 2px; }
.avatar { width: 44px; height: 44px; font-size: 1.2rem; }
.acct-head { display: flex; gap: 12px; align-items: center; }
a.acct-link { text-decoration: none; color: inherit; margin-top: 16px; }
.linkish { border: none !important; background: none !important; color: var(--brand); }
.welcome { text-align: center; max-width: 460px; margin: 0 auto; padding-top: 12px; }
.welcome .w-logo, .wz-done .w-logo { font-size: 3.2rem; }
.welcome h1 { font-size: 1.8rem; margin: 6px 0 2px; }
.welcome .w-tag { color: var(--muted); margin-bottom: 18px; }
.w-points { list-style: none; padding: 0; margin: 0 0 22px; text-align: left; display: grid; gap: 12px; }
.w-points li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.w-points li span { font-size: 1.6rem; }
.wizard { max-width: 560px; margin: 0 auto; }
.wizard h1 { font-size: 1.35rem; }
.wizard h3 { margin: 16px 0 8px; font-size: .95rem; color: var(--muted); }
.wz-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.wz-bar div { height: 100%; background: var(--brand); transition: width .25s; }
.wz-step { color: var(--muted); font-size: .85rem; margin: 6px 0 4px; }
.wz-choices { display: grid; gap: 10px; }
.wz-choice { justify-content: flex-start; gap: 12px; font-size: 1.05rem; padding: 14px; }
.wz-choice span { font-size: 1.6rem; }
.wz-choice.on { border-color: var(--brand); background: var(--surface-2); outline: 2px solid var(--brand); }
.wz-als { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-al { border-radius: 999px; min-height: 40px; padding: 6px 12px; font-weight: 600; font-size: .9rem; }
.wz-al span { font-size: 1.1rem; }
.wz-al.on { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.wz-sev { display: grid; gap: 8px; }
.wz-sevrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-weight: 600; cursor: pointer; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--danger); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.wz-nav { display: flex; gap: 8px; align-items: center; margin-top: 22px; position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.wz-done { text-align: center; }
.tabs3r { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.tabs3r button { padding: 10px 4px; font-size: .88rem; }
.tabs3r button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.fav-star { color: #d99a00; }
.fav-btn.on { background: #fff4de; color: #7a4a00; border-color: #d99a00; }
/* Avis */
.rv { border-top: 1px solid var(--line); padding: 10px 0; }
.rv:first-child { border-top: none; }
.rv-exp { font-weight: 700; }
.exp-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.exp-choice button { flex-direction: column; font-size: .85rem; padding: 10px 4px; }
.exp-choice button span { font-size: 1.5rem; }
.exp-choice button.on { background: var(--surface-2); border-color: var(--brand); outline: 2px solid var(--brand); }
.stats6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats6 > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stats6 b { display: block; font-size: 1.6rem; }
.stats6 span { font-size: .8rem; color: var(--muted); }
.tabs6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.tabs6 button { padding: 10px 4px; font-size: .85rem; }
.tabs6 button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
blockquote.quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- v14 : formules ---------- */
.pill.pro { background: #fff4de; color: #7a4a00; }
.pill.label { background: #e7f6ec; color: #1d7a3e; }
.poster .p-top { color: var(--accent, #b42318) !important; }
.poster { border-color: var(--accent, #bbb) !important; }
fieldset.pro-fields { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
fieldset.pro-fields legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
fieldset.pro-fields[disabled] { opacity: .75; }
fieldset.pro-fields[disabled] legend a { pointer-events: auto; }
input[type=color] { height: 44px; padding: 4px; }
.locked { position: relative; }
.locked .blur { filter: blur(5px); pointer-events: none; user-select: none; opacity: .6; }
.lock-card { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); width: min(420px, 92%); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
table.plans { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .9rem; }
table.plans th, table.plans td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; }
table.plans td:first-child { text-align: left; }
table.plans .hl { background: #fffaf0; }
@media (prefers-color-scheme: dark) { table.plans .hl { background: #2a2416; } }
.label-card { border-color: #1d7a3e; }
#legalPrint { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body.print-legal > *:not(#legalPrint) { display: none !important; }
  body.print-legal #legalPrint { display: block !important; }
}
.legal { font-family: system-ui, sans-serif; color: #111; background: #fff; }
.legal h1 { color: var(--accent); font-size: 18pt; margin: 0 0 4px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 9pt; margin-top: 8px; }
.legal th, .legal td { border: 1px solid #999; padding: 4px; text-align: center; }
.legal th { background: #f3f3f3; font-size: 7.5pt; vertical-align: bottom; }
.legal th div { font-size: 12pt; }
.legal td:first-child, .legal th:first-child { text-align: left; min-width: 160px; }
.legal tr.grp td { background: var(--accent); color: #fff; font-weight: 700; text-align: left; }
.legal td.contains { font-weight: 800; color: #b42318; }
.legal td.traces { color: #9a5b00; font-weight: 700; }
.legal td.removable { color: #0f766e; font-weight: 700; }
.legal .leg { font-size: 8pt; color: #444; margin: 4px 0; }
.label-badge { background: #e7f6ec; color: #1d7a3e; border-radius: 10px; padding: 8px 12px; margin: 4px 0 8px; font-size: .92rem; }
@media (prefers-color-scheme: dark) { .label-badge { background: #12301f; color: #6ee7a0; } }
a.resto-cta { display: flex; gap: 12px; align-items: center; text-align: left; text-decoration: none; color: inherit; margin-top: 22px; border-style: dashed; }
a.resto-cta .em { font-size: 2rem; }
.wz-all { background: var(--surface-2); margin-bottom: 8px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-card h3 { margin: 0; }
.plan-card .price { font-size: 1.2rem; font-weight: 800; margin: 4px 0 8px; }
.plan-card.pro { border-color: #d99a00; background: #fffaf0; }
@media (prefers-color-scheme: dark) { .plan-card.pro { background: #2a2416; } }
@media (max-width: 560px) { .plan-cards { grid-template-columns: 1fr; } }
.loading-note { display: flex; gap: 10px; align-items: center; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
pre.implog { background: var(--surface-2); border-radius: 8px; padding: 10px; font-size: .82rem; white-space: pre-wrap; margin: 0; max-height: 220px; overflow: auto; }

/* v18 : import de la carte par photo */
dialog.wide { width: min(760px, calc(100% - 16px)); max-height: calc(100dvh - 16px); }
.mi-tips { margin: 0 0 10px; padding-left: 1.2rem; color: var(--muted); }
.mi-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 10px 0; }
.mi-thumbs figure { position: relative; margin: 0; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.mi-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mi-thumbs figure .chip { position: absolute; top: 6px; right: 6px; min-height: 30px; padding: 2px 9px; background: var(--surface); }
.mi-add { aspect-ratio: 3 / 4; border: 2px dashed var(--line); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--brand); }
.mi-add span { font-size: 2rem; line-height: 1; }
.mi-add:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.mi-dish { padding: 12px; margin-bottom: 10px; }
.mi-dish.off { opacity: .55; }
.mi-dish input[type=checkbox], #mi-ok { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); flex: none; }
.al-chip.guessed { border: 1.5px dashed currentColor; background: transparent; }
.mi-foot { position: sticky; bottom: -18px; background: var(--surface); border-top: 1px solid var(--line); margin: 0 -18px -18px; padding: 12px 18px 18px; }
.import-cta { display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--brand); }
.import-cta .em { font-size: 2rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.stats6 .hot { border-color: var(--warn); background: var(--warn-bg); }
table.kv.w th { width: auto; color: var(--text); }
table.kv.w td { padding: 6px 8px; }
table.kv.w tr + tr > * { border-top: 1px solid var(--line); }
.stats6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats6 b { font-size: clamp(1.05rem, 4.6vw, 1.6rem); overflow-wrap: anywhere; }

/* v19 : fiabilité, signalements, étiquettes */
button.linkbtn { background: none; border: none; padding: 4px 2px; min-height: 32px; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
button.linkbtn:hover { color: var(--danger); }
.dish.v-reported { border-left: 5px dashed var(--warn); }
.stale-note { border-left-color: var(--warn); }
.rp-kind { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.rp-kind:has(input:checked) { border-color: var(--brand); background: var(--surface-2); }
.rp-kind input { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }
.verify-card { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.verify-card.late { border-color: var(--warn); background: var(--warn-bg); }
.report-card { border-left: 4px solid var(--warn); }
.report-card.done { border-left-color: var(--line); opacity: .8; }
.label-result .ingredients { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.label-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.label-cta > .grow { flex: 1 1 200px; }
.label-cta > button { flex: 1 1 100%; }
/* v19 : titres et encadrés qui passent à la ligne proprement sur mobile */
.row > h1.grow { flex: 1 1 240px; overflow-wrap: anywhere; }
.verify-card > .grow { flex: 1 1 220px; }
.verify-card > button { flex: 1 1 auto; }
.stats6 b { white-space: nowrap; font-size: clamp(.95rem, 4.2vw, 1.6rem); }
.row > p.grow { flex: 1 1 200px; }

/* v20 : recherche et pagination des restaurants */
.pro-note { text-align: center; margin: 12px 0; }
.rsearch { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 4px 6px 4px 12px; margin: 0 0 12px; }
.rsearch:focus-within { border-color: var(--brand); }
.rsearch input { border: none; padding: 8px 4px; min-height: 40px; background: transparent; outline: none; flex: 1; min-width: 0; }
.rsearch input::-webkit-search-cancel-button { display: none; }
.rsearch .chip { min-height: 32px; padding: 2px 10px; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 14px 0 0; }
.pager .chip { min-width: 40px; }
.pager .chip[disabled] { opacity: .4; cursor: default; }
.rsearch input[type=search] { border: none !important; box-shadow: none !important; background: transparent !important; padding-left: 4px; }

/* ================= v21 : outils de la famille ================= */
.tabbar a { position: relative; }
.tabbar a.has-alert::after { content: ''; position: absolute; top: 6px; left: calc(50% + 10px); width: 10px; height: 10px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
fieldset.plain { border: none; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] .aitem, fieldset.plain[disabled] .card { opacity: .8; }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); min-height: 96px; box-shadow: var(--shadow); }
.tool .em { font-size: 1.6rem; }
.tool b { font-size: .92rem; }
.tool .small { font-size: .75rem; line-height: 1.2; }
.tool:active { transform: scale(.98); }
@media (min-width: 640px) { .tools { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.alerts { display: grid; gap: 8px; margin: 0 0 12px; }
button.alert, .alert { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; border-radius: 12px; padding: 10px 12px; font-weight: 600; border: 1.5px solid; min-height: 48px; }
.alert.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.alert .grow { color: var(--text); }
.alert > span:first-child { font-size: 1.3rem; }
.safe-link, .travel-link { text-decoration: none; color: var(--text); align-items: center; }
.safe-link > span:first-child, .travel-link > span:first-child { font-size: 1.4rem; }
.pen-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.pen-row.expired { background: var(--danger-bg); } .pen-row.expired .small { color: var(--danger); }
.pen-row.soon { background: var(--warn-bg); } .pen-row.soon .small { color: var(--warn); }
.prod-actions { margin: 0 0 12px; }
.prod-actions button { flex: 1 1 160px; }
.prod-actions button.on { background: #fff7d6; border-color: #e0b100; color: #6b5200; }
.alt-box { border: 1.5px solid var(--brand); }
.alt-list { display: grid; gap: 8px; }
.alt-item, .safe-item { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 400; min-height: 64px; }
.alt-item img, .safe-item img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #fff; flex: none; border: 1px solid var(--line); }
.alt-noimg { width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); border-radius: 8px; flex: none; }
.ok-pill { background: var(--ok-bg); }
.safe-item { margin-bottom: 8px; flex-wrap: wrap; }
.safe-item select { width: auto; max-width: 150px; min-height: 36px; padding: 4px 8px; font-size: .85rem; }
.safe-item.bad { border-color: var(--danger); background: var(--danger-bg); }
button.linklike { background: none; border: none; padding: 0; min-height: 0; text-align: left; font-weight: 400; display: block; flex: 1 1 140px; }
.invite-code { font: 700 2.2rem/1.2 'DejaVu Sans Mono', ui-monospace, monospace; letter-spacing: .12em; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 14px; margin: 8px 0; user-select: all; }
.qr-mini { width: 110px; flex: none; background: #fff; padding: 4px; border-radius: 8px; }
.qr-mini svg { width: 100%; height: auto; display: block; }
.member { padding: 8px 0; border-bottom: 1px solid var(--line); }
.member select { width: auto; min-height: 36px; padding: 4px 8px; font-size: .85rem; }
.emergency-call { display: flex; gap: 12px; align-items: center; text-decoration: none; background: var(--danger); color: #fff; border-color: var(--danger); }
.emergency-call .em { font-size: 2rem; } .emergency-call .small { color: #fff; opacity: .9; }
.phrase { display: flex; gap: 10px; align-items: center; margin: 0; }
.phrase .ph { font-size: 1.15rem; font-weight: 600; margin: 0 0 2px; }
.phrase.urgent { border-color: var(--danger); }
.bigtext { position: fixed; inset: 0; z-index: 100; background: #fff; color: #111; display: flex; flex-direction: column; justify-content: center; padding: 24px; gap: 24px; }
.bigtext p { font-size: clamp(2rem, 9vw, 4rem); font-weight: 800; line-height: 1.2; margin: 0; text-align: center; }
.bigtext.urgent { background: #b42318; color: #fff; }
.bigtext.urgent button { background: #fff; color: #b42318; }
.seg2, .seg3 { display: grid; gap: 6px; } .seg2 { grid-template-columns: 1fr 1fr; } .seg3 { grid-template-columns: repeat(3, 1fr); margin-top: 6px; }
.seg2 button.on, .seg3 button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger-solid, .btn.danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.jr-add button { flex: 1 1 150px; }
.jr { cursor: pointer; }
.jr-react { border-left: 5px solid var(--warn); }
.jr-react.severe { border-left-color: var(--danger); } .jr-react.mild { border-left-color: var(--ok); }
.jr-stats { margin-bottom: 8px; }
.print-only { display: none; }
.guest-al ul.al { list-style: none; padding: 0; margin: 4px 0; }
.guest-al ul.al li { font-size: 1.15rem; font-weight: 700; padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.guest-al .tag { background: var(--danger); color: #fff; border-radius: 6px; font-size: .75rem; padding: 2px 6px; }
.guest-al { border: 2px solid var(--danger); }
.guest-sos { border: 2px solid var(--danger); background: var(--danger-bg); }
.guest-sos ol { padding-left: 1.2rem; }
.acard[dir="rtl"] ul.al li { flex-direction: row-reverse; }
.acard[dir="rtl"] ol { padding-left: 0; padding-right: 1.2rem; }

/* Plan d'urgence : aperçu écran + impression A4 */
.plan-doc { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-size: .9rem; }
.plan-doc header { display: flex; justify-content: space-between; gap: 12px; border-bottom: 3px solid #b42318; padding-bottom: 8px; margin-bottom: 10px; }
.plan-doc h2 { margin: 0; font-size: 1.2rem; color: #b42318; }
.plan-doc .who { font-size: 1.5rem; font-weight: 800; margin: 4px 0 0; }
.plan-doc .big-num { background: #b42318; color: #fff; border-radius: 12px; padding: 6px 12px; font-size: 1.6rem; font-weight: 800; text-align: center; line-height: 1.1; }
.plan-doc .big-num span { font-size: .8rem; font-weight: 600; }
.plan-doc h3 { font-size: 1rem; margin: 0 0 6px; }
.plan-doc ul, .plan-doc ol { margin: 0 0 6px; padding-left: 1.2rem; }
.plan-doc li { margin: 2px 0; }
.pd-al { background: #fdecea; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.pd-al ul { columns: 2; list-style: none; padding: 0; } .pd-al li { font-size: 1.05rem; }
.pd-al .tag { background: #b42318; color: #fff; border-radius: 5px; font-size: .65rem; padding: 1px 5px; vertical-align: middle; }
.pd-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.pd-mild { border: 2px solid #c77700; border-radius: 10px; padding: 10px; }
.pd-severe { border: 3px solid #b42318; border-radius: 10px; padding: 10px; background: #fff7f6; }
.pd-severe h3 { color: #b42318; } .pd-mild h3 { color: #9a5b00; }
.pd-info { margin-top: 10px; } .pd-info p { margin: 4px 0; }
.pd-info table { width: 100%; border-collapse: collapse; margin-top: 6px; } .pd-info td { border: 1px solid #ddd; padding: 6px 8px; vertical-align: top; }
.plan-doc footer { margin-top: 10px; font-size: .7rem; color: #666; text-align: center; }
@media (max-width: 560px) { .pd-cols { grid-template-columns: 1fr; } .pd-al ul { columns: 1; } }
@media print {
  .print-only { display: block; }
  .version, #toast { display: none !important; }
  .safe-item, .jr, .card { break-inside: avoid; box-shadow: none; }
  body.print-plan #view > *:not(#planDoc) { display: none !important; }
  body.print-plan .plan-doc { border: none; padding: 0; font-size: 11pt; }
  body.print-plan .pd-cols { grid-template-columns: 1fr 1.3fr; }
  body.print-plan .pd-al ul { columns: 2; }
  @page { size: A4; margin: 12mm; }
}

/* ================= v22 : navigation du profil ================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.phead { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); }
.phead b { font-size: 1.1rem; }
.phead .pill { font-size: .72rem; padding: 1px 8px; vertical-align: middle; }
.phead .chip { flex: none; }
.pav { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.pav.small { width: 30px; height: 30px; font-size: .9rem; }
.subnav { position: sticky; top: var(--topbar-h, 57px); z-index: 15; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px;
  margin: 10px -16px 14px; padding: 6px 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.subnav.two { grid-template-columns: 1fr 1fr; }
.subnav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 6px 2px;
  border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .74rem; font-weight: 700; text-align: center; line-height: 1.15; }
.subnav.two a { flex-direction: row; gap: 8px; font-size: .9rem; min-height: 46px; }
.subnav a span { font-size: 1.35rem; line-height: 1; }
.subnav.two a span { font-size: 1.2rem; }
.subnav a.on { background: var(--surface); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.subnav a:not(.on):hover { background: var(--surface-2); color: var(--text); }
.subnav .dot { position: absolute; top: 6px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.subnav .count { position: absolute; top: 3px; right: calc(50% - 26px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-style: normal; font-size: .68rem; display: grid; place-items: center; }
.sect-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sect-head h2 { margin: 0; font-size: 1.1rem; }
.card > .sect-head:first-child { margin-bottom: 2px; }
details.acc { padding: 0; }
details.acc > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer; min-height: 52px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: '›'; font-size: 1.4rem; color: var(--muted); transition: transform .2s; margin-left: 6px; }
details.acc[open] > summary::after { transform: rotate(90deg); }
details.acc > summary b { flex: 1; }
details.acc > :not(summary) { margin: 0 16px 16px; }
.next-step { text-decoration: none; color: var(--text); align-items: center; margin-top: 16px; border: 1.5px solid var(--brand); }
.next-step > span:first-child { font-size: 1.6rem; }
#done { margin-top: 4px; }
.prof-choice { justify-content: flex-start; gap: 10px; }
.prof-choice.primary .pav { background: var(--brand-ink); color: var(--brand); }
@media (min-width: 720px) { .subnav { margin-left: 0; margin-right: 0; border-radius: 14px; border: 1px solid var(--line); } }
.pen-row > .grow { flex: 1 1 180px; }
.pen-row > .chip { flex: none; }
.share-opt { display: flex; align-items: center; gap: 12px; text-align: left; justify-content: flex-start; }
.share-opt > span:first-child { font-size: 1.6rem; }
.share-opt .small { font-weight: 400; opacity: .85; }
.travel-link { margin-top: 16px; }

/* v24 : comptes utilisateurs (admin) */
.user-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font-weight: 400; margin-bottom: 8px; padding: 12px; }
.user-row b { word-break: break-all; }
.user-row.banned { opacity: .65; }
.pill.s-bad { background: var(--danger-bg); color: var(--danger); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }

/* ===== v26 : accueil ===== */
.home-hello h1 { margin-bottom: 2px; }
.home-hello p { margin-top: 0; }
.home-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.home-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 128px; padding: 14px 8px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font: inherit; text-align: center; box-shadow: var(--shadow); cursor: pointer; }
.home-big > span[aria-hidden] { font-size: 2.2rem; line-height: 1; }
.home-big b { font-size: 1.02rem; }
.home-big .small { color: var(--muted); }
.home-big.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.home-big.primary .small { color: var(--brand-ink); opacity: .85; }
.home-kid { width: 100%; font: inherit; color: var(--text); cursor: pointer; }
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.home-grid a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 600; text-align: center; }
.home-grid a > span[aria-hidden] { font-size: 1.5rem; }
.sect-head a.small { font-weight: 600; }
.kid-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 700; margin: 2px; }
.kid-chip.ok { background: var(--ok-bg); color: var(--ok); } .kid-chip.warn { background: var(--warn-bg); color: var(--warn); } .kid-chip.no { background: var(--danger-bg); color: var(--danger); }

/* ===== v26 : mode enfant ===== */
body.kid .topbar, body.kid .tabbar, body.kid .version { display: none !important; }
body.kid #view { padding-bottom: 16px; }
.kid { min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); display: flex; flex-direction: column; align-items: stretch; gap: 14px; text-align: center; }
.kid-name { font-size: 1.3rem; font-weight: 800; margin: 8px 0 0; }
#kidStage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.kid-go { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 46vh; border-radius: 28px; border: 0;
  background: var(--brand); color: var(--brand-ink); font: inherit; font-size: 2rem; font-weight: 800; line-height: 1.15; padding: 20px; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.kid-go > span { font-size: 4.5rem; line-height: 1; }
.kid-go.small { min-height: 0; font-size: 1.3rem; flex-direction: row; padding: 16px; border-radius: 20px; }
.kid-go.small > span { font-size: 1.8rem; }
.kid-manual summary { color: var(--muted); cursor: pointer; }
.kid-manual form { margin-top: 10px; flex-wrap: nowrap; }
.kid-manual input { flex: 1; min-width: 0; font-size: 1.1rem; }
.kid-hint { font-size: 1.3rem; margin: 0; }
#kidReader { position: relative; width: 100%; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
#kidReader video { width: 100%; height: 100%; object-fit: cover; display: block; }
.kid-back { align-self: center; font-size: 1.05rem; }
.kid-res { border-radius: 28px; padding: 26px 18px; font-size: 1.2rem; }
.kid-res p { margin: 6px 0; }
.kid-res.ok { background: var(--ok-bg); color: var(--ok); border: 4px solid var(--ok); }
.kid-res.warn { background: var(--warn-bg); color: var(--warn); border: 4px solid var(--warn); }
.kid-res.no { background: var(--danger-bg); color: var(--danger); border: 4px solid var(--danger); }
.kid-res.wait { background: var(--surface-2); }
.kid-big { font-size: 5rem; line-height: 1.1; }
.kid-word { font-size: 2.6rem; font-weight: 900; letter-spacing: .02em; }
.kid-prod { color: var(--text); opacity: .75; font-size: 1rem; }
.kid-exit { position: relative; align-self: center; width: 56px; height: 56px; border-radius: 50%; font-size: 1.5rem; padding: 0; background: var(--surface-2);
  border: 1px solid var(--line); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.kid-exit .ring { position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--brand) 0deg, transparent 0deg); z-index: -1; }
.kid-exit.holding .ring { animation: kidring 3s linear forwards; }
@property --kidp { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes kidring { from { --kidp: 0deg; } to { --kidp: 360deg; } }
.kid-exit.holding .ring { background: conic-gradient(var(--brand) var(--kidp), transparent var(--kidp)); }
.kid-exit-help { margin: 0; visibility: hidden; }
.kid-exit-help.on { visibility: visible; }

/* ===== v26 : demandes des familles ===== */
.demand-box { margin: 10px 0; }
.demand-box .demand-count { margin: 6px 0 0; }
.dem-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.dem-n { min-width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--warn-bg); color: var(--warn); }
.card > .demand-box { margin: 0; }

/* ===== v28 : retours utilisateurs ===== */
.home-fb { width: 100%; font: inherit; color: var(--text); cursor: pointer; }
.fb-link { text-align: center; margin: 24px 0 0; font-size: .9rem; }
.fb-kinds button { padding: 8px 4px; font-size: .88rem; }
.fb-kinds button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.fb-row { border-top: 1px solid var(--line); padding: 12px 0; }
.fb-row:first-child { border-top: 0; }
.fb-msg { white-space: pre-wrap; margin: 6px 0; }
.fb-meta { color: var(--muted); font-size: .8rem; }

/* ===== v29 : garder une fiche invitée ===== */
.keep-guest { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.keep-guest .linkbtn { white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; font-size: 1.15rem; display: inline-grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
body.focus #fbTop { display: none; }
.keep-guest .row:last-child { flex-wrap: wrap; gap: 6px; }
.keep-guest .row:last-child > .primary { flex: 1 1 100%; text-align: center; justify-content: center; }
.keep-guest .row:last-child > .linkbtn { margin: 0 auto; }
#profileSwitch { max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== v30 : pièces jointes des retours ===== */
.fb-files { display: grid; gap: 6px; margin-top: 12px; }
.fb-file { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.fb-file img, .fb-pdf { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; display: grid; place-items: center; font-size: 1.6rem; background: var(--surface); }
.fb-file .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fb-add { margin-top: 12px; }
.fb-att { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.fb-att a { display: block; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; }
.fb-att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-att .fb-pdf { width: 100%; height: 100%; font-size: 2rem; }
.fb-add[hidden] { display: none !important; }

/* ===== v33 : inscription visible sur la page invité ===== */
.keep-top { display: flex; align-items: center; gap: 12px; margin: 12px 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); text-decoration: none; box-shadow: var(--shadow); }
.keep-top > span[aria-hidden] { font-size: 1.6rem; }
.keep-top .small { opacity: .9; }
.keep-top .keep-cta { background: var(--brand-ink); color: var(--brand); font-weight: 800; border-radius: 999px; padding: 8px 12px; font-size: .88rem; text-align: center; flex: none; max-width: 42%; }
.keep-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 2px solid var(--brand); box-shadow: 0 -6px 20px rgba(0,0,0,.12); }
.keep-bar[hidden] { display: none; }
.keep-bar .btn { white-space: nowrap; }
.keep-x { background: none; border: 0; font-size: 1.1rem; color: var(--muted); min-height: 40px; padding: 0 6px; }
body.has-keepbar #view { padding-bottom: 90px; }
