/* ============================================================
   Listes de Noël — « Nuit de Noël »
   Concept : une app de nuit chaleureuse. Fond vert sapin profond, lueurs dorées,
   portraits ronds au centre, listes compactes, fiche détaillée en feuille.
   ============================================================ */
:root {
  --bg: #0a1612;
  --surface: #11221c;
  --surface-hi: #182d25;
  --sheet: #10211b;
  --field: #0c1a15;
  --line: rgba(255, 255, 255, .08);
  --line-hi: rgba(255, 255, 255, .14);
  --ink: #f6f0e4;
  --ink-2: #b9c3bb;
  --ink-3: #7e8c84;
  --gold: #eab651;
  --gold-ink: #1d1505;
  --gold-soft: rgba(234, 182, 81, .15);
  --berry: #ef6a55;
  --berry-soft: rgba(239, 106, 85, .14);
  --mint: #86d6aa;
  --mint-soft: rgba(134, 214, 170, .13);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  --tab-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background-color: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.45; min-height: 100vh; color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(70% 45% at 85% -5%, rgba(234, 182, 81, .16), transparent 70%),
    radial-gradient(60% 40% at -10% 15%, rgba(239, 106, 85, .10), transparent 70%),
    radial-gradient(90% 60% at 50% 110%, rgba(40, 90, 66, .35), transparent 70%),
    linear-gradient(180deg, #0f2019 0%, #0a1612 60%, #08120e 100%);
  background-attachment: fixed; }
body.noscroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

#app {
  max-width: 720px; margin: 0 auto; position: relative; z-index: 1;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-left, 0px)) calc(var(--tab-h) + 48px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.display { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 0; font-weight: 600; letter-spacing: -.01em; }

/* ---------- portraits ---------- */
.av { --s: 44px; position: relative; width: var(--s); height: var(--s); flex: none; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center;
  background: var(--c, #2d4a3e); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(234, 182, 81, .55); }
.av .ini { font-family: var(--display); font-weight: 600; font-size: calc(var(--s) * .42); color: #fff; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-xs { --s: 24px; box-shadow: 0 0 0 2px var(--sheet); } .av-s { --s: 32px; } .av-m { --s: 48px; } .av-l { --s: 76px; } .av-xl { --s: 116px; }
.av-l, .av-xl { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--gold), 0 10px 40px -6px rgba(234, 182, 81, .45); }

/* ---------- en-têtes ---------- */
.top { padding: 18px 2px 6px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.countdown { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 13px; }
.countdown b { font-family: var(--display); font-size: 17px; font-weight: 700; }
.greet { font-size: clamp(32px, 9vw, 44px); line-height: 1.05; margin: 10px 0 4px; text-wrap: balance; }
.sub { color: var(--ink-2); margin: 0; font-size: 15px; }
.sec { display: flex; align-items: baseline; gap: 10px; font-size: 21px; margin: 30px 2px 14px; }
.sec-note { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }

/* barre du haut des pages internes */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; display: flex; align-items: center; gap: 10px; margin: 0 -16px; padding: 10px 16px;
  transition: background .2s; }
.bar.scrolled { background: rgba(10, 22, 18, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar-title { font-weight: 800; font-size: 16px; opacity: 0; transition: opacity .2s; }
.bar.scrolled .bar-title { opacity: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-hi); border: 1px solid var(--line); flex: none; }

/* ---------- accueil ---------- */
.mine { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 14px 16px; border-radius: var(--r-lg);
  background: linear-gradient(120deg, rgba(234, 182, 81, .18), rgba(234, 182, 81, .05) 60%), var(--surface); border: 1px solid rgba(234, 182, 81, .25); }
.mine-t { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 20px; }
.mine-s { color: var(--ink-2); font-size: 14px; }
.mine .grow { flex: 1; min-width: 0; }
.mine .i { color: var(--gold); }
.people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 4px; }
.people .av-l { --s: 64px; }
@media (min-width: 560px) { .people { gap: 22px 8px; } .people .av-l { --s: 84px; } }
.pt { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 2px; border-radius: var(--r-md); transition: transform .15s; }
.pt:active { transform: scale(.95); }
.pt-av { position: relative; }
.pt-name { margin-top: 9px; font-weight: 800; font-size: 14.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pt-meta { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.dot { position: absolute; top: -2px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--berry); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }

/* ---------- profil (haut de liste) ---------- */
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 4px; }
.profile h1 { font-size: 34px; margin: 16px 0 2px; line-height: 1.05; }
.profile-meta { color: var(--ink-2); font-weight: 600; font-size: 15px; }
.hint { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); text-align: left; }
.hint .i { width: 16px; height: 16px; color: var(--gold); }
.hint.gold { color: var(--gold); background: var(--gold-soft); border-color: rgba(234, 182, 81, .25); }

/* filtre */
.seg { display: flex; gap: 4px; margin: 22px 0 14px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button { flex: 1; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.seg button b { font-weight: 800; color: var(--ink-3); margin-left: 3px; }
.seg button.on { background: var(--surface-hi); color: var(--ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 4px 12px -4px rgba(0, 0, 0, .5); }
.seg button.on b { color: var(--gold); }

/* ---------- lignes d'articles ---------- */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 10px 12px 10px 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); transition: background .15s, transform .15s; }
.row:hover { background: var(--surface-hi); }
.row:active { transform: scale(.985); }
.thumb { width: 64px; height: 64px; flex: none; border-radius: 13px; overflow: hidden; background: #f2ece0; display: grid; place-items: center; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.ph { background: radial-gradient(120% 120% at 20% 10%, color-mix(in srgb, var(--c) 55%, #fff 0%), var(--c)); }
.thumb.ph span { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 28px; color: rgba(255, 255, 255, .85); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-title { font-weight: 700; font-size: 16px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-meta { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; }
.row-meta .sep { opacity: .5; }
.row-meta .dom { overflow: hidden; text-overflow: ellipsis; }
.price { color: var(--gold); font-weight: 800; }
.heart { color: var(--berry); font-size: 13px; }
.row-flag { font-size: 12.5px; font-weight: 700; color: var(--berry); }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.row-side .i { color: var(--ink-3); width: 18px; height: 18px; }
.chip { font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.chip.free { color: var(--mint); background: var(--mint-soft); }
.chip.taken { color: var(--gold); background: var(--gold-soft); }
.chip.me { color: var(--gold-ink); background: var(--gold); }
.chip.gone { color: var(--berry); background: var(--berry-soft); }
.stack { display: flex; }
.stack .av + .av { margin-left: -8px; }
.row.is-taken .row-title { color: var(--ink-2); }
.row.is-gone { opacity: .6; } .row.is-gone .row-title { text-decoration: line-through; }
.empty { padding: 34px 20px; text-align: center; color: var(--ink-3); font-weight: 600; border-radius: var(--r-md); border: 1px dashed var(--line-hi); }
.row-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 8px; padding: 16px; border-radius: var(--r-md); border: 1px dashed rgba(234, 182, 81, .4); color: var(--gold); font-weight: 800; }
.offlist .row { border-style: dashed; border-color: rgba(234, 182, 81, .3); }

/* bouton flottant */
.fab { position: fixed; z-index: 18; right: max(20px, calc(50% - 340px)); bottom: calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px)); height: 54px; padding: 0 20px 0 16px; border-radius: 27px;
  display: flex; align-items: center; gap: 8px; background: var(--gold); color: var(--gold-ink); font-weight: 800; box-shadow: 0 10px 30px -6px rgba(234, 182, 81, .55), 0 2px 6px rgba(0, 0, 0, .4); }
.fab .i { stroke-width: 2.4; }

/* ---------- fiche article (feuille) ---------- */
.d-media { margin: 0 -20px; background: #f2ece0; display: grid; place-items: center; height: 240px; position: relative; }
.d-media img { max-height: 240px; width: 100%; object-fit: contain; cursor: zoom-in; }
.d-media .count { position: absolute; right: 12px; bottom: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 800; }
.d-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.d-thumbs img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; cursor: pointer; opacity: .6; }
.d-thumbs img.on { opacity: 1; outline: 2px solid var(--gold); }
.d-head { display: flex; align-items: flex-start; gap: 14px; margin-top: 16px; }
.d-title { flex: 1; font-size: 25px; line-height: 1.12; margin: 0; text-wrap: balance; }
.d-price { font-family: var(--display); font-weight: 700; font-size: 25px; color: var(--gold); white-space: nowrap; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-hi); color: var(--ink-2); }
.tag.love { color: var(--berry); background: var(--berry-soft); }
.tag.gold { color: var(--gold); background: var(--gold-soft); }
.note { display: flex; gap: 10px; margin-top: 16px; }
.note-b { flex: 1; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: var(--surface-hi); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.note-b small { display: block; font-size: 12px; font-weight: 800; color: var(--ink-3); margin-bottom: 2px; }
.btn-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 13px 16px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.btn-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-link .i { width: 18px; height: 18px; color: var(--gold); }
.alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--berry-soft); color: #ffcfc5; font-size: 14.5px; font-weight: 600; }
.alert .i { color: var(--berry); width: 20px; height: 20px; }
.d-sec { margin-top: 22px; }
.d-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.d-sec-h h3 { margin: 0; font-size: 17px; }
.d-sec-h span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.givers { display: flex; flex-direction: column; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.giver { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.giver + .giver { border-top: 1px solid var(--line); }
.giver .gn { flex: 1; font-weight: 700; }
.giver .ga { font-weight: 800; font-variant-numeric: tabular-nums; }
.giver .ga.unk { color: var(--ink-3); font-weight: 600; font-size: 14px; }
.pay { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 7px; border-radius: 6px; background: var(--gold-soft); color: var(--gold); }
.nobody { padding: 14px; text-align: center; color: var(--ink-3); font-weight: 600; border-radius: var(--r-sm); border: 1px dashed var(--line-hi); }
.links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; padding: 0 2px; }
.lnk { font-weight: 700; font-size: 14px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-hi); }
.lnk.danger { color: var(--berry); }
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-b { padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface-hi); font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.msg.me .msg-b { border-radius: 16px 16px 4px 16px; background: var(--gold-soft); }
.msg-meta { font-size: 11.5px; color: var(--ink-3); font-weight: 700; margin-bottom: 2px; }
.msg-meta button { color: var(--ink-3); text-decoration: underline; font-size: 11.5px; margin-left: 6px; }
.compose { display: flex; gap: 8px; margin-top: 12px; }
.compose input { flex: 1; min-width: 0; border-radius: 999px; padding: 11px 16px; }
.send { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); flex: none; }
.send .i { stroke-width: 2.2; width: 20px; height: 20px; }
.cta { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom, 0px)); margin: 22px -20px calc(-22px - env(safe-area-inset-bottom, 0px)); padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(16, 33, 27, 0), var(--sheet) 30%); display: flex; flex-direction: column; gap: 10px; }
.inline-form { padding: 14px; border-radius: var(--r-md); background: var(--surface-hi); border: 1px solid var(--line-hi); display: flex; flex-direction: column; gap: 12px; }
.inline-form p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ---------- boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 14px; font-weight: 800; font-size: 16px; background: var(--surface-hi); color: var(--ink); border: 1px solid var(--line); }
.btn.primary { background: var(--gold); color: var(--gold-ink); border-color: transparent; box-shadow: 0 8px 22px -10px rgba(234, 182, 81, .8); }
.btn.danger { background: var(--berry); color: #fff; border-color: transparent; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; } .btn-row .btn { flex: 1; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--ink); background: var(--field); border: 1px solid var(--line-hi); border-radius: var(--r-sm); padding: 12px 14px; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.field > span { font-weight: 700; font-size: 14px; color: var(--ink-2); }
.field > span em { font-style: normal; font-weight: 600; color: var(--ink-3); }
.money { position: relative; max-width: 200px; }
.money input { padding-right: 38px; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.money::after { content: "€"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--ink-3); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 15px; margin-top: 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb-e { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: #f2ece0; }
.thumb-e img { width: 100%; height: 100%; object-fit: cover; }
.thumb-e button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; font-weight: 800; line-height: 1; }
.add-photo { width: 72px; height: 72px; border-radius: 12px; border: 1px dashed var(--line-hi); display: grid; place-items: center; color: var(--ink-3); cursor: pointer; }

/* ---------- comptes ---------- */
.sum { display: grid; grid-template-columns: 1fr 1px 1fr; margin-top: 18px; padding: 18px 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.sum .sep { background: var(--line); }
.sum span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.sum b { font-family: var(--display); font-weight: 700; font-size: 32px; font-variant-numeric: tabular-nums; }
.pos { color: var(--mint); } .neg { color: var(--berry); }
.bal { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.bal + .bal { margin-top: 8px; }
.bal-t { flex: 1; min-width: 0; font-weight: 600; line-height: 1.3; }
.bal-t b { font-weight: 800; }
.group { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.group + .group { margin-top: 8px; }
.group-h { font-weight: 800; } .group-h span { color: var(--ink-3); font-weight: 600; }
.line { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 15px; }
.line .lt { flex: 1; }
.line.done .lt { color: var(--ink-3); }
.line.done .lt s { text-decoration-thickness: 1.5px; }
.ok { color: var(--mint); font-weight: 800; font-size: 13px; white-space: nowrap; }
.hist { display: flex; align-items: center; gap: 10px; padding: 10px 2px; font-size: 14.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.hist .lt { flex: 1; }

/* ---------- admin ---------- */
.adm { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.adm + .adm { margin-top: 8px; }
.adm-av { cursor: pointer; } .adm-name { flex: 1; font-weight: 800; } .adm-name small { display: block; color: var(--ink-3); font-weight: 600; }

/* ---------- sans accès ---------- */
.noaccess { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.noaccess h1 { font-size: 38px; margin: 18px 0 6px; }
.noaccess p { color: var(--ink-2); max-width: 26em; margin: 4px 0; }
.na-badge { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); box-shadow: 0 0 60px -10px rgba(234, 182, 81, .6); }
.na-badge .i { width: 44px; height: 44px; stroke-width: 1.5; }

/* ---------- barre d'onglets flottante ---------- */
#tabbar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100% - 24px)); height: var(--tab-h);
  display: flex; padding: 6px; border-radius: 24px; background: rgba(16, 33, 27, .82); border: 1px solid var(--line-hi); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); }
#tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 18px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
#tabbar a .i { width: 23px; height: 23px; }
#tabbar a.on { color: var(--gold); background: var(--gold-soft); }

/* ---------- feuilles ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(3, 8, 6, .62); backdrop-filter: blur(2px); animation: fade .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; background: var(--sheet); border-top: 1px solid var(--line-hi);
  border-radius: 26px 26px 0 0; padding: 8px 20px calc(22px + env(safe-area-inset-bottom, 0px)); animation: up .28s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 -20px 60px -10px rgba(0, 0, 0, .6); }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: 540px; max-height: 88vh; transform: translate(-50%, -50%); border-radius: 26px; border: 1px solid var(--line-hi); animation: pop .22s ease-out; }
  .cta { bottom: -22px; margin-bottom: -22px; padding-bottom: 18px; }
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-hi); margin: 2px auto 10px; }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; }
.sheet-close .i { width: 18px; height: 18px; }
.sheet-title { font-size: 25px; margin: 6px 0 4px; line-height: 1.1; }
.sheet-text { color: var(--ink-2); margin: 6px 0 0; font-size: 15px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 22px; }
.sheet-actions .btn { flex: 1; }
.viewer { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 14px; background: #f2ece0; }
.linkbox { font-size: 14px; margin-top: 12px; }
@keyframes up { from { transform: translateY(60px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -48%) scale(.97); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* toast */
#toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tab-h) + 30px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 14px; background: var(--ink); color: #13201a; font-weight: 800; font-size: 15px; transition: .22s; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6); }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.err { background: var(--berry); color: #fff; }

/* barre de maquette */
#demo-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 7px max(16px, env(safe-area-inset-left, 0px)); font-size: 13px; font-weight: 700; background: #050b09; color: var(--ink-2); border-bottom: 1px solid var(--line); }
#demo-bar select { width: auto; padding: 4px 8px; font-size: 13px; border-radius: 8px; }
#demo-bar .db-tag { background: var(--gold); color: var(--gold-ink); padding: 2px 8px; border-radius: 6px; letter-spacing: .08em; font-weight: 800; }
#demo-bar button { text-decoration: underline; color: var(--ink-2); font-size: 13px; }

/* neige discrète */
#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
#snow i { position: absolute; top: -10px; border-radius: 50%; background: #fff; animation: fall linear infinite; }
@keyframes fall { to { transform: translate3d(24px, 110vh, 0); } }
@media (prefers-reduced-motion: reduce) { #snow { display: none; } *, *::before { animation: none !important; transition: none !important; } }
