/* Boussole KDP : habillage. Telephone d'abord, puis ordinateur. */
:root {
  --fond: #f4f2ec; --carte: #ffffff; --creux: #ebe8df; --texte: #1b2a2a; --doux: #667472;
  --trait: #e0dcd0; --vert: #1f6b5c; --vert-fonce: #17524a; --sur-vert: #ffffff; --ambre: #d8922b;
  --bon: #2f8f5b; --moyen: #c98a1b; --mauvais: #c2503f; --ombre: 0 1px 2px rgba(27,42,42,.06), 0 6px 20px rgba(27,42,42,.06);
  --rayon: 14px; --bas: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121817; --carte: #1a2221; --creux: #222c2a; --texte: #e8ecea; --doux: #93a19e;
    --trait: #2b3735; --vert: #58b7a0; --vert-fonce: #7fcdb9; --sur-vert: #0f1614; --ambre: #e5a94a;
    --ombre: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1 { font-size: 1.45rem; line-height: 1.2; margin: 0 0 .25em; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 1.7em 0 .6em; }
h3 { font-size: .95rem; margin: 0 0 .3em; }
p { margin: .4em 0; }
a { color: var(--vert); }
.doux { color: var(--doux); }
.petit { font-size: .84rem; }
.erreur { color: var(--mauvais); min-height: 1.3em; margin: .3em 0; font-size: .9rem; }
svg { width: 22px; height: 22px; flex: none; }
.logo { color: var(--vert); width: 30px; height: 30px; }
.logo .pointe { fill: var(--ambre); }
.logo.grand { width: 58px; height: 58px; }

/* ---------- champs et boutons */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; background: var(--carte); border: 1px solid var(--trait); border-radius: 10px;
  padding: 11px 13px; outline: none; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--vert); box-shadow: 0 0 0 3px rgba(31,107,92,.18); }
label { display: block; font-size: .86rem; font-weight: 600; margin: .9em 0 .35em; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border-radius: 10px; border: 1px solid var(--vert); background: var(--vert);
  color: var(--sur-vert); font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; }
.bouton:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.bouton.clair { background: transparent; color: var(--vert); }
.bouton.clair:hover { background: rgba(31,107,92,.09); }
.bouton.mini { min-height: 34px; padding: 0 12px; font-size: .86rem; border-radius: 8px; }
.bouton.plein { width: 100%; }
.bouton:disabled { opacity: .5; cursor: default; }
.lien { background: none; border: 0; padding: 6px 0; color: var(--doux); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; }
.lien:hover { color: var(--texte); }
.coche { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: .92rem; margin: .8em 0; }
.coche input { width: 19px; height: 19px; accent-color: var(--vert); }
:focus-visible { outline: 3px solid rgba(31,107,92,.45); outline-offset: 2px; }

/* ---------- porte d'entree */
.porte { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.porte-carte { width: min(100%, 380px); background: var(--carte); border: 1px solid var(--trait);
  border-radius: 20px; padding: 30px 26px; box-shadow: var(--ombre); text-align: center; }
.porte-carte label { text-align: left; }
.porte-carte .bouton { margin-top: 6px; }

/* ---------- ossature */
.appli { min-height: 100dvh; }
.rail { display: none; }
.scene { padding-bottom: calc(74px + var(--bas)); min-width: 0; }
.barre { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--trait); }
.marque { display: inline-flex; align-items: center; gap: 9px; color: var(--texte); text-decoration: none;
  font-size: 1.06rem; letter-spacing: -.01em; white-space: nowrap; }
.marque b { color: var(--vert); }
.marche { display: flex; gap: 6px; margin-left: auto; min-width: 0; }
.marche select { width: auto; min-width: 0; padding: 7px 8px; font-size: .86rem; border-radius: 9px; }
.barre .rond { flex: none; }
@media (max-width: 480px) { .marque.mobile span { display: none; } #pays { max-width: 132px; } }
.rond { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--trait); background: var(--carte); color: var(--texte); }
main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 30px; outline: none; }

.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid;
  grid-template-columns: repeat(5, 1fr); background: var(--carte); border-top: 1px solid var(--trait);
  padding: 6px 4px calc(6px + var(--bas)); }
.onglets a { display: grid; justify-items: center; gap: 2px; padding: 5px 2px; border-radius: 10px;
  color: var(--doux); text-decoration: none; font-size: .68rem; font-weight: 600; }
.onglets a[aria-current=page] { color: var(--vert); background: rgba(31,107,92,.1); }

.activite { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--carte);
  border: 1px solid var(--trait); display: flex; align-items: center; gap: 11px; font-size: .9rem;
  cursor: pointer; box-shadow: var(--ombre); }
.activite b { display: block; }
.tourne { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 3px solid var(--creux);
  border-top-color: var(--vert); animation: tour 0.9s linear infinite; }
@keyframes tour { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tourne { animation-duration: 3s; } }
.bulle { position: fixed; left: 50%; bottom: calc(92px + var(--bas)); transform: translateX(-50%); z-index: 9;
  background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 99px; font-size: .9rem;
  max-width: calc(100vw - 32px); box-shadow: var(--ombre); }

