/* KISSBOT — système de design noir & rouge (cf DESIGN_SYSTEM.md).
   Glassmorphism sombre + halos rouges, repris du panel kissbot-thin. */
:root {
  --accent: #FF0303;
  --accent-2: #ff2a41;
  --accent-deep: #c20202;
  --bg-solid: #0d0d0f;
  --card: rgba(255, 255, 255, .03);
  --card-2: rgba(0, 0, 0, .3);
  --surface: rgba(255, 255, 255, .04);
  --border: rgba(255, 255, 255, .08);
  --border-red: rgba(255, 70, 70, .14);
  --text: #f4f5f7;
  --muted: #8b9198;
  --ok: #4ade80;
  --err: #ff5c5c;
  --radius: 20px;
  --radius-sm: 10px;
  --sidebar-w: 244px;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Inter", "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(255, 3, 3, .12) 0%, rgba(255, 3, 3, .035) 33%, transparent 60%),
    radial-gradient(60% 50% at 100% -5%, rgba(255, 3, 3, .08), transparent 55%),
    linear-gradient(165deg, #0d0d0f, #0b080a 55%, #110507 95%);
  background-attachment: fixed;
  min-height: 100vh;
}

.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.error { color: var(--err); }
.ok { color: var(--ok); }

/* ---------- Logo / wordmark ---------- */
.logo-img {
  width: 38px; height: 38px; border-radius: 11px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)) drop-shadow(0 0 12px rgba(255, 3, 3, .25));
  transition: transform .3s var(--bounce);
}
.logo-img:hover { transform: scale(1.08) rotate(3deg); }
.brand-kicker {
  font-weight: 900; font-size: 18px; letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #f4f5f7 45%, #bfc3c7 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)) drop-shadow(0 0 10px rgba(255, 3, 3, .3));
}
.brand-row { display: flex; align-items: center; gap: 11px; justify-content: center; }

/* ---------- Inputs ---------- */
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .2);
  transition: border-color .25s, box-shadow .25s;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(255, 3, 3, .5);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .2), 0 0 0 3px rgba(255, 3, 3, .1);
}
textarea { min-height: 72px; resize: vertical; font-weight: 500; }

/* ---------- Boutons ---------- */
button {
  font-family: inherit; cursor: pointer; border: none; color: #fff;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  transition: all .25s var(--bounce);
}
button:hover { background: rgba(255, 255, 255, .08); transform: translateY(-1px); }
button:disabled { opacity: .42; cursor: default; transform: none; }
/* Aucun lien en bleu par défaut : hérite la couleur du texte (les liens stylés gardent la leur). */
a { color: inherit; }
.primary, .pack-btn, .btn-like {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 3, 3, .55);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 800;
  box-shadow: 0 8px 22px rgba(255, 3, 3, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.primary:hover, .pack-btn:hover, .btn-like:hover {
  background: linear-gradient(135deg, #ff2222, var(--accent));
  box-shadow: 0 10px 28px rgba(255, 3, 3, .4), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.link-btn { background: none; color: var(--muted); padding: 6px 8px; font-weight: 500; }
.link-btn:hover { background: none; color: var(--text); transform: none; }

/* ---------- Landing (login) ---------- */
.landing { display: flex; min-height: 100vh; }

/* — Gauche : animation — */
.landing-visual {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--border-red);
  background: linear-gradient(160deg, #0c0c0e, #160609 70%, #1a0508);
}
.visual-glow {
  position: absolute; width: 540px; height: 540px; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(255, 3, 3, .26) 0%, rgba(255, 3, 3, .07) 40%, transparent 66%);
  filter: blur(12px); animation: breathe 7s ease-in-out infinite;
}
/* Halo rouge qui respire : nappe douce (.visual-glow) + cœur plus vif (::after) */
.visual-glow::after {
  content: ''; position: absolute; inset: 28%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 60, 60, .5), transparent 70%);
  filter: blur(16px); animation: breathe 5.5s ease-in-out infinite reverse;
}
@keyframes breathe { 0%, 100% { opacity: .58; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }


/* Champ de fantômes Snapchat (gris) en DIAGONALE + défilement dans le sens */
.snap-diag {
  position: absolute; left: -50%; top: -50%; width: 200%; height: 200%;
  z-index: 0; pointer-events: none;
  background: url("assets/snap-pattern.png") repeat;
  background-size: 46px;
  transform: rotate(30deg);
  opacity: .02;
  animation: diagScroll 44s linear infinite;
}
@keyframes diagScroll { from { background-position: 0 0; } to { background-position: 0 -460px; } }
.visual-logo {
  position: relative; width: 168px; height: 168px; object-fit: contain; z-index: 2;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .6)) drop-shadow(0 0 36px rgba(255, 3, 3, .5));
  animation: float 4.5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

