/* Le Sonar : rouge du logo, encre sombre, statuts portés par une pastille et une bande de couleur. */
:root {
  --fond: #f4f3f1; --surface: #fff; --creux: #eceae7; --encre: #17191c; --encre-douce: #5c6067; --trait: #dcd9d4;
  --sonar: #e2382c; --sonar-doux: #fbe6e3; --onde: rgba(226,56,44,.11);
  --attente: #b86d04; --attente-fond: #fdf1dc; --cours: #2563b8; --cours-fond: #e3edfb; --ok: #1f8a4c; --ok-fond: #e0f3e7;
  --titre: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --texte: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --fond: #121416; --surface: #1b1e21; --creux: #24282c; --encre: #f1efec; --encre-douce: #a3a7ad;
    --trait: #30353a; --sonar: #ff5a4d; --sonar-doux: #3a1d1a; --onde: rgba(255,90,77,.13);
    --attente: #f0a93b; --attente-fond: #3a2c12; --cours: #74a8f2; --cours-fond: #172a45; --ok: #55c486; --ok-fond: #14301f; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sonar); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--titre); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(26px, 5vw, 36px); } h2 { font-size: 21px; } h3 { font-size: 17px; }
p { margin: 0; }
.doux { color: var(--encre-douce); } .petit { font-size: 14px; } .num { font-variant-numeric: tabular-nums; }

/* Barre haute et navigation */
.barre { background: var(--surface); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 5; }
.barre-in { max-width: 1080px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 18px; }
.marque { font-family: var(--titre); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 15px; text-decoration: none; white-space: nowrap; }
.marque b { color: var(--sonar); }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--encre-douce); white-space: nowrap; }
.nav a:hover { background: var(--creux); color: var(--encre); }
.nav a[aria-current="page"] { background: var(--encre); color: var(--fond); }
.lien-bouton { background: none; border: 0; padding: 0; color: var(--encre-douce); text-decoration: underline; cursor: pointer; font-size: 14px; }
.page { max-width: 1080px; margin: 0 auto; padding: 22px 18px 90px; display: flex; flex-direction: column; gap: 20px; }
.tete { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.tete p { max-width: 60ch; }

/* Blocs */
.bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bloc.echo { position: relative; overflow: hidden; }
.bloc.echo::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-radial-gradient(circle at 100% 0, transparent 0 42px, var(--onde) 42px 45px);
  -webkit-mask-image: linear-gradient(to left, #000, transparent 60%); mask-image: linear-gradient(to left, #000, transparent 60%); }
.bloc.echo > * { position: relative; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.deux { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); align-items: start; }
.chiffres { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.chiffre { background: var(--creux); border-radius: 12px; padding: 12px 14px; }
.chiffre strong { display: block; font-family: var(--titre); font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chiffre span { font-size: 13.5px; color: var(--encre-douce); }

/* Listes d'éléments */
.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.liste > li { padding: 12px 0; border-top: 1px solid var(--trait); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.liste > li:first-child { border-top: 0; padding-top: 2px; }
.liste .corps { flex: 1 1 220px; min-width: 0; }
.liste .corps a { font-weight: 600; text-decoration: none; }
.liste .corps a:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Pastilles de statut */
.pastille { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--creux); color: var(--encre-douce); }
.pastille::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-attente { background: var(--attente-fond); color: var(--attente); }
.p-cours { background: var(--cours-fond); color: var(--cours); }
.p-ok { background: var(--ok-fond); color: var(--ok); }
.p-rouge { background: var(--sonar-doux); color: var(--sonar); }

/* Boutons et formulaires */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--trait); background: var(--surface); border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 14.5px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--encre-douce); }
.btn.fort { background: var(--sonar); border-color: var(--sonar); color: #fff; }
.btn.fort:hover { filter: brightness(1.07); }
.btn.mini { padding: 5px 12px; font-size: 13.5px; }
form.pile, .pile { display: flex; flex-direction: column; gap: 12px; }
.champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.champ label, .legende { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--encre-douce); }
.champ input, .champ select, .champ textarea { width: 100%; border: 1px solid var(--trait); background: var(--fond); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.champ textarea { min-height: 84px; resize: vertical; }
.champ input:focus, .champ select:focus, .champ textarea:focus { border-color: var(--sonar); outline: none; box-shadow: 0 0 0 3px var(--onde); }
.champ .aide { font-size: 13px; color: var(--encre-douce); }
.champ .erreur, .erreur { font-size: 13.5px; color: var(--sonar); font-weight: 600; }
.ligne { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.choix { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.choix label { position: relative; cursor: pointer; }
.choix input { position: absolute; opacity: 0; inset: 0; }
.choix span { display: inline-block; border: 1px solid var(--trait); border-radius: 999px; padding: 7px 14px; font-size: 14.5px; font-weight: 600; background: var(--fond); }
.choix input:checked + span { background: var(--encre); color: var(--fond); border-color: var(--encre); }
.choix input:focus-visible + span { outline: 2px solid var(--sonar); outline-offset: 2px; }
.case { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.case input { width: 20px; height: 20px; accent-color: var(--sonar); }

/* Messages */
.message { border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.m-ok { background: var(--ok-fond); color: var(--ok); }
.m-attention { background: var(--attente-fond); color: var(--attente); }
.m-info { background: var(--cours-fond); color: var(--cours); }
.m-erreur { background: var(--sonar-doux); color: var(--sonar); }

/* Tableaux */
.defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--encre-douce); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

/* Fil d'une recommandation */
.fil { display: flex; gap: 4px; flex-wrap: wrap; }
.fil span { flex: 1 1 90px; text-align: center; padding: 7px 8px; background: var(--creux); color: var(--encre-douce); font-size: 13px; font-weight: 700; border-radius: 8px; }
.fil span.fait { background: var(--cours-fond); color: var(--cours); }
.fil span.ici { background: var(--encre); color: var(--fond); }
.fil span.ici.gagne { background: var(--ok); color: #fff; }
.fil span.ici.perdu { background: var(--encre-douce); color: var(--fond); }

/* Connexion */
.seul { min-height: 100%; display: grid; place-items: center; padding: 24px 18px; }
.seul .bloc { width: min(100%, 440px); padding: 28px; gap: 16px; }
html.plein, html.plein body { height: 100%; }

@media (max-width: 560px) { .page { padding: 16px 14px 80px; } .bloc { padding: 16px; } }

/* Téléphone : la navigation passe sur sa propre ligne, défilable au doigt. */
@media (max-width: 760px) {
  .barre-in { flex-wrap: wrap; gap: 6px 12px; padding: 8px 14px; }
  .barre-in form { margin-left: auto; }
  .nav { order: 3; flex: 1 0 100%; margin: 0 -14px; padding: 0 14px 2px; }
}
