@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: light;
  --plan: #e9edf2;
  --surface: #fcfcfb;
  --encre: #0f1b2d;
  --encre-2: #485468;
  --discret: #7d8591;
  --trait: #dfe3e8;
  --axe: #c0c6ce;
  --accent: #2a78d6;
  --accent-encre: #ffffff;
  --perte: #e34948;
  --neutre: #a9b0ba;
  --lavis: rgba(42, 120, 214, 0.12);
  --bon: #0ca30c;
  --alerte-fond: #fff4dc;
  --alerte-encre: #6b4a00;
  --marine: #0f1b2d;
  --marine-encre: #f2f5f9;
  --rayon: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --plan: #0f1114;
    --surface: #1a1a19;
    --encre: #f0efec;
    --encre-2: #c3c2b7;
    --discret: #898781;
    --trait: #2c2c2a;
    --axe: #3d3d3a;
    --accent: #3987e5;
    --perte: #e66767;
    --neutre: #5d6168;
    --lavis: rgba(57, 135, 229, 0.16);
    --alerte-fond: #3a2e10;
    --alerte-encre: #f4d58a;
    --marine: #1a2538;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plan);
  color: var(--encre);
  font: 400 16px/1.5 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-stretch: 100%;
}
#app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
.attente { padding: 48px 0; color: var(--discret); }

h1 { font-size: 34px; line-height: 1.05; font-weight: 800; font-stretch: 118%; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 19px; line-height: 1.25; font-weight: 700; font-stretch: 108%; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 700; margin: 20px 0 6px; }
p { margin: 0 0 10px; max-width: 62ch; }
a { color: var(--accent); }
small, .note { font-size: 13px; color: var(--encre-2); }
.discret { color: var(--discret); }

.entete { padding: calc(22px + env(safe-area-inset-top)) 0 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.entete .retour { font-size: 14px; text-decoration: none; display: inline-block; margin-bottom: 8px; }

.carte { background: var(--surface); border-radius: var(--rayon); padding: 18px; margin-bottom: 12px; }
.carte.marine { background: var(--marine); color: var(--marine-encre); }
.carte.marine .note { color: #b8c2d1; }
.carte > :last-child { margin-bottom: 0; }

.bandeau { background: var(--alerte-fond); color: var(--alerte-encre); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }
.bandeau strong { font-weight: 700; }

/* La fourchette : la forme signature. Un chiffre n'est jamais montré seul. */
.chiffres { display: grid; gap: 18px; }
.chiffre .nom { font-size: 14px; color: var(--encre-2); }
.chiffre .valeur { font-size: 30px; line-height: 1.1; font-weight: 750; font-stretch: 78%; letter-spacing: -0.01em; }
.chiffre .valeur span { font-weight: 400; color: var(--discret); font-size: 20px; }
.chiffre .mediane { font-size: 13px; color: var(--encre-2); }
.marine .chiffre .nom, .marine .chiffre .mediane { color: #b8c2d1; }
.marine .chiffre .valeur span { color: #8d99ab; }

.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.tuile .nom { font-size: 13px; color: var(--encre-2); }
.tuile .valeur { font-size: 22px; font-weight: 700; font-stretch: 85%; }

.bouton { appearance: none; border: 0; border-radius: 10px; padding: 13px 18px; font: inherit; font-weight: 650; background: var(--accent); color: var(--accent-encre); cursor: pointer; min-height: 46px; }
a.bouton { display: inline-flex; align-items: center; text-decoration: none; }
.bouton.second { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 1.5px var(--axe); }
.bouton.danger { background: transparent; color: var(--perte); box-shadow: inset 0 0 0 1.5px var(--perte); }
.bouton.petit { padding: 8px 12px; min-height: 36px; font-size: 14px; }
.bouton:disabled { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.puces { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -2px; }
.puce { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; background: var(--plan); color: var(--encre); cursor: pointer; }
.puce[aria-pressed='true'] { background: var(--encre); color: var(--surface); font-weight: 650; }

ul.liste { margin: 0; padding: 0; list-style: none; }
ul.liste li { padding: 10px 0; border-top: 1px solid var(--trait); }
ul.liste li:first-child { border-top: 0; padding-top: 0; }
ul.points { margin: 0 0 10px; padding-left: 20px; }
ul.points li { margin-bottom: 6px; max-width: 60ch; }

.ligne { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.statut { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--plan); color: var(--encre-2); white-space: nowrap; }
.statut.attente-v { background: var(--alerte-fond); color: var(--alerte-encre); }

.etapes { list-style: none; padding: 0; margin: 12px 0 0; }
.etapes li { display: flex; gap: 10px; padding: 5px 0; font-size: 15px; color: var(--discret); }
.etapes li.encours { color: inherit; font-weight: 650; }
.etapes li.fait { color: inherit; }
.etapes .marque { width: 18px; flex: none; text-align: center; }
.etapes li.encours .marque { animation: pouls 1.2s ease-in-out infinite; }
@keyframes pouls { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .etapes li.encours .marque { animation: none; } }

.jauge { height: 8px; border-radius: 4px; background: var(--lavis); overflow: hidden; margin: 6px 0 4px; }
.jauge i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

.paliers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 14px 0 6px; }
.paliers div { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); }
.paliers div.atteint { background: #5aa2f2; }
.paliers-noms { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; font-size: 11px; color: #b8c2d1; }

label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 4px; }
label .aide { display: block; font-weight: 400; color: var(--encre-2); font-size: 13px; }
input, select, textarea { width: 100%; font: inherit; color: inherit; background: var(--plan); border: 1.5px solid transparent; border-radius: 9px; padding: 11px 12px; min-height: 46px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 0; }
textarea { min-height: 84px; resize: vertical; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.case { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.case input { width: 22px; min-height: 22px; height: 22px; padding: 0; }
.erreur { color: var(--perte); font-size: 14px; margin-top: 8px; }
.succes { color: var(--bon); font-size: 14px; margin-top: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px 7px 0; border-top: 1px solid var(--trait); vertical-align: top; }
th { font-weight: 600; color: var(--encre-2); border-top: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.defile { overflow-x: auto; }
details { margin-top: 12px; }
summary { cursor: pointer; font-size: 14px; color: var(--accent); padding: 6px 0; }

.graphe { position: relative; margin: 6px 0 4px; }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.graphe text { font-family: inherit; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--encre-2); margin-top: 6px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; }
.bulle { position: fixed; z-index: 30; pointer-events: none; background: var(--encre); color: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.35; max-width: 240px; }
.bulle b { font-weight: 700; }

.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--trait); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.onglets a { flex: 1; max-width: 144px; text-align: center; padding: 12px 2px 11px; font-size: 13px; color: var(--encre-2); text-decoration: none; position: relative; }
.onglets a[aria-current='page'] { color: var(--encre); font-weight: 700; }
.onglets a[aria-current='page']::before { content: ''; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.onglets .pastille { display: inline-block; min-width: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; margin-left: 3px; }

.porte { max-width: 400px; margin: 0 auto; padding-top: 14vh; }
.porte h1 { margin-bottom: 8px; }

.hyps { list-style: none; margin: 0; padding: 0; }
.hyps li { padding: 10px 0; border-top: 1px solid var(--trait); }
.hyps li:first-child { border-top: 0; }
.hyps .tete { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.hyps .v { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.hyps .v b { font-weight: 700; }