/* — Droite : connexion — */
.landing-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px; }
/* Widget translucide (glass) derrière les infos de connexion */
.form-inner {
  width: 100%; max-width: 384px;
  padding: 36px 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .022));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .09),
    0 26px 64px rgba(0, 0, 0, .55),
    0 12px 48px rgba(255, 3, 3, .10);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}
.form-inner .brand-row { justify-content: flex-start; margin-bottom: 6px; }
.form-sub { margin: 0; }
#login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
#login-form label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
#login-form .primary { margin-top: 4px; }
/* Slot Cloudflare Turnstile (CAPTCHA login) — visible seulement quand activé (cf app.js). */
.turnstile-slot { margin: 12px 0 4px; min-height: 0; }
.turnstile-slot:not([hidden]) { display: flex; justify-content: center; }
.landing-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.landing-or span { text-transform: uppercase; letter-spacing: 1px; }
.landing-or::before, .landing-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-secondary {
  display: block; text-align: center; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); padding: 12px; border-radius: 12px;
  font-weight: 700; font-size: 13px; transition: all .2s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 3, 3, .35); transform: translateY(-1px); }
#api-hint { margin-top: 16px; }

@media (max-width: 820px) {
  .landing { flex-direction: column; }
  .landing-visual { min-height: 280px; flex: none; border-right: none; border-bottom: 1px solid var(--border-red); }
  .visual-logo { width: 120px; height: 120px; }
  .visual-tag { font-size: 15px; bottom: 7%; }
  .landing-form { padding: 24px 16px; }
  .form-inner { max-width: 440px; padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .visual-glow, .visual-glow::after, .visual-logo, .snap-diag { animation: none !important; }
}

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0));
  border-right: 1px solid var(--border-red);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; position: relative; }
.sidebar-brand::after {
  content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 3, 3, .32), rgba(255, 255, 255, .08), transparent);
}
.sidebar-brand .brand-kicker { font-size: 17px; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 14px 10px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav-item {
  background: none; color: var(--muted); text-align: left; font-weight: 600; font-size: 13.5px;
  padding: 11px 14px; border-radius: 11px; border: 1px solid transparent;
  display: flex; align-items: center; gap: 11px; letter-spacing: .2px;
}
.nav-item .ic { display: inline-flex; align-items: center; opacity: .8; }
.nav-item .ic svg { width: 18px; height: 18px; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--text); transform: none; }
.nav-item:hover .ic { opacity: 1; }
.nav-item.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 3, 3, .16), rgba(255, 3, 3, .04));
  border-color: rgba(255, 3, 3, .22);
  box-shadow: inset 0 -2px 0 var(--accent), 0 6px 18px rgba(255, 3, 3, .14), inset 0 1px 0 rgba(255, 255, 255, .06);
  text-shadow: 0 0 12px rgba(255, 3, 3, .35);
}
.nav-item.active .ic { opacity: 1; transform: scale(1.06); }
.dirty-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: auto; box-shadow: 0 0 8px rgba(255, 3, 3, .6); }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 9px; }

/* Encadré licence (crédits + plan + expiration) en bas de sidebar */
#sidebar-license { padding: 0 14px 4px; }
.lic-card {
  background: linear-gradient(180deg, rgba(255, 3, 3, .08), rgba(255, 255, 255, .02));
  border: 1px solid var(--border-red); border-radius: 14px; padding: 13px 14px;
}
.lic-top { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.lic-plan-tag {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800;
  letter-spacing: .4px; text-transform: uppercase; box-shadow: 0 2px 8px rgba(255, 3, 3, .35);
}
.lic-plan-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.lic-credits { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.lic-credits strong { display: block; font-size: 20px; font-weight: 900; color: var(--text); letter-spacing: .3px; margin-bottom: 1px; }
.lic-bar { height: 6px; background: rgba(255, 255, 255, .07); border-radius: 999px; overflow: hidden; margin-bottom: 9px; }
.lic-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); border-radius: 999px; box-shadow: 0 0 10px rgba(255, 3, 3, .5); }
.lic-exp { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.lic-exp svg { width: 13px; height: 13px; flex-shrink: 0; opacity: .8; }
.lic-btn {
  width: 100%; padding: 9px; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: #fff; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: 1px solid rgba(255, 3, 3, .55); box-shadow: 0 6px 16px rgba(255, 3, 3, .28);
  transition: transform .12s, box-shadow .12s;
}
.lic-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(255, 3, 3, .4); }

