/* tele-link — tableau de bord. Doux, aéré, mobile d'abord. Couleurs en variables, mode sombre automatique. */
:root {
  color-scheme: light;
  --fond: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f2f1ed;
  --surface-3: #eae8e3;
  --bord: rgba(28, 27, 24, .07);
  --bord-fort: rgba(28, 27, 24, .13);
  --texte: #1b1c20;
  --texte-2: #55565d;
  --muet: #8d8e94;
  --accent: #5b5bd6;
  --accent-fort: #4d4dc4;
  --accent-texte: #ffffff;
  --accent-doux: #efeffc;
  --accent-doux-2: #e2e2fa;
  --ok: #1f8a5a;
  --ok-fond: #e6f5ec;
  --attention: #a3620a;
  --attention-fond: #fcf1de;
  --erreur: #cc3d3d;
  --erreur-fond: #fceaea;
  --hausse: #1f8a5a;
  --baisse: #cc3d3d;
  --ombre: 0 1px 2px rgba(30, 28, 24, .04), 0 6px 20px -10px rgba(30, 28, 24, .10);
  --ombre-haute: 0 2px 6px rgba(30, 28, 24, .05), 0 18px 40px -16px rgba(30, 28, 24, .22);
  --rayon: 22px;
  --rayon-m: 16px;
  --rayon-p: 12px;
  --grille: rgba(28, 27, 24, .06);
  --verre: rgba(255, 255, 255, .82);
  --courbe-visites: #b4b2c4;
  /* une couleur fixe par source (jamais selon le rang) */
  --s-tiktok_ads: #5b6cf0;
  --s-instagram_ads: #ef7d5c;
  --s-tiktok_orga: #22a88c;
  --s-instagram_orga: #e9a630;
  --s-tiktok_live: #d96aa7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #14171f;
    --surface: #1c2029;
    --surface-2: #242935;
    --surface-3: #2d3341;
    --bord: rgba(220, 228, 255, .07);
    --bord-fort: rgba(220, 228, 255, .14);
    --texte: #eceef4;
    --texte-2: #b3b8c5;
    --muet: #808696;
    --accent: #8e8ff5;
    --accent-fort: #a3a4f8;
    --accent-texte: #14152a;
    --accent-doux: #262844;
    --accent-doux-2: #30335a;
    --ok: #5cd29a;
    --ok-fond: #173326;
    --attention: #f0b956;
    --attention-fond: #372a12;
    --erreur: #f08484;
    --erreur-fond: #3b1d20;
    --hausse: #5cd29a;
    --baisse: #f08484;
    --ombre: 0 1px 2px rgba(0, 0, 0, .25);
    --ombre-haute: 0 18px 40px -14px rgba(0, 0, 0, .6);
    --grille: rgba(220, 228, 255, .06);
    --verre: rgba(28, 32, 41, .82);
    --courbe-visites: #6d7488;
    --s-tiktok_ads: #7d8bf5;
    --s-instagram_ads: #f28f72;
    --s-tiktok_orga: #3cc2a3;
    --s-instagram_orga: #f0b955;
    --s-tiktok_live: #e584ba;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.muet { color: var(--muet); }
.petit { font-size: 13px; }
.num, .chiffre { font-variant-numeric: tabular-nums; }
.cache { display: none !important; }
svg { flex-shrink: 0; }
::selection { background: var(--accent-doux-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- structure ---------- */
.lateral { display: none; }
.contenu { max-width: 1120px; margin: 0 auto; padding: 0 16px calc(104px + env(safe-area-inset-bottom)); }
.entete {
  display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 0 18px;
  position: sticky; top: 0; z-index: 5; background: var(--fond);
}
.entete-titres { flex: 1; min-width: 0; }
.entete h1 { font-size: 30px; font-weight: 750; letter-spacing: -.025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sur-titre { font-size: 13px; font-weight: 550; color: var(--muet); }
.sur-titre:empty { display: none; }
#entete-actions { display: flex; gap: 8px; flex-shrink: 0; }
#entete-actions:empty { display: none; }
.entete-haut { display: flex; align-items: center; min-height: 20px; }
.avec-retour .entete-haut { min-height: 34px; margin-bottom: 2px; }
.retour { width: 44px; height: 44px; margin: -5px 2px -5px -13px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; }
.avec-retour .sur-titre { color: var(--texte-2); }
.retour:active { background: var(--surface-2); }
.moi {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--accent-doux); color: var(--accent); font-weight: 700; font-size: 15px; position: relative;
}
body[data-page="plus"] .moi, body[data-page="compte"] .moi { visibility: hidden; }
.moi::before { content: ""; position: absolute; inset: -3px; }

.marque { display: inline-flex; align-items: center; gap: 0; font-weight: 750; font-size: 18px; letter-spacing: -.02em; color: var(--texte); }
.marque .point { color: var(--accent); padding: 0 1px; }
.marque .logo {
  width: 26px; height: 26px; border-radius: 9px; margin-right: 10px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #f0a3c8));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
  position: relative;
}
.marque .logo::after { content: ""; position: absolute; inset: 8px; border: 2px solid rgba(255, 255, 255, .92); border-radius: 50%; }

/* barre du bas */
.barre-bas {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
  background: var(--verre); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border: 1px solid var(--bord); border-radius: 26px; box-shadow: var(--ombre-haute); padding: 6px;
  max-width: 460px; margin: 0 auto;
}
.nav-b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; border-radius: 20px; color: var(--muet); font-size: 11px; font-weight: 600; }
.nav-b .ico { display: flex; }
.nav-b.actif { color: var(--texte); }
.nav-b.actif .ico { color: var(--accent); }
.nav-creer .ico {
  width: 46px; height: 46px; border-radius: 16px; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-texte) !important; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.nav-creer .lib { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nav-creer:active .ico { transform: scale(.95); }

@media (min-width: 900px) {
  .barre-bas, .moi { display: none; }
  .lateral {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: 248px; padding: 24px 16px 18px;
    background: var(--fond); border-right: 1px solid var(--bord);
  }
  .lateral .marque { padding: 0 8px 22px; }
  .creer-lat { margin: 0 0 18px; width: 100%; }
  .lateral nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
  .nav-groupe { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muet); padding: 18px 12px 6px; }
  .nav-l { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 42px; border-radius: 12px; color: var(--texte-2); font-weight: 550; font-size: 14.5px; }
  .nav-l svg { color: var(--muet); }
  .nav-l:hover { background: var(--surface-2); }
  .nav-l.actif { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
  .nav-l.actif svg { color: var(--accent); }
  .qui { margin-top: auto; padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; }
  .initiale { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-doux); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
  .qui-nom { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
  .qui-nom b { font-weight: 650; text-transform: capitalize; }
  .qui-nom small { color: var(--muet); font-size: 12px; }
  .contenu { margin-left: 248px; padding: 0 40px 48px; max-width: none; }
  .contenu > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
  .entete { padding: 30px 0 22px; }
  .entete h1 { font-size: 32px; }
}

/* ---------- blocs ---------- */
.bloc { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 20px; box-shadow: var(--ombre); margin-bottom: 14px; min-width: 0; }
.bloc-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; min-height: 32px; }
.bloc-tete h2 { flex: 1 1 auto; }
.grille-2 { display: grid; gap: 14px; margin-bottom: 14px; align-items: start; }
.grille-2 > .bloc { margin-bottom: 0; }
@media (min-width: 900px) { .grille-2 { grid-template-columns: 1fr 1fr; } .grille-2.seul { grid-template-columns: 1fr; } .bloc { padding: 24px; } }
.chargement { padding: 48px 12px; text-align: center; color: var(--muet); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; }
.roue { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.vide { padding: 30px 12px; text-align: center; color: var(--muet); font-size: 14px; }
.vide strong { display: block; color: var(--texte); font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.vide .btn { margin-top: 16px; }
.titre-section { font-size: 13px; font-weight: 650; color: var(--muet); margin: 22px 4px 10px; display: flex; justify-content: space-between; align-items: baseline; }
.titre-section a { font-weight: 600; }

/* ---------- héros de l'accueil ---------- */
.heros { padding: 22px 20px 20px; }
.heros .lib, .kpi .lib { color: var(--muet); font-size: 13px; font-weight: 600; }
.heros .grand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 18px; }
.heros .grand .val { font-size: 56px; font-weight: 750; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.heros .petits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.heros .petit-kpi { background: var(--surface-2); border-radius: var(--rayon-m); padding: 12px 14px; min-width: 0; }
.heros .petit-kpi .val { font-size: 24px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.heros .petit-kpi .ecart { margin-top: 2px; }
.ecart { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 650; color: var(--muet); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ecart.pilule { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 13px; }
.ecart.hausse { color: var(--hausse); }
.ecart.baisse { color: var(--baisse); }
.ecart.pilule.hausse { background: var(--ok-fond); }
.ecart.pilule.baisse { background: var(--erreur-fond); }
@media (min-width: 900px) {
  .heros { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: end; padding: 28px; }
  .heros .grand { margin-bottom: 0; }
  .heros .grand .val { font-size: 68px; }
}

@media (min-width: 900px) {
  .haut-accueil .heros { display: flex; flex-direction: column; align-items: stretch; }
  .haut-accueil .heros .petits { gap: 12px; }
  .haut-accueil .heros .petit-kpi { padding: 16px 18px; }
  .haut-accueil .heros .petit-kpi .val { font-size: 28px; }
  .haut-accueil .heros .grand { margin-bottom: 22px; }
}
/* KPI génériques (rentabilité) */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-m); padding: 16px; box-shadow: var(--ombre); min-width: 0; }
.kpi .val { font-size: 24px; font-weight: 720; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.fort { background: var(--accent); border-color: transparent; color: var(--accent-texte); }
.kpi.fort .lib { color: color-mix(in srgb, var(--accent-texte) 75%, transparent); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 14px; } .kpi { padding: 20px; } .kpi .val { font-size: 30px; } }

/* parcours visite → clic → sub */
.parcours { display: flex; flex-direction: column; gap: 14px; }
.marche-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.marche-lib { font-size: 14px; font-weight: 600; color: var(--texte-2); display: inline-flex; align-items: center; gap: 8px; }
.marche-taux { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-doux); padding: 2px 8px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.marche-tete b { font-size: 22px; font-weight: 720; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.piste { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.piste i { display: block; height: 100%; border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.m-visites .piste i { background: color-mix(in srgb, var(--muet) 45%, transparent); }
.m-clics .piste i { background: var(--accent); }
.m-subs .piste i { background: var(--s-tiktok_orga); }
.pied { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--bord); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-size: 13px; color: var(--muet); }
.pied b { color: var(--texte); font-weight: 650; font-variant-numeric: tabular-nums; }
.pied:empty { display: none; }
@media (min-width: 900px) { .marche-tete b { font-size: 26px; } }

/* ---------- filtres ---------- */
.filtres { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filtres .espace { flex: 1; }
.segment { display: inline-flex; background: var(--surface-3); border-radius: 13px; padding: 3px; flex: 0 0 auto; max-width: 100%; }
.segment button {
  border: 0; background: transparent; color: var(--texte-2); font: inherit; font-size: 13.5px; font-weight: 600; padding: 0 13px; min-height: 36px;
  border-radius: 10px; cursor: pointer; white-space: nowrap; flex: 1;
}
.segment button[aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.segment.plein { display: flex; width: 100%; }
.btn-filtres { position: relative; }
.btn-filtres .compte-filtres { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-texte); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.panneau {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-m);
  padding: 14px; margin: -4px 0 14px; box-shadow: var(--ombre);
}
.panneau label { font-size: 12px; }
.panneau .plein { grid-column: 1 / -1; }
.panneau .bas-panneau { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
@media (min-width: 900px) { .panneau { grid-template-columns: repeat(4, 1fr); } }
.interrupteur { display: inline-flex; flex-direction: row; align-items: center; gap: 10px; font-size: 14px; font-weight: 550; color: var(--texte-2); white-space: nowrap; cursor: pointer; min-height: 44px; }
.interrupteur input { width: 42px; height: 26px; appearance: none; -webkit-appearance: none; background: var(--surface-3); border-radius: 99px; position: relative; cursor: pointer; padding: 0; border: 0; margin: 0; transition: background .2s; flex-shrink: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.interrupteur input:checked { background: var(--accent); }
.interrupteur input:checked::after { transform: translateX(16px); }
.interrupteur input:focus { outline: none; }

/* recherche */
.recherche { position: relative; flex: 1 1 0; min-width: 0; }
.recherche svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muet); pointer-events: none; }
.recherche input { padding-left: 42px; border-radius: 14px; background: var(--surface); border-color: var(--bord); min-height: 48px; }
.filtres:has(.recherche) { flex-wrap: nowrap; }
.filtres:has(.recherche) .espace { display: none; }
.filtres:has(.recherche) .btn-filtres { min-height: 48px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--bord); padding: 0 16px; }
.filtres:has(.recherche) .btn-filtres.doux { background: var(--accent-doux); box-shadow: none; }

/* ---------- graphique ---------- */
.graph { position: relative; height: 230px; margin: 0 -6px; }
@media (min-width: 900px) { .graph { height: 300px; } }
.legende { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.legende span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--texte-2); background: var(--surface-2); padding: 5px 10px; border-radius: 99px; font-weight: 550; }
.legende b { color: var(--texte); font-weight: 650; font-variant-numeric: tabular-nums; }
.legende i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legende button { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; color: var(--texte-2); background: var(--surface-2); padding: 0 12px; min-height: 36px; border-radius: 99px; font-weight: 550; border: 0; cursor: pointer; position: relative; transition: opacity .15s, background .15s, box-shadow .15s; }
.legende button::before { content: ""; position: absolute; inset: -4px 0; }
.legende.isole button[aria-pressed="false"] { opacity: .45; }
.legende button[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--bord-fort); }
.astuce { font-size: 12px; color: var(--muet); margin: 10px 2px 0; }
.pastille { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---------- classements (liste) ---------- */
.rangs { display: flex; flex-direction: column; }
.rang-l { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--bord); color: inherit; }
.rang-l:last-child { border-bottom: 0; }
.rang-l.cliquable { cursor: pointer; }
.rang-n { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--muet); font-variant-numeric: tabular-nums; }
.rang-l:nth-child(1) .rang-n { background: var(--accent); color: var(--accent-texte); }
.rang-l:nth-child(2) .rang-n, .rang-l:nth-child(3) .rang-n { background: var(--accent-doux); color: var(--accent); }
.rang-nom { min-width: 0; }
.rang-nom b { display: block; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rang-nom small { display: block; color: var(--muet); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rang-val { text-align: right; font-variant-numeric: tabular-nums; }
.rang-val b { display: block; font-weight: 700; font-size: 16px; }
.rang-val small { display: block; color: var(--muet); font-size: 12px; }
.barre-prog { grid-column: 2 / -1; height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: -4px; }
.barre-prog i { display: block; height: 100%; border-radius: 99px; background: var(--accent); opacity: .55; }

/* tableaux (argent, classements sur ordinateur) */
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { font-size: 12px; font-weight: 600; color: var(--muet); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.cliquable { cursor: pointer; }
@media (hover: hover) { tbody tr.cliquable:hover td { background: var(--surface-2); } }
.rang { color: var(--muet); width: 24px; }

/* ---------- liste de liens (cartes) ---------- */
.compteur { font-size: 13px; color: var(--muet); margin: 2px 4px 10px; }
.liste { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 900px) { .liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; } }
.carte-lien {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-m); padding: 12px 10px 12px 14px; box-shadow: var(--ombre);
  min-width: 0; display: flex; align-items: center; gap: 6px;
}
.carte-lien.archivee { opacity: .62; }
.carte-lien .haut { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; }
.carte-lien .ident { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.carte-lien .ligne-compte { display: flex; align-items: center; gap: 8px; min-width: 0; }
.carte-lien .compte { font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte); min-width: 0; }
.carte-lien .meta { font-size: 12.5px; color: var(--muet); display: flex; align-items: center; gap: 6px; min-width: 0; }
.carte-lien .meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-lien .chiffres { font-size: 12.5px; color: var(--muet); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte-lien .chiffres b { color: var(--texte-2); font-weight: 650; }
.etat { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 99px; }
.etat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.etat.attente { background: var(--attente-fond, var(--attention-fond)); color: var(--attention); }
.etat.gris { background: var(--surface-2); color: var(--muet); }
.ronds { display: flex; gap: 2px; flex-shrink: 0; }
.rond {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--muet); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, transform .1s;
}
.rond.copie { color: var(--accent); }
.rond:active { transform: scale(.92); background: var(--surface-2); }
@media (hover: hover) { .rond:hover { background: var(--surface-2); color: var(--texte); } .rond.copie:hover { background: var(--accent-doux); color: var(--accent); } }
.rond.fait { background: var(--ok-fond) !important; color: var(--ok) !important; }

.avatar { border-radius: 50%; object-fit: cover; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--texte-2); flex-shrink: 0; overflow: hidden; }
.avatar.t40 { width: 42px; height: 42px; font-size: 16px; }
.avatar.t28 { width: 28px; height: 28px; font-size: 12px; }
.avatar.t48 { width: 48px; height: 48px; font-size: 19px; }
.avatar.t56 { width: 56px; height: 56px; font-size: 21px; }
.avatar.t72 { width: 72px; height: 72px; font-size: 26px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--texte-2); white-space: nowrap; }
.badge.ok { background: var(--ok-fond); color: var(--ok); }
.badge.attente { background: var(--attention-fond); color: var(--attention); }
.badge.archive { background: var(--surface-2); color: var(--muet); }
.badge.ok::before, .badge.attente::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- formulaires ---------- */
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--texte-2); min-width: 0; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--texte); background: var(--surface-2); border: 1px solid transparent; border-radius: 14px;
  padding: 0 14px; min-height: 48px; width: 100%; min-width: 0; transition: border-color .15s, background .15s, box-shadow .15s;
}
textarea { padding: 12px 14px; min-height: 150px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d8e94' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input::placeholder, textarea::placeholder { color: var(--muet); opacity: .85; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-doux); }
input[type="date"] { width: auto; min-height: 40px; font-size: 14px; }
.panneau select, .panneau input { min-height: 44px; font-size: 15px; }
.pile { display: flex; flex-direction: column; gap: 18px; }
.ligne-champs { display: grid; gap: 16px; }
@media (min-width: 640px) { .ligne-champs { grid-template-columns: 1fr 1fr; } }
.aide { font-size: 12.5px; color: var(--muet); font-weight: 400; line-height: 1.4; }
.champ-grand input { font-size: 18px; min-height: 56px; font-weight: 550; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 650; font-size: 15px;
  min-height: 44px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--surface-2); color: var(--texte); cursor: pointer;
  white-space: nowrap; transition: background .15s, transform .1s, opacity .15s; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
@media (hover: hover) { .btn:hover { background: var(--surface-3); } .btn.primaire:hover { background: var(--accent-fort); } }
.btn.primaire { background: var(--accent); color: var(--accent-texte); box-shadow: 0 4px 12px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.doux { background: var(--accent-doux); color: var(--accent); }
@media (hover: hover) { .btn.doux:hover { background: var(--accent-doux-2); } }
.btn.petit { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.large { width: 100%; min-height: 54px; font-size: 16px; border-radius: 16px; }
.btn.danger { color: var(--erreur); background: var(--erreur-fond); }
.btn.contour { background: transparent; box-shadow: inset 0 0 0 1px var(--bord-fort); }
.btn.copie.fait, .btn.fait { background: var(--ok-fond) !important; color: var(--ok) !important; }
.icone-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; color: var(--muet); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icone-btn:hover { background: var(--surface-2); color: var(--texte); }
.lien-btn { border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; padding: 0; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* puces de choix (modèle, source) */
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 0;
  background: var(--surface-2); color: var(--texte-2); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.puce.avec-photo { padding-left: 6px; }
.puce[aria-pressed="true"] { background: var(--accent-doux); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.puce .pastille { width: 9px; height: 9px; }
.champ-titre { font-size: 13px; font-weight: 650; color: var(--texte-2); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

/* repli « Plus d'options » */
details.repli { border-radius: var(--rayon-m); background: var(--surface-2); }
details.repli > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; font-weight: 600; font-size: 14.5px; color: var(--texte);
}
details.repli > summary::-webkit-details-marker { display: none; }
details.repli > summary .resume { flex: 1; min-width: 0; text-align: right; color: var(--muet); font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.repli > summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muet); border-bottom: 2px solid var(--muet); transform: rotate(45deg) translateY(-3px); transition: transform .2s; flex-shrink: 0;
}
details.repli[open] > summary::after { transform: rotate(225deg) translateY(-1px); }
details.repli > .dedans { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 16px; }
details.repli input, details.repli select, details.repli textarea { background: var(--surface); }
details.repli input:focus, details.repli select:focus { background: var(--surface); }
.bloc details.repli + details.repli { margin-top: 10px; }
details.section { background: var(--surface); border: 1px solid var(--bord); box-shadow: var(--ombre); border-radius: var(--rayon); margin-bottom: 14px; }
details.section > summary { min-height: 60px; padding: 0 20px; font-size: 16px; }
details.section > .dedans { padding: 4px 20px 20px; }
details.section input, details.section select, details.section textarea { background: var(--surface-2); }

/* ---------- alertes, toast ---------- */
.alerte { padding: 12px 14px; border-radius: 14px; font-size: 14px; margin: 0 0 12px; line-height: 1.45; }
.alerte a { font-weight: 650; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.alerte.erreur { background: var(--erreur-fond); color: var(--erreur); }
.alerte.ok { background: var(--ok-fond); color: var(--ok); }
.alerte.attention { background: var(--attention-fond); color: var(--attention); }
.alerte.info { background: var(--accent-doux); color: var(--texte); }
.pile .alerte { margin: 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(16px);
  background: var(--texte); color: var(--fond); padding: 12px 18px; border-radius: 99px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .25s cubic-bezier(.2, .8, .2, 1); z-index: 50; max-width: calc(100% - 32px); box-shadow: var(--ombre-haute);
}
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { #toast { bottom: 32px; left: calc(50% + 124px); } }

/* ---------- détail d'un lien ---------- */
.fiche .tete { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.fiche .tete .ident { flex: 1; min-width: 0; }
.fiche .tete .ident b { display: block; font-size: 17px; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.fiche .tete .ident span { display: block; color: var(--muet); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-boite { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 14px; padding: 6px 6px 6px 14px; min-width: 0; }
.url-boite code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; color: var(--texte); }
.url-boite { min-height: 52px; }
.url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 500; color: var(--texte-2); letter-spacing: -.005em; }
.url b { color: var(--accent); font-weight: 650; }
.fiche .actions { margin-top: 12px; }
.fiche .actions .btn { flex: 1; }
.fiche .details { margin-top: 14px; font-size: 12.5px; color: var(--muet); }
.fiche .meta { display: flex !important; align-items: center; gap: 6px; }

/* résultat création */
.reussite { text-align: center; padding: 26px 20px 22px; }
.reussite .coche { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-fond); color: var(--ok); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.reussite h2 { font-size: 19px; margin-bottom: 4px; }
.reussite .sous { color: var(--muet); font-size: 14px; margin-bottom: 16px; }
.reussite .url-boite { text-align: left; margin-bottom: 12px; }
.resultat { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bord); min-width: 0; }
.resultat:last-child { border-bottom: 0; }
.resultat .q { flex: 0 1 40%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.resultat code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--texte-2); }

.journal { padding: 0; margin: 0; }
.journal li { padding: 12px 0; border-bottom: 1px solid var(--bord); font-size: 14px; list-style: none; }
.journal li:last-child { border-bottom: 0; }

/* ---------- page Plus ---------- */
.profil { display: flex; align-items: center; gap: 14px; }
.profil .avatar { background: var(--accent-doux); color: var(--accent); }
.profil b { display: block; font-size: 18px; font-weight: 680; text-transform: capitalize; }
.profil span { color: var(--muet); font-size: 13.5px; }
.menu { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden; margin-bottom: 14px; }
.menu a, .menu button {
  font: inherit; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 18px; color: var(--texte); font-weight: 500; font-size: 15.5px;
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left; position: relative;
}
.menu a + a::before, .menu a + form::before, .menu form + a::before { content: ""; position: absolute; left: 62px; right: 0; top: 0; height: 1px; background: var(--bord); }
.menu form { position: relative; }
.menu .ico-menu { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-doux); color: var(--accent); }
.menu .ico-menu svg { width: 18px; height: 18px; }
.menu a::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--muet); border-top: 2px solid var(--muet); transform: rotate(45deg); opacity: .7; }
.menu .rouge { color: var(--erreur); }
.menu .rouge .ico-menu { background: var(--erreur-fond); color: var(--erreur); }
@media (hover: hover) { .menu a:hover, .menu button:hover { background: var(--surface-2); } }

/* ---------- modèles ---------- */
.modele { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.modele h2 { font-size: 18px; line-height: 1.3; }
.modele-etat { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; }
.point-etat { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.point-etat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.point-etat.ok { color: var(--ok); }
.point-etat.attente { color: var(--attention); }

/* ---------- connexion ---------- */
.page-connexion { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-doux), transparent 60%), var(--fond); }
.carte-connexion { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--bord); border-radius: 28px; padding: 32px 24px 26px; box-shadow: var(--ombre-haute); }
.carte-connexion .marque { margin-bottom: 26px; }
.carte-connexion h1 { font-size: 26px; font-weight: 750; letter-spacing: -.025em; margin-bottom: 6px; }
.carte-connexion .muet { margin: 0 0 22px; font-size: 14.5px; }
.carte-connexion .btn { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (min-width: 900px) { body:not([data-page="lien"]) .retour { display: none; } }
.interrupteur input { min-height: 0; border: 0; box-shadow: none; }
.interrupteur input:not(:checked) { background: var(--bord-fort); }
@media (min-width: 900px) {
  body[data-page="lien"] .contenu > *, body[data-page="creer"] .contenu > *, body[data-page="compte"] .contenu > *, body[data-page="modeles"] .contenu > * { max-width: 760px; }
}
.modele .badge { white-space: normal; }
.rang-nom small { white-space: normal; text-overflow: clip; }
.rang-l.a-part { opacity: .75; }
.rang-l.a-part .rang-n { background: none; }
.rang-l.a-part .rang-nom b, .rang-l.a-part .rang-val b { color: var(--muet); font-weight: 600; }
.rang-val small { white-space: pre-line; line-height: 1.3; }

/* ---------- création : bandeau Dupliquer, résultat ---------- */
.bandeau-copie { background: var(--accent-doux); border-radius: var(--rayon-m); padding: 14px 14px 8px; }
.bandeau-haut { display: flex; gap: 12px; align-items: flex-start; }
.bandeau-haut b { display: block; font-size: 15px; font-weight: 650; color: var(--texte); overflow-wrap: anywhere; }
.bandeau-haut span { font-size: 14px; color: var(--texte-2); }
.ico-copie { width: 34px; height: 34px; border-radius: 11px; background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bandeau-bas { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 4px; border-top: 1px solid color-mix(in srgb, var(--accent) 14%, transparent); }
.resume-choix { font-size: 13.5px; color: var(--texte-2); font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reussite .pile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.reussite .alerte { text-align: left; margin: 0 0 12px; }
.reussite .lien-texte { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-size: 14px; font-weight: 600; }
.reussite .coche.deja { background: var(--accent-doux); color: var(--accent); }
.reussite.masse .resultats { text-align: left; margin: 14px 0 6px; }
.reussite.masse .resultat { padding: 4px 0; }
.reussite.masse .resultat .q { flex: 1; }
.btn.copie.large span { font-size: 16px; }

/* ---------- argent : héros du jour, listes téléphone ---------- */
.heros-jour .lib-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.heros-jour .grand { margin: 6px 0 0 !important; }
.heros-jour .grand .val { font-size: 44px; }
@media (min-width: 900px) { .heros.heros-jour { display: block; } .heros-jour .grand .val { font-size: 52px; } }
.date-pilule { min-height: 36px !important; padding: 0 12px !important; border-radius: 99px !important; background: var(--surface-2); font-size: 13.5px !important; font-weight: 600; color: var(--texte-2); width: auto; border: 0; }
.jours { display: flex; flex-direction: column; }
.jour-l { border-bottom: 1px solid var(--bord); }
.jour-l:last-of-type { border-bottom: 0; }
.jour-l > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; cursor: pointer; font-size: 14.5px; }
.jour-l > summary::-webkit-details-marker { display: none; }
.jour-l > summary b { font-variant-numeric: tabular-nums; font-weight: 650; }
.jour-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 2px 0 12px; font-size: 13.5px; }
.jour-detail > span { display: flex; justify-content: space-between; gap: 8px; background: var(--surface-2); padding: 8px 12px; border-radius: 12px; }
.jour-detail b { font-variant-numeric: tabular-nums; font-weight: 600; }
.jour-detail .lien-btn { grid-column: 1 / -1; justify-self: start; }
.plein-l { width: 100%; margin-top: 10px; }
.roi-liste { display: flex; flex-direction: column; }
.roi-l { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--bord); color: inherit; }
.roi-l:last-child { border-bottom: 0; }
.roi-nom { min-width: 0; font-size: 15px; font-weight: 600; }
.roi-nom strong, .roi-nom > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 620; }
.roi-nom .avec-point { display: flex; align-items: center; gap: 8px; }
.roi-nom small { display: block; font-size: 12.5px; color: var(--muet); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roi-val { font-size: 20px; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: right; }
.roi-detail { grid-column: 1 / -1; font-size: 12.5px; color: var(--muet); font-variant-numeric: tabular-nums; }
.seul-ordi { display: none; }
@media (min-width: 600px) { .seul-mobile { display: none !important; } .seul-ordi { display: block; } }
.rond.copie { background: var(--accent-doux); }
details.repli > summary > span:first-child { flex: 1; min-width: 0; }
details.repli > summary > span:first-child + .resume { flex: 0 1 auto; }
.apercu-lien { color: var(--accent, #5b5bd6); font-weight: 600; word-break: break-all; }
.apercu-lien:empty { display: none; }
.rond-mini { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--texte-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rond-mini:hover, .rond-mini:focus-visible { background: var(--surface, rgba(127,127,127,.12)); color: var(--accent); }
.url-edit .url-boite { padding: 6px 8px 6px 14px; }
.url-edit .hote-fixe { flex: none; color: var(--texte-2); font-size: 15px; font-weight: 500; }
.url-edit .fin-edit { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 15px; font-weight: 650; padding: 8px 0; outline: none; }
.url-edit .actions { margin-top: 10px; }
