:root {
  --bg: #050505;
  --bg2: #0c0c0f;
  --panel: #111114;
  --panel2: #18181d;
  --border: #2a2a32;
  --text: #eef1f5;
  --muted: #8b919c;
  --blue: #c5ced9;
  --green: #8fd4b0;
  --red: #e86a6a;
  --btn-label-size: 13px;
  --btn-label-weight: 700;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
/* `clip` (et non `hidden`) empeche le debordement horizontal SANS creer de
   conteneur de defilement, ce qui casserait `position: sticky` (header mobile). */
html { background: var(--bg); overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(197, 206, 217, 0.06) 0%, transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
}
.app {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: rgba(5, 5, 5, .55);
}

/* ---------- HAUT ---------- */
.top {
  position: relative;
  padding: 14px 18px 12px;
  background: rgba(5, 5, 5, .85);
  backdrop-filter: blur(10px);
  border-bottom: none;
}
.panel-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---------- panneau fixe : apercu + parametres ---------- */
.toppanel {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 1fr; /* deux moities strictement egales */
  gap: 12px;
  padding: 12px 18px;
  background: rgba(5, 5, 5, .95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.tp-preview, .tp-params {
  min-width: 0;
  height: 228px;
  background: #141418;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.tp-params {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}
.tp-preview { display: flex; flex-direction: column; }
.tp-title {
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
  flex-shrink: 0;
}
.tp-rows { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
/* Zone reservee pour de futurs parametres (meme hauteur que l'apercu). */
.tp-rows-extra { flex: 1 1 auto; min-height: 56px; }
.tp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.tp-lbl { color: var(--muted); font-weight: 600; white-space: nowrap; }
.tp-val { color: var(--text); font-weight: 700; text-align: right; }
.tp-plan-val {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; flex-wrap: wrap;
}
.tp-mini {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: var(--text); cursor: default;
}
.tp-mini input { accent-color: var(--blue); margin: 0; }

/* Ligne abonnement : pastille d'etat lisible en un coup d'oeil + bouton. */
.tp-row-plan { align-items: center; }
.tp-plan-val { gap: 8px; }
.tp-plan-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: .3px;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel2); color: var(--muted);
  text-transform: uppercase;
}
.tp-plan-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex: none;
}
.tp-plan-pill.free { color: #8b98a5; }
.tp-plan-pill.premium {
  color: #1c1300; border-color: #e8a317;
  background: linear-gradient(180deg, #ffd970, #e8a317);
}
.tp-plan-pill.premium .dot { background: #1c1300; }
.tp-link {
  border: none; background: none; padding: 0;
  color: #ffd23f; font-size: 12px; font-weight: 800; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.tp-link:hover { color: #ffe566; }
.tp-notif {
  display: inline-flex; align-items: center; justify-content: flex-end;
  gap: 6px; cursor: pointer; font-weight: 600;
}
.tp-notif input { accent-color: var(--blue); margin: 0; cursor: pointer; }

/* ---------- Parametres : tuiles ---------- */
.tp-list { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.tp-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  background: #1b2735; border: 1px solid #2f3f4f; border-radius: 11px;
}
.tp-item-tap { cursor: pointer; }
.tp-item-tap:hover { border-color: #3c5066; }
/* Ligne verrouillee (ex. Turbo reserve aux Premium) : grisee mais cliquable. */
.tp-item.locked { cursor: pointer; }
.tp-item.locked:hover { border-color: #3c5066; }
.tp-item.locked .tp-item-ico,
.tp-item.locked .tp-item-main { opacity: .45; }
.tp-item-ico {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; background: #243345; color: #aebccb;
}
.tp-item-ico.ico-plan { color: #ffd23f; background: rgba(232,163,23,.16); }
.tp-item-ico.ico-bell { color: #6cc0ff; background: rgba(108,192,255,.14); }
.tp-item-ico.ico-turbo { color: #ffd23f; background: rgba(255,210,63,.14); }
.tp-item-ico.ico-install { color: #00ba7c; background: rgba(0,186,124,.15); }
.tp-val-action { color: var(--blue); }
.tp-item-main { flex: 1 1 auto; min-width: 0; }
.tp-item-lbl { font-size: 13px; font-weight: 700; color: #f3f6f9; line-height: 1.2; }
.tp-lbl-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  color: #ffd23f; background: rgba(255,210,63,.14);
  padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
}
.tp-item-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tp-item-ctrl { flex: none; display: flex; align-items: center; gap: 8px; }
.tp-item-ctrl .tp-val { font-size: 13px; font-weight: 700; }

/* Interrupteur facon iOS pour les notifications. */
.tp-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.tp-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tp-switch-slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
  background: #3a4a5c; transition: background .18s ease;
}
.tp-switch-slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .18s ease;
}
.tp-switch input:checked + .tp-switch-slider { background: var(--green); }
.tp-switch input:checked + .tp-switch-slider::before { transform: translateX(18px); }
.tp-switch input:disabled + .tp-switch-slider { opacity: .5; cursor: not-allowed; }

.tp-note { margin-top: 10px; font-size: 11px; line-height: 1.4; color: #5b6b7a; flex-shrink: 0; }
.tp-note:not(.hidden) { display: block; }

/* ---------- Invite d'installation PWA ---------- */
.install-ico { width: auto; height: 64px; max-width: 200px; border-radius: 14px; flex: none; object-fit: contain; }
.install-x {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  border: none; background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.install-x:hover { background: rgba(255,255,255,.06); color: var(--text); }

/* Section grisee (ex. notifications indisponibles hors app sur mobile). */
/* Section desactivee : on grise le CONTENU (pas l'overlay) et on superpose un
   message pleinement lisible par-dessus (ex. notifications a installer). */
.tp-item.is-disabled { position: relative; pointer-events: none; }
.tp-item.is-disabled > :not(.notify-lock) { opacity: .3; }
.notify-lock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 0 14px;
  border-radius: 11px;
  background: rgba(18,27,37,.9);
  z-index: 2;
}
.notify-lock span {
  font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.35;
}

/* Popup generique (ex. explication "fausse alerte probable") */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
}
.modal.hidden { display: none; }
.modal-card {
  position: relative; width: 100%; max-width: 400px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 26px 22px 24px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.modal-card .install-x { position: absolute; top: 12px; right: 12px; }
.modal-ico {
  width: 52px; height: 52px; margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 26px;
  background: rgba(244,33,46,.15); color: #ff8a91;
}
.modal-card h3 { margin: 10px 0 12px; font-size: 18px; }
.modal-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.modal-note {
  margin: 14px 0 0; font-size: 12.5px; color: #6b7a89; line-height: 1.5;
}
.modal-note a { color: var(--blue); text-decoration: none; font-weight: 700; }
.modal-note a:hover { text-decoration: underline; }

/* Modale d'instructions iOS */
.ios-install {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
}
.ios-install.hidden { display: none; }
.ios-card {
  position: relative; width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 26px 22px 22px; text-align: center;
}
.ios-card .install-x { position: absolute; top: 12px; right: 12px; }
.ios-card h3 { margin: 12px 0 16px; font-size: 18px; }
.ios-steps { text-align: left; margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.ios-steps li { font-size: 14px; line-height: 1.45; color: var(--text); }
.ios-steps b { color: var(--text); }
.ios-share {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px; vertical-align: -6px;
  background: rgba(29,155,240,.15); color: var(--blue); padding: 3px;
}
.ios-lead { margin: 0 0 14px; font-size: 13.5px; color: var(--text); line-height: 1.45; }
.ios-note { margin: 16px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.tp-hint { font-size: 13px; font-weight: 700; color: var(--text); }
.tp-sub {
  margin-top: 12px; margin-bottom: 8px;
  font-size: 13px; font-weight: 700; color: var(--text);
}
.tp-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; margin-bottom: 7px;
  background: #1b2733; border: 1px solid #2f3f4f; border-radius: 9px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.tp-opt:hover { border-color: var(--blue); }
.tp-opt input { accent-color: var(--blue); cursor: pointer; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }
.brand .logo { font-size: 22px; }
/* Logo image : se dimensionne via la font-size du contexte (.brand, .lp-brand...). */
/* flex: none empeche l'image d'etre ecrasee a ~0 dans les en-tetes flex (mobile). */
img.logo {
  height: 1.55em; width: auto; max-width: min(220px, 52vw); flex: none;
  vertical-align: middle; display: inline-block; object-fit: contain;
}
.brand h1 { font-size: 18px; margin: 0; }
.brand-home {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; cursor: pointer;
}
.brand-home:hover { opacity: .8; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.conn.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.conn.off { background: var(--red); }

.top-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
  opacity: 0.9;
}
.monitor-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  flex-wrap: wrap;
}
.monitor-add {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}
.monitor-top .add-row {
  width: min(240px, 100%);
  max-width: 240px;
  flex: 0 1 auto;
}
.monitor-bulk-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  font-weight: var(--btn-label-weight);
  letter-spacing: 0.03em;
}
.monitor-list-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  font-weight: var(--btn-label-weight);
  letter-spacing: 0.03em;
}
.monitor-top .monitored-head {
  margin-top: 0;
  flex-shrink: 0;
  gap: 8px;
  margin-left: auto;
}
.bulk-monitor-modal {
  width: min(420px, calc(100vw - 32px));
}
.bulk-monitor-modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.bulk-monitor-modal textarea {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  min-height: 120px;
}
.bulk-monitor-submit {
  width: 100%;
  margin-top: 12px;
  padding: 11px 16px;
}
.monitored-drawer.collapsed { display: none; }
.monitored-drawer:not(.collapsed) {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}
.monitored-lists-hint {
  margin: 14px 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.monitored-lists-hint.hidden { display: none; }
.monitored-lists {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 0;
}
.monitored-lists:empty { display: none; }
.monitored-drawer:has(.monitored-lists:not(:empty)) .chips {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.monitored-list-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.monitored-list-main {
  min-width: 0;
  flex: 1;
}
.monitored-list-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitored-list-name a {
  color: inherit;
  text-decoration: none;
}
.monitored-list-name a:hover { text-decoration: underline; }
.monitored-list-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.monitored-list-meta.err { color: #ffb020; }
.monitored-list-meta.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.monitored-list-card.is-syncing {
  border-color: rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.04);
}
.list-sync-spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  animation: turbo-spin .7s linear infinite;
  flex: none;
}
.list-sync-btn .list-sync-spin {
  width: 10px;
  height: 10px;
  vertical-align: middle;
}
@media (prefers-reduced-motion: reduce) {
  .list-sync-spin { animation: none; border-top-color: var(--blue); }
}
.monitored-list-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.list-sync-btn {
  white-space: nowrap;
  font-size: 12px;
  padding-left: 10px;
  padding-right: 10px;
}
.list-monitor-modal {
  width: min(440px, calc(100vw - 32px));
}
.list-monitor-modal input {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.list-monitor-submit {
  width: 100%;
  margin-top: 12px;
  padding: 11px 16px;
}
.list-monitor-submit.is-loading {
  opacity: 0.75;
  cursor: wait;
}
.list-monitor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.list-monitor-status.hidden { display: none; }
.list-monitor-spin {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  animation: turbo-spin .7s linear infinite;
}
.list-monitor-modal.is-busy .install-x,
.list-monitor-modal.is-busy input {
  pointer-events: none;
  opacity: 0.55;
}
@media (prefers-reduced-motion: reduce) {
  .list-monitor-spin { animation: none; border-top-color: var(--blue); }
}

.add-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 6px 6px 12px;
}
.add-row:focus-within { border-color: var(--blue); }
.add-row-compact {
  padding: 4px 4px 4px 10px;
}
.add-row input[type="text"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  padding: 6px 0;
  font-family: inherit;
}
.add-row textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  padding: 6px 0;
  resize: vertical;
  font-family: inherit;
  min-height: 44px;
}
.add-row .btn {
  align-self: center;
  flex-shrink: 0;
  padding: 7px 12px;
  font-weight: var(--btn-label-weight);
  letter-spacing: 0.04em;
  min-width: 52px;
}
.add-row-compact .btn {
  padding: 6px 12px;
}
.sync-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 2px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.sync-hint-spin {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--muted);
  animation: turbo-spin .7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .sync-hint-spin { animation: none; border-top-color: var(--muted); }
}
.btn {
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 9px;
  font-size: var(--btn-label-size);
  font-weight: var(--btn-label-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, transform .05s;
}
/* Les boutons rendus via <a> ne doivent jamais etre soulignes. */
a.btn, a.btn:hover { text-decoration: none; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #e8edf2 0%, #b8c2ce 100%);
  border-color: #aeb8c4;
  color: #09090b;
}

/* ---------- Bouton Retour (toutes les pages) ---------- */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  transition: color .15s, background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
a.page-back, a.page-back:hover { text-decoration: none; }
.page-back:hover {
  color: var(--text);
  background: var(--panel);
  border-color: rgba(139, 152, 165, .5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.page-back:active { transform: translateY(1px); }
.page-back:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.page-back__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  opacity: .9;
  transition: transform .15s ease;
}
.page-back:hover .page-back__ico { transform: translateX(-2px); }
.page-back--start { align-self: flex-start; }
.page-back--center { align-self: center; margin-top: 10px; }
.co-top .page-back,
.ac-top .page-back { margin-left: auto; }

.monitored-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.monitored-count { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.monitored-drawer .chips {
  margin-top: 14px;
  padding-top: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
.chip .chip-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--panel2); }
.chip .state { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip .state.ok { background: var(--green); }
.chip .state.error { background: var(--red); }
.chip .state.pending { background: #ffd400; }
.chip a { color: var(--text); text-decoration: none; }
.chip a:hover { color: var(--blue); }
.chip .chip-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
.chip .chip-count.err { color: var(--red); border-color: rgba(244,33,46,.4); }
/* En attente du premier scan : petit spinner neutre (gris) dans le compteur. */
.chip .chip-count.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
}
.chip .chip-spin {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--muted);
  animation: turbo-spin .7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .chip .chip-spin { animation: none; border-top-color: var(--muted); }
}
.chip .x {
  cursor: pointer;
  color: var(--muted);
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 50%;
}
.chip .x:hover { color: var(--red); background: rgba(244,33,46,.12); }
/* ---------- bouton Turbo (API officielle, Premium) ---------- */
.chip .turbo-toggle {
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel2);
  font-size: 13px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  transition: color .15s, background .15s, border-color .15s;
}
.chip .turbo-toggle:hover { color: #ffd400; border-color: rgba(255,212,0,.5); }
.chip .turbo-toggle:disabled { opacity: .5; cursor: default; }
/* PRET : contour JAUNE + eclair jaune (detection effective). */
.chip .turbo-toggle.is-on {
  color: #ffd400;
  background: var(--panel2);
  border-color: #ffd400;
  box-shadow: 0 0 6px rgba(255, 212, 0, .35);
}
.chip .turbo-toggle.is-on:hover {
  color: #ffd400;
  border-color: #ffd400;
  background: rgba(255, 212, 0, .12);
}
/* EN PREPARATION (synchro initiale) : l'eclair est REMPLACE par un spinner de
   chargement. Le contour ne devient JAUNE (is-on) qu'une fois la reference
   posee -> montre clairement que le turbo n'est pas instantane au clic. */
.chip .turbo-toggle.is-loading {
  position: relative;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 0;               /* masque l'emoji eclair (emoji couleur) */
  vertical-align: middle;
  background: var(--panel2);
  border-color: rgba(255, 212, 0, .4);
}
.chip .turbo-toggle.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;               /* centrage parfait dans l'encart */
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 212, 0, .25);
  border-top-color: #ffd400;
  animation: turbo-spin .7s linear infinite;
}
@keyframes turbo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .chip .turbo-toggle.is-loading::after { animation: none; border-top-color: rgba(255, 212, 0, .6); }
}
.chip.is-turbo {
  border-color: #ffd400;
  box-shadow:
    0 0 0 1px rgba(255, 212, 0, .22) inset,
    0 0 8px rgba(255, 210, 63, .42),
    0 0 18px rgba(255, 210, 63, .18);
}
.chip.is-turbo:hover {
  border-color: #ffd23f;
  box-shadow:
    0 0 0 1px rgba(255, 210, 63, .28) inset,
    0 0 10px rgba(255, 210, 63, .5),
    0 0 22px rgba(255, 210, 63, .22);
}
.chips-empty { color: var(--muted); font-size: 13px; padding: 4px 2px; }

/* ---------- compteurs ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.stats .stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}
.stats .v { font-size: 19px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .v.green { color: var(--green); }
.stats .v.blue { color: var(--blue); }
.stats .v.amber { color: #ffd400; }
.stats .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 3px; }

/* ---------- MILIEU : feed ---------- */
.feed {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.feed-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
}
.feed-empty-icon { font-size: 40px; opacity: .6; }
.feed-empty p { margin: 12px 0 4px; font-size: 15px; }
.feed-empty small { font-size: 12px; opacity: .8; }

/* ---------- sections temporelles ---------- */
.feed-group { display: flex; flex-direction: column; gap: 10px; }
.feed-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
}
.feed-group-head::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue);
}
.feed-group-head .g-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.feed-group-head .g-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
.feed-group-head .g-clear {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(244, 33, 46, .85);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: var(--btn-label-size);
  font-weight: var(--btn-label-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .15s, background .15s;
}
.feed-group-head .g-clear::before {
  content: "";
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='black'%3E%3Cpath fill-rule='evenodd' d='M8.75 1A2.75 2.75 0 0 0 6 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 0 0 .23 1.482l.149-.022.841 9.518A2.75 2.75 0 0 0 7.596 19h4.807a2.75 2.75 0 0 0 2.742-2.53l.841-9.518.149.023a.75.75 0 0 0 .23-1.482A41.03 41.03 0 0 0 14 4.193V3.75A2.75 2.75 0 0 0 11.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 8.59a.75.75 0 0 0-1.152.082l-.022.066-.558 8.56a.75.75 0 0 0 1.065.832l.054-.044.558-8.56a.75.75 0 0 0-.105-.942zm4.852.018a.75.75 0 0 1 .105.942l-.558 8.56a.75.75 0 0 1-1.14-.832l.558-8.56.022-.066a.75.75 0 0 1 .105-.022z'/%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 20 20' fill='black'%3E%3Cpath fill-rule='evenodd' d='M8.75 1A2.75 2.75 0 0 0 6 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 0 0 .23 1.482l.149-.022.841 9.518A2.75 2.75 0 0 0 7.596 19h4.807a2.75 2.75 0 0 0 2.742-2.53l.841-9.518.149.023a.75.75 0 0 0 .23-1.482A41.03 41.03 0 0 0 14 4.193V3.75A2.75 2.75 0 0 0 11.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 8.59a.75.75 0 0 0-1.152.082l-.022.066-.558 8.56a.75.75 0 0 0 1.065.832l.054-.044.558-8.56a.75.75 0 0 0-.105-.942zm4.852.018a.75.75 0 0 1 .105.942l-.558 8.56a.75.75 0 0 1-1.14-.832l.558-8.56.022-.066a.75.75 0 0 1 .105-.022z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.feed-group-head .g-clear:hover {
  filter: brightness(1.12);
  background: #ff3b47;
}
.feed-group-items {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 820px) {
  .feed-group-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .feed-group-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Mobile : pas d'apercu (pas de survol pertinent), parametres pleine largeur ---------- */
@media (max-width: 640px) {
  .app { border-left: none; border-right: none; }
  .top { padding: 12px 12px 10px; }
  .brand { margin-bottom: 0; flex-wrap: wrap; row-gap: 8px; }
  .top-sep { margin: 10px 0; }
  .monitor-top { gap: 8px; }
  .monitor-top .add-row { max-width: none; width: 100%; }
  .monitor-add { flex: 1 1 100%; }
  .monitor-top .monitored-head { margin-left: 0; width: 100%; }
  .brand h1 { font-size: 16px; }
  .user-box { gap: 6px; margin-left: auto; }
  .btn.small { padding: 8px 12px; }

  /* On masque la colonne apercu et on laisse les parametres prendre toute la largeur. */
  .toppanel {
    position: static;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 10px 12px;
  }
  .tp-preview { display: none; }
  .tp-params { height: auto; }

  .feed { padding: 14px 12px; gap: 18px; }
  .feed-group-items { gap: 10px; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- carte de notification ---------- */
/* NON CLIQUEE (non lue) : carte claire. */
.ncard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  background: #27384a;
  border: 1px solid #3c5066;
  border-radius: 14px;
  padding: 18px 14px 15px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s, background .25s, opacity .25s;
}
.ncard:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}
.ncard.fresh {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(0,186,124,.35);
  animation: pop .35s ease;
}
.ncard-av {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; background: var(--panel2);
  border: 2px solid rgba(255, 255, 255, .12);
  margin-bottom: 4px;
}
.ncard-name {
  font-weight: 800; font-size: 16px; color: #f3f6f9;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ncard-handle {
  font-size: 13px; color: #6cc0ff; font-weight: 600;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ncard-by {
  display: flex; align-items: center; gap: 6px;
  margin-top: 7px; font-size: 11.5px; color: #aebccb;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ncard-by-av {
  width: 20px; height: 20px; border-radius: 50%;
  object-fit: cover; background: var(--panel2); flex-shrink: 0;
}
.ncard-by b { color: #fff; font-weight: 700; }
.ncard-time { font-size: 12px; color: #7d8fa1; margin-top: 5px; }

/* Barre Padre integree en bas de carte (trade SOL / Base / Robinhood / Ethereum). */
.ncard.has-padre {
  padding-bottom: 0;
  overflow: hidden;
}
.ncard-padre-bar {
  display: flex;
  align-self: stretch;
  width: calc(100% + 28px);
  margin: 10px -14px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .25);
}
.ncard-padre-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 8px;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: var(--btn-label-size);
  font-weight: var(--btn-label-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: rgba(80, 80, 90, .55);
  transition: filter .15s, background .15s;
  position: relative;
  z-index: 2;
  -webkit-font-smoothing: antialiased;
  white-space: nowrap;
}
.ncard-padre-link:hover {
  filter: brightness(1.08);
}
.ncard-padre-link--solana {
  background: linear-gradient(
    180deg,
    rgba(153, 69, 255, .78) 0%,
    rgba(20, 241, 149, .45) 100%
  );
}
.ncard-padre-link--base {
  background: linear-gradient(
    180deg,
    #0052ff 0%,
    #0047db 100%
  );
}
.ncard-padre-link--base:hover {
  background: linear-gradient(180deg, #1a66ff 0%, #0052ff 100%);
  filter: none;
}
.ncard-padre-link--robinhood {
  background: linear-gradient(
    180deg,
    #00c805 0%,
    #00a004 100%
  );
}
.ncard-padre-link--robinhood:hover {
  background: linear-gradient(180deg, #1fd916 0%, #00c805 100%);
  filter: none;
}
.ncard-padre-link--ethereum {
  background: linear-gradient(
    180deg,
    #627eea 0%,
    #4c5fd5 100%
  );
}
.ncard-padre-link--ethereum:hover {
  background: linear-gradient(180deg, #7b93f0 0%, #627eea 100%);
  filter: none;
}
.ncard-padre-link + .ncard-padre-link {
  border-left: 1px solid rgba(255, 255, 255, .12);
}

/* Croix : masque la carte de l'affichage PERSONNEL (n'affecte pas les autres). */
.ncard-x {
  position: absolute;
  top: 4px; right: 5px;
  width: 30px; height: 30px;
  line-height: 28px; text-align: center;
  padding: 0; border: none; border-radius: 50%;
  background: transparent; color: var(--red);
  font-size: 25px; font-weight: 700; cursor: pointer;
  opacity: 1;
  transition: color .15s, background .15s;
}
.ncard-x:hover { background: rgba(244,33,46,.16); }

/* Bouton "telecharger l'image" : en haut a gauche (miroir de la croix). */
.ncard-dl {
  position: absolute;
  top: 6px; left: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 50%;
  background: transparent; color: #7d8fa1;
  cursor: pointer; opacity: 0;
  transition: color .15s, background .15s, opacity .18s;
}
.ncard:hover .ncard-dl { opacity: 1; }
.ncard-dl:hover { color: var(--blue); background: rgba(29,155,240,.16); }
/* Sur ecran tactile (pas de hover), on laisse le bouton visible. */
@media (hover: none) {
  .ncard-dl { opacity: .85; }
}

/* DEJA CLIQUEE (lue) : un peu plus sombre + coche verte (en haut a gauche). */
.ncard.seen {
  background: #1f2c3a;
  border-color: #324559;
}
.ncard.seen .ncard-name { color: #aebccb; }
.ncard.seen .ncard-handle { color: #5aa9e6; }
.ncard.seen .ncard-av { opacity: .82; }
.ncard.seen:hover { border-color: var(--blue); }

/* "Fausse alerte probable" : cible affichant 0 abonne / 0 abonnement (typique
   d'un compte desactive puis reactive qui reapparait). Le badge est superpose
   (position absolue) : il ne modifie PAS la hauteur de la carte, qui reste
   identique aux autres. Une teinte rouge signale la carte d'un coup d'oeil. */
.ncard.suspect {
  border-color: rgba(244,33,46,.6);
  background: #3a2f38;
  box-shadow: inset 0 0 0 1px rgba(244,33,46,.22);
}
.ncard.suspect:hover { border-color: #f4212e; }
.ncard.suspect.seen { background: #2e2730; }
.ncard-warn {
  position: absolute;
  top: 7px; left: 7px;
  z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #f4212e;
  color: #fff;
  cursor: help;
  box-shadow: 0 2px 7px rgba(0,0,0,.4);
}
.ncard-warn:hover { background: #ff3b47; }
.ncard-warn-ico {
  font-size: 15px; line-height: 1; flex: none;
  font-weight: 800; font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
}

/* ---------- BAS : config ---------- */
.config {
  position: sticky;
  bottom: 0;
  background: rgba(5, 5, 5, .92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.config-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 13px 18px;
  cursor: pointer;
}
.config-toggle:hover { color: var(--text); }
.config-toggle .badge {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
}
.config-toggle .chevron { margin-left: auto; transition: transform .2s; }
.config.open .config-toggle .chevron { transform: rotate(180deg); }

.config-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.config.open .config-panel { max-height: 60vh; overflow: auto; }
.scraper-form {
  display: flex;
  gap: 8px;
  padding: 6px 18px 0;
  flex-wrap: wrap;
}
.scraper-form input {
  flex: 1;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.scraper-form input:focus { border-color: var(--blue); }
.scraper-form textarea {
  flex: 1 1 100%;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.scraper-form textarea:focus { border-color: var(--blue); }
.scraper-form .btn { align-self: flex-start; }
.hint code {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11px;
}
.hint { color: var(--muted); font-size: 12px; padding: 8px 18px 4px; margin: 0; }
.scraper-list { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.scraper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}
.scraper .tok { color: var(--text); font-weight: 700; }
.scraper .px { color: var(--muted); }
.scraper .x {
  margin-left: auto;
  cursor: pointer;
  color: var(--muted);
  border: none; background: transparent;
  font-size: 16px; padding: 2px 6px; border-radius: 6px;
}
.scraper .x:hover { color: var(--red); background: rgba(244,33,46,.12); }
.scraper-empty { color: var(--muted); font-size: 12px; padding: 4px 0; }
.scraper-summary { color: var(--muted); font-size: 12px; padding: 2px 0 6px; }
.scraper-summary b { color: var(--text); }
.scraper.is-busy { border-color: rgba(0,186,124,.5); background: rgba(0,186,124,.06); }
.scraper.is-locked { border-color: rgba(244,33,46,.45); background: rgba(244,33,46,.08); }
.scraper.is-locked.is-busy { border-color: rgba(244,33,46,.55); background: rgba(244,33,46,.1); }
.scraper.is-sleeping { border-color: rgba(255,165,0,.5); background: rgba(255,165,0,.08); }
.scraper.is-sleeping.is-busy { border-color: rgba(255,165,0,.55); background: rgba(255,165,0,.1); }
.sc-status { margin-left: auto; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sc-status.busy { color: var(--green, #00ba7c); }
.sc-status.idle { color: var(--muted); font-weight: 600; }
.sc-status.locked { color: #ff6b74; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.sc-status.sleeping { color: #ffa500; }
.scraper-summary .sc-locked-count { color: #ff6b74; }
.scraper-summary .sc-sleep-count { color: #ffa500; }
.scraper .x { margin-left: 6px; }

/* ---------- intervalle ---------- */
.interval-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 4px;
  flex-wrap: wrap;
}
.interval-form label { font-size: 13px; color: var(--muted); font-weight: 600; }
.interval-form input {
  width: 80px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}
.interval-form input:focus { border-color: var(--blue); }
.interval-form .unit { color: var(--muted); font-size: 13px; }
.interval-form label small { color: var(--muted); font-weight: 500; }
.interval-form input { width: 64px; }
.range-field { display: inline-flex; align-items: center; gap: 6px; }
.range-field .rl { color: var(--muted); font-size: 12px; }
.range-sep { color: var(--muted); font-size: 14px; }
.btn.small { padding: 7px 12px; }

/* ---------- debug ---------- */
.debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 18px 6px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.debug-head > div { display: flex; gap: 6px; }
.debug-log {
  margin: 0 18px 18px;
  background: #0a0e13;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  height: 180px;
  overflow: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
}
.debug-log .ln { white-space: pre-wrap; word-break: break-word; }
.debug-log .t { color: #5b6b7a; }
.debug-log .lvl-info .m { color: var(--text); }
.debug-log .lvl-debug .m { color: var(--muted); }
.debug-log .lvl-error .m { color: var(--red); }
.debug-empty { color: var(--muted); }

.toast {
  position: fixed;
  bottom: 70px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  z-index: 50; opacity: 0; transition: opacity .2s, transform .2s;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.is-success {
  border-color: rgba(63, 185, 80, 0.55);
  box-shadow: 0 6px 24px rgba(63, 185, 80, 0.12);
}
.toast.is-ok-pop.show {
  animation: toast-ok-pop 0.45s ease;
}
@keyframes toast-ok-pop {
  0% { transform: translateX(-50%) translateY(8px) scale(0.96); opacity: 0; }
  60% { transform: translateX(-50%) translateY(-6px) scale(1.02); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-4px) scale(1); opacity: 1; }
}

/* ---------- apercu de profil (dans le panneau gauche) ---------- */
.pv-msg {
  margin: auto;
  padding: 20px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.pv-banner {
  height: 54px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: #22303c;
}
/* Pas de banniere : degrade discret. On evite `opacity` ici car cela cree un
   contexte d'empilement qui ferait passer le fond PAR-DESSUS l'avatar. */
.pv-banner.empty {
  background: linear-gradient(120deg, #1b3a52 0%, #3a3556 100%);
}
/* L'avatar reste au-dessus de la banniere en toutes circonstances. */
.pv-top { position: relative; z-index: 1; }
.pv-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  margin-top: -28px;
}
.pv-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}
.pv-av {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; background: var(--panel2);
  border: 3px solid #141418;
  flex-shrink: 0;
}
.pv-id { padding-bottom: 4px; min-width: 0; }
.pv-name {
  font-weight: 800; font-size: 16px; color: #f3f6f9;
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* fond sombre translucide pour rester lisible par-dessus la banniere */
  background: rgba(0, 0, 0, .5);
  padding: 1px 8px;
  border-radius: 7px;
}
.pv-badge { color: var(--blue); font-size: 13px; }
.pv-handle { font-size: 13px; color: var(--muted); padding-left: 2px; margin-top: 2px; }
.pv-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.pv-bio {
  padding: 8px 18px 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.pv-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 8px 18px 0;
  font-size: 12px;
  color: var(--muted);
}
.pv-meta a { color: var(--blue); text-decoration: none; }
.pv-stats {
  display: flex;
  gap: 20px;
  padding-bottom: 4px;
  flex-shrink: 0;
}
.pv-stats div { display: flex; flex-direction: column; }
.pv-stats b { font-size: 15px; color: var(--text); }
.pv-stats span { font-size: 11px; color: var(--muted); }
/* bandeau "suivi par" en bas de l'apercu */
.pv-by {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(0, 0, 0, .35);
  border-top: 1px solid #233140;
}
.pv-by-av {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; background: var(--panel2);
  flex-shrink: 0;
}
.pv-by b { color: var(--text); }

/* ---------- dashboard admin ---------- */
/* Menu de navigation du dashboard admin (onglets) */
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  gap: 2px;
  padding: 8px 18px 0;
  background: rgba(5, 5, 5, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav-btn {
  flex: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.admin-nav-btn:hover { color: var(--text); }
.admin-nav-btn.active { color: var(--text); border-bottom-color: var(--blue); }
.admin-nav-count {
  font-size: 11px;
  font-weight: 800;
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.5;
}
.admin-nav-btn.active .admin-nav-count {
  background: rgba(197, 206, 217, .15);
  color: #6cc0ff;
  border-color: transparent;
}

/* Panneaux de section : un seul visible a la fois */
.admin-tab { display: none; flex-direction: column; gap: 16px; }
.admin-tab.active { display: flex; }

/* Formulaire des reglages de detection : sections a en-tete + cartes de champ */
.tune-form { display: flex; flex-direction: column; gap: 14px; }
.tune-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(5, 5, 5, .35);
  overflow: hidden;
}
.tune-group-h {
  margin: 0;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text);
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
}
.tune-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 14px;
}
.tune-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.tune-field-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.tune-field-ctl { display: flex; align-items: center; gap: 8px; }
.tune-input {
  flex: 1;
  min-width: 0;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}
.tune-input:focus { outline: none; border-color: var(--blue); }
.tune-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  min-width: 24px;
}
.tune-range { font-size: 10.5px; color: #5b6b7a; }

/* Sous-menu par type de compte (Free / Premium / Turbo) */
.tune-subnav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tune-subnav-btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.tune-subnav-btn:hover { color: var(--text); }
.tune-subnav-btn.active {
  color: #fff;
  background: rgba(197, 206, 217, .18);
  border-color: var(--blue);
}
.tune-subpanels {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(5, 5, 5, .35);
  overflow: hidden;
}
.tune-subpanel { display: none; }
.tune-subpanel.active { display: block; }
.tune-general { margin-top: 14px; }

/* Legende : explication de chaque parametre */
.tune-legend {
  padding: 14px;
  border-top: 1px solid var(--border);
}
.tune-legend-h {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.tune-legend dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tune-legend-item {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr;
  gap: 6px 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tune-legend-item:last-child { border-bottom: none; padding-bottom: 0; }
.tune-legend-item dt { font-size: 12.5px; font-weight: 700; color: var(--text); }
.tune-legend-item dd {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 640px) {
  .tune-legend-item { grid-template-columns: 1fr; gap: 3px; }
}

.admin-main {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-card {
  background: rgba(5, 5, 5, .5);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.admin-card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}
.admin-card-head > div { display: flex; gap: 8px; }

/* listes de donnees (membres, comptes surveilles) */
.data-table { display: flex; flex-direction: column; }
.dt-empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.dt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.dt-row:last-child { border-bottom: none; }
.dt-av {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; background: var(--panel2); flex-shrink: 0;
}
.dt-main { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.dt-main a { color: var(--text); text-decoration: none; }
.dt-main a:hover { color: var(--blue); }
.dt-sub { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }
.dt-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn.danger { background: rgba(244,33,46,.14); border-color: rgba(244,33,46,.4); color: #ff6b74; }
.btn.danger:hover { background: rgba(244,33,46,.24); }
.tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; padding: 2px 7px; border-radius: 999px;
  background: #22303c; color: var(--muted);
}
.tag.admin { background: rgba(29,155,240,.18); color: var(--blue); }
.tag.ok { background: rgba(0,186,124,.18); color: var(--green); }
.tag.error { background: rgba(244,33,46,.18); color: var(--red); }
.tag.pending, .tag.checking { background: rgba(255,212,0,.16); color: #ffd400; }
.tag.owner { background: rgba(138,99,210,.18); color: #b9a7ee; text-transform: none; }
.tag.premium { background: rgba(255,210,63,.16); color: #ffd23f; }
.tag.padre { background: rgba(139,92,246,.18); color: #c4b5fd; }
.dt-premium {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.dt-premium input { accent-color: #ffd23f; cursor: pointer; margin: 0; }
.dt-premium:hover { color: #ffd23f; }

/* Pastille de comptage dans les en-tetes de cartes admin. */
.admin-card-head .badge {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- KPIs (indicateurs cles) ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.kpi {
  display: flex; align-items: center; gap: 12px;
  background: rgba(5, 5, 5, .5);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.kpi-ico {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: #22303c; color: #aebccb;
}
.kpi-ico.ico-online { color: var(--green); background: rgba(0,186,124,.15); }
.kpi-ico.ico-eye { color: #6cc0ff; background: rgba(108,192,255,.14); }
.kpi-ico.ico-users { color: #b9a7ee; background: rgba(138,99,210,.18); }
.kpi-ico.ico-member { color: #ffd23f; background: rgba(255,210,63,.14); }
.kpi-ico.ico-monitored { color: #6cc0ff; background: rgba(108,192,255,.14); }
.kpi-ico.ico-scraper { color: #aebccb; background: #22303c; }
.kpi-body { min-width: 0; }
.kpi-val { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi-sub { font-size: 11px; color: #6b7a89; margin-top: 1px; }

/* ---------- Grille 2 colonnes (membres / comptes) ---------- */
.admin-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 820px) {
  .admin-2col { grid-template-columns: 1fr; }
}

/* ---------- Graphique de visites (barres) ---------- */
.chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 140px; padding: 6px 2px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.chart-col {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  height: 100%; justify-content: flex-end;
}
.chart-bar {
  width: 100%; max-width: 18px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #d8dee6, #9aa6b5);
  transition: filter .15s;
}
.chart-col:hover .chart-bar { filter: brightness(1.25); }
.chart-x { font-size: 9px; color: #5b6b7a; }
@media (max-width: 640px) {
  .chart-x { display: none; }
}

/* ---------- Colonnes audience + mini-tables ---------- */
.audience-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.audience-h {
  margin: 0 0 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.mini-table { display: flex; flex-direction: column; gap: 7px; }
.mini-empty { color: var(--muted); font-size: 12px; }
.mini-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.mini-label {
  flex: 0 0 38%; min-width: 0; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-bar {
  flex: 1 1 auto; height: 7px; border-radius: 999px;
  background: rgba(255,255,255,.06); overflow: hidden;
}
.mini-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #b8c2ce, #e2e8ef);
}
.mini-count { flex: none; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- page d'accueil (auth) ---------- */
.hidden { display: none !important; }
.auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: rgba(5, 5, 5, .6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .logo { font-size: 26px; }
.auth-brand h1 { font-size: 20px; margin: 0; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 6px 0 20px; }
.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
  border-radius: 7px;
  cursor: pointer;
}
.auth-tab.active { background: var(--panel2); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.auth-form input {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
}
.auth-form input:focus { border-color: var(--blue); }
.auth-submit { margin-top: 4px; padding: 11px; font-size: var(--btn-label-size); }
.auth-msg { margin-top: 14px; font-size: 13px; min-height: 18px; text-align: center; }
.auth-msg.err { color: var(--red); }
.auth-msg.ok { color: var(--green); }
.auth-link {
  background: none; border: none; padding: 0; margin-top: 2px;
  color: var(--blue); font-size: 13px; cursor: pointer; text-align: center;
}
.auth-link:hover { text-decoration: underline; }
.auth-hint { font-size: 13px; color: var(--muted, #8a93a6); margin: 0 0 4px; }

/* ---------- offres / tarifs (page d'accueil) ---------- */
.pricing { width: 100%; max-width: 720px; }
.pricing-title { font-size: 20px; margin: 0; text-align: center; }
.pricing-sub { color: var(--muted); font-size: 13px; margin: 6px 0 18px; text-align: center; }
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.price-card {
  position: relative;
  background: rgba(5, 5, 5, .6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
}
.price-card.featured {
  border-color: #c9a233;
  box-shadow: 0 0 0 1px rgba(255, 210, 63, .25), 0 12px 40px rgba(0, 0, 0, .4);
}
.price-badge {
  position: absolute;
  top: -11px; right: 16px;
  background: #ffd23f; color: #1a1300;
  font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
}
.price-name { font-size: 15px; font-weight: 800; color: var(--text); }
.price-amount {
  font-size: 30px; font-weight: 800; color: #fff;
  margin: 6px 0 14px;
}
.price-amount span { font-size: 14px; font-weight: 600; color: var(--muted); }
.price-feats {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 9px;
  flex: 1;
}
.price-feats li {
  font-size: 13px; color: var(--text); line-height: 1.4;
  padding-left: 22px; position: relative;
}
.price-feats li::before {
  content: "\2713";
  position: absolute; left: 0; top: 0;
  color: var(--green); font-weight: 800;
}
.price-feats li b { color: #fff; }
.price-feats .bolt { color: #ffd23f; }
.price-foot {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); text-align: center;
}
@media (max-width: 560px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ======================================================================
   LANDING PAGE  (base saine, layout flexbox)
   ====================================================================== */
.lp-body {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 18px 72px;
  background: rgba(5, 5, 5, .55);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
/* Fond decoratif plein ecran (calque fixe : pas de bande sur les cotes). */
.lp-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(800px 500px at 20% -10%, rgba(197, 206, 217, .10), transparent 60%),
    var(--bg);
}

/* ---------- NAV ---------- */
.lp-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
  background: rgba(5, 5, 5, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.lp-brand { display: flex; align-items: center; gap: 11px; }
.lp-brand .logo { font-size: 30px; }
.lp-brand-name { font-weight: 800; font-size: 23px; letter-spacing: -.02em; }
.lp-nav-links { display: flex; gap: 22px; margin-left: auto; }
.lp-nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.lp-nav-links a:hover { color: var(--text); }
.lp-nav-cta { display: flex; gap: 8px; }
.lp-nav-cta.no-links { margin-left: auto; }

/* ---------- HERO ---------- */
.lp-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 64px 0 44px;
}
.lp-hero-text {
  flex: 1 1 420px;
  min-width: 0;
}
.lp-pill {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  color: #ffd23f;
  background: rgba(255, 210, 63, .1);
  border: 1px solid rgba(255, 210, 63, .28);
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 22px;
}
.lp-title {
  font-size: 44px; line-height: 1.12; font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -.02em;
}
.lp-accent { color: var(--blue); }
.lp-lead {
  font-size: 16px; line-height: 1.65; color: var(--muted);
  margin: 0 0 22px;
}
.lp-lead b { color: var(--text); }
.lp-hero-points {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.lp-hero-points li {
  font-size: 14px; color: var(--text); font-weight: 600;
  padding-left: 26px; position: relative;
}
.lp-hero-points li::before {
  content: "\2713";
  position: absolute; left: 0; top: 0;
  color: var(--green); font-weight: 800;
}
/* ---------- Landing : boutons harmonises ---------- */
/* Meme rayon, meme graisse, memes transitions pour toutes les CTA visibles
   (nav, formulaire d'acces, gros bouton demo). Les boutons INTERNES a l'apercu
   demo gardent le rendu de l'app reelle et ne sont pas cibles ici. */
.lp-nav-cta .btn,
.lp-demo-cta .btn,
.lp-auth .auth-submit {
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.1;
  transition: transform .12s ease, box-shadow .2s ease,
    background .2s ease, border-color .2s ease, color .15s ease, filter .15s ease;
}
.lp-nav-cta .btn:hover,
.lp-demo-cta .btn:hover,
.lp-auth .auth-submit:hover { filter: none; transform: translateY(-1px); }
.lp-nav-cta .btn:active,
.lp-demo-cta .btn:active,
.lp-auth .auth-submit:active { transform: translateY(0); }

/* Primaire (bleu) : leger degrade + halo qui s'intensifie au survol. */
.lp-nav-cta .btn.primary,
.lp-demo-cta .btn.primary,
.lp-auth .auth-submit {
  background: linear-gradient(180deg, #e8edf2 0%, #b8c2ce 100%);
  border-color: #aeb8c4;
  color: #09090b;
  box-shadow: 0 6px 16px rgba(197, 206, 217, .28);
}
.lp-nav-cta .btn.primary:hover,
.lp-demo-cta .btn.primary:hover,
.lp-auth .auth-submit:hover {
  box-shadow: 0 12px 26px rgba(197, 206, 217, .45);
}

/* Secondaire ("Log in" dans la nav) : bouton fantome coherent avec le primaire. */
.lp-nav-cta .btn:not(.primary) {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .16);
  color: var(--text);
}
.lp-nav-cta .btn:not(.primary):hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .28);
}

/* Tailles harmonisees. */
.lp-nav-cta .btn.small { padding: 9px 18px; font-size: var(--btn-label-size); }
.lp-btn-lg { padding: 15px 30px; font-size: 15.5px; border-radius: 12px; }

/* ---------- CARTE AUTH (theme sombre, aligne sur l'app) ---------- */
.lp-auth {
  flex: 0 1 400px;
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  color: var(--text);
}
.lp-auth-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.lp-auth .auth-tabs {
  margin-bottom: 14px;
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 4px;
}
.lp-auth .auth-tab { color: var(--muted); }
.lp-auth .auth-tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.lp-auth-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.lp-auth .auth-form:not(.hidden) {
  flex: 1;
  min-height: 0;
}
.lp-auth .auth-form { gap: 11px; }
.lp-auth .auth-form label { color: var(--muted); }
.lp-auth .auth-form input {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
}
.lp-auth .auth-form input::placeholder { color: var(--muted); }
.lp-auth .auth-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(197, 206, 217, .2);
}
.lp-auth .auth-hint { color: var(--muted); line-height: 1.5; }
.lp-auth .auth-link { color: #6bc4ff; }
.lp-auth .auth-link:hover { color: #9dd8ff; }
.lp-auth .auth-submit { margin-top: auto; }
.lp-auth .auth-msg { margin-top: 8px; min-height: 0; margin-bottom: 0; }
.lp-auth .auth-msg:empty { margin-top: 0; }
.lp-auth .auth-msg.err { color: #f87171; }
.lp-auth .auth-msg.ok { color: #34d399; }

.btn.google-auth,
.btn.x-auth,
.btn.email-auth {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  border-radius: 10px;
  background: #172029;
  color: var(--text);
  border: 1px solid #2a3540;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn.google-auth:hover,
.btn.x-auth:hover,
.btn.email-auth:hover {
  filter: none;
  background: #1c2732;
  border-color: #354656;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.btn.google-auth svg,
.btn.x-auth svg,
.btn.email-auth svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: block;
  width: 20px;
  height: 20px;
}
.auth-btn-label {
  width: 100%;
  text-align: center;
  padding: 0 44px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}
.btn.google-auth {
  text-decoration: none;
}
.oauth-btns,
.auth-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oauth-btns.hidden,
.auth-choices.hidden { display: none; }
.auth-invite {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.auth-invite.hidden { display: none; }
.auth-invite input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--panel2);
  color: var(--text);
}
.auth-invite input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(197, 206, 217, .2);
  outline: none;
}
.email-panel.hidden { display: none; }
.email-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.email-panel .page-back--start { margin-bottom: 6px; }
.email-panel-intro {
  margin: 0 0 6px;
}
.email-panel-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}
.email-panel-lead {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: #a8b3bf;
}
.lp-auth .email-panel .auth-form label.auth-field-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #9aa8b5;
  gap: 7px;
}
.lp-auth .email-panel .auth-form input {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.lp-auth .email-panel .auth-link {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.btn.email-auth {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.btn.x-auth {
  text-decoration: none;
}
.auth-divider {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 0;
}

/* ---------- SECTIONS ---------- */
.lp-section {
  padding: 52px 0;
  border-top: 1px solid var(--border);
}
.lp-h2 {
  font-size: 28px; font-weight: 800; text-align: center; margin: 0 0 8px;
  letter-spacing: -.02em;
}
.lp-h2-sub { text-align: center; color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.lp-section > .lp-h2 { margin-bottom: 28px; }

.lp-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.lp-feat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
}
.lp-feat-ico { font-size: 26px; margin-bottom: 12px; }
.lp-feat h3 { font-size: 16px; margin: 0 0 8px; }
.lp-feat p { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 0; }

.lp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.lp-step {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
}
.lp-step-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 16px;
  margin-bottom: 14px;
}
.lp-step h3 { font-size: 16px; margin: 0 0 8px; }
.lp-step p { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 0; }

.lp-pricing { max-width: 720px; margin: 0 auto; }
.lp-price-btn { width: 100%; text-align: center; margin-top: 18px; text-decoration: none; }

.lp-final { text-align: center; padding: 56px 0 24px; }

/* ---------- DEMO : apercu de l'interface ---------- */
/* Meme largeur que la partie utilisateur (.app). */
.lp-demo-wrap { position: relative; max-width: 1200px; margin: 0 auto; }
.lp-demo-badge {
  position: absolute;
  top: -11px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .03em;
  text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(197, 206, 217, .4);
  white-space: nowrap;
}
/* Le cadre demo reprend l'app mais sans hauteur plein ecran ni sticky. */
.lp-demo-app {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  -webkit-user-select: none;
  user-select: none;
}
.lp-demo-app .feed { min-height: 0; }
.lp-demo-cta { display: flex; justify-content: center; margin-top: 28px; }

/* Animation "autour du formulaire" jouee au clic sur un bouton Get started.
   Les etats a 0% et 100% sont identiques a l'etat de repos (meme box-shadow,
   meme couleur de bordure, scale 1) pour eviter tout a-coup quand la classe
   est retiree a la fin de l'animation. */
@keyframes lpAuthPulse {
  0%   { box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 0 0 rgba(29,155,240,0); border-color: #e2e8f0; transform: scale(1); }
  8%   { box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 0 0 rgba(29,155,240,.9); border-color: var(--blue); }
  45%  { transform: scale(1.03); }
  75%  { box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 0 30px rgba(29,155,240,0); }
  100% { box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 0 0 rgba(29,155,240,0); border-color: #e2e8f0; transform: scale(1); }
}
.lp-auth.pulse {
  animation: lpAuthPulse 0.9s ease-out 3;
}

/* Header de la demo : logo DigX + indicateur de connexion + champ d'ajout. */
.lp-demo-top { padding: 12px 18px; }
.lp-demo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.lp-demo-bar .logo { font-size: 20px; line-height: 1; }
.lp-demo-name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.lp-demo-app .add-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 8px 0;
}
.lp-demo-app .add-row input::placeholder { color: var(--muted); }
.lp-demo-app .add-row { align-items: center; }

/* Avatar du compte suivi : deja floute cote serveur (PNG). */
.lp-demo-app .ncard-av { background: #22303c; }

/* Barre de masquage : remplace le nom/handle/stats du compte suivi.
   Placee a l'interieur des vrais elements (pv-name, pv-bio, ncard-name...). */
.lp-demo-app .redact-bar {
  display: inline-block;
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, #34485c, #46596d 50%, #34485c);
  vertical-align: middle;
}
.lp-demo-app .redact-bar.tall { height: 14px; }
.lp-demo-app .redact-bar.w40 { width: 40px; }
.lp-demo-app .redact-bar.w45 { width: 45px; }
.lp-demo-app .redact-bar.w50 { width: 50px; }
.lp-demo-app .redact-bar.w55 { width: 55px; }
.lp-demo-app .redact-bar.w70 { width: 70px; }
.lp-demo-app .redact-bar.w80 { width: 80px; }
.lp-demo-app .redact-bar.w120 { width: 120px; }
.lp-demo-app .redact-bar.wfull { width: 100%; }

.lp-demo-app .ncard-by .redact-bar { vertical-align: -1px; }

.lp-footer {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 32px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 32px;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.lp-footer .logo { font-size: 18px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 820px) {
  .lp-hero { padding: 44px 0 36px; gap: 36px; }
  .lp-features { grid-template-columns: repeat(2, 1fr); }
  /* Formulaire empile : on supprime la hauteur mini (qui creait un grand vide
     entre les champs et le bouton) et on resserre les espaces. */
  .lp-auth { padding: 24px 18px; }
  .lp-auth-body { min-height: 0; }
  .lp-auth .auth-form:not(.hidden) { min-height: 0; }
  .lp-auth .auth-form { gap: 12px; }
  .lp-auth .auth-submit { margin-top: 6px; }
  /* Message vide : ne reserve pas d'espace sous le bouton. */
  .lp-auth .auth-msg:empty { margin-top: 0; }
}
@media (max-width: 680px) {
  .lp-nav-links { display: none; }
  .lp-nav-cta { margin-left: auto; }
  .lp-title { font-size: 34px; }
  .lp-lead { font-size: 15px; }
  .lp-steps { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .lp-features { grid-template-columns: 1fr; }
}

/* ---------- barre utilisateur (dashboard) ---------- */
.user-box { display: flex; align-items: center; gap: 8px; }
.user-box .uname { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Badge de plan (Free / Premium) dans la barre du haut. */
.plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border, #30363d);
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.plan-badge:hover { filter: brightness(1.08); }
.plan-badge.free {
  background: var(--panel2);
  border-color: var(--border);
  color: var(--text);
}
.plan-badge.premium {
  color: #1c1300;
  background: linear-gradient(180deg, #ffd970, #e8a317);
  border-color: #e8a317;
}

/* Bouton Upgrade : accent dore pour inciter au passage Premium. */
.btn.upgrade {
  background: linear-gradient(180deg, #ffd970, #e8a317);
  border-color: #e8a317;
  color: #1c1300;
  font-weight: 700;
}
.btn.upgrade:hover { filter: brightness(1.05); }

/* Menu du header : tous les items partagent la meme police, taille, style et
   couleur (Admin, pastille de plan, Mon compte, Upgrade). */
.user-box .btn,
.user-box .btn.small,
.user-box .btn.upgrade,
.user-box .plan-badge,
.user-box .tp-plan-pill {
  font-family: inherit;
  font-size: var(--btn-label-size);
  font-weight: var(--btn-label-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  line-height: 1.1;
}
/* On conserve l'accent dore "premium" d'origine (Upgrade + pastilles premium),
   tout en gardant la taille/forme harmonisee du menu. */
.user-box .btn.upgrade,
.user-box .plan-badge.premium,
.user-box .tp-plan-pill.premium {
  background: linear-gradient(180deg, #ffd970, #e8a317);
  border-color: #e8a317;
  color: #1c1300;
}
.user-box .btn:hover,
.user-box .plan-badge:hover,
.user-box .tp-plan-pill:hover { filter: brightness(1.15); }
.user-box .tp-plan-pill .dot { display: none; }

/* ---------- Page d'accès (code d'invitation) ---------- */
.lp-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 18px;
  border: none;
  background: transparent;
}
.lp-gate::before {
  background:
    radial-gradient(700px 420px at 50% -5%, rgba(197, 206, 217, .12), transparent 62%),
    radial-gradient(500px 300px at 80% 100%, rgba(197, 206, 217, .05), transparent 55%),
    var(--bg);
}
.gate-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.gate-logo { font-size: 42px; max-width: min(280px, 78vw); }
.gate-card {
  width: 100%;
  background: rgba(17, 17, 20, .92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.gate-title {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
}
.gate-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}
.gate-lead--tight { margin-bottom: 14px; }
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.gate-form input {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
}
.gate-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(197, 206, 217, .18);
}
.gate-submit { width: 100%; justify-content: center; padding: 13px 16px; }
.gate-msg { width: 100%; text-align: center; min-height: 18px; }
.gate-back { display: block; margin: 16px auto 0; }
.lp-auth--gate {
  flex: none;
  width: 100%;
  max-width: none;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