.content { flex: 1; min-width: 0; padding: 30px 40px; max-width: 880px; }
.page-head { display: flex; align-items: center; gap: 15px; margin-bottom: 26px; padding-bottom: 18px; position: relative; }
.page-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(255, 3, 3, .42), rgba(255, 255, 255, .08) 38%, transparent 75%); }
.page-head-ic {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; color: var(--accent-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01));
  border: 1px solid var(--border-red);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 6px 16px rgba(0, 0, 0, .35), 0 0 18px rgba(255, 3, 3, .16);
}
.page-head-ic svg { width: 23px; height: 23px; }
.page-head h1 { margin: 0 0 3px; font-size: 24px; font-weight: 900; letter-spacing: .3px; }
.page-head p { margin: 0; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px; margin: 0 0 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .25);
  backdrop-filter: blur(8px);
}
.card h2 { margin: 0 0 4px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.card > .muted { margin: 0 0 16px; font-size: 12.5px; }

.chip {
  background: var(--card-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 12px; font-size: 12px; text-align: center; font-weight: 700; letter-spacing: .3px;
}

/* ---------- Champs ---------- */
.fields { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }

/* Toggle premium (piste + pastille, glow rouge ON) */
.switch-row { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.switch-row span { font-size: 12px; font-weight: 600; }
.switch-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 40px; height: 22px; flex-shrink: 0;
  border-radius: 999px; background: rgba(0, 0, 0, .45); border: 1px solid var(--border);
  position: relative; cursor: pointer; transition: background .3s, border-color .3s; box-shadow: none;
}
.switch-row input[type="checkbox"]::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #a1aab3; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: all .4s var(--bounce);
}
.switch-row input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border-color: rgba(255, 3, 3, .55);
}
.switch-row input[type="checkbox"]:checked::after { left: 20px; background: #fff; box-shadow: 0 2px 6px rgba(255, 3, 3, .45); }

/* ---------- Groupes config (compte vs modèle) ---------- */
.group-header { margin: 10px 0 16px; padding-bottom: 8px; position: relative; }
.group-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 3, 3, .15), transparent);
}
.group-header h1 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.6px; margin: 0 0 3px; color: var(--accent-2); font-weight: 800; }
.group-header p { font-size: 12px; margin: 0; }
#config-account .group-header { margin-top: 30px; }
.model-picker {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card-2); border: 1px dashed var(--border-red);
  border-radius: var(--radius); padding: 11px 16px; margin-bottom: 18px; font-size: 12.5px;
}
.model-picker strong { color: var(--text); }

/* ---------- Banner ---------- */
.banner { border-radius: var(--radius-sm); padding: 11px 15px; margin-bottom: 16px; font-size: 12.5px; font-weight: 600; }
.banner.warn { background: rgba(255, 193, 7, .12); border: 1px solid rgba(255, 193, 7, .35); color: #ffe08a; }
.banner.err { background: rgba(255, 3, 3, .1); border: 1px solid rgba(255, 60, 60, .4); color: #ff9c9c; }

/* ---------- Actions ---------- */
.actions { display: flex; align-items: center; gap: 14px; padding: 12px 0 30px; }
.primary { min-width: 160px; padding: 13px; border-radius: 14px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg-solid) 40%); padding-top: 18px; }