/* ---------- blocs */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 16px; margin: 12px 0; }
.entete { margin-bottom: 14px; }
.rangee { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.rangee > .champ { flex: 1 1 220px; }
.rangee label { margin-top: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.actions .pousse { margin-left: auto; }
details.carte > summary { cursor: pointer; font-weight: 650; }
details.carte[open] > summary { margin-bottom: 8px; }
.vide { text-align: center; color: var(--doux); padding: 34px 16px; }
.attente { display: grid; justify-items: center; gap: 10px; padding: 30px 16px; text-align: center; }
.attente .tourne { width: 34px; height: 34px; border-width: 4px; }
.journal { list-style: none; margin: 6px 0 0; padding: 0; font-size: .86rem; color: var(--doux); max-width: 100%; }
.journal li:last-child { color: var(--texte); font-weight: 600; }

.outils { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.outil { display: flex; gap: 13px; align-items: flex-start; padding: 16px; border-radius: var(--rayon);
  background: var(--carte); border: 1px solid var(--trait); color: var(--texte); text-decoration: none; }
.outil:hover { border-color: var(--vert); box-shadow: var(--ombre); }
.outil .pastille { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: rgba(31,107,92,.11); color: var(--vert); flex: none; }
.outil p { margin: 0; color: var(--doux); font-size: .88rem; }

.etiq { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px;
  font-size: .76rem; font-weight: 700; border: 1px solid var(--trait); background: var(--carte); white-space: nowrap; }
.etiq.bon { color: var(--bon); border-color: color-mix(in srgb, var(--bon) 40%, var(--trait)); }
.etiq.moyen { color: var(--moyen); border-color: color-mix(in srgb, var(--moyen) 40%, var(--trait)); }
.etiq.mauvais { color: var(--mauvais); border-color: color-mix(in srgb, var(--mauvais) 40%, var(--trait)); }
.puces { display: flex; flex-wrap: wrap; gap: 7px; }
.puce { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--trait); background: var(--carte);
  cursor: pointer; font-size: .88rem; }
.puce[aria-pressed=true] { background: var(--vert); border-color: var(--vert); color: var(--sur-vert); }

.verdict { font-size: 1.08rem; font-weight: 650; border-left: 5px solid var(--vert); }
.verdict.bon { border-left-color: var(--bon); } .verdict.moyen { border-left-color: var(--moyen); }
.verdict.mauvais { border-left-color: var(--mauvais); }
.notes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.note { margin: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 14px; }
.note .texte { display: grid; }
.note .texte strong { font-size: 1rem; }
.note .jauge { grid-column: 1 / -1; }
.note b { display: block; font-size: 2.1rem; line-height: 1.1; letter-spacing: -.02em; white-space: nowrap; }
.note b span { font-size: .9rem; color: var(--doux); font-weight: 500; }
.jauge { display: block; height: 8px; border-radius: 4px; background: var(--creux); overflow: hidden; margin-top: 9px; }
.jauge i { display: block; height: 100%; border-radius: 4px; background: var(--doux); }
.jauge i.bon { background: var(--bon); } .jauge i.moyen { background: var(--moyen); } .jauge i.mauvais { background: var(--mauvais); }
.jauge.fine { height: 6px; margin: 0; width: 64px; display: inline-block; vertical-align: middle; }
.note.rocket { border-left: 5px solid var(--trait); }
.note.rocket.bon { border-left-color: var(--bon); } .note.rocket.moyen { border-left-color: var(--moyen); }
.note.rocket.mauvais { border-left-color: var(--mauvais); }
.note.rocket b { font-size: 1.7rem; }
main h3 { margin-top: 1.2em; }
td .lien { white-space: nowrap; }
.actions select { width: auto; padding: 6px 8px; font-size: .86rem; }
.chiffres { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.chiffres div { background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: 10px 12px; }
.chiffres b { display: block; font-size: 1.15rem; }
.chiffres span { color: var(--doux); font-size: .8rem; }
ul.raisons { margin: .3em 0 .8em; padding-left: 1.15em; font-size: .92rem; }

/* ---------- tableaux */
.defile { overflow-x: auto; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--carte); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--doux); font-weight: 650; white-space: nowrap; background: var(--carte); font-size: .8rem; }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button:hover { color: var(--texte); }
th[aria-sort=ascending] button::after { content: "▲"; font-size: .6rem; }
th[aria-sort=descending] button::after { content: "▼"; font-size: .6rem; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.large { min-width: 220px; }
td.moyen { min-width: 150px; }
td .sous { display: block; color: var(--doux); font-size: .8rem; }
tbody tr:hover td { background: color-mix(in srgb, var(--vert) 5%, transparent); }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--trait); }
.liste li:last-child { border-bottom: 0; }
.liste .corps { flex: 1; min-width: 0; cursor: pointer; }
.liste .corps b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.groupe { margin: 14px 0; }
.groupe .tete { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.groupe pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .9rem;
  background: var(--creux); border-radius: 10px; padding: 12px; max-height: 240px; overflow: auto; }
.avert { color: var(--doux); font-size: .82rem; margin-top: 22px; }

/* ---------- ordinateur */
@media (min-width: 920px) {
  .appli { display: grid; grid-template-columns: 238px minmax(0, 1fr); }
  .rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 20px 14px;
    border-right: 1px solid var(--trait); background: var(--carte); }
  .rail .marque { padding: 2px 8px 18px; font-size: 1.15rem; }
  .rail nav { display: grid; gap: 3px; }
  .rail nav a { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px;
    color: var(--texte); text-decoration: none; font-weight: 550; font-size: .95rem; }
  .rail nav a:hover { background: var(--creux); }
  .rail nav a[aria-current=page] { background: rgba(31,107,92,.12); color: var(--vert); }
  .rail-pied { margin-top: auto; display: grid; gap: 6px; padding: 0 8px; }
  .onglets, .mobile { display: none; }
  .scene { padding-bottom: 0; }
  .barre { justify-content: flex-end; padding: 12px 28px; }
  main { padding: 26px 28px 50px; }
  .activite { margin: 14px 28px 0; }
  .bulle { bottom: 28px; }
  h1 { font-size: 1.7rem; }
}
