/* Clai IA — styles. Couleurs reprises des maquettes validées par Lucas. */

:root,
:root[data-theme="dark"] {
  --bg: #0B0F1F;
  --bg-footer: #0D1224;
  --surface: #141A2E;
  --surface-2: #1B2340;
  --border: #26304D;
  --line: #1E2740;
  --text: #E8ECF8;
  --muted: #9AA3C0;
  --placeholder: #8A93B2;
  --accent: #22D3EE;
  --accent-text: #67E8F9;
  --violet: #A855F7;
  --violet-text: #C4A5FF;
  --badge-bg: #13283A;
  --badge-border: #1F4A5E;
  --pill-bg: #1A1533;
  --pill-border: #3B2F6B;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  --link: #22D3EE;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-footer: #F8F9FD;
  --surface: #F3F5FB;
  --surface-2: #EEF1F8;
  --border: #D5DBEA;
  --line: #E3E7F1;
  --text: #0F1B3D;
  --muted: #55607F;
  --placeholder: #6B7590;
  --accent: #0891B2;
  --accent-text: #0E7490;
  --violet: #7C3AED;
  --violet-text: #6D28D9;
  --badge-bg: #E6F7FB;
  --badge-border: #A5E3EF;
  --pill-bg: #F4EEFF;
  --pill-border: #D8C8F7;
  --shadow: 0 12px 32px rgba(15, 27, 61, 0.15);
  --link: #0E7490;
  color-scheme: light;
}

:root { --grad: linear-gradient(135deg, #0E7490, #7E22CE); }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
a { color: var(--link); }

.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;
}

.app {
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* En-tête */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 44px; height: 44px; display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
:root[data-theme="dark"] .icon-moon,
:root:not([data-theme]) .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }

/* Barre du modèle */
.modelbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.model-picker { position: relative; }
.model-btn {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 20px; border: 1px solid var(--pill-border); background: var(--pill-bg);
  color: var(--text); font-size: 14px; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); }
.plan-badge {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 12px;
  background: var(--badge-bg); color: var(--accent-text); border: 1px solid var(--badge-border);
}

.model-menu {
  position: absolute; top: 48px; left: 0; width: 260px; z-index: 10;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 8px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.model-menu[hidden] { display: none; }
.model-opt {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 48px; padding: 8px 12px; border-radius: 10px; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--text);
}
.model-opt[aria-selected="true"] { border-color: var(--accent); background: var(--badge-bg); }
.model-opt.locked { opacity: 0.55; }
.model-opt-name { display: block; font-weight: 600; font-size: 14px; }
.model-opt-desc { display: block; font-size: 12px; color: var(--muted); }
.model-opt-lock { font-size: 11px; color: var(--violet-text); white-space: nowrap; }