/* ---------- Médias / Bibliothèque ---------- */
.media-upload { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.media-upload select { width: auto; }
.media-upload input[type="file"] { width: auto; flex: 1; min-width: 180px; font-weight: 500; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.lib-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.lib-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--card-2); display: block; }
.lib-meta { padding: 8px 10px; font-size: 11px; display: flex; justify-content: space-between; align-items: center; }
.lib-cat { color: var(--accent-2); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.lib-del {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border-radius: 999px;
  background: rgba(0, 0, 0, .6); font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.lib-del:hover { background: var(--accent); box-shadow: 0 4px 12px rgba(255, 3, 3, .4); transform: none; }
.lib-empty { color: var(--muted); font-size: 13px; padding: 10px 2px; }

/* ---------- Top up ---------- */
.balance-card { text-align: center; padding: 30px; }
.balance-big { font-size: 46px; font-weight: 900; letter-spacing: -1px; line-height: 1; color: #fff; text-shadow: 0 0 30px rgba(255, 3, 3, .45); }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 14px; }
.pack {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; transition: border-color .25s, transform .25s var(--bounce);
}
.pack:hover { border-color: rgba(255, 3, 3, .4); transform: translateY(-2px); }
.pack .qty { font-size: 30px; font-weight: 900; }
.pack .price { color: var(--muted); margin: 4px 0 16px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.pack-btn { width: 100%; }

/* ---------- Support / Affiliation ---------- */
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
a.btn-like { display: inline-block; text-decoration: none; padding: 12px 20px; border-radius: 14px; }
.badge-soon {
  display: inline-block; background: rgba(255, 193, 7, .14); border: 1px solid rgba(255, 193, 7, .35);
  color: #ffe08a; font-size: 10px; padding: 3px 9px; border-radius: 999px; margin-left: 8px;
  text-transform: uppercase; letter-spacing: .5px; font-weight: 700; vertical-align: middle;
}

/* ---------- Animations d'entrée des pages ---------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-enter { animation: fadeInUp .34s var(--bounce) both; }

/* ---------- Chargement (shimmer + spinner) ---------- */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.lib-thumb {
  background: linear-gradient(100deg, rgba(255,255,255,.03) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.03) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
}
.lib-thumb[src] { animation: none; background: var(--card-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .12); border-top-color: var(--accent);
  animation: spin .7s linear infinite; display: inline-block; vertical-align: middle;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 24, .96); border: 1px solid var(--border);
  color: var(--text); padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s var(--bounce); backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.toast.ok::before { background: var(--ok); box-shadow: 0 0 10px rgba(74, 222, 128, .6); }
.toast.err::before { background: var(--accent); box-shadow: 0 0 10px rgba(255, 3, 3, .6); }

/* ---------- Dropzone bibliothèque ---------- */
.dropzone { transition: border-color .2s, background .2s; }
.dropzone.dragover { border-color: var(--accent); background: rgba(255, 3, 3, .06); }

/* ---------- Accessibilité focus ---------- */
:focus-visible { outline: 2px solid rgba(255, 3, 3, .6); outline-offset: 2px; }
button:focus-visible, .nav-item:focus-visible { outline-offset: 1px; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-brand { padding: 14px 16px; }
  .sidebar-brand::after { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; order: 3; padding: 8px; }
  .nav-item { flex: 1; justify-content: center; }
  .sidebar-foot { flex-direction: row; border-top: none; align-items: center; }
  .content { padding: 22px; }
  .funnel { flex-direction: column; }
  .funnel-arrow { transform: rotate(90deg); }
}

/* ---------- Flotte + Caisse (monitoring) ---------- */
.funnel { display: flex; align-items: stretch; gap: 8px; margin-top: 8px; }
.funnel-step { flex: 1; background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 10px; text-align: center; }
.funnel-n { font-size: 26px; font-weight: 900; letter-spacing: .3px; }
.funnel-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.funnel-pct { font-size: 12px; margin-top: 6px; color: var(--ok); }
.funnel-arrow { display: flex; align-items: center; color: var(--muted); font-size: 18px; }
.caisse-kpis { display: flex; gap: 22px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.caisse-kpis strong { color: var(--text); font-size: 16px; margin-left: 4px; }
.kb-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.kb-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.kb-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.kb-table tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions .link-btn { padding: 4px 8px; font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-on { background: var(--ok); box-shadow: 0 0 0 3px rgba(74, 222, 128, .15); }
.dot-off { background: var(--muted); opacity: .5; }
.stage { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); }
.stage-cta_sent { color: #ffd27d; border-color: rgba(255,210,125,.25); }
.stage-click { color: #7dd3fc; border-color: rgba(125,211,252,.25); }
.stage-conversion { color: var(--ok); border-color: rgba(74,222,128,.3); }

/* Sélecteur multi-modèle (page Config) */
.model-picker { margin-bottom: 18px; padding: 14px 16px; border: 1px solid rgba(255,3,3,.18); border-radius: var(--radius-sm); background: rgba(255,3,3,.05); }
.mp-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 7px; }
.mp-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mp-row select { flex: 1; min-width: 180px; }
.model-picker .tiny { margin: 8px 0 0; }

/* Mises à jour (accueil) — fil d'actus type Telegram */
.upd { padding: 18px 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); margin-bottom: 14px; }
.upd-date { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.upd-date strong { color: var(--text); }
.upd-body { font-size: 14px; line-height: 1.6; }
.upd-body a { color: var(--accent-2); word-break: break-all; }

/* ---------- Champs additionnels (notes, badges, listes, locked, premium) ---------- */
.field-toggle { display: flex; flex-direction: column; gap: 5px; }
.field-note { margin: 0; opacity: .82; line-height: 1.45; }

.field.locked, .field-toggle.locked { opacity: .5; }
.field.locked label, .field-toggle.locked .switch-row { cursor: default; }
.field.locked input, .field.locked select, .field-toggle.locked input { cursor: not-allowed; }

/* Liste éditable (messages de relance / openers) */
.list-field { display: flex; flex-direction: column; gap: 8px; }
.list-rows { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; gap: 8px; align-items: center; }
.list-row input { flex: 1; }
.list-del {
  width: 36px; height: 36px; flex-shrink: 0; padding: 0; border-radius: var(--radius-sm);
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted); font-size: 13px;
}
.list-del:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(255, 3, 3, .35); transform: none; }
.list-add { align-self: flex-start; padding: 6px 4px; }

/* Carte premium (nos différenciateurs) */
.card-premium {
  border-color: rgba(255, 3, 3, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .25), 0 0 0 1px rgba(255, 3, 3, .06), 0 12px 40px rgba(255, 3, 3, .10);
}
.card-premium > h2 { color: var(--accent-2); }

/* Slider 0–100 */
input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; }

/* ---------- Configuration : barre modèle + onglets ---------- */
#config-modelbar { margin-bottom: 6px; }
.tabbar { display: flex; gap: 7px; flex-wrap: wrap; margin: 18px 0 22px; }
.tab-btn {
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 17px; font-weight: 700; font-size: 13px; letter-spacing: .2px;
}
.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, .07); transform: none; }
.tab-btn.active {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: rgba(255, 3, 3, .55); box-shadow: 0 6px 18px rgba(255, 3, 3, .28);
}

/* Écran « créer un premier modèle » */
.empty-create { max-width: 420px; margin: 40px auto; text-align: center; }
.empty-create .empty-icon { width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 3, 3, .08); border: 1px solid var(--border-red); box-shadow: 0 0 26px rgba(255, 3, 3, .25), inset 0 1px 0 rgba(255, 255, 255, .06); }
.empty-create .empty-icon svg { width: 30px; height: 30px; color: var(--accent-2); }
.empty-create h2 { font-size: 19px; margin: 0 0 5px; text-transform: none; letter-spacing: 0; }
.empty-create > .muted { margin: 0 auto; max-width: 300px; font-size: 13px; }
.empty-create form { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; text-align: left; }

