/* ============================================================================
   Postman · Console — feuille de style
   Pensée pour le téléphone d'abord : grandes zones à toucher, barre d'onglets en
   bas, feuilles qui montent du bas, zones sûres de l'iPhone (encoche, barre du bas).
   Sommaire : 1 base · 2 écran de connexion · 3 coque (en-tête, onglets) · 4 cartes et boutons
              5 onglet Soirée · 6 Inscrits · 7 Journal · 8 Annonce · 9 Réglages · 10 feuilles et messages
   ============================================================================ */

/* ---------- 1. base */
:root {
  color-scheme: dark;
  --bg: #080c15;
  --card: #131a2b;
  --card2: #1a2338;
  --card3: #232d48;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .14);
  --txt: #f2f5ff;
  --mut: #8f9ab7;
  --acc: #25d366;
  --acc-ink: #04130a;
  --red: #ff5d5d;
  --amb: #ffb648;
  --blu: #5aa9ff;
  --pur: #b690ff;
  --r: 20px;
  --sab: env(safe-area-inset-bottom, 0px);
  --sat: env(safe-area-inset-top, 0px);
  --nav-h: 62px;
  --hdr-h: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg) radial-gradient(900px 420px at 50% -160px, rgba(37, 211, 102, .10), transparent 70%) no-repeat;
  color: var(--txt);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  touch-action: manipulation;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
a { color: var(--blu); }
b { font-weight: 700; }
.hidden { display: none !important; }
.screen { min-height: 100vh; min-height: 100dvh; }
.muted { color: var(--mut); font-size: 13.5px; }
.note { margin-top: 10px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.ell { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- formulaires et boutons */
.inp {
  width: 100%; height: 50px; padding: 0 14px; outline: none;
  background: var(--card); color: var(--txt); font-size: 16px;
  border: 1.5px solid var(--line2); border-radius: 14px;
  -webkit-appearance: none; appearance: none; transition: border-color .15s;
}
textarea.inp { height: auto; padding: 12px 14px; resize: none; line-height: 1.4; }
.inp:focus { border-color: var(--acc); }
.inp::placeholder { color: #5f6a86; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.num-in { width: 84px; flex: none; height: 46px; text-align: center; }
.sel-in { width: 136px; flex: none; height: 46px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  width: 100%; min-height: 52px; padding: 0 18px; border-radius: 16px;
  background: var(--card2); color: var(--txt); font-size: 16px; font-weight: 650; text-align: center;
  transition: transform .12s var(--ease), opacity .15s, background .15s;
}
.btn small { display: block; width: 100%; font-weight: 500; font-size: 12px; opacity: .75; }
.btn:active { transform: scale(.97); }
.btn.acc { background: var(--acc); color: var(--acc-ink); }
.btn.red { background: var(--red); color: #fff; }
.btn.amb { background: var(--amb); color: #231500; flex-direction: column; gap: 0; padding-top: 10px; padding-bottom: 10px; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line2); }
.btn.sm { width: auto; min-height: 44px; padding: 0 16px; border-radius: 13px; font-size: 15px; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.busy { opacity: .6; }
.icbtn {
  width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--card2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: var(--txt);
  transition: transform .12s var(--ease);
}
.icbtn:active { transform: scale(.92); }
.icbtn.spin svg { animation: spin 1s linear infinite; }

.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.row .grow { flex: 2; }
.row.gap { margin-top: 12px; }

/* ---------- 2. écran de connexion */
#login {
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  max-width: 420px; margin: 0 auto; padding: calc(32px + var(--sat)) 24px calc(32px + var(--sab));
}
#login .logo {
  width: 84px; height: 84px; border-radius: 26px; margin-bottom: 6px; color: #fff;
  background: linear-gradient(145deg, #2fe27a, #0e9f55);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 34px rgba(37, 211, 102, .35);
}
#login h1 { margin: 6px 0 0; font-size: 36px; line-height: 1.05; letter-spacing: -.02em; }
#login h1 span { display: block; margin-top: 6px; font-size: 20px; font-weight: 600; letter-spacing: 0; color: var(--acc); }
#login p { margin: 0; color: var(--mut); }
.field-group { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--mut); }

/* ---------- 3. coque : en-tête, onglets du bas, tirer pour rafraîchir */
#app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(8, 12, 21, .82);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.hrow { display: flex; align-items: center; gap: 10px; min-height: calc(var(--hdr-h) + var(--sat)); padding: calc(8px + var(--sat)) 16px 8px; }
header .title { flex: 1; min-width: 0; font-size: 19px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .title small { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--mut); overflow: hidden; text-overflow: ellipsis; }
.banner { padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: var(--amb); background: rgba(255, 182, 72, .14); border-top: 1px solid rgba(255, 182, 72, .25); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  background: var(--card2); color: var(--mut); font-size: 12.5px; font-weight: 750; letter-spacing: .04em;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mut); }
.pill.on { background: rgba(37, 211, 102, .14); color: var(--acc); }
.pill.on .dot { background: var(--acc); animation: ping 2s infinite; }
.pill.off { background: rgba(255, 93, 93, .12); color: var(--red); }
.pill.off .dot { background: var(--red); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); } 70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }

#ptr {
  position: fixed; left: 50%; top: calc(var(--sat) + var(--hdr-h) - 36px); z-index: 4;
  width: 40px; height: 40px; border-radius: 50%; color: var(--mut);
  background: var(--card3); border: 1px solid var(--line2); box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, 0); opacity: 0; pointer-events: none;
}
#ptr.ready { color: var(--acc); border-color: rgba(37, 211, 102, .5); }
#ptr.loading svg { animation: spin .8s linear infinite; }

