:root {
  --fond: #0e0f14; --surface: #171921; --surface-2: #1f222c; --bord: #2a2e3a;
  --texte: #eceef4; --doux: #9aa0b1; --faible: #6b7183;
  --accent: #ff4f7b; --accent-doux: rgba(255, 79, 123, .14);
  --ok: #3ccf8e; --ok-doux: rgba(60, 207, 142, .14);
  --attention: #f5b041; --attention-doux: rgba(245, 176, 65, .14);
  --danger: #ff6b6b; --danger-doux: rgba(255, 107, 107, .14);
  --info: #6aa8ff; --info-doux: rgba(106, 168, 255, .14);
  --instagram: #e1306c; --youtube: #ff3b30; --x: #d7dae3; --tiktok: #25f4ee;
  --rayon: 14px; --ombre: 0 1px 0 rgba(255,255,255,.03) inset;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --fond: #f5f6f9; --surface: #ffffff; --surface-2: #f0f1f5; --bord: #e1e4ec;
    --texte: #161821; --doux: #5b6172; --faible: #8a90a0; --x: #161821;
    --accent-doux: rgba(255, 79, 123, .10); --ombre: 0 1px 2px rgba(16,24,40,.05);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 15px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.carte-connexion { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--bord); border-radius: 20px; padding: 28px 24px; }