/* Onglets : icônes, pastille « non enregistré », avatar modèle, contexte */
.tab-btn { display: inline-flex; align-items: center; gap: 8px; position: relative; }
.tab-ic { display: inline-flex; opacity: .85; }
.tab-ic svg { width: 16px; height: 16px; }
.tab-btn.active .tab-ic { opacity: 1; }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .7); }
.tab-btn:not(.active) .tab-dot { background: var(--accent); box-shadow: 0 0 8px rgba(255, 3, 3, .7); }
.tab-intro { margin: -12px 0 18px; font-size: 12.5px; }
.mp-avatar {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 4px 12px rgba(255, 3, 3, .35);
}

@media (max-width: 760px) {
  .tabbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .tab-btn { flex-shrink: 0; }
  .mp-row { flex-wrap: wrap; }
}

/* ---------- Page Friends : cockpit du filtre ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.stat-n { font-size: 30px; font-weight: 900; letter-spacing: -.5px; line-height: 1; }
.stat-l { font-size: 12px; color: var(--muted); margin-top: 6px; }
.shadow-delta { background: rgba(255, 3, 3, .06); border: 1px solid rgba(255, 3, 3, .2); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.shadow-delta strong { color: var(--text); }
.shadow-delta em { color: var(--accent-2); font-style: normal; font-weight: 700; }
.reasons { display: flex; flex-direction: column; gap: 10px; }
.reason-row { display: grid; grid-template-columns: 160px 1fr 40px; align-items: center; gap: 12px; font-size: 13px; }
.reason-l { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reason-bar { height: 8px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.reason-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); border-radius: 999px; }
.reason-n { text-align: right; font-weight: 700; }
@media (max-width: 760px) { .reason-row { grid-template-columns: 110px 1fr 32px; } }

/* ---------- Media vault (Library) ---------- */
.vault-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.vault-chip { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.vault-chip:hover { color: var(--text); background: rgba(255, 255, 255, .07); transform: none; }
.vault-chip.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border-color: rgba(255, 3, 3, .55); box-shadow: 0 6px 18px rgba(255, 3, 3, .28); }
.vault-chip-n { background: rgba(0, 0, 0, .28); border-radius: 999px; min-width: 18px; text-align: center; font-size: 11px; padding: 1px 6px; }
.vault-chip.active .vault-chip-n { background: rgba(255, 255, 255, .22); }
.vault-chip.empty:not(.active) { opacity: .5; }
.vault-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 14px; border-radius: var(--radius); transition: box-shadow .2s; }
.vault-grid.dragover { box-shadow: 0 0 0 2px var(--accent), 0 0 24px rgba(255, 3, 3, .25); }
.vault-add { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; aspect-ratio: 1; border: 2px dashed var(--border-red); border-radius: 16px; color: var(--muted); cursor: pointer; background: var(--card-2); transition: all .2s; }
.vault-add:hover { border-color: var(--accent); color: var(--text); background: rgba(255, 3, 3, .05); transform: translateY(-1px); }
.vault-add-ic { font-size: 30px; font-weight: 300; line-height: 1; }
.vault-add-l { font-size: 12px; font-weight: 700; }
.vault-cell { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--card-2); }
.vault-cell .lib-thumb { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.vault-del { position: absolute; top: 7px; right: 7px; width: 28px; height: 28px; padding: 0; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; opacity: 0; display: flex; align-items: center; justify-content: center; transition: opacity .15s; }
.vault-cell:hover .vault-del { opacity: 1; }
.vault-del:hover { background: var(--accent); box-shadow: 0 4px 12px rgba(255, 3, 3, .4); transform: none; }
.vault-cap { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; border: none; border-radius: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .8) 45%); color: #fff; font-size: 11px; padding: 16px 10px 8px; box-shadow: none; opacity: 0; transition: opacity .15s; }
.vault-cell:hover .vault-cap, .vault-cap:focus { opacity: 1; }
.vault-cap::placeholder { color: rgba(255, 255, 255, .55); }
@media (max-width: 760px) { .vault-del, .vault-cap { opacity: 1; } }
.vault-cell[draggable="true"] { cursor: grab; }
.vault-cell.dragging { opacity: .4; }
.vault-cell.drop-target { outline: 2px dashed var(--accent); outline-offset: -3px; }
.vault-ord { position: absolute; top: 7px; left: 7px; z-index: 2; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(255, 3, 3, .45); }
.vault-order-hint { grid-column: 1 / -1; margin: 6px 0 0; }
/* Slot vide numéroté (badge fantôme) */
.vault-ord.ghost { background: rgba(255, 255, 255, .08); color: var(--muted); box-shadow: none; }
/* Pied du vault : rappel d'ordre OU message de blocage (3/3) */
.vault-foot { grid-column: 1 / -1; margin-top: 8px; }
.vault-foot p { margin: 0; }
.vault-full { display: flex; align-items: center; gap: 11px; padding: 13px 15px; border: 1px solid var(--border-red); border-radius: 13px; background: rgba(255, 3, 3, .06); font-size: 13px; }
.vault-full svg { width: 19px; height: 19px; color: var(--accent-2); flex-shrink: 0; }
.vault-full strong { color: #fff; font-weight: 800; }
/* Photos au-delà de la limite (données héritées) : signalées pour suppression */
.vault-over { grid-column: 1 / -1; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.vault-over-msg { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--accent-2); font-size: 12.5px; font-weight: 700; }
.vault-over-msg svg { width: 16px; height: 16px; flex-shrink: 0; }
.vault-over-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.vault-cell.over { outline: 2px solid rgba(255, 3, 3, .45); outline-offset: -2px; }
/* Séquence d'envoi : 1 slot = photo carrée + son menu de TYPE dessous */
.vault-slot { display: flex; flex-direction: column; gap: 8px; }
.vault-slot[draggable="true"] { cursor: grab; }
.vault-slot.dragging { opacity: .4; }
.vault-slot.drop-target .vault-cell { outline: 2px dashed var(--accent); outline-offset: -3px; }
.vault-type { display: block; }
.vault-type select { width: 100%; padding: 8px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.vault-type.dim { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: 11.5px; opacity: .6; }
/* Barre de comptage de la séquence (remplace les onglets de type) */
.vault-seqbar { margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.vault-seq-n { color: var(--text); font-weight: 800; }

/* ---------- Library : onglets Photos | Voice notes ---------- */
.lib-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; }
.lib-tab { background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 18px; border-radius: 9px; }
.lib-tab:hover { background: rgba(255, 255, 255, .05); color: var(--text); transform: none; }
.lib-tab.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); box-shadow: 0 4px 14px rgba(255, 3, 3, .3); }