main {
  flex: 1; width: 100%; max-width: 620px; margin: 0 auto;
  padding: 14px 16px calc(var(--nav-h) + var(--sab) + 28px);
  transition: opacity .2s;
}
main.loading { opacity: .5; pointer-events: none; }
section.tab { display: none; flex-direction: column; gap: 14px; }
section.tab.active { display: flex; animation: tabin .24s var(--ease); }
@keyframes tabin { from { opacity: 0; transform: translateY(10px); } }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: center; height: calc(var(--nav-h) + var(--sab)); padding: 6px 6px var(--sab);
  background: rgba(10, 14, 24, .88);
  -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px);
  border-top: 1px solid var(--line);
}
nav.tabs button {
  position: relative; flex: 1; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 14px; color: var(--mut); font-size: 10.5px; font-weight: 650; transition: color .15s, transform .12s;
}
nav.tabs button .ic { width: 26px; height: 26px; transition: transform .25s var(--ease); }
nav.tabs button.active { color: var(--acc); }
nav.tabs button.active .ic { transform: translateY(-1px) scale(1.08); }
nav.tabs button.active::before { content: ""; position: absolute; top: -7px; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 0 0 4px 4px; background: var(--acc); }
nav.tabs button:active { transform: scale(.94); }
nav.tabs button .badge {
  position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--amb); color: #231500; font-size: 11px; font-weight: 800; box-shadow: 0 0 0 2px #0a0e18;
}
body.kb nav.tabs, body.kb .sendbar { display: none; } /* clavier ouvert : on libère la place */
body.kb main { padding-bottom: 24px; }

/* ---------- 4. cartes, interrupteurs, listes */
.card {
  padding: 16px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .18);
}
.card.flush { padding: 4px 16px; }
.card h3 { margin: 0 0 12px; font-size: 12.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); }
.card > .btn, .card > .row, .card > .actions { margin-top: 12px; }
.card > h3 + .btn { margin-top: 0; }
.card > .kv:first-of-type { border-top: 0; padding-top: 0; }

.switch {
  position: relative; flex: none; width: 62px; height: 36px; border-radius: 999px; outline: none; cursor: pointer;
  background: #2b3450; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .22s var(--ease);
}
.switch.on { background: var(--acc); }
.switch.on::after { transform: translateX(26px); }
.switch:focus-visible { box-shadow: 0 0 0 3px rgba(37, 211, 102, .4); }
.switch.busy { opacity: .55; pointer-events: none; }
.switch.big { width: 78px; height: 46px; }
.switch.big::after { top: 4px; left: 4px; width: 38px; height: 38px; }
.switch.big.on::after { transform: translateX(32px); }
.switch.mini { width: 52px; height: 32px; }
.switch.mini::after { width: 26px; height: 26px; }
.switch.mini.on::after { transform: translateX(20px); }

.opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
h3 + .opt { border-top: 0; padding-top: 0; }
.opt .l { flex: 1; min-width: 0; font-weight: 650; }
.opt .l small { display: block; margin-top: 1px; font-size: 12.5px; font-weight: 400; color: var(--mut); }
.l.inst { margin-bottom: 4px; font-weight: 650; }
.empty { padding: 22px 0; text-align: center; font-size: 14.5px; color: var(--mut); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.kv span:first-child { color: var(--mut); }
.kv span:last-child { min-width: 0; text-align: right; }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 116px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--card2); color: var(--mut); font-size: 12px; font-weight: 650; white-space: nowrap; }
.chip.g { color: var(--acc); } .chip.r { color: var(--red); } .chip.a { color: var(--amb); } .chip.b { color: var(--blu); }

/* pastilles de choix : filtres, public, tons */
.filters { display: flex; gap: 8px; margin: 0 -16px; padding: 2px 16px 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filters button, .aud button {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--mut); font-size: 14px; font-weight: 650;
  transition: background .15s, color .15s, transform .1s;
}
.filters button:active, .aud button:active { transform: scale(.95); }
.filters button.active, .aud button.active { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.cnt { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: 12px; font-weight: 750; text-align: center; }
.active .cnt { background: rgba(0, 0, 0, .15); }
.aud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 5. onglet Soirée */
.hero {
  padding: 18px; border-color: rgba(255, 93, 93, .22);
  background: linear-gradient(135deg, rgba(255, 93, 93, .10), rgba(255, 93, 93, .02) 60%), var(--card);
  transition: background .3s, border-color .3s;
}
.hero.on {
  border-color: rgba(37, 211, 102, .4);
  background: linear-gradient(135deg, rgba(37, 211, 102, .22), rgba(37, 211, 102, .04) 60%), var(--card);
  box-shadow: 0 0 0 1px rgba(37, 211, 102, .12), 0 12px 40px rgba(37, 211, 102, .12);
}
.status { display: flex; align-items: center; gap: 14px; }
.st-text { flex: 1; min-width: 0; }
.status .big { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.status .sub { margin-top: 3px; font-size: 13.5px; color: var(--mut); }

.issue { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.issue:first-child { border-top: 0; padding-top: 0; }
.issue .lv { flex: none; margin-top: 1px; }
.issue .tx { flex: 1; min-width: 0; }
.issue .go { flex: none; align-self: center; min-height: 38px; padding: 0 12px; font-size: 13.5px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: block; width: 100%; padding: 14px 14px 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: inherit; text-align: left; }
button.tile { transition: transform .12s var(--ease); }
button.tile:active { transform: scale(.97); }
.tile .v { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile .l { margin-top: 3px; font-size: 12.5px; color: var(--mut); }
.tile.warn .v { color: var(--amb); }
.tile.good .v { color: var(--acc); }
.tile.bump { animation: bump .8s var(--ease); }
@keyframes bump { 0% { background: var(--card); } 25% { transform: scale(1.04); background: rgba(37, 211, 102, .18); } 100% { transform: scale(1); background: var(--card); } }
.tile.sk .v, .tile.sk .l { border-radius: 8px; color: transparent; background: linear-gradient(90deg, var(--card2), var(--card3), var(--card2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.tile.sk .l { width: 60%; margin-top: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.cost { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.cost .usd { font-size: 44px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cost .usd.bump { animation: pop .7s var(--ease); }
@keyframes pop { 30% { transform: scale(1.07); color: var(--acc); } }
.cost .eur { font-size: 15px; color: var(--mut); }
.costline { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--mut); }
.costline b { color: var(--txt); text-align: right; }

.spark { display: block; width: 100%; height: 84px; }
.spark rect { fill: var(--acc); opacity: .5; }
.spark rect.peak { opacity: 1; }
.sparkx { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--mut); font-variant-numeric: tabular-nums; }

.rank { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 0; border-top: 1px solid var(--line); text-align: left; transition: background .12s; }
.rank:first-child { border-top: 0; padding-top: 0; }
.rank:active, .person:active { background: rgba(255, 255, 255, .04); }
.rank .medal { flex: none; width: 28px; text-align: center; font-size: 21px; font-weight: 800; color: var(--mut); }
.rank .n { flex: 1; min-width: 0; }
.rank .n b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .n small { font-size: 12.5px; color: var(--mut); }
.rank .tot { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- 6. onglet Inscrits */
.search { display: flex; gap: 8px; }
.search .inp { flex: 1; font-size: 17px; }
.list { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border-top: 1px solid var(--line); text-align: left; transition: background .12s; }
.person:first-child { border-top: 0; }
.num { flex: none; display: flex; align-items: center; justify-content: center; width: 50px; height: 46px; border-radius: 14px; background: var(--card2); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.num.blocked { background: rgba(255, 93, 93, .16); color: var(--red); }
.person .n { flex: 1; min-width: 0; }
.person .n b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .n small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--mut); }
.chev { flex: none; margin-left: -2px; font-size: 22px; color: var(--mut); }

/* ---------- 7. onglet Journal */
.ev { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.ev:first-child { border-top: 0; padding-top: 0; }
.ev .t { flex: none; width: 44px; padding-top: 1px; font-size: 13px; color: var(--mut); font-variant-numeric: tabular-nums; }
.ev .ic { flex: none; width: 24px; text-align: center; }
.ev .d { flex: 1; min-width: 0; word-break: break-word; }
.ev .d small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--mut); }

/* ---------- 8. onglet Annonce : éditeur, aperçu, envoi */
.toolbar { display: flex; gap: 6px; margin-bottom: 10px; }
.toolbar button { min-width: 44px; height: 44px; border-radius: 12px; background: var(--card2); font-size: 16px; font-weight: 700; transition: background .12s, transform .1s; }
.toolbar button:active { transform: scale(.94); }
.toolbar button.b { font-weight: 900; }
.toolbar button.i { font: italic 700 17px Georgia, serif; }
.toolbar button.s { text-decoration: line-through; }
.toolbar button.m { font: 700 13px ui-monospace, Menlo, monospace; }
.toolbar button.wide { padding: 0 12px; font-size: 14px; }
.toolbar button.push { margin-left: auto; }
.toolbar button.on { background: var(--acc); color: var(--acc-ink); }
.editor {
  min-height: 140px; max-height: 42vh; overflow: auto; padding: 14px; outline: none;
  background: var(--card2); border: 1.5px solid var(--line2); border-radius: 16px;
  font-size: 17px; line-height: 1.4; white-space: pre-wrap; word-break: break-word;
  -webkit-user-select: text; user-select: text; transition: border-color .15s;
}
.editor:focus { border-color: var(--acc); }
.editor:empty::before { content: attr(data-ph); color: #5f6a86; pointer-events: none; }
.editor b, .editor strong { font-weight: 800; }
.editor code { padding: 0 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); font-family: ui-monospace, Menlo, monospace; }
#attach-zone:not(:empty) { margin-top: 12px; }
.attach { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 14px; background: var(--card2); font-size: 14px; }
.attach .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach .x { flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--red); font-weight: 700; }
.rec { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 93, 93, .12); border: 1px solid rgba(255, 93, 93, .4); }
.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.rec .muted { margin-left: auto; }
@keyframes blink { 50% { opacity: .2; } }
.mediabar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.mbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 62px; border-radius: 14px; background: var(--card2); font-size: 12.5px; font-weight: 650; transition: transform .1s, background .15s; }
.mbtn .mi { font-size: 22px; line-height: 1; }
.mbtn:active { transform: scale(.95); }
.mbtn.on { background: rgba(255, 93, 93, .18); color: var(--red); }

.preview {
  display: flex; flex-direction: column; gap: 6px; min-height: 80px; padding: 14px 12px; border-radius: 16px;
  background: #0b1812 radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 14px 14px;
}
.bubble {
  align-self: flex-end; max-width: 88%; padding: 7px 10px 5px;
  background: #005c4b; color: #e9fdf5; border-radius: 12px 3px 12px 12px;
  font-size: 15.5px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
.bubble .meta { margin-top: 3px; text-align: right; font-size: 11px; color: #a3d9c4; }
.bubble img, .bubble video { display: block; max-width: 100%; margin: 2px 0 6px; border-radius: 8px; }
.bubble .vocal { display: flex; align-items: center; gap: 8px; min-width: 210px; margin-bottom: 4px; padding: 8px; border-radius: 10px; background: rgba(0, 0, 0, .2); }
.bubble .vocal .play { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #005c4b; font-size: 13px; }
.bubble .vocal .wave { flex: 1; height: 18px; border-radius: 2px; opacity: .8; background: repeating-linear-gradient(90deg, #9bd8c5 0 2px, transparent 2px 5px); }
.bubble .vocal .dur { font-size: 12px; }
.bubble code { font-family: ui-monospace, Menlo, monospace; }
.bubble .muted { color: #a3d9c4; }

.tones { display: flex; flex-wrap: wrap; gap: 8px; }
.tones button { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--card2); color: var(--mut); font-size: 14px; font-weight: 650; transition: background .15s, color .15s; }
.tones button.active { background: var(--pur); color: #1a0b33; }

.sendbar {
  position: sticky; bottom: calc(var(--nav-h) + var(--sab) + 10px); z-index: 3;
  display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 22px;
  background: rgba(17, 23, 40, .92);
  -webkit-backdrop-filter: saturate(1.5) blur(18px); backdrop-filter: saturate(1.5) blur(18px);
  border: 1px solid var(--line2); box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}
.costnote { font-size: 14px; text-align: center; color: var(--mut); }
.costnote b { color: var(--txt); }
.costnote .muted { margin-top: 3px; font-size: 12.5px; }
.progress { height: 8px; overflow: hidden; border-radius: 99px; background: var(--card3); }
.progress > i { display: block; width: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--acc), #7dffb0); transition: width .3s var(--ease); }
#a-result:empty { display: none; }
.result { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--acc); }
.result.warn { border-left-color: var(--amb); }
.result b { font-size: 16px; }
.result .actions { margin-top: 6px; }
.fail-list { padding: 10px 12px; border-radius: 12px; background: var(--card2); font-size: 14px; }
.fail-list small { display: block; margin-top: 4px; color: var(--mut); }

/* ---------- 9. onglet Réglages */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card2); }
.seg button { flex: 1; height: 44px; border-radius: 11px; color: var(--mut); font-size: 15px; font-weight: 700; transition: background .18s, color .18s; }
.seg button.active { background: var(--acc); color: var(--acc-ink); box-shadow: 0 2px 10px rgba(37, 211, 102, .3); }
.check { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.check .ic { flex: none; width: 24px; text-align: center; }
.check b { display: block; }
.check small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--mut); word-break: break-word; }
.check.ko b { color: var(--red); }
.check.warn b { color: var(--amb); }
#diag-out:not(:empty) { margin-top: 12px; }
.bl { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.bl:first-child { border-top: 0; padding-top: 0; }
.bl .n { flex: 1; min-width: 0; }
.bl .n small { display: block; font-size: 12.5px; color: var(--mut); }

/* ---------- 10. feuilles du bas, confirmations, messages */
.sheetwrap { position: fixed; inset: 0; z-index: 20; display: none; }
.sheetwrap.open { display: block; }
.sheetwrap .bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); animation: fade .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 620px; max-height: 90vh; max-height: 90dvh; margin: 0 auto; overflow: auto;
  padding: 10px 18px calc(20px + var(--sab)); overscroll-behavior: contain;
  background: var(--card); border-top: 1px solid var(--line2); border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); animation: up .26s var(--ease);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: var(--line2); }
.sheet h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.01em; }
.sheet .sub { margin-bottom: 14px; font-size: 14.5px; color: var(--mut); }
.sheet .subhead { margin: 18px 0 6px; font-size: 12.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); }
.sheet .inp + .check-line, .sheet .sub .check-line { margin-top: 14px; }
.check-line { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; font-size: 14.5px; color: var(--txt); }
.check-line input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--acc); }

#toast {
  position: fixed; left: 50%; top: calc(var(--sat) + var(--hdr-h) + 10px); z-index: 30;
  max-width: 92vw; padding: 12px 18px; border-radius: 999px; text-align: center;
  background: #fff; color: #0b1020; font-size: 14.5px; font-weight: 650; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transform: translate(-50%, -14px); transition: opacity .2s, transform .25s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* petits utilitaires : la politique de sécurité interdit les attributs style="…" dans le HTML */
.tx-red { color: var(--red); }
.mt6 { margin-top: 6px; }
.mb12 { margin-bottom: 12px; }