.marque { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.01em; font-size: 18px; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: var(--accent) url("/icone.svg") center/cover; flex: none; }
.sous { color: var(--doux); margin: 18px 0 10px; }
.membres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.membres button { padding: 12px 6px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface-2); cursor: pointer; font-weight: 600; }
.membres button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-doux); }
.champ { display: block; margin-bottom: 12px; }
.champ span { display: block; font-size: 13px; color: var(--doux); margin-bottom: 6px; }
.champ input { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface-2); color: var(--texte); font: inherit; }
.champ input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.bouton { width: 100%; padding: 12px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
.bouton:disabled { opacity: .6; cursor: default; }
.erreur { color: var(--danger); min-height: 1.4em; margin: 10px 0 0; font-size: 14px; }

/* Structure */
.entete { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: color-mix(in srgb, var(--fond) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bord); }
.fraicheur { flex: 1; color: var(--doux); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.fraicheur .point { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.fraicheur.vieux .point { background: var(--attention); }
.fraicheur.mort .point { background: var(--danger); }
.moi { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.lien-bouton { background: none; border: 0; color: var(--doux); cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.onglets { display: flex; gap: 4px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 4; background: var(--fond); }
.onglets::-webkit-scrollbar { display: none; }
.onglets button { flex: none; background: none; border: 0; padding: 10px 12px; color: var(--doux); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 600; }
.onglets button.actif { color: var(--texte); border-bottom-color: var(--accent); }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 80px; }
h2 { font-size: 16px; margin: 28px 0 12px; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 10px; }
h2 .compte-titre { color: var(--faible); font-weight: 500; font-size: 13px; }
h2:first-child { margin-top: 4px; }
.vide { color: var(--faible); padding: 18px; border: 1px dashed var(--bord); border-radius: var(--rayon); text-align: center; }

/* Chiffres */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tuile { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); }
.tuile .valeur { font-size: 28px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tuile .libelle { color: var(--doux); font-size: 13px; }
.tuile .detail { color: var(--faible); font-size: 12px; margin-top: 2px; }

/* Lives */
.lives { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.live { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 14px; display: grid; gap: 4px; text-decoration: none; }
.live.actif { border-color: color-mix(in srgb, var(--danger) 55%, var(--bord)); }
.live .nom { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.live .titre { color: var(--doux); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.direct { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--danger); padding: 2px 6px; border-radius: 5px; }
.hors { font-size: 11px; color: var(--faible); border: 1px solid var(--bord); padding: 1px 6px; border-radius: 5px; }

/* Cartes de clips */
.clips { display: grid; gap: 10px; }
.clip { display: grid; grid-template-columns: 64px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px; box-shadow: var(--ombre); }
.clip .image { width: 64px; height: 114px; border-radius: 9px; background: var(--surface-2); object-fit: cover; display: block; }
.clip .corps { min-width: 0; display: grid; gap: 4px; align-content: start; }
.clip .haut { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--doux); }
.clip .titre { font-weight: 650; }
.clip .legende { color: var(--doux); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip .bas { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--doux); margin-top: 2px; }
.clip .motif { font-size: 13px; color: var(--danger); }
.heure { font-weight: 700; color: var(--texte); font-variant-numeric: tabular-nums; }
.pastille { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bord); white-space: nowrap; }
.pastille::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faible); }
.p-instagram::before { background: var(--instagram); } .p-youtube::before { background: var(--youtube); }
.p-x::before { background: var(--x); } .p-tiktok::before { background: var(--tiktok); }
.etat { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 6px; }
.e-ok { color: var(--ok); background: var(--ok-doux); } .e-attention { color: var(--attention); background: var(--attention-doux); }
.e-danger { color: var(--danger); background: var(--danger-doux); } .e-info { color: var(--info); background: var(--info-doux); }
.e-neutre { color: var(--doux); background: var(--surface-2); }
.jour { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faible); margin: 22px 0 8px; font-weight: 700; }
details.repli { margin-top: 26px; }
details.repli summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
@media (min-width: 760px) { .clips.grille { grid-template-columns: repeat(2, 1fr); } }

/* Comptes */
.marques { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.marque-carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; }
.marque-carte h3 { margin: 0 0 4px; font-size: 16px; }
.marque-carte .type { color: var(--faible); font-size: 12px; margin-bottom: 10px; }
.ligne-reseau { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--bord); align-items: center; }
.ligne-reseau .compteurs { grid-column: 1 / -1; color: var(--doux); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.ligne-reseau .note { grid-column: 1 / -1; color: var(--faible); font-size: 12px; }
.ligne-reseau a { text-decoration: none; }
.ligne-reseau a:hover .poignee { text-decoration: underline; }
.poignee { font-weight: 600; margin-left: 6px; }

/* Tableaux */
.tableau-defile { overflow-x: auto; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
th { color: var(--faible); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.nombre, th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
td.large { white-space: normal; min-width: 220px; }

/* Équipe */
.equipe { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.personne { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; }
.personne h3 { margin: 0 0 10px; font-size: 16px; display: flex; justify-content: space-between; }
.personne h3 span { color: var(--faible); font-weight: 500; font-size: 13px; }
.tache { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--bord); cursor: pointer; }
.tache input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.tache .quoi { font-size: 14px; }
.tache.faite .quoi { color: var(--faible); text-decoration: line-through; }
.tache .meta { color: var(--faible); font-size: 12px; margin-top: 2px; }

/* Machine */
.robots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.robot { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 14px; }
.robot .nom { font-weight: 650; display: flex; gap: 8px; align-items: center; }
.robot .quand, .robot .err { font-size: 13px; color: var(--doux); }
.robot .err { color: var(--attention); }
.voyant { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.voyant.ko { background: var(--danger); }
.alertes { display: grid; gap: 8px; }
.alerte { background: var(--surface); border: 1px solid var(--bord); border-left: 3px solid var(--info); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.alerte.attention { border-left-color: var(--attention); } .alerte.critique, .alerte.erreur { border-left-color: var(--danger); }
.journal { display: grid; gap: 0; border-left: 2px solid var(--bord); margin-left: 6px; }
.entree { position: relative; padding: 0 0 16px 18px; font-size: 14px; }
.entree::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.entree .quand { font-weight: 700; font-size: 13px; }
.entree .quoi { color: var(--doux); }

@media (max-width: 560px) {
  .entete { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .fraicheur { order: 3; flex-basis: 100%; }
  .tuile .valeur { font-size: 24px; }
  .marques, .equipe { grid-template-columns: 1fr; }
}

/* Inspirations */
.aide { color: var(--doux); font-size: 14px; margin: -4px 0 12px; max-width: 70ch; }
.formulaire { display: grid; grid-template-columns: 2fr 2fr auto; gap: 8px; }
.formulaire input { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); font: inherit; min-width: 0; }
.formulaire input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.formulaire .bouton { width: auto; padding: 11px 18px; }
.inspi { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; display: grid; gap: 6px; }
.inspi .haut { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-weight: 650; }
.inspi .haut a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspi .chiffres { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--doux); }
.inspi .chiffres b { color: var(--texte); font-variant-numeric: tabular-nums; }
.inspi .legende { color: var(--doux); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.inspi .pourquoi { font-size: 14px; font-style: italic; }
.inspi .meta { color: var(--faible); font-size: 12px; }
@media (max-width: 560px) { .formulaire { grid-template-columns: 1fr; } .formulaire .bouton { width: 100%; } }

/* Fil en direct */
.fil { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 4px 14px; }
.evenement { display: grid; grid-template-columns: 96px auto 1fr; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--bord); font-size: 14px; }
.evenement:first-child { border-top: 0; }
.evenement .quand { color: var(--faible); font-size: 12px; font-variant-numeric: tabular-nums; }
.evenement .quoi { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .evenement { grid-template-columns: auto 1fr; } .evenement .quand { grid-column: 1 / -1; } }