/* ---------- Voice notes (pool) ---------- */
.voice-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.voice-import { display: inline-flex; align-items: center; cursor: pointer; padding: 10px 16px; font-size: 12px; border-radius: 10px; }
.voice-count { color: var(--muted); font-size: 13px; font-weight: 600; }
.voice-list { display: flex; flex-direction: column; gap: 10px; }
.voice-row { display: flex; align-items: center; gap: 14px; padding: 11px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; transition: border-color .2s; }
.voice-row:hover { border-color: var(--border-red); }
.voice-play { flex-shrink: 0; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); box-shadow: 0 4px 12px rgba(255, 3, 3, .3); }
.voice-play.playing { background: var(--surface); box-shadow: none; }
.voice-wave { flex-shrink: 0; display: flex; align-items: center; gap: 2px; height: 26px; width: 88px; }
.voice-wave span { flex: 1; background: var(--accent-2); opacity: .5; border-radius: 2px; height: 50%; }
.voice-wave span:nth-child(2n) { height: 90%; }
.voice-wave span:nth-child(3n) { height: 32%; }
.voice-wave span:nth-child(4n) { height: 70%; }
.voice-wave span:nth-child(5n) { height: 100%; }
.voice-row:hover .voice-wave span, .voice-play.playing ~ .voice-wave span { opacity: .8; }
.voice-label { flex: 1; min-width: 0; background: var(--card-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 500; }
.voice-dur { flex-shrink: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.voice-del { flex-shrink: 0; width: 32px; height: 32px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); background: var(--surface); }
.voice-del:hover { background: var(--accent); color: #fff; }
@media (max-width: 640px) { .voice-wave { display: none; } }

/* ---------- Top up & plans ---------- */
.section-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin: 28px 0 14px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.plan { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; display: flex; flex-direction: column; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.plan-pop { border-color: rgba(255, 3, 3, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 12px 36px rgba(255, 3, 3, .12); }
.plan-current { border-color: rgba(74, 222, 128, .35); }
.plan-tag { position: absolute; top: 14px; right: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 3px 9px; border-radius: 999px; }
.plan-name { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 800; }
.plan-price { font-size: 34px; font-weight: 900; letter-spacing: -1px; margin: 6px 0 14px; line-height: 1; }
.plan-price span { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-feats { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.plan-feats li { font-size: 13px; color: var(--text); padding-left: 22px; position: relative; }
.plan-feats li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan-btn { width: 100%; margin-top: auto; }

/* ---------- Support page ---------- */
.support-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.support-hero .sh-ic {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 15px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2aabee, #229ed9);
  box-shadow: 0 8px 20px rgba(34, 158, 217, .32), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.support-hero .sh-ic svg { width: 27px; height: 27px; margin-left: -1px; }
.support-hero h2 { margin: 0 0 3px; }
.support-hero p { margin: 0; }
#support-faq, #support-links { margin-top: 16px; }
.sec-h { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-2); font-weight: 800; margin: 0 0 6px; }
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-top: 1px solid var(--border); }
.faq-item:first-child { border-top: none; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer; border-radius: 0;
  padding: 15px 2px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-weight: 700; font-size: 14px; color: var(--text);
}
.faq-q:hover { background: none; transform: none; color: var(--accent-2); }
.faq-q .chev { display: inline-flex; color: var(--muted); transition: transform .25s var(--bounce); }
.faq-q .chev svg { width: 18px; height: 18px; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); color: var(--accent-2); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.faq-item.open .faq-a { max-height: 260px; }
.faq-a p { margin: 0 2px 16px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.faq-a strong { color: var(--text); font-weight: 700; }
.help-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.help-link {
  display: flex; flex-direction: column; gap: 3px; padding: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card-2);
  transition: border-color .2s, transform .2s;
}
.help-link:hover { border-color: var(--border-red); transform: translateY(-2px); background: var(--card-2); }
.help-link .hl-t { font-weight: 700; font-size: 13.5px; color: var(--text); }
.help-link .hl-d { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) { .help-links { grid-template-columns: 1fr; } }

/* ---------- Affiliate page ---------- */
/* Hero "devenir partenaire" */
.aff-hero { position: relative; overflow: hidden; }
.aff-hero-top { display: flex; align-items: center; gap: 15px; margin-bottom: 6px; }
.aff-hero h2 { color: var(--accent-2); }
.aff-badge {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 8px 22px rgba(255, 3, 3, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.aff-badge svg { width: 24px; height: 24px; }
.aff-hero-num { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 10px 0 18px; }
.aff-pct {
  font-size: 66px; font-weight: 900; letter-spacing: -3px; line-height: .9;
  background: linear-gradient(135deg, #fff 0%, var(--accent-2) 62%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 3, 3, .35));
}
.aff-pct-cap { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.aff-pct-cap strong { color: var(--text); }
.aff-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 16px 0 4px; border-top: 1px solid var(--border);
}
.aff-strip > div { text-align: center; }
.aff-strip strong { display: block; font-size: 17px; font-weight: 900; color: var(--text); }
.aff-strip span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.aff-cta { display: inline-block; margin-top: 18px; text-align: center; }
.aff-who { text-align: center; margin: 12px 0 0; }

/* Étapes "how it works" */
.aff-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.aff-steps li { display: flex; gap: 13px; align-items: flex-start; }
.aff-steps li strong { font-size: 13.5px; color: var(--text); }
.aff-steps li p { margin: 2px 0 0; }
.aff-step-n {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 4px 12px rgba(255, 3, 3, .3);
}

/* Carte gains (dashboard partenaire) */
.aff-earn { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.aff-earn-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--accent-2); font-weight: 800; margin-bottom: 5px; }
.aff-earn-val {
  font-size: 46px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; color: var(--text);
  text-shadow: 0 4px 18px rgba(255, 3, 3, .22);
}
.aff-earn-val .aff-unit { font-size: 16px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.aff-earn-note { margin-top: 7px; }
.aff-earn-side { display: flex; gap: 12px; }
.aff-mini {
  min-width: 82px; text-align: center; padding: 12px 14px; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--border);
}
.aff-mini strong { display: block; font-size: 24px; font-weight: 900; color: var(--text); }
.aff-mini span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

/* Lien de parrainage */
.aff-link-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.aff-code {
  flex: 1; min-width: 220px; padding: 12px 14px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card-2); color: var(--text); overflow-wrap: anywhere;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .2);
}
.aff-copy { white-space: nowrap; }
.aff-code-hint { margin: 10px 0 0; }
.aff-inline { padding: 1px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; }

@media (max-width: 720px) {
  .aff-strip { grid-template-columns: 1fr; gap: 6px; }
  .aff-earn { flex-direction: column; align-items: flex-start; }
  .aff-earn-side { width: 100%; }
  .aff-mini { flex: 1; }
  .aff-pct { font-size: 54px; }
}

/* ---------- Right rail (discreet Telegram nudge) ---------- */
/* Volontairement sobre : pas de colonne pleine ni de bloc voyant — juste un petit
   lien Telegram en haut à droite, sticky, raccord au thème. */
.rail {
  width: 248px; flex-shrink: 0; align-self: flex-start;
  position: sticky; top: 30px; padding: 30px 24px 0 4px;
}
.rail-tg {
  display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text);
  padding: 11px 12px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s, background .2s;
}
.rail-tg:hover { border-color: var(--border-red); transform: translateY(-1px); background: rgba(255, 255, 255, .03); }
.rail-tg-ic {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #c8ccd2; background: rgba(255, 255, 255, .05);
}
.rail-tg-ic svg { width: 17px; height: 17px; margin-left: 1px; }
.rail-tg-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.25; }
.rail-tg-txt strong { font-size: 12.5px; font-weight: 700; }
.rail-tg-arr { margin-left: auto; color: var(--muted); font-size: 15px; }
@media (max-width: 1100px) { .rail { display: none; } }