/* Messages */
.messages {
  flex: 1; overflow-y: auto;
  padding: 4px 16px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.msg {
  max-width: 85%; padding: 12px 14px; font-size: 15px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-ai {
  align-self: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px 18px 18px 18px;
}
.msg-user {
  align-self: flex-end; max-width: 80%; color: #FFFFFF; background: var(--grad);
  border-radius: 18px 4px 18px 18px;
}
.msg-error { border-color: #F43F5E; }
.msg-media { width: 85%; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.media-placeholder {
  height: 180px; border-radius: 12px; background: var(--surface-2);
  border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; padding: 12px; text-align: center;
}
.msg-meta { font-size: 12px; color: var(--muted); padding: 0 4px; }
.typing { color: var(--muted); font-style: italic; }

/* Zone d'écriture */
.composer {
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg-footer);
  display: flex; flex-direction: column; gap: 10px;
}
.tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  background: var(--surface); border-radius: 14px; padding: 4px;
}
.tab {
  height: 40px; border-radius: 10px; border: none; font-size: 14px; font-weight: 600;
  background: transparent; color: var(--muted);
}
.tab[aria-selected="true"] { background: var(--grad); color: #FFFFFF; }

.input-row { display: flex; gap: 8px; align-items: center; margin: 0; }
.input-row input {
  flex: 1; min-width: 0; height: 48px; border-radius: 24px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 0 18px; font-size: 16px; font-family: inherit;
}
.input-row input::placeholder { color: var(--placeholder); }
.input-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.send-btn {
  width: 48px; height: 48px; flex: none; border-radius: 24px; border: none;
  background: linear-gradient(135deg, #22D3EE, #A855F7); color: #0B0F1F;
  display: flex; align-items: center; justify-content: center;
}
.send-btn:disabled { opacity: 0.5; cursor: default; }
.quota { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Page connexion ---------- */
.auth {
  min-height: 100dvh; max-width: 440px; margin: 0 auto;
  padding: 48px 24px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 28px;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.auth-logo { width: 96px; height: 96px; }
.auth-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 28px; letter-spacing: 2px; }
.auth-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field[hidden] { display: none; }
.auth-field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-field input {
  height: 48px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 0 16px; font-size: 16px; font-family: inherit;
}
.auth-field input::placeholder { color: var(--placeholder); }
.auth-erreur { margin: 0; min-height: 1.2em; font-size: 14px; color: #FB7185; }
:root[data-theme="light"] .auth-erreur { color: #BE123C; }
.auth-btn {
  height: 52px; border-radius: 16px; border: none; color: #FFFFFF; font-size: 16px; font-weight: 600;
  background: var(--grad);
}
.auth-btn:disabled { opacity: 0.6; }
.auth-bas { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.auth-note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.theme-switch {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 4px;
}
.theme-switch button {
  height: 36px; border-radius: 18px; border: none; font-size: 13px; font-weight: 600;
  background: transparent; color: var(--muted);
}
.theme-switch button[aria-pressed="true"] { background: var(--grad); color: #FFFFFF; }

/* ---------- Menu ---------- */
.menu-fond { position: fixed; inset: 0; background: rgba(5, 8, 20, 0.55); z-index: 20; }
.menu-fond[hidden] { display: none; }
.menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); z-index: 21;
  background: var(--bg); border-left: 1px solid var(--border);
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow);
}
.menu[hidden] { display: none; }
.menu-haut { display: flex; justify-content: space-between; align-items: center; }
.menu-titre { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; }
.menu-compte {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.menu-pseudo { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.menu-email { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.menu-liens { display: flex; flex-direction: column; gap: 4px; }
.menu-lien {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 12px;
  border-radius: 12px; border: none; background: transparent; color: var(--text); font-size: 15px;
  text-decoration: none; text-align: left; width: 100%;
}
.menu-lien:hover { background: var(--surface); }
.menu-lien small { color: var(--muted); font-size: 12px; }
.menu-btn {
  height: 48px; border-radius: 14px; border: none; color: #FFFFFF; font-weight: 600; font-size: 15px;
  background: var(--grad); text-decoration: none; display: flex; align-items: center; justify-content: center;
}
.menu-btn.secondaire { background: transparent; color: var(--text); border: 1px solid var(--border); }
.menu-bas { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.menu-btn[hidden] { display: none; }

/* ---------- Personnalisation : couleurs ---------- */
:root[data-couleur="ocean"] { --accent: #38BDF8; --violet: #2DD4BF; --grad: linear-gradient(135deg, #0369A1, #0F766E); --pill-border: #1E4D6B; --accent-text: #7DD3FC; }
:root[data-couleur="feu"]   { --accent: #FB923C; --violet: #F43F5E; --grad: linear-gradient(135deg, #C2410C, #BE123C); --pill-border: #7C2D12; --accent-text: #FDBA74; }
:root[data-couleur="foret"] { --accent: #4ADE80; --violet: #A3E635; --grad: linear-gradient(135deg, #15803D, #4D7C0F); --pill-border: #14532D; --accent-text: #86EFAC; }
:root[data-couleur="rose"]  { --accent: #F472B6; --violet: #C084FC; --grad: linear-gradient(135deg, #BE185D, #7E22CE); --pill-border: #831843; --accent-text: #F9A8D4; }
:root[data-theme="light"][data-couleur="ocean"] { --accent: #0369A1; --accent-text: #075985; --pill-border: #BAE6FD; }
:root[data-theme="light"][data-couleur="feu"]   { --accent: #C2410C; --accent-text: #9A3412; --pill-border: #FED7AA; }
:root[data-theme="light"][data-couleur="foret"] { --accent: #15803D; --accent-text: #166534; --pill-border: #BBF7D0; }
:root[data-theme="light"][data-couleur="rose"]  { --accent: #BE185D; --accent-text: #9D174D; --pill-border: #FBCFE8; }
.send-btn { background: linear-gradient(135deg, var(--accent), var(--violet)); }

/* ---------- Personnalisation : fonds ---------- */
:root[data-fond="etoiles"] body {
  background-image:
    radial-gradient(circle at 12% 18%, var(--muted) 1px, transparent 1.5px),
    radial-gradient(circle at 68% 42%, var(--muted) 1px, transparent 1.5px),
    radial-gradient(circle at 35% 78%, var(--muted) 1px, transparent 1.5px),
    radial-gradient(circle at 88% 85%, var(--muted) 1px, transparent 1.5px);
  background-size: 180px 180px;
}
:root[data-fond="grille"] body {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
}
:root[data-fond="aurore"] body {
  background-image: linear-gradient(170deg, transparent 40%, color-mix(in srgb, var(--violet) 22%, transparent) 100%);
}

/* ---------- Personnalisation : disposition ---------- */
:root[data-disposition="inversee"] .topbar { order: 0; }
:root[data-disposition="inversee"] .modelbar { order: 1; }
:root[data-disposition="inversee"] .composer { order: 2; border-top: none; border-bottom: 1px solid var(--line); }
:root[data-disposition="inversee"] .messages { order: 3; }
:root[data-disposition="compacte"] .msg { padding: 8px 11px; font-size: 14px; }
:root[data-disposition="compacte"] .messages { gap: 8px; }
:root[data-disposition="compacte"] .topbar { padding-block: 10px 8px; }

/* ---------- Avatar de l'IA ---------- */
.avatar {
  flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #FFFFFF; font-weight: 700;
}
.ligne-ia { display: flex; gap: 8px; align-items: flex-start; align-self: flex-start; max-width: 92%; }
.ligne-ia .msg { max-width: none; }

/* ---------- Pages secondaires (formules, personnaliser, historique) ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; }
.page-haut { display: flex; align-items: center; gap: 10px; padding: 16px 0 12px; border-bottom: 1px solid var(--line); }
.page-haut h1 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 22px; }
.page-haut .plan-badge { margin-left: auto; }
.retour { text-decoration: none; }
.intro { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.bandeau-test {
  font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 12px;
  border: 1px dashed var(--pill-border); background: var(--pill-bg); color: var(--text);
}
.statut { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--accent-text); }
.statut.erreur { color: #FB7185; }

.cartes { display: flex; flex-direction: column; gap: 14px; }
.carte {
  padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.carte.actuelle { border: 2px solid var(--accent); }
.carte-tete { display: flex; justify-content: space-between; align-items: center; }
.carte h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 22px; }
.prix { font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prix small { font-size: 14px; color: var(--muted); font-family: Inter, sans-serif; font-weight: 400; }
.carte ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.carte li { display: flex; gap: 10px; font-size: 14px; line-height: 1.4; }
.carte li::before { content: "✓"; color: var(--accent); font-weight: 700; }
.bouton {
  min-height: 48px; padding: 0 16px; border-radius: 14px; border: none; font-size: 15px; font-weight: 600;
  background: var(--grad); color: #FFFFFF;
}
.bouton.secondaire { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.bouton:disabled { opacity: 0.6; cursor: default; }

.section { display: flex; flex-direction: column; gap: 10px; }
.section-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section h2 { margin: 0; font-size: 16px; }
.niveau { font-size: 12px; color: var(--violet-text); white-space: nowrap; }
.grille-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.choix {
  min-height: 64px; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px;
}
.choix[aria-pressed="true"] { border: 2px solid var(--accent); }
.choix:disabled { opacity: 0.35; cursor: not-allowed; }
.pastille { width: 28px; height: 28px; border-radius: 50%; }
.verrou {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 14px; border: 1px dashed var(--border); color: var(--muted); font-size: 13px;
}
.verrou a { white-space: nowrap; }
.champ-texte {
  height: 48px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 0 16px; font-size: 16px; font-family: inherit;
}
.apercu {
  padding: 14px; border-radius: 18px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px;
}

.histo-jour { margin: 8px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.histo-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.histo-q { align-self: flex-end; max-width: 85%; padding: 8px 12px; border-radius: 14px 4px 14px 14px; background: var(--grad); color: #FFFFFF; font-size: 14px; overflow-wrap: anywhere; }
.histo-r { align-self: flex-start; max-width: 85%; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.histo-heure { font-size: 11px; color: var(--muted); }
.vide { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 16px; }
.auth-bienvenue { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.auth-titre { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 22px; text-wrap: balance; }
.auth-form[hidden] { display: none; }
.badge-admin {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 8px; background: var(--grad); color: #FFFFFF;
}
.badge-admin[hidden] { display: none; }
.avatar { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plus-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); }
.effort-titre { margin: 6px 6px 2px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.4; color: var(--muted); }
.effort-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 12px; border-radius: 10px;
  border: none; background: transparent; color: var(--text); font-size: 14px; text-align: left;
}
.effort-opt:hover { background: var(--badge-bg); }
.effort-opt.locked { opacity: 0.55; }
.effort-note { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--badge-bg); color: var(--accent-text); }
.effort-coche { margin-left: auto; color: var(--accent); font-weight: 700; }
.effort-opt .model-opt-lock { margin-left: auto; }
.model-menu { max-height: 70vh; overflow-y: auto; }
.ligne-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ligne-form .champ-texte { flex: 1 1 160px; min-width: 0; }
.admin-carte { gap: 8px; padding: 14px; }
.admin-lien { font-size: 12px; overflow-wrap: anywhere; color: var(--link); }
.admin-barre { height: 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.admin-plein { height: 100%; background: var(--grad); }
select.champ-texte { appearance: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu-lien[hidden] { display: none; }
.journal { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 14px; padding: 8px; }
.journal-ligne { display: flex; gap: 8px; font-size: 12px; line-height: 1.4; padding: 4px 6px; border-radius: 8px; overflow-wrap: anywhere; }
.journal-ligne.alerte { background: rgba(244, 63, 94, 0.12); }
.journal-quand { color: var(--muted); white-space: nowrap; }
.badge-bloque { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: #BE123C; color: #fff; }
.zone-danger { border: 1px solid rgba(244, 63, 94, 0.5); border-radius: 16px; padding: 14px; }
.bouton.danger { background: #BE123C; }
.statut.erreur { color: #FB7185; }
:root[data-theme="light"] .statut.erreur { color: #BE123C; }
.texte-regles { display: flex; flex-direction: column; gap: 10px; line-height: 1.55; font-size: 15px; }
.texte-regles h2 { margin: 14px 0 0; font-family: 'Space Grotesk', sans-serif; font-size: 19px; }
.texte-regles ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.texte-regles p { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-family: 'Space Grotesk', sans-serif; font-size: 34px; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 12px; color: var(--muted); }
.connecte { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.point-vert { width: 10px; height: 10px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 8px #22C55E; flex: none; }

/* ---------- Personnaliser (refait) ---------- */
.perso-carte { padding: 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); }
.perso-carte.fermee { opacity: .85; }
.perso-carte .choix { background: var(--bg); }
.grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grille-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grille-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choix .pastille { width: 34px; height: 34px; }
.choix-grand { min-height: 0; padding: 10px 6px; gap: 8px; justify-content: flex-start; }
.choix-grand strong { font-size: 13px; }
.choix-desc { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.3; }
.apercu-fond { width: 100%; aspect-ratio: 1 / 1; max-width: 72px; border-radius: 10px; border: 1px solid var(--border); background-color: var(--bg); }
.fond-etoiles { background-image: radial-gradient(circle at 20% 25%, var(--text) 1px, transparent 1.5px), radial-gradient(circle at 70% 60%, var(--text) 1px, transparent 1.5px), radial-gradient(circle at 40% 80%, var(--muted) 1px, transparent 1.5px); background-size: 24px 24px; }
.fond-grille { background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 10px 10px; }
.fond-aurore { background-image: linear-gradient(160deg, transparent 30%, color-mix(in srgb, var(--violet) 45%, transparent)); }
.mini-tel { width: 46px; height: 78px; border-radius: 9px; border: 2px solid var(--border); background: var(--bg); display: flex; flex-direction: column; gap: 3px; padding: 4px; box-sizing: border-box; }
.m-haut { height: 7px; border-radius: 3px; background: var(--muted); opacity: .6; flex: none; }
.m-onglets { height: 9px; border-radius: 3px; background: var(--grad); flex: none; }
.m-msgs { flex: 1; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.m-bulle { height: 7px; width: 70%; border-radius: 3px; background: var(--border); }
.m-bulle.m-moi { align-self: flex-end; background: var(--accent); opacity: .8; }
.mini-inversee .m-onglets { order: 1; }
.mini-inversee .m-haut { order: 0; }
.mini-inversee .m-msgs { order: 2; }
.mini-compacte .m-bulle { height: 4px; }
.choix[aria-pressed="true"] .mini-tel { border-color: var(--accent); }

/* ---------- Barre du bas « tout-en-un » ---------- */
.composer { padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); gap: 6px; border-top: none; background: transparent; }
.boite {
  display: flex; flex-direction: column; gap: 8px; margin: 0;
  padding: 12px 10px 10px 16px; border-radius: 26px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: border-color .2s, box-shadow .2s;
}
.boite:focus-within { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 10px 30px rgba(0, 0, 0, .25); }
.boite textarea {
  width: 100%; min-height: 28px; max-height: 160px; resize: none; border: none; outline: none; background: transparent;
  color: var(--text); font: inherit; font-size: 16px; line-height: 1.45; padding: 2px 4px 0 0;
}
.boite textarea::placeholder { color: var(--placeholder); }
.boite textarea:focus { outline: none; }
.boite-bas { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.boite .tabs { display: flex; gap: 6px; background: transparent; padding: 0; border-radius: 0; flex-wrap: nowrap; min-width: 0; }
.boite .tab {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.boite .tab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boite .tab[aria-selected="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.boite .send-btn { width: 42px; height: 42px; flex: none; border-radius: 50%; color: #fff; }
.boite .send-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.composer .quota { font-size: 11px; }
@media (max-width: 370px) { .boite .tab { padding: 0 9px; } .boite .tab span { font-size: 12px; } }
:root[data-disposition="inversee"] .composer { border-bottom: none; }
:root[data-theme="light"] .boite { box-shadow: 0 8px 24px rgba(15, 27, 61, .10); }
:root[data-theme="light"] .boite:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), 0 8px 24px rgba(15, 27, 61, .10); }

/* ---------- Accueil (discussion vide) ---------- */
.accueil { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px 4px; }
.accueil-logo img { width: 96px; height: 96px; filter: drop-shadow(0 0 24px color-mix(in srgb, var(--violet) 60%, transparent)); }
.accueil-logo .avatar { box-shadow: 0 0 30px color-mix(in srgb, var(--violet) 50%, transparent); }
.accueil-titre { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 30px; line-height: 1.15; text-wrap: balance; }
.grad-texte { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accueil-sous { margin: 0; max-width: 420px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 560px; margin-top: 8px; }
.suggestion {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 14px; border-radius: 16px; text-align: left;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  transition: border-color .15s, transform .15s;
}
.suggestion:hover { border-color: var(--accent); transform: translateY(-1px); }
.suggestion span { font-size: 18px; }
.messages { scroll-behavior: smooth; }

/* ---------- Grand écran (PC) : plus large, plus grand ---------- */
@media (min-width: 1000px) {
  .app { max-width: 1200px; }
  .topbar { padding: 22px 40px 16px; }
  .brand-logo { width: 54px; height: 54px; }
  .brand-name { font-size: 26px; }
  .brand-sub { font-size: 13px; }
  .icon-btn { width: 48px; height: 48px; }
  .modelbar { padding: 16px 40px; }
  .model-btn { height: 44px; font-size: 15px; }
  .plan-badge { font-size: 13px; padding: 8px 14px; }
  .messages { padding: 12px max(40px, calc((100% - 860px) / 2)) 24px; gap: 18px; }
  .msg { font-size: 16.5px; padding: 14px 18px; }
  .composer { padding: 10px max(40px, calc((100% - 900px) / 2)) 22px; }
  .boite { padding: 16px 14px 12px 20px; border-radius: 30px; }
  .boite textarea { font-size: 17px; }
  .boite .tab { height: 40px; padding: 0 16px; font-size: 14px; }
  .boite .send-btn { width: 48px; height: 48px; }
  .accueil-logo img { width: 130px; height: 130px; }
  .accueil-titre { font-size: 44px; }
  .accueil-sous { font-size: 17px; max-width: 520px; }
  .suggestions { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 860px; }
  .suggestion { flex-direction: column; align-items: flex-start; min-height: 96px; padding: 14px; font-size: 15px; }
  .model-menu { width: 300px; }
}

/* ---------- Petit écran (téléphone) : plus compact ---------- */
@media (max-width: 480px) {
  .topbar { padding: 10px 12px 8px; }
  .brand { gap: 8px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 10px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
  .topbar-actions { gap: 6px; }
  .modelbar { padding: 8px 12px; }
  .model-btn { height: 34px; padding: 0 11px; font-size: 13px; }
  .plan-badge { font-size: 11px; padding: 4px 9px; }
  .messages { padding: 4px 12px 10px; gap: 10px; }
  .msg { font-size: 14.5px; padding: 9px 12px; }
  .composer { padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); gap: 4px; }
  .boite { padding: 9px 7px 7px 13px; border-radius: 22px; gap: 6px; }
  .boite textarea { font-size: 16px; min-height: 24px; }
  .boite .tab { height: 32px; padding: 0 10px; font-size: 12px; gap: 5px; }
  .boite .tab svg { width: 14px; height: 14px; }
  .boite .send-btn { width: 38px; height: 38px; }
  .composer .quota { font-size: 10px; }
  .accueil { gap: 10px; padding: 12px 0; }
  .accueil-logo img { width: 72px; height: 72px; }
  .accueil-titre { font-size: 24px; }
  .accueil-sous { font-size: 14px; }
  .suggestion { min-height: 44px; padding: 8px 10px; font-size: 13px; border-radius: 14px; }
}

/* ---------- Très grands écrans : tout est agrandi ---------- */
@media (min-width: 1500px) and (min-height: 760px) { :root { --zoom: 1.2; } }
@media (min-width: 1900px) and (min-height: 940px) { :root { --zoom: 1.3; } }
@media (min-width: 2400px) and (min-height: 1250px) { :root { --zoom: 1.6; } }
@media (min-width: 1500px) and (min-height: 760px) {
  body { zoom: var(--zoom); }
  .app { height: calc(100dvh / var(--zoom)); }
  .auth { min-height: calc(100dvh / var(--zoom)); }
}

/* L'accueil reste centré mais n'est jamais coupé quand la fenêtre est basse. */
.messages:has(.accueil) { justify-content: safe center; }
.messages .accueil { margin: 0; }
@media (min-width: 1000px) and (max-height: 780px) {
  .accueil { gap: 8px; padding: 8px 0; }
  .accueil-logo img { width: 80px; height: 80px; }
  .accueil-titre { font-size: 34px; }
  .suggestion { min-height: 64px; }
}

.etapes-2fa { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.cle-2fa { display: block; margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; font-size: 15px; letter-spacing: 1px; overflow-wrap: anywhere; user-select: all; }


/* ---------- Le fond couvre tout l'écran ---------- */
body { background-color: var(--bg); background-attachment: fixed; min-height: 100dvh; }
:root[data-fond="aurore"] body {
  background-image:
    radial-gradient(ellipse at 15% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(ellipse at 90% 100%, color-mix(in srgb, var(--violet) 32%, transparent), transparent 60%);
}
:root[data-fond="uni"] body, :root:not([data-fond]) body {
  background-image:
    radial-gradient(ellipse at 10% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 50%),
    radial-gradient(ellipse at 100% 110%, color-mix(in srgb, var(--violet) 12%, transparent), transparent 55%);
}

/* ---------- Plus de style ---------- */
/* en-tête et barre du bas en verre dépoli */
.topbar { position: relative; border-bottom-color: color-mix(in srgb, var(--border) 60%, transparent); }
.boite { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.icon-btn { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(8px); transition: transform .15s, border-color .15s; }
.icon-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.brand-name { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* halo animé derrière le logo de l'accueil */
.accueil-logo { position: relative; }
.accueil-logo::before {
  content: ""; position: absolute; inset: -30%; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, var(--accent), var(--violet), var(--accent));
  filter: blur(36px); opacity: .35; animation: halo 8s linear infinite;
}
@keyframes halo { to { transform: rotate(360deg); } }

/* bulles qui apparaissent en douceur */
.msg, .ligne-ia { animation: apparait .28s ease-out; }
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg-ai { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); }
.msg-user { box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 30%, transparent); }

/* suggestions avec lueur */
.suggestion { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(8px); }
.suggestion:hover { box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 25%, transparent); }

/* bouton envoyer qui brille */
.boite .send-btn { box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 40%, transparent); transition: transform .15s; }
.boite .send-btn:hover:not(:disabled) { transform: scale(1.06); }
.boite:focus-within { border-color: transparent; background-image: linear-gradient(color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface) 92%, transparent)), var(--grad); background-origin: border-box; background-clip: padding-box, border-box; border: 1.5px solid transparent; }

@media (prefers-reduced-motion: reduce) {
  .accueil-logo::before, .msg, .ligne-ia { animation: none; }
}

/* ---------- Bandeau âge / accord parental ---------- */
.bandeau-age { margin: 0 16px 8px; padding: 12px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45;
  border: 1px solid rgba(250, 204, 21, .55); background: color-mix(in srgb, #FACC15 12%, var(--surface)); color: var(--text); display: flex; flex-direction: column; gap: 8px; }
.bandeau-age[hidden] { display: none; }
.bandeau-age.doux { border-color: var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent); font-size: 13px; color: var(--muted); }
.bandeau-age p { margin: 0; }
.bandeau-ligne { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bandeau-ligne input { height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0 10px; font: inherit; }
.bandeau-ligne code { flex: 1 1 200px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; overflow-wrap: anywhere; }
.bouton-bandeau { height: 40px; padding: 0 14px; border-radius: 12px; border: none; background: var(--grad); color: #fff; font-weight: 600; }
@media (min-width: 1000px) { .bandeau-age { margin: 0 max(40px, calc((100% - 860px) / 2)) 10px; } }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.case input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.case.gros { font-weight: 600; }
.lien-bouton { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.adm-barres-parent { display: flex; flex-direction: column; gap: 8px; }
.adm-barres-parent .adm-barre { display: grid; grid-template-columns: 70px minmax(0, 1fr) 32px; gap: 8px; align-items: center; font-size: 13px; }
.adm-barres-parent .piste { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.adm-barres-parent .plein { height: 100%; background: var(--grad); }
.adm-barres-parent b { text-align: right; }

/* ---------- Boutons du haut : suivent la couleur du thème ---------- */
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--accent) 12%, color-mix(in srgb, var(--surface) 80%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-weight: 700; letter-spacing: .01em;
}
.plan-badge::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: var(--grad);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 18h18l-1.5-10-5 4L12 5l-2.5 7-5-4z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 18h18l-1.5-10-5 4L12 5l-2.5 7-5-4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.model-btn {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--violet) 14%, transparent);
  transition: border-color .15s, transform .15s;
}
.model-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.model-btn .dot { background: var(--grad); box-shadow: 0 0 8px var(--accent); }
.icon-btn {
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--violet) 12%, transparent);
  color: var(--accent-text);
}
.icon-btn:hover { background: var(--grad); color: #fff; border-color: transparent; }
.adm-onglets em, .adm-badge { background: var(--grad); }
.zone-texte { height: auto; min-height: 90px; padding: 10px 14px; resize: vertical; font: inherit; }
select.champ-texte { appearance: auto; }

/* ---------- Plusieurs conversations ---------- */
.cadre { display: block; }
.convs {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); z-index: 30;
  display: flex; flex-direction: column; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 12px 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border); transform: translateX(-105%); transition: transform .25s ease;
}
.convs.ouvert { transform: none; box-shadow: var(--shadow); }
.convs-fond { position: fixed; inset: 0; z-index: 29; background: rgba(5, 8, 20, .5); }
.convs-fond[hidden] { display: none; }
.convs-haut { display: flex; align-items: center; justify-content: space-between; font-family: 'Space Grotesk', sans-serif; font-size: 17px; }
.convs-nouvelle {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 14px; border: none;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 30%, transparent);
}
.convs-liste { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.convs-vide { font-size: 13px; color: var(--muted); padding: 8px 4px; }
.conv-ligne { display: flex; align-items: stretch; gap: 2px; }
.conv {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 12px; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--text);
}
.conv:hover { background: var(--surface); }
.conv[aria-current="true"] { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.conv-titre { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-quand { font-size: 11px; color: var(--muted); }
.conv-sup { border: none; background: transparent; color: var(--muted); border-radius: 10px; padding: 0 8px; font-size: 13px; opacity: .6; }
.conv-sup:hover { opacity: 1; background: var(--surface); }
@media (min-width: 1100px) {
  .cadre { display: grid; grid-template-columns: 290px minmax(0, 1fr); }
  .convs { position: sticky; top: 0; height: calc(100dvh / var(--zoom, 1)); transform: none; width: auto; box-shadow: none; z-index: 1; }
  .convs-fermer, #convs-btn { display: none; }
  .convs-fond { display: none; }
  .app { max-width: none; }
}

/* ---------- Annonce de la team ---------- */
.annonce {
  display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 10px 14px; border-radius: 14px; font-size: 14px; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); animation: apparait .3s ease-out;
}
.annonce[hidden] { display: none; }
.annonce.succes { background: color-mix(in srgb, #22C55E 15%, var(--surface)); border-color: rgba(34, 197, 94, .55); }
.annonce.alerte { background: color-mix(in srgb, #F43F5E 14%, var(--surface)); border-color: rgba(244, 63, 94, .55); }
.annonce span { flex: 1; }
.annonce button { border: none; background: transparent; color: var(--muted); font-size: 16px; width: 32px; height: 32px; border-radius: 8px; }
@media (min-width: 1000px) { .annonce { margin: 0 max(40px, calc((100% - 860px) / 2)) 10px; } }

/* ---------- Outils sous les réponses ---------- */
.outils { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.outil { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border); background: transparent; font-size: 15px; line-height: 1; opacity: .7; transition: opacity .15s, transform .15s; }
.outil:hover { opacity: 1; transform: translateY(-1px); }
.outil.choisi { opacity: 1; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.merci { font-size: 12px; color: var(--muted); margin-left: 4px; }

/* ---------- Dessins de Clai Vision ---------- */
.msg-media { width: min(85%, 420px); }
.dessins { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dessin { width: 100%; aspect-ratio: 1 / 1; image-rendering: pixelated; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
@media (max-width: 480px) { .dessins { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Menu refait ---------- */
.menu { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); gap: 14px; width: min(340px, 88vw); overflow-y: auto; }
.menu-profil {
  display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 20px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--violet) 22%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
}
.menu-avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; color: #fff; background: var(--grad); box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 40%, transparent); }
.menu-qui { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.menu-qui .menu-pseudo { font-size: 18px; font-weight: 700; }
.menu-qui .menu-email { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.menu-puces { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.menu-puces .badge-admin { font-size: 10px; }
.menu-formule { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; color: var(--accent-text); background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.menu-formule[hidden] { display: none; }
.menu-groupes { display: flex; flex-direction: column; gap: 12px; }
.menu-groupe { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); }
.menu-groupe-titre { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 4px; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px; border-radius: 12px; text-decoration: none; color: var(--text); transition: background .15s; }
.menu-item[hidden] { display: none; }
.menu-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mi-icone { width: 38px; height: 38px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--grad); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--violet) 25%, transparent); }
.mi-icone svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mi-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mi-texte span { font-size: 15px; font-weight: 600; }
.mi-texte small { font-size: 12px; color: var(--muted); }
.mi-fleche { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.menu-btn.deconnexion { gap: 8px; background: transparent; color: #F43F5E; border: 1px solid rgba(244, 63, 94, .45); }
.menu-btn.deconnexion:hover { background: rgba(244, 63, 94, .1); }

/* ---------- Panneau « Mes discussions » refait ---------- */
.convs { gap: 12px; padding-left: 14px; padding-right: 14px; }
.convs-titre { display: flex; align-items: center; gap: 8px; }
.convs-titre img { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--violet) 50%, transparent)) brightness(1.3); }
.convs-titre strong { font-family: 'Space Grotesk', sans-serif; font-size: 18px; }
.convs-nb { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--grad); color: #fff; }
.convs-nb:empty { display: none; }
.convs-nouvelle { justify-content: flex-start; padding: 0 12px; min-height: 48px; border-radius: 16px; }
.convs-plus { width: 28px; height: 28px; border-radius: 9px; background: rgba(255, 255, 255, .22); display: flex; align-items: center; justify-content: center; }
.convs-recherche {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 14px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border);
}
.convs-recherche:focus-within { border-color: var(--accent); }
.convs-recherche input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.convs-groupe { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 4px; }
.conv { flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; }
.conv-icone { width: 34px; height: 34px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.conv[aria-current="true"] .conv-icone { background: var(--grad); border-color: transparent; }
.conv-texte { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.conv[aria-current="true"] { box-shadow: inset 3px 0 0 var(--accent); }
.conv-ligne .conv-sup { opacity: 0; }
.conv-ligne:hover .conv-sup, .conv-ligne:focus-within .conv-sup, .conv-sup.sur { opacity: 1; }
.conv-sup.sur { color: #F43F5E; font-size: 11px; font-weight: 700; }
@media (hover: none) { .conv-ligne .conv-sup { opacity: .6; } }
.convs-vide { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.convs-vide strong { color: var(--text); font-size: 15px; }
.convs-vide-icone { width: 64px; height: 64px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 30px; margin-bottom: 4px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); box-shadow: 0 8px 24px color-mix(in srgb, var(--violet) 18%, transparent); }
.convs-profil {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; text-align: left; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--border);
}
.convs-profil[hidden] { display: none; }
.convs-profil:hover { border-color: var(--accent); }
.convs-profil-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.convs-profil-texte strong { color: var(--text); font-size: 14px; }
.convs-profil-texte small { font-size: 11px; }
.menu-avatar.petit { width: 36px; height: 36px; font-size: 16px; }

/* ---------- Motifs de signalement ---------- */
.motifs { border: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.motifs legend { margin-bottom: 6px; padding: 0; }
.motif {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent); font-size: 13px; font-weight: 600; line-height: 1.3;
  transition: border-color .15s, background .15s;
}
.motif span { font-size: 18px; flex: none; }
.motif input { position: absolute; opacity: 0; pointer-events: none; }
.motif:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.motif:has(input:checked) { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--violet) 30%, transparent); }
.motif:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 360px) { .motifs { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Carte profil du panneau (refaite) ---------- */
.convs-profil {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 10px; border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), color-mix(in srgb, var(--violet) 20%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); color: var(--text);
}
.cp-avatar {
  position: relative; width: 42px; height: 42px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; color: #fff; background: var(--grad);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent);
}
.cp-avatar .avatar { width: 42px !important; height: 42px !important; }
.cp-avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; border: 2px solid var(--surface); }
.convs-profil-texte strong { display: flex; align-items: center; gap: 6px; font-size: 15px; min-width: 0; }
.convs-profil-texte strong > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-admin { font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--grad); color: #fff; flex: none; }
.cp-admin[hidden] { display: none; }
.cp-formule { align-self: flex-start; margin-top: 3px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; color: var(--accent-text);
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.cp-btn { width: 36px; height: 36px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); text-decoration: none; transition: background .15s, color .15s; }
.cp-btn:hover { background: var(--grad); color: #fff; border-color: transparent; }

/* Icônes du menu : emojis clairs sur fond doux */
.mi-icone { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: none; font-size: 20px; line-height: 1; }
.menu-item:hover .mi-icone { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }

/* Badge formule : emoji propre à chaque formule (plus de couronne dessinée) */
.plan-badge::before { content: none; display: none; }

/* ---------- Bouton du modèle refait ---------- */
.model-btn {
  gap: 8px; padding: 0 12px 0 6px; border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.model-btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: none; }
.model-btn:focus { outline: none; }
.model-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.model-btn[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.modele-emoji {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.model-btn svg { opacity: .6; }
@media (max-width: 480px) { .modele-emoji { width: 26px; height: 26px; font-size: 14px; } }
.model-opt[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.effort-opt:hover, .model-opt:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.effort-note { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* ---------- Liste des modèles et effort (refaite) ---------- */
.model-menu {
  width: 330px; padding: 10px; gap: 4px; border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.mo-groupe { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 4px; }
.mo {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border-radius: 14px; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--text); transition: background .15s;
}
.mo:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.mo-emoji { width: 40px; height: 40px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.mo-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mo-texte strong { font-size: 15px; }
.mo-texte small { font-size: 12px; color: var(--muted); }
.mo-etat { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.mo-etat.coche { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--grad); color: #fff; font-size: 13px; }
.mo-choisi { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.mo-choisi .mo-emoji { background: var(--grad); border-color: transparent; }
.mo-ferme .mo-texte, .mo-ferme .mo-emoji { opacity: .55; }
.mo-bientot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mo-bientot .mo { flex-direction: column; justify-content: center; gap: 4px; min-height: 92px; padding: 8px 4px; text-align: center; background: color-mix(in srgb, var(--surface) 70%, transparent); border-color: var(--border); }
.mo-bientot .mo-texte small { display: none; }
.mo-bientot .mo-texte strong { font-size: 12px; }
.mo-bientot .mo-etat { font-size: 10px; }
.effort-rangee { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border); }
.ef { height: 36px; border-radius: 10px; border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; padding: 0 2px; }
.ef:hover { color: var(--text); }
.ef-choisi { background: var(--grad); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--violet) 30%, transparent); }
.ef-ferme { opacity: .4; }
.effort-aide { margin: 6px 6px 4px; font-size: 12px; color: var(--muted); line-height: 1.4; }
@media (max-width: 480px) { .model-menu { width: min(330px, calc(100vw - 24px)); } }

/* ---------- Panneau « Mes discussions » plus compact ---------- */
@media (min-width: 1100px) { .cadre { grid-template-columns: 250px minmax(0, 1fr); } }
.convs { gap: 8px; padding-left: 10px; padding-right: 10px; }
.convs-titre img { width: 22px; height: 22px; }
.convs-titre strong { font-size: 15px; }
.convs-nouvelle { min-height: 40px; font-size: 13px; border-radius: 12px; gap: 8px; padding: 0 10px; }
.convs-plus { width: 22px; height: 22px; border-radius: 7px; }
.convs-plus svg { width: 13px; height: 13px; }
.convs-recherche { height: 36px; border-radius: 11px; padding: 0 10px; }
.convs-recherche input { font-size: 13px; }
.convs-groupe { font-size: 10px; padding: 8px 6px 2px; }
.conv { padding: 6px 8px; gap: 8px; }
.conv-icone { width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
.conv-titre { font-size: 13px; }
.conv-quand { font-size: 10px; }
.convs-vide { padding: 22px 8px; font-size: 12px; }
.convs-vide strong { font-size: 13px; }
.convs-vide-icone { width: 46px; height: 46px; border-radius: 16px; font-size: 22px; }
.convs-profil { padding: 7px 6px 7px 8px; gap: 8px; border-radius: 14px; }
.cp-avatar, .cp-avatar .avatar { width: 32px !important; height: 32px !important; font-size: 14px; }
.cp-avatar::after { width: 9px; height: 9px; }
.convs-profil-texte strong { font-size: 13px; }
.cp-admin { font-size: 8px; padding: 1px 5px; }
.cp-formule { font-size: 10px; padding: 1px 6px; }
.cp-btn { width: 30px; height: 30px; border-radius: 9px; }
.cp-btn svg { width: 15px; height: 15px; }

/* ---------- Nouvelles couleurs ---------- */
:root[data-couleur="soleil"]  { --accent: #FACC15; --violet: #F97316; --grad: linear-gradient(135deg, #CA8A04, #EA580C); --accent-text: #FDE047; }
:root[data-couleur="glace"]   { --accent: #67E8F9; --violet: #60A5FA; --grad: linear-gradient(135deg, #0891B2, #2563EB); --accent-text: #A5F3FC; }
:root[data-couleur="galaxie"] { --accent: #818CF8; --violet: #D946EF; --grad: linear-gradient(135deg, #4F46E5, #C026D3); --accent-text: #C7D2FE; }
:root[data-couleur="menthe"]  { --accent: #34D399; --violet: #14B8A6; --grad: linear-gradient(135deg, #059669, #0D9488); --accent-text: #6EE7B7; }
:root[data-couleur="or"]      { --accent: #FBBF24; --violet: #D97706; --grad: linear-gradient(135deg, #B45309, #D97706); --accent-text: #FDE68A; }
:root[data-theme="light"][data-couleur="soleil"]  { --accent: #CA8A04; --accent-text: #854D0E; }
:root[data-theme="light"][data-couleur="glace"]   { --accent: #0891B2; --accent-text: #155E75; }
:root[data-theme="light"][data-couleur="galaxie"] { --accent: #4F46E5; --accent-text: #3730A3; }
:root[data-theme="light"][data-couleur="menthe"]  { --accent: #059669; --accent-text: #065F46; }
:root[data-theme="light"][data-couleur="or"]      { --accent: #B45309; --accent-text: #78350F; }

/* ---------- Nouveaux fonds (sur tout l'écran) ---------- */
:root[data-fond="vagues"] body {
  background-image: repeating-radial-gradient(circle at 50% 120%, transparent 0 38px, color-mix(in srgb, var(--accent) 9%, transparent) 38px 40px);
}
:root[data-fond="damier"] body {
  background-image: conic-gradient(color-mix(in srgb, var(--accent) 7%, transparent) 25%, transparent 0 50%, color-mix(in srgb, var(--accent) 7%, transparent) 0 75%, transparent 0);
  background-size: 40px 40px;
}
:root[data-fond="bulles"] body {
  background-image:
    radial-gradient(circle at 15% 25%, color-mix(in srgb, var(--accent) 16%, transparent) 0 60px, transparent 61px),
    radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--violet) 16%, transparent) 0 90px, transparent 91px),
    radial-gradient(circle at 70% 75%, color-mix(in srgb, var(--accent) 12%, transparent) 0 120px, transparent 121px),
    radial-gradient(circle at 25% 85%, color-mix(in srgb, var(--violet) 14%, transparent) 0 70px, transparent 71px);
}
:root[data-fond="diagonales"] body {
  background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 7%, transparent) 0 2px, transparent 2px 22px);
}
.fond-vagues { background-image: repeating-radial-gradient(circle at 50% 130%, transparent 0 8px, color-mix(in srgb, var(--accent) 45%, transparent) 8px 9.5px); }
.fond-damier { background-image: conic-gradient(color-mix(in srgb, var(--accent) 30%, transparent) 25%, transparent 0 50%, color-mix(in srgb, var(--accent) 30%, transparent) 0 75%, transparent 0); background-size: 16px 16px; }
.fond-bulles { background-image: radial-gradient(circle at 25% 30%, color-mix(in srgb, var(--accent) 45%, transparent) 0 9px, transparent 10px), radial-gradient(circle at 70% 65%, color-mix(in srgb, var(--violet) 45%, transparent) 0 15px, transparent 16px); }
.fond-diagonales { background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 40%, transparent) 0 2px, transparent 2px 9px); }

/* ---------- Nouvelles dispositions ---------- */
:root[data-disposition="large"] .messages { padding-left: 16px; padding-right: 16px; }
:root[data-disposition="large"] .msg, :root[data-disposition="large"] .ligne-ia { max-width: 100%; }
:root[data-disposition="large"] .ligne-ia { width: 100%; }
@media (min-width: 1000px) { :root[data-disposition="large"] .messages { padding-left: 40px; padding-right: 40px; } }
:root[data-disposition="grandtexte"] .msg { font-size: 19px; line-height: 1.55; }
:root[data-disposition="grandtexte"] .boite textarea { font-size: 19px; }
.grille-dispo { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mini-large .m-bulle { width: 100%; }
.mini-grandtexte .m-bulle { height: 11px; }

/* ---------- Encore plus de couleurs ---------- */
:root[data-couleur="rubis"]     { --accent: #F87171; --violet: #E11D48; --grad: linear-gradient(135deg, #DC2626, #9F1239); --accent-text: #FECACA; }
:root[data-couleur="lavande"]   { --accent: #C4B5FD; --violet: #A78BFA; --grad: linear-gradient(135deg, #8B5CF6, #C084FC); --accent-text: #DDD6FE; }
:root[data-couleur="citron"]    { --accent: #D9F99D; --violet: #84CC16; --grad: linear-gradient(135deg, #A3E635, #65A30D); --accent-text: #ECFCCB; }
:root[data-couleur="cosmos"]    { --accent: #22D3EE; --violet: #3B82F6; --grad: linear-gradient(135deg, #1E3A8A, #0891B2); --accent-text: #A5F3FC; }
:root[data-couleur="arcenciel"] { --accent: #F472B6; --violet: #22D3EE; --grad: linear-gradient(135deg, #F43F5E, #F59E0B, #22C55E, #22D3EE, #A855F7); --accent-text: #FBCFE8; }
:root[data-theme="light"][data-couleur="rubis"]     { --accent: #DC2626; --accent-text: #991B1B; }
:root[data-theme="light"][data-couleur="lavande"]   { --accent: #7C3AED; --accent-text: #5B21B6; }
:root[data-theme="light"][data-couleur="citron"]    { --accent: #65A30D; --accent-text: #3F6212; }
:root[data-theme="light"][data-couleur="cosmos"]    { --accent: #1D4ED8; --accent-text: #1E3A8A; }
:root[data-theme="light"][data-couleur="arcenciel"] { --accent: #DB2777; --accent-text: #9D174D; }

/* ---------- Encore plus de fonds ---------- */
:root[data-fond="pois"] body { background-image: radial-gradient(color-mix(in srgb, var(--accent) 12%, transparent) 0 5px, transparent 6px); background-size: 34px 34px; }
:root[data-fond="rayures"] body { background-image: repeating-linear-gradient(0deg, color-mix(in srgb, var(--accent) 6%, transparent) 0 14px, transparent 14px 40px); }
:root[data-fond="losanges"] body {
  background-image: linear-gradient(45deg, color-mix(in srgb, var(--accent) 6%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--accent) 6%, transparent) 75%),
                    linear-gradient(-45deg, color-mix(in srgb, var(--violet) 6%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--violet) 6%, transparent) 75%);
  background-size: 44px 44px;
}
:root[data-fond="spirale"] body { background-image: repeating-conic-gradient(from 0deg at 50% 50%, color-mix(in srgb, var(--accent) 7%, transparent) 0 6deg, transparent 6deg 18deg); }
.fond-pois { background-image: radial-gradient(color-mix(in srgb, var(--accent) 55%, transparent) 0 3px, transparent 4px); background-size: 14px 14px; }
.fond-rayures { background-image: repeating-linear-gradient(0deg, color-mix(in srgb, var(--accent) 35%, transparent) 0 5px, transparent 5px 13px); }
.fond-losanges { background-image: linear-gradient(45deg, color-mix(in srgb, var(--accent) 35%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--accent) 35%, transparent) 75%),
  linear-gradient(-45deg, color-mix(in srgb, var(--violet) 35%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--violet) 35%, transparent) 75%); background-size: 18px 18px; }
.fond-spirale { background-image: repeating-conic-gradient(from 0deg at 50% 50%, color-mix(in srgb, var(--accent) 40%, transparent) 0 8deg, transparent 8deg 22deg); }

/* ---------- Micro ---------- */
.micro-btn { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: transparent; font-size: 19px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.micro-btn + .send-btn { margin-left: 8px; }
.micro-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.micro-btn.ecoute { background: #EF4444; border-color: #EF4444; animation: ecoute 1.2s ease-in-out infinite; }
@keyframes ecoute { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } }
.micro-info { margin: 0 auto 10px; max-width: 760px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); font-size: 14px; line-height: 1.5; }
.micro-info p { margin: 0 0 10px; }
.micro-info div { display: flex; gap: 8px; flex-wrap: wrap; }
.micro-info .bouton { width: auto; height: 38px; padding: 0 16px; margin: 0; }

/* ---------- Succès débloqué ---------- */
.toast-succes { position: fixed; top: 18px; left: 50%; z-index: 100; display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 14px; border-radius: 18px;
  background: var(--surface); color: var(--text); text-decoration: none; border: 1.5px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35), 0 0 30px color-mix(in srgb, var(--violet) 35%, transparent);
  transform: translateX(-50%); animation: toast-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.toast-succes.part { animation: toast-out .5s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -30px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -30px); } }
.ts-emoji { font-size: 34px; animation: ts-tourne .8s ease .2s; }
@keyframes ts-tourne { 50% { transform: scale(1.3) rotate(-12deg); } }
.ts-texte { display: flex; flex-direction: column; line-height: 1.2; }
.ts-texte small { font-size: 12px; color: var(--accent-text); font-weight: 700; }
.ts-texte b { font-size: 17px; }

/* ---------- Page Succès ---------- */
.succes-resume { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 16px; }
.succes-resume b { font-family: 'Space Grotesk', sans-serif; font-size: 34px; }
.succes-barre { flex: 1; height: 12px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); overflow: hidden; }
.succes-barre i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.succes-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-succes { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 10px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.badge-succes .bs-emoji { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.badge-succes.obtenu { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 18%, transparent); }
.badge-succes.obtenu .bs-emoji { background: var(--grad); box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 40%, transparent); }
.badge-succes:not(.obtenu) .bs-emoji { filter: grayscale(1); opacity: .45; }
.badge-succes b { font-size: 15px; }
.badge-succes small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.bs-prog { width: 80%; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; margin-top: 4px; }
.bs-prog i { display: block; height: 100%; background: var(--grad); }
.bs-etat { font-size: 12px; font-weight: 700; color: var(--accent-text); }

/* ---------- Réponse qui s'écrit ---------- */
.curseur { display: inline-block; width: 9px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; border-radius: 2px; background: var(--grad); animation: curseur .8s steps(1) infinite; }
@keyframes curseur { 50% { opacity: 0; } }
/* ---------- Le dessin sort du bruit ---------- */
img.dessin.sort-du-bruit { animation: sort-du-bruit 1.6s steps(12) both; }
@keyframes sort-du-bruit {
  0% { filter: blur(6px) saturate(0) contrast(2.5) brightness(1.4); transform: scale(.92); opacity: .4; }
  60% { filter: blur(2px) saturate(.6) contrast(1.4); }
  100% { filter: none; transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { img.dessin.sort-du-bruit { animation: none; } .curseur { animation: none; } }
/* ---------- Appli installée : on respecte l'encoche des téléphones ---------- */
@media (display-mode: standalone) {
  .app { padding-top: env(safe-area-inset-top); }
  .composer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
button.menu-item { width: 100%; border: none; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hors-ligne { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.hors-ligne img { filter: brightness(1.5); }
.hors-ligne h1 { margin: 0; font-family: 'Space Grotesk', sans-serif; }
.hors-ligne p { margin: 0 0 8px; color: var(--muted); line-height: 1.5; }
.hors-ligne .bouton { width: auto; padding: 0 28px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---------- Page Formules (refaite) ---------- */
.page.page-large { max-width: 1100px; }
.f-haut { text-align: center; padding: 10px 0 0; }
.f-haut h2 { margin: 0 0 8px; font-family: 'Space Grotesk', sans-serif; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; }
.f-haut p { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.f-test { display: inline-block; margin-top: 12px !important; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); font-size: 13.5px !important; }
.f-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: stretch; }
.f-carte { --c: #4ADE80; --c2: #16A34A; position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 20px; border-radius: 24px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, var(--surface)) 0, var(--surface) 130px);
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); transition: transform .2s, box-shadow .2s; }
.f-carte:hover { transform: translateY(-4px); box-shadow: 0 16px 40px color-mix(in srgb, var(--c) 22%, transparent); }
.f-carte.f-lite { --c: #FACC15; --c2: #CA8A04; }
.f-carte.f-plus { --c: #FB923C; --c2: #EA580C; }
.f-carte.f-pro { --c: #22D3EE; --c2: #0891B2; }
.f-carte.f-max { --c: #60A5FA; --c2: #2563EB; }
.f-carte.f-maxi { --c: #C084FC; --c2: #DB2777; border-width: 1.5px; box-shadow: 0 0 30px color-mix(in srgb, var(--c) 22%, transparent); }
.f-carte.f-admin { --c: #FBBF24; --c2: #B45309; }
.f-carte.actuelle { border: 2px solid var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.f-ruban { position: absolute; top: 16px; right: 16px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--c), var(--c2)); }
.f-ruban.legende { animation: legende-f 2.4s ease-in-out infinite; }
@keyframes legende-f { 50% { box-shadow: 0 0 16px var(--c); } }
.f-tete { display: flex; align-items: center; gap: 12px; }
.f-emoji { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c2) 20%, transparent)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.f-nom h3 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 22px; }
.f-nom small { color: var(--muted); font-size: 13px; }
.f-prix { display: flex; align-items: baseline; gap: 6px; }
.f-prix b { font-family: 'Space Grotesk', sans-serif; font-size: 40px; line-height: 1; background: linear-gradient(135deg, var(--c), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.f-prix span { color: var(--muted); font-size: 14px; }
.f-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.f-liste li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.f-i { width: 24px; flex-shrink: 0; text-align: center; }
.f-inclus { color: var(--muted); font-weight: 600; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.f-bientot { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.f-btn { height: 48px; border-radius: 14px; border: none; cursor: pointer; font: 700 15px Inter, sans-serif; color: #fff; background: linear-gradient(135deg, var(--c), var(--c2)); transition: filter .2s, transform .15s; }
.f-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.f-btn.actuel { background: transparent; color: var(--text); border: 1.5px solid var(--c); cursor: default; }
.f-titre { margin: 20px 0 0; text-align: center; font-family: 'Space Grotesk', sans-serif; font-size: 26px; }
.f-tableau-zone { overflow-x: auto; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); }
.f-tableau { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.f-tableau th, .f-tableau td { padding: 11px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.f-tableau tr:last-child td { border-bottom: none; }
.f-tableau th { font-weight: 700; font-size: 13px; }
.f-th-emoji { display: block; font-size: 20px; margin-bottom: 2px; }
.f-tableau .f-ligne { text-align: left; font-weight: 600; padding-left: 16px; white-space: nowrap; }
.f-tableau td.oui { color: var(--accent-text); font-weight: 800; font-size: 16px; }
.f-tableau td.non { color: var(--muted); opacity: .5; }
.f-tableau .actuelle { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.f-prix-ligne td { font-weight: 700; }
:root[data-theme="light"] .f-carte { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, var(--surface)) 0, var(--surface) 130px); }
@media (max-width: 480px) { .f-grille { grid-template-columns: minmax(0, 1fr); } .f-prix b { font-size: 34px; } }
.plan-badge[hidden] { display: none !important; }
/* Le menu défile au lieu d'écraser la carte du profil quand il y a beaucoup d'éléments. */
.menu > * { flex-shrink: 0; }

/* ---------- Correcteur en direct ---------- */
.saisie { position: relative; }
.saisie textarea { position: relative; z-index: 1; background: transparent; }
.calque { position: absolute; inset: 0; z-index: 0; overflow: hidden; white-space: pre-wrap; overflow-wrap: break-word; color: transparent; pointer-events: none; margin: 0; }
.calque mark { background: transparent; color: transparent; text-decoration: underline wavy #EF4444; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.corrections { display: flex; gap: 6px; flex-wrap: wrap; }
.corrections[hidden] { display: none; }
.correction { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 11px; border-radius: 999px; cursor: pointer; font: 500 13.5px Inter, sans-serif; color: var(--text);
  background: color-mix(in srgb, #EF4444 8%, transparent); border: 1px solid color-mix(in srgb, #EF4444 35%, var(--border)); transition: background .15s; }
.correction:hover { background: color-mix(in srgb, #22C55E 14%, transparent); border-color: color-mix(in srgb, #22C55E 50%, var(--border)); }
.correction s { color: var(--muted); text-decoration-color: #EF4444; }
.correction b { color: #22C55E; font-weight: 700; }
:root[data-theme="light"] .correction b { color: #15803D; }

/* ---------- Images comme ChatGPT ---------- */
.msg-media { max-width: min(420px, 100%); }
.image-grande { position: relative; width: min(340px, 100%); aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--border); }
.image-grande img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.ig-flou { filter: blur(14px) saturate(.6); transform: scale(1.15); }
.image-grande.devoile .ig-net { animation: devoile 2.2s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes devoile { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.image-grande.devoile::after { content: ""; position: absolute; left: 0; right: 0; height: 40px; top: -40px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .55), transparent); animation: balayage 2.2s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes balayage { to { top: 100%; } }
.versions { display: flex; gap: 8px; margin-top: 8px; }
.versions button { width: 54px; height: 54px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid var(--border); background: #fff; cursor: pointer; opacity: .7; transition: opacity .15s, border-color .15s; }
.versions button:hover { opacity: 1; }
.versions button.choisi { border-color: var(--accent); opacity: 1; }
.versions img.dessin { width: 100%; height: 100%; border: none; border-radius: 0; display: block; }
.toile-attente { position: relative; width: min(340px, 100%); aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 55%),
              radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--violet) 45%, transparent), transparent 55%),
              color-mix(in srgb, var(--surface) 70%, #888 10%);
  background-size: 200% 200%; animation: ondule 4s ease-in-out infinite; border: 1px solid var(--border); }
.toile-attente::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); background-size: 250% 100%; animation: reflet-image 1.8s linear infinite; }
@keyframes ondule { 50% { background-position: 100% 100%; } }
@keyframes reflet-image { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.attente-texte { position: relative; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text); background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(6px); }
.typing-image { padding: 10px !important; }
@media (prefers-reduced-motion: reduce) { .image-grande.devoile .ig-net, .image-grande.devoile::after, .toile-attente, .toile-attente::before { animation: none; } }
.versions[hidden] { display: none; }

/* Avertissement du filtre (infos perso cachées) */
.msg.msg-alerte { align-self: center; max-width: 92%; font-size: 13.5px; padding: 8px 14px; border-radius: 14px; text-align: center;
  background: color-mix(in srgb, #F59E0B 12%, var(--surface)); border: 1px solid color-mix(in srgb, #F59E0B 45%, var(--border)); color: var(--text); }
.piege { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Alertes de sécurité (admins) */
.alertes-admin { position: fixed; top: 14px; right: 14px; z-index: 90; padding: 9px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #EF4444, #B91C1C); box-shadow: 0 8px 24px rgba(239, 68, 68, .45); animation: alerte-pulse 1.6s ease-in-out infinite; }
@keyframes alerte-pulse { 50% { box-shadow: 0 8px 30px rgba(239, 68, 68, .8); } }
@media (prefers-reduced-motion: reduce) { .alertes-admin { animation: none; } }

/* QR code de la double vérification */
.qr-2fa { display: inline-flex; margin: 10px 0 6px; padding: 10px; border-radius: 16px; background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.qr-2fa svg { display: block; width: 220px; height: 220px; }
.aide-2fa { margin: 8px 0 4px; font-size: 14px; color: var(--muted); }

/* ---------- Fenêtre « Installer Clai » ---------- */
.modale-fond { position: fixed; inset: 0; z-index: 200; background: rgba(5, 8, 20, .55); backdrop-filter: blur(4px); animation: apparait-fond .2s ease; }
@keyframes apparait-fond { from { opacity: 0; } }
.modale { position: fixed; z-index: 201; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow-y: auto;
  padding: 22px; border-radius: 26px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); animation: apparait-modale .25s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes apparait-modale { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }
.modale-fermer { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 15px; cursor: pointer; }
.inst-tete { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding-right: 40px; }
.inst-icone { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 8px 20px color-mix(in srgb, var(--violet) 35%, transparent); }
.inst-tete h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 22px; }
.inst-tete p { margin: 4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.inst-go { width: 100%; height: 52px; border: none; border-radius: 16px; cursor: pointer; font: 700 16px Inter, sans-serif; color: #fff; background: var(--grad); box-shadow: 0 10px 24px color-mix(in srgb, var(--violet) 35%, transparent); }
.inst-ou { margin: 12px 0 6px; text-align: center; font-size: 13px; color: var(--muted); }
.inst-onglets { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 14px; }
.inst-onglets button { flex: 1; min-height: 38px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font: 600 13px Inter, sans-serif; cursor: pointer; padding: 4px 6px; }
.inst-onglets button[aria-selected="true"] { background: var(--grad); color: #fff; }
.inst-etapes { list-style: none; counter-reset: etape; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.inst-etapes li { counter-increment: etape; display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.inst-etapes li::before { content: counter(etape); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--grad); }
.inst-note { margin: 16px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; color: var(--muted); background: color-mix(in srgb, var(--accent) 8%, transparent); }
@media (prefers-reduced-motion: reduce) { .modale, .modale-fond { animation: none; } }

/* ---------- Espace parent : code secret et journal ---------- */
.champ-pin { letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.champ-pin.grand { font-size: 26px; height: 58px; max-width: 260px; margin: 0 auto; }
.porte-parent { align-items: center; text-align: center; }
.porte-icone { font-size: 46px; }
.intro.petit { font-size: 13px; }
.journal-parent { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.jp-ligne { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.jp-bloque, .jp-alerte { background: color-mix(in srgb, #EF4444 7%, var(--bg)); border-color: color-mix(in srgb, #EF4444 30%, var(--border)); }
.jp-icone { font-size: 18px; }
.jp-texte { display: flex; flex-direction: column; min-width: 0; }
.jp-texte strong { font-size: 14px; font-weight: 600; }
.jp-texte small { font-size: 12px; color: var(--muted); }

/* Jauge de force du mot de passe */
.jauge-mdp { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.jauge-mdp[hidden] { display: none; }
.jm-barre { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.jm-barre i { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--text) 12%, transparent); transition: background .2s; }
.jauge-mdp.f0 .jm-barre i:nth-child(-n+1) { background: #EF4444; }
.jauge-mdp.f1 .jm-barre i:nth-child(-n+1) { background: #F97316; }
.jauge-mdp.f2 .jm-barre i:nth-child(-n+2) { background: #F59E0B; }
.jauge-mdp.f3 .jm-barre i:nth-child(-n+3) { background: #22C55E; }
.jauge-mdp.f4 .jm-barre i { background: linear-gradient(90deg, #22C55E, #10B981); }
.jm-texte { font-size: 12.5px; color: var(--muted); }
.jauge-mdp.f0 .jm-texte, .jauge-mdp.f1 .jm-texte { color: #EA580C; }
.jauge-mdp.f3 .jm-texte, .jauge-mdp.f4 .jm-texte { color: #16A34A; font-weight: 700; }

/* Mode protégé (moins de 15 ans) */
.mode-protege .outil.partager, .mode-protege #micro { display: none !important; }

/* ---------- 🆘 J'ai un problème ---------- */
.menu-sos .mi-icone { background: color-mix(in srgb, #EF4444 16%, transparent); }
.sos-titre { margin: 0 0 6px; font-family: 'Space Grotesk', sans-serif; font-size: 22px; padding-right: 40px; }
.sos-intro { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.sos-motifs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.sos-motif { min-height: 44px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font: 600 13.5px Inter, sans-serif; cursor: pointer; text-align: left; }
.sos-motif[aria-pressed="true"] { border-color: #F59E0B; background: color-mix(in srgb, #F59E0B 14%, var(--bg)); }
.sos-texte { width: 100%; min-height: 80px; resize: vertical; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 15px/1.45 Inter, sans-serif; padding: 10px 12px; box-sizing: border-box; }
.sos-envoyer { width: 100%; height: 50px; margin-top: 10px; border: none; border-radius: 14px; cursor: pointer; font: 700 16px Inter, sans-serif; color: #fff; background: linear-gradient(135deg, #F59E0B, #EA580C); }
.sos-info { margin: 10px 0 0; font-size: 14px; color: #EA580C; }
.sos-info.ok { padding: 12px; border-radius: 14px; color: var(--text); background: color-mix(in srgb, #22C55E 12%, var(--bg)); border: 1px solid color-mix(in srgb, #22C55E 40%, var(--border)); }
.sos-numeros { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sos-numeros-titre { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); }
.sos-numero { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: var(--text); background: var(--bg); border: 1px solid var(--border); }
.sos-numero b { font-size: 17px; }
.sos-numero span { font-size: 12px; color: var(--muted); }

/* Captcha fait maison */
.captcha { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 7%, transparent); border: 1px solid var(--border); }
.captcha[hidden] { display: none; }
.captcha-question { margin: 0; font-size: 14px; font-weight: 600; }
.captcha-choix { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.captcha-animal { aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); font-size: 28px; cursor: pointer; transition: transform .1s; }
.captcha-animal:hover { transform: scale(1.06); }
.captcha-animal[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); transform: scale(1.08); }

/* ---------- Clai Motion ---------- */
.motion { display: flex; flex-direction: column; gap: 8px; width: min(320px, 100%); }
.motion-ecran { width: 100%; aspect-ratio: 1; border-radius: 18px; image-rendering: pixelated; background: #fff; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.motion-barre { display: flex; align-items: center; gap: 4px; }
.motion-etiquette { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--accent-text); }

/* Bouton 🆘 en haut de la discussion */
.icon-btn.sos-haut { font-size: 18px; border-color: color-mix(in srgb, #EF4444 45%, var(--border)); background: color-mix(in srgb, #EF4444 10%, transparent); }
.icon-btn.sos-haut:hover { background: color-mix(in srgb, #EF4444 22%, transparent); }

/* ---------- Clai Jeux ---------- */
.jx-accueil { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.jx-carte { --c: #A855F7; --c2: #EC4899; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px; border-radius: 24px; cursor: pointer; text-align: left; font: inherit; color: var(--text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, var(--surface)), var(--surface) 70%); border: 1.5px solid color-mix(in srgb, var(--c) 45%, var(--border)); transition: transform .2s, box-shadow .2s; }
.jx-carte.quiz { --c: #22D3EE; --c2: #3B82F6; }
.jx-carte:hover { transform: translateY(-4px); box-shadow: 0 16px 40px color-mix(in srgb, var(--c) 25%, transparent); }
.jx-emoji { font-size: 48px; }
.jx-carte b { font-family: 'Space Grotesk', sans-serif; font-size: 22px; }
.jx-carte small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.jx-jouer { margin-top: 6px; padding: 8px 16px; border-radius: 999px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--c), var(--c2)); }
.jx-jeu { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); }
.jx-jeu[hidden] { display: none; }
.jx-haut { display: flex; justify-content: space-between; font-weight: 700; }
.jx-points { color: #F59E0B; }
.jx-barre { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.jx-barre i { display: block; height: 100%; background: var(--grad); transition: width .4s; }
#jx-zone { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.jx-attente { display: flex; flex-direction: column; align-items: center; padding: 50px 0; color: var(--muted); }
.jx-attente span { font-size: 54px; animation: jx-tourne 1.4s ease-in-out infinite; }
@keyframes jx-tourne { 50% { transform: rotate(-12deg) scale(1.1); } }
.jx-dessin { width: min(256px, 70vw); aspect-ratio: 1; border-radius: 20px; image-rendering: pixelated; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.jx-gain { margin: 0; font-size: 13px; color: var(--muted); }
.jx-theme { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.jx-question { margin: 4px 0; text-align: center; font-family: 'Space Grotesk', sans-serif; font-size: 24px; }
.jx-chrono { width: 100%; max-width: 420px; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.jx-chrono i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #22C55E, #F59E0B); }
.jx-choix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 520px; }
.jx-reponse { min-height: 54px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--border); background: var(--bg); color: var(--text); font: 700 16px Inter, sans-serif; cursor: pointer; transition: transform .12s, border-color .12s; }
.jx-reponse:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent); }
.jx-reponse.bonne { border-color: #22C55E; background: color-mix(in srgb, #22C55E 18%, var(--bg)); }
.jx-reponse.fausse { border-color: #EF4444; background: color-mix(in srgb, #EF4444 15%, var(--bg)); }
.jx-retour { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.jx-retour p { margin: 0; font-size: 18px; font-weight: 800; }
.jx-retour.oui p { color: #16A34A; } .jx-retour.non p { color: #DC2626; }
.jx-suivant { height: 48px; padding: 0 26px; border: none; border-radius: 14px; cursor: pointer; font: 800 15px Inter, sans-serif; color: #fff; background: var(--grad); }
.jx-suivant.secondaire { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.jx-fin { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 0; text-align: center; }
.jx-fin h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 36px; }
.jx-fin p { margin: 0; color: var(--muted); }
.jx-trophee { font-size: 70px; animation: jx-tourne 1.6s ease-in-out infinite; }
.jx-classement { padding: 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); }
.jx-classement-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.jx-classement-tete h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; }
.jx-onglets { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.jx-onglets button { border: none; border-radius: 9px; padding: 7px 12px; background: transparent; color: var(--muted); font: 700 13px Inter, sans-serif; cursor: pointer; }
.jx-onglets button[aria-selected="true"] { background: var(--grad); color: #fff; }
.jx-deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.jx-deux h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.jx-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.jx-liste li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.jx-liste li.moi { border-color: var(--accent); }
.jx-liste li.vide { color: var(--muted); font-size: 13px; }
.jx-liste .rang { width: 26px; text-align: center; font-weight: 800; }
.jx-liste .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .jx-accueil, .jx-deux { grid-template-columns: minmax(0, 1fr); } .jx-question { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .jx-attente span, .jx-trophee { animation: none; } }
.jx-accueil[hidden] { display: none; }
.jx-lettre { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 7px; font-size: 13px; color: #fff; background: var(--grad); }
.jx-badge { margin: 0; padding: 8px 14px; border-radius: 999px; font-weight: 800; color: var(--text) !important; background: color-mix(in srgb, #F59E0B 16%, var(--surface)); border: 1px solid color-mix(in srgb, #F59E0B 45%, var(--border)); }

/* ---------- Ma galerie ---------- */
.ga-filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.ga-filtres button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 700 14px Inter, sans-serif; cursor: pointer; }
.ga-filtres button[aria-selected="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.ga-filtres em { font-style: normal; opacity: .8; margin-left: 2px; }
.ga-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ga-tuile { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: transform .15s; }
.ga-tuile:hover { transform: translateY(-3px); }
.ga-ouvrir { position: relative; padding: 0; border: none; cursor: pointer; background: #fff; aspect-ratio: 1; }
.ga-ouvrir img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.ga-lecture { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(0, 0, 0, .55); font-size: 13px; }
.ga-bas { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.ga-phrase { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ga-fav { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 17px; cursor: pointer; }
.ga-fav.oui { border-color: #F59E0B; background: color-mix(in srgb, #F59E0B 15%, transparent); }
.ga-vide { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 0; text-align: center; color: var(--muted); }
.ga-vide span { font-size: 54px; }
.ga-vide .bouton { width: auto; padding: 0 22px; display: inline-flex; align-items: center; text-decoration: none; }
.ga-modale { width: min(560px, calc(100vw - 28px)); }
.ga-titre { margin: 0; padding-right: 40px; font-family: 'Space Grotesk', sans-serif; font-size: 20px; }
.ga-date { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.ga-versions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ga-version { display: flex; flex-direction: column; gap: 6px; }
.ga-grande { width: 100%; aspect-ratio: 1; image-rendering: pixelated; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.ga-dl { height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 600 13px Inter, sans-serif; cursor: pointer; }
.ga-supprimer { margin-top: 14px; width: 100%; height: 42px; border-radius: 12px; border: 1px solid color-mix(in srgb, #EF4444 45%, var(--border)); background: transparent; color: #EF4444; font: 700 14px Inter, sans-serif; cursor: pointer; }
.ga-modale .motion { margin: 0 auto; }

/* Règles : sommaire et mentions à compléter */
.sommaire { display: flex; flex-wrap: wrap; gap: 6px; }
.sommaire a { padding: 6px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.sommaire a:hover { border-color: var(--accent); }
.a-completer { padding: 12px 14px; border-radius: 14px; font-weight: 600; background: color-mix(in srgb, #F59E0B 14%, var(--surface)); border: 1px solid color-mix(in srgb, #F59E0B 50%, var(--border)); }
.texte-regles h2 { scroll-margin-top: 20px; }

/* ---------- Clai Musique ---------- */
.musique { display: flex; flex-direction: column; gap: 10px; width: min(420px, 100%); }
.mu-tete { display: flex; align-items: center; gap: 12px; }
.mu-jouer { width: 54px; height: 54px; flex-shrink: 0; border-radius: 50%; border: none; cursor: pointer; font-size: 20px; color: #fff; background: var(--grad); box-shadow: 0 8px 20px color-mix(in srgb, var(--violet) 35%, transparent); }
.mu-infos { display: flex; flex-direction: column; min-width: 0; }
.mu-infos b { font-size: 15px; }
.mu-infos small { font-size: 12.5px; color: var(--muted); }
.mu-rouleau { width: 100%; height: auto; aspect-ratio: 640 / 140; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, var(--bg)); border: 1px solid var(--border); }
.mu-bas { display: flex; align-items: center; gap: 8px; }
.mu-ia { font-size: 11.5px; color: var(--muted); }
/* 4 onglets sur téléphone : seulement les icônes (le nom reste lu par les lecteurs d'écran) */
@media (max-width: 520px) {
  .boite .tab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .boite .tab { padding: 0 12px; min-width: 44px; justify-content: center; }
  .boite .tab svg { margin: 0; }
}
.bandeau-beta { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; background: color-mix(in srgb, #F59E0B 14%, var(--surface)); border: 1px solid color-mix(in srgb, #F59E0B 45%, var(--border)); }
.bandeau-beta[hidden] { display: none; }
.f-btn.bientot { background: transparent; color: var(--muted); border: 1.5px dashed var(--border); cursor: default; }

.styles-mu { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.styles-mu::-webkit-scrollbar { display: none; }
.styles-mu[hidden] { display: none; }
.styles-mu button { flex-shrink: 0; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in srgb, var(--text) 5%, var(--bg)); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.styles-mu button:hover { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, var(--bg)); }
.mu-dl { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; border: none; background: var(--grad); color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.mu-dl:disabled { opacity: .7; cursor: wait; }
.mu-bas { flex-wrap: wrap; }

.ameliorer-btn { align-self: flex-start; margin: 4px 0 2px; padding: 9px 16px; border-radius: 999px; border: none; background: var(--grad); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 30%, transparent); }
.ameliorer-btn:hover { filter: brightness(1.08); }

/* ---------- Classement des dessins ---------- */
.cl-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin: 14px 0 18px; }
.cl-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cl-carte { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.cl-grand { padding: 12px 10px; }
.cl-rang-1 { border: 2px solid #F5B301; box-shadow: 0 10px 30px color-mix(in srgb, #F5B301 25%, transparent); padding-bottom: 18px; }
.cl-rang-2 { border-color: #C0C7D1; }
.cl-rang-3 { border-color: #CD7F32; }
.cl-image { width: 100%; aspect-ratio: 1; border-radius: 12px; image-rendering: pixelated; background: #fff; }
.cl-rang { position: absolute; top: 4px; left: 6px; z-index: 1; font-size: 20px; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,.5); color: #fff; }
.cl-grand .cl-rang { font-size: 28px; top: -12px; left: 50%; transform: translateX(-50%); }
.cl-phrase { margin: 2px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.cl-auteur { margin: 0; font-size: 12px; color: var(--muted); }
.cl-bas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.cl-vote { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.cl-vote.oui { border-color: #F43F5E; background: color-mix(in srgb, #F43F5E 15%, transparent); }
.cl-vote:disabled { opacity: .6; cursor: default; }
.cl-petit { padding: 6px 9px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cl-cache { opacity: .6; border-style: dashed; }
.cl-alerte { margin: 0; font-size: 12px; font-weight: 700; color: #F59E0B; }
@media (max-width: 420px) { .cl-podium { gap: 6px; } .cl-grand .cl-phrase { font-size: 12px; } .cl-grand .cl-bas .cl-petit { display: none; } }
.ga-proposer { margin-top: 6px; }
.ga-anonyme { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin: 8px 0 0; }

/* ---------- Donne ton avis ---------- */
.avis-modale { max-width: 440px; }
.avis-modale h2 { margin: 0 0 4px; }
.avis-sous { margin: 4px 0 10px; font-size: 13.5px; color: var(--muted); }
.avis-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.avis-type { padding: 10px; border-radius: 14px; border: 1.5px solid var(--border); background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.avis-type[aria-checked="true"] { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 16%, transparent); }
.avis-label { display: block; margin: 10px 0 4px; font-size: 13.5px; font-weight: 700; }
.avis-etoiles { display: flex; gap: 4px; }
.avis-etoile { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: transparent; font-size: 22px; cursor: pointer; color: var(--text); }
.avis-texte { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.avis-envoyer { width: 100%; margin-top: 6px; padding: 12px; border-radius: 999px; border: none; background: var(--grad); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.avis-msg { margin: 6px 0 0; font-size: 13.5px; color: #F87171; }
.avis-merci { font-size: 48px; text-align: center; }
.mi-nouveau { margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: #F43F5E; color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle; }
/* ---------- Nouveautés ---------- */
.nv-liste { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.nv-maj { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.nv-maj h2 { margin: 0; font-size: 17px; }
.nv-date { margin: 2px 0 8px; font-size: 12.5px; color: var(--muted); }
.nv-maj ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; }
.nv-maj.recent { border-color: var(--violet); box-shadow: 0 8px 26px color-mix(in srgb, var(--violet) 18%, transparent); }
button.menu-item { width: 100%; border: none; background: transparent; font: inherit; text-align: left; cursor: pointer; }

.cl-defi { margin: 14px 0 4px; padding: 16px; border-radius: 20px; text-align: center; background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 22%, var(--surface)), color-mix(in srgb, #22D3EE 14%, var(--surface))); border: 1px solid color-mix(in srgb, var(--violet) 45%, var(--border)); }
.cl-defi-sur { margin: 0; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cl-defi-titre { margin: 4px 0 6px; font-size: 26px; }
.cl-defi-aide { margin: 0; font-size: 13.5px; }
.cl-gagnant { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px; border-radius: 14px; background: color-mix(in srgb, #F5B301 14%, transparent); text-align: left; font-size: 13.5px; font-weight: 700; }
.cl-gagnant img { width: 48px; height: 48px; border-radius: 10px; image-rendering: pixelated; background: #fff; }
.cl-gagnant p { margin: 0; }

.motion-musique { align-self: flex-start; margin-top: 8px; padding: 9px 16px; border-radius: 999px; border: none; background: var(--grad); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.motion-musique:disabled { opacity: .6; cursor: wait; }
.motion-styles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.motion-styles[hidden] { display: none; }
.motion-styles button { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.motion-etat { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.motion-etat:empty { display: none; }

/* ---------- Profil public ---------- */
.pf { display: flex; flex-direction: column; gap: 10px; }
.pf-reglages { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px dashed var(--border); }
.pf-interrupteur { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.pf-interrupteur input { width: 20px; height: 20px; accent-color: var(--violet); }
.pf-aide { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.pf-label { display: block; margin: 12px 0 4px; font-size: 13px; font-weight: 700; }
.pf-ligne { display: flex; gap: 8px; }
.pf-bio { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.pf-bouton { padding: 10px 14px; border-radius: 12px; border: none; background: var(--grad); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.pf-tete { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.pf-avatar { width: 76px !important; height: 76px !important; flex-shrink: 0; font-size: 32px; }
.pf-info h2 { margin: 0; font-size: 24px; }
.pf-team { display: inline-block; margin-top: 2px; padding: 2px 8px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 800; }
.pf-depuis { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.pf-bio-txt { margin: 6px 0 0; font-size: 14.5px; }
.pf-prive { margin: 0; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, #F59E0B 14%, transparent); font-size: 13.5px; font-weight: 600; }
.pf-section { margin: 12px 0 0; font-size: 16px; }
.pf-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-badge { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 22px; }
.pf-dessins { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.pf-dessin { margin: 0; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.pf-dessin img { width: 100%; aspect-ratio: 1; border-radius: 10px; image-rendering: pixelated; background: #fff; }
.pf-dessin figcaption { font-size: 11.5px; margin-top: 4px; color: var(--muted); }
.pf-musiques { display: flex; flex-direction: column; gap: 10px; }
.pf-musique { padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.pf-retirer { margin-top: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.pf-vide { margin: 0; font-size: 13.5px; color: var(--muted); }
.cl-auteur a { color: inherit; font-weight: 700; }
.mu-profil { flex-shrink: 0; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }

/* ---------- Projets à plusieurs ---------- */
.pj { display: flex; flex-direction: column; gap: 12px; }
.pj-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.pj-champ { flex: 1; min-width: 150px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.pj-btn { padding: 10px 14px; border-radius: 12px; border: none; background: var(--grad); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.pj-btn.secondaire { background: transparent; color: var(--text); border: 1px solid var(--border); }
.pj-btn.danger { background: transparent; color: #F87171; border: 1px solid color-mix(in srgb, #F87171 50%, var(--border)); }
.pj-btn:disabled { opacity: .6; cursor: wait; }
.pj-invit { padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--violet) 16%, var(--surface)); border: 1px solid var(--violet); }
.pj-invit p { margin: 0 0 8px; font-weight: 700; }
.pj-creer { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.pj-label { display: block; font-weight: 800; margin-bottom: 8px; }
.pj-emojis { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pj-emoji { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: transparent; font-size: 19px; cursor: pointer; }
.pj-emoji[aria-checked="true"] { border: 2px solid var(--violet); background: color-mix(in srgb, var(--violet) 18%, transparent); }
.pj-liste { display: flex; flex-direction: column; gap: 8px; }
.pj-carte { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.pj-icone { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--violet) 18%, transparent); font-size: 24px; flex-shrink: 0; }
.pj-t { display: flex; flex-direction: column; min-width: 0; }
.pj-t small { color: var(--muted); font-size: 12.5px; }
.pj-membres { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-membre { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.pj-membre.invite { opacity: .7; border-style: dashed; }
.pj-mini { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 2px; }
.pj-compo { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.pj-modes { display: flex; gap: 6px; overflow-x: auto; }
.pj-mode { flex-shrink: 0; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.pj-mode[aria-selected="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.pj-zone { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.pj-envoyer { align-self: flex-end; }
.pj-mur { display: flex; flex-direction: column; gap: 10px; }
.pj-el { position: relative; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.pj-el.moi { border-color: color-mix(in srgb, var(--violet) 50%, var(--border)); }
.pj-auteur { margin: 0 30px 6px 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pj-texte { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-question { margin: 0 0 6px; font-weight: 700; }
.pj-reponse { padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.pj-ia { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.pj-image { width: min(220px, 100%); aspect-ratio: 1; border-radius: 12px; image-rendering: pixelated; background: #fff; }
.pj-suppr { position: absolute; top: 8px; right: 8px; border: none; background: transparent; cursor: pointer; font-size: 14px; opacity: .6; }
.pj-info { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.pj-bas { justify-content: space-between; margin-top: 10px; }

/* ---------- Passkeys ---------- */
.passkey-zone[hidden] { display: none; }
.passkey-ou { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--muted); font-size: 13px; }
.passkey-ou::before, .passkey-ou::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.passkey-btn { width: 100%; padding: 13px; border-radius: 14px; border: 1.5px solid var(--border); background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.passkey-btn:hover { border-color: var(--violet); }
.pk-ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.pk-retirer { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.pk-nom { width: 100%; box-sizing: border-box; margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.pk-ajouter { width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px; border: none; background: var(--grad); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.pk-info { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Kit média ---------- */
.km-section { margin-top: 22px; }
.km-section h2 { font-size: 18px; margin: 0 0 10px; }
.km-logos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.km-logo, .km-pub, .km-capture { margin: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.km-logo img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: repeating-conic-gradient(color-mix(in srgb, var(--text) 8%, transparent) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.km-logo figcaption, .km-capture figcaption { font-size: 12px; color: var(--muted); }
.km-dl { display: inline-block; padding: 7px 10px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 12.5px; font-weight: 700; text-decoration: none; text-align: center; }
.km-couleurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.km-couleur { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.km-couleur span { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); }
.km-couleur small { color: var(--muted); font-family: monospace; }
.km-pubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.km-pub video { width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; background: #000; }
.km-pub figcaption { display: flex; flex-direction: column; }
.km-pub small { color: var(--muted); font-size: 12px; }
.km-captures { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.km-capture { padding: 6px; position: relative; }
.km-capture img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; }
.km-capture .km-dl { position: absolute; top: 10px; right: 10px; padding: 5px 8px; }
.km-texte { margin-bottom: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.km-texte p { margin: 6px 0 8px; font-size: 14px; white-space: pre-wrap; }
.km-copier { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.km-team, .km-regles ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
@media (max-width: 420px) { .km-logos { grid-template-columns: repeat(2, 1fr); } }
.noel-option { margin: 8px 0; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.noel-option[hidden] { display: none; }

/* ---------- Crée ton jeu ---------- */
.cj-boite { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.cj-texte { width: 100%; box-sizing: border-box; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.cj-idees { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cj-idees button { flex-shrink: 0; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cj-creer { padding: 13px 18px; border-radius: 999px; border: none; background: var(--grad); color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.cj-creer:disabled { opacity: .6; cursor: wait; }
.cj-sec { padding: 12px 16px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.cj-aide { margin: 0; font-size: 13px; color: var(--muted); }
.cj-etapes p { margin: 6px 0; font-weight: 600; }
.cj-code { margin: 8px 0; max-height: 280px; overflow: auto; padding: 14px; border-radius: 14px; background: #05060c; color: #7DD3FC; font: 13px/1.5 ui-monospace, monospace; white-space: pre-wrap; border: 1px solid var(--border); }
.cj-zone { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 12px; }
.cj-titre { margin: 0; font-size: 20px; }
.cj-ecran { width: min(360px, 100%); aspect-ratio: 2 / 3; border-radius: 18px; touch-action: none; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.cj-boutons { display: flex; gap: 8px; }
.cj-ia { margin: 0; font-size: 11.5px; color: var(--muted); }
.jx-carte.createur { text-decoration: none; color: inherit; }
.jx-carte.noel-jeu { text-decoration: none; color: inherit; background: linear-gradient(135deg, color-mix(in srgb, #DC2626 35%, var(--surface)), color-mix(in srgb, #15803D 30%, var(--surface))); }
.jx-carte.noel-jeu[hidden] { display: none; }

/* ---------- Fond de Noël 🎄 ---------- */
:root[data-fond="noel"] body { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 120 120'><g opacity='0.2'><path d='M30 18 L44 40 H36 L50 62 H40 L56 86 H4 L20 62 H10 L24 40 H16 Z' fill='%2316A34A'/><rect x='26' y='86' width='8' height='10' fill='%2392400E'/><path d='M30 9 l2.4 5 5.4.6-4 3.7 1.1 5.4-4.9-2.7-4.9 2.7 1.1-5.4-4-3.7 5.4-.6z' fill='%23FACC15'/><circle cx='24' cy='48' r='3' fill='%23DC2626'/><circle cx='38' cy='58' r='3' fill='%23FACC15'/><circle cx='20' cy='72' r='3' fill='%2338BDF8'/><circle cx='42' cy='78' r='3' fill='%23DC2626'/><rect x='74' y='74' width='26' height='22' rx='2' fill='%23DC2626'/><rect x='84.5' y='74' width='5' height='22' fill='%23FACC15'/><rect x='72' y='70' width='30' height='7' rx='2' fill='%23B91C1C'/><path d='M87 70 c-6-8-14-4-8 0 M87 70 c6-8 14-4 8 0' stroke='%23FACC15' stroke-width='2.5' fill='none'/><g stroke='%2393C5FD' stroke-width='1.6' stroke-linecap='round'><path d='M80 22h16M88 14v16M82.4 16.4l11.2 11.2M82.4 27.6l11.2 -11.2'/></g><g stroke='%23BFDBFE' stroke-width='1.6' stroke-linecap='round'><path d='M103 52h10M108 47v10M104.5 48.5l7.0 7.0M104.5 55.5l7.0 -7.0'/></g><g stroke='%2393C5FD' stroke-width='1.6' stroke-linecap='round'><path d='M56 104h12M62 98v12M57.8 99.8l8.399999999999999 8.399999999999999M57.8 108.2l8.399999999999999 -8.399999999999999'/></g><g stroke='%23BFDBFE' stroke-width='1.6' stroke-linecap='round'><path d='M60 30h8M64 26v8M61.2 27.2l5.6 5.6M61.2 32.8l5.6 -5.6'/></g><g stroke='%23BFDBFE' stroke-width='1.6' stroke-linecap='round'><path d='M6 108h8M10 104v8M7.2 105.2l5.6 5.6M7.2 110.8l5.6 -5.6'/></g></g></svg>"); background-size: 150px 150px; }
.fond-noel { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 120 120'><g opacity='1'><path d='M30 18 L44 40 H36 L50 62 H40 L56 86 H4 L20 62 H10 L24 40 H16 Z' fill='%2316A34A'/><rect x='26' y='86' width='8' height='10' fill='%2392400E'/><path d='M30 9 l2.4 5 5.4.6-4 3.7 1.1 5.4-4.9-2.7-4.9 2.7 1.1-5.4-4-3.7 5.4-.6z' fill='%23FACC15'/><circle cx='24' cy='48' r='3' fill='%23DC2626'/><circle cx='38' cy='58' r='3' fill='%23FACC15'/><circle cx='20' cy='72' r='3' fill='%2338BDF8'/><circle cx='42' cy='78' r='3' fill='%23DC2626'/><rect x='74' y='74' width='26' height='22' rx='2' fill='%23DC2626'/><rect x='84.5' y='74' width='5' height='22' fill='%23FACC15'/><rect x='72' y='70' width='30' height='7' rx='2' fill='%23B91C1C'/><path d='M87 70 c-6-8-14-4-8 0 M87 70 c6-8 14-4 8 0' stroke='%23FACC15' stroke-width='2.5' fill='none'/><g stroke='%2393C5FD' stroke-width='1.6' stroke-linecap='round'><path d='M80 22h16M88 14v16M82.4 16.4l11.2 11.2M82.4 27.6l11.2 -11.2'/></g><g stroke='%23BFDBFE' stroke-width='1.6' stroke-linecap='round'><path d='M103 52h10M108 47v10M104.5 48.5l7.0 7.0M104.5 55.5l7.0 -7.0'/></g><g stroke='%2393C5FD' stroke-width='1.6' stroke-linecap='round'><path d='M56 104h12M62 98v12M57.8 99.8l8.399999999999999 8.399999999999999M57.8 108.2l8.399999999999999 -8.399999999999999'/></g><g stroke='%23BFDBFE' stroke-width='1.6' stroke-linecap='round'><path d='M60 30h8M64 26v8M61.2 27.2l5.6 5.6M61.2 32.8l5.6 -5.6'/></g><g stroke='%23BFDBFE' stroke-width='1.6' stroke-linecap='round'><path d='M6 108h8M10 104v8M7.2 105.2l5.6 5.6M7.2 110.8l5.6 -5.6'/></g></g></svg>"); background-size: 60px 60px; background-color: color-mix(in srgb, #DC2626 6%, transparent); }

/* ---------- Couleur de Noël 🎄 : rouge, vert sapin et une touche d'or ---------- */
:root[data-couleur="noel"] { --accent: #F87171; --violet: #16A34A; --grad: linear-gradient(135deg, #DC2626, #15803D); --accent-text: #FECACA; }
:root[data-theme="light"][data-couleur="noel"] { --accent: #DC2626; --accent-text: #991B1B; }
.msg-source { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.msg-source a { color: var(--accent); font-weight: 600; }
