/* Ovonido : système visuel. Clair, sobre, chiffres d'abord.
   Palette sûre pour le daltonisme : bleu = fait, orange = à corriger, ambre = attention ; toujours avec un symbole. */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #F6F6F4; --surface: #FFFFFF; --subtle: #F0F0ED; --hover: #F8F8F6;
  --line: #E4E4E0; --line-2: #D2D2CC;
  --text: #111113; --muted: #64646B; --faint: #9B9BA1;
  --ink: #15233B; --ink-2: #213356; --nuit-soft: #E9EDF4;
  --blue: #0072B2; --blue-soft: #E8F2F9; --blue-ring: rgba(0, 114, 178, .22);
  --orange: #C2410C; --orange-mark: #D55E00; --orange-soft: #FDF1EA;
  --amber: #E69F00; --amber-soft: #FFF7E3;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(17, 17, 19, .04);
  --sh-2: 0 1px 2px rgba(17, 17, 19, .05), 0 8px 24px -8px rgba(17, 17, 19, .10);
  --sh-3: 0 24px 64px -16px rgba(17, 17, 19, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; font-feature-settings: 'cv11', 'ss01'; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.num, input.n, td, .kpi b { font-variant-numeric: tabular-nums; }

/* ---------- barre du haut ---------- */
header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  padding: 0 24px; min-height: 60px; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.marque { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; font-size: 15px; white-space: nowrap; }
.marque::before { content: ''; width: 24px; height: 24px; border-radius: 7px; background: #15233B url('/icone.svg') center/cover; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.marque .sep { color: var(--faint); font-weight: 400; }
.marque .sous { color: var(--muted); font-weight: 500; }
header nav { display: flex; gap: 2px; flex: 1; align-self: stretch; }
header nav a { display: flex; align-items: center; padding: 0 12px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
header nav a:hover { color: var(--text); }
header nav a.actif { color: var(--text); border-bottom-color: var(--ink); }
header .qui { font-size: 13px; color: var(--muted); }
.esp { flex: 1; }

/* ---------- pastilles d'état ---------- */
.pastille { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 550;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); white-space: nowrap; }
.pastille { color: var(--blue); }
.pastille.attente { color: #7A5200; background: var(--amber-soft); border-color: #F2D68A; }
.pastille.horsligne { color: var(--text); }
button.pastille { color: var(--muted); }
button.pastille { cursor: pointer; }
button.pastille:hover { background: var(--hover); color: var(--text); }

/* ---------- mise en page ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 32px 24px 48px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; margin: 32px 0 12px; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 16px; }
.mini { font-size: 13px; color: var(--muted); }
.rang { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; margin-bottom: 16px; box-shadow: var(--sh-1); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.center { text-align: center; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 550; font-size: 14px; cursor: pointer; text-decoration: none;
  box-shadow: var(--sh-1); transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: #BEBEB7; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tuile:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--blue-ring); border-color: var(--blue); }
.btn.plein { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, var(--sh-1); }
.btn.plein:hover { background: var(--ink-2); }
.btn.choisi { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.petit { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- bandeaux ---------- */
.bandeau { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; font-size: 14px; font-weight: 500; border: 1px solid; }
.bandeau.info { background: var(--blue-soft); border-color: #C6DDEC; color: #0B3D5E; }
.bandeau.alerte { background: var(--orange-soft); border-color: #F5CDB6; color: #7A2A08; }

/* ---------- tuiles (tablette) ---------- */
.tuile { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 20px; min-height: 128px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.tuile:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.tuile:active { transform: translateY(1px); }
.tuile .titre { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.tuile .etat { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--subtle); color: var(--muted); }
.tuile.fait .etat { background: var(--blue-soft); color: var(--blue); }
.tuile.afaire .etat { background: var(--orange-soft); color: var(--orange); }
.tuile .mini { margin-top: auto; }

/* ---------- formulaires ---------- */
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 20px; }
label.champ { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 550; color: var(--text); }
label.champ .u { font-weight: 450; color: var(--faint); margin-left: 2px; }
input.n { height: 64px; width: 100%; padding: 0 16px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface); box-shadow: inset 0 1px 2px rgba(17,17,19,.04); transition: border-color .12s, box-shadow .12s; }
input.n::placeholder { color: var(--faint); font-weight: 400; }
input.n.avert { border-color: var(--orange-mark); background: var(--orange-soft); box-shadow: 0 0 0 3px rgba(213, 94, 0, .15); }
textarea { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); resize: vertical; }
details > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '+'; display: inline-block; width: 18px; font-weight: 500; }
details[open] > summary::before { content: '−'; }
details[open] > summary { margin-bottom: 8px; }

.calc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 20px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.calc > span { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--subtle); font-size: 12px; font-weight: 550; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.calc b { font-size: 22px; font-weight: 650; letter-spacing: -.02em; color: var(--text); text-transform: none; font-variant-numeric: tabular-nums; }

.bas { position: sticky; bottom: 0; display: flex; gap: 12px; justify-content: flex-end; padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(246,246,244,0), var(--bg) 35%); }

/* ---------- gestion : formulaires compacts ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; align-items: end; }
.form label, .boite > label, .carte > label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--muted); }
.form input, .form select, .boite input:not([type=checkbox]), .boite select, .carte input:not([type=checkbox]):not([type=file]):not(.n), .carte select, main > .rang select {
  height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; color: var(--text); box-shadow: var(--sh-1); }
.boite textarea { min-height: 72px; font-size: 14px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ink); }

/* ---------- tableaux ---------- */
.defile { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; background: var(--surface); }
th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: right; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--subtle); text-align: right; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child, th.g, td.g { text-align: left; }
tr.clic { cursor: pointer; } tr.clic:hover td { background: var(--hover); }
td.hn { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.carte table th { position: static; }
.ok { color: var(--blue); font-weight: 600; } .non { color: var(--orange); font-weight: 600; } .att { color: #8A5A00; font-weight: 600; }
.code { display: inline-block; font: 600 26px/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .18em; padding: 12px 16px; border-radius: var(--r-sm); background: var(--subtle); border: 1px solid var(--line); }

/* ---------- fenêtres ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 24px; overflow: auto;
  background: rgba(17, 17, 19, .32); backdrop-filter: blur(2px); animation: fondu .12s ease-out; }
.modal .boite { width: 100%; max-width: 880px; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3); animation: monte .16s ease-out; }
.modal .boite h2:first-child, .modal .boite h3:first-child { margin-top: 0; }
.modal ul { padding-left: 18px; } .modal li { margin: 8px 0; line-height: 1.45; }
@keyframes fondu { from { opacity: 0; } }
@keyframes monte { from { opacity: 0; transform: translateY(6px) scale(.99); } }

/* ---------- KPI (gestion) ---------- */
#contenu { margin-top: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; box-shadow: var(--sh-1); }
.kpi { background: var(--surface); padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi > span { font-size: 12px; font-weight: 550; color: var(--muted); }
.kpi b { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.kpi small { font-size: 12px; color: var(--faint); }

/* ================= Tablette ================= */
body.tab { font-size: 17px; line-height: 1.45; }
body.tab header { min-height: 72px; }
body.tab header .bat { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
body.tab header .lot { color: var(--muted); font-size: 15px; }
body.tab main { max-width: 1040px; padding: 28px 24px 40px; }
body.tab h2 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin: 28px 0 14px; }
body.tab .btn { height: 52px; padding: 0 20px; font-size: 16px; border-radius: var(--r); }
body.tab .btn.grand { height: 60px; padding: 0 28px; font-size: 17px; }
body.tab .carte { padding: 24px; }
body.tab .segment { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--subtle); border: 1px solid var(--line); flex-wrap: wrap; }
body.tab .segment .btn { height: 46px; box-shadow: none; border-color: transparent; background: transparent; color: var(--muted); }
body.tab .segment .btn.choisi { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--sh-1); }

/* ================= Gestion ================= */
body.gest { font-size: 14px; line-height: 1.5; }

@media (max-width: 680px) {
  header { padding: 8px 14px; } header nav { order: 3; width: 100%; flex: none; overflow-x: auto; } header nav a { height: 40px; }
  main { padding: 20px 14px 40px; } body.tab main { padding: 20px 14px 40px; }
  .carte { padding: 18px; } .calc { grid-template-columns: 1fr 1fr 1fr; } .calc > span { padding: 10px; }
}

/* ================= Mouvement ================= */
@media (prefers-reduced-motion: no-preference) {
  .entree > * { animation: entree .38s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
  main.entre { animation: fondu .18s ease-out; }
  .glisse.depuis-droite { animation: depuisDroite .26s cubic-bezier(.2, .8, .2, 1); }
  .glisse.depuis-gauche { animation: depuisGauche .26s cubic-bezier(.2, .8, .2, 1); }
  .fil > *, .grille-bat > * { animation: entree .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
}
@keyframes entree { from { opacity: 0; transform: translateY(8px); } }
@keyframes depuisDroite { from { opacity: 0; transform: translateX(28px); } }
@keyframes depuisGauche { from { opacity: 0; transform: translateX(-28px); } }
.btn, .tuile, .touche, .etape, .pal-item, .alerte { -webkit-tap-highlight-color: transparent; }
.btn:active, .touche:active { transform: scale(.97); }
a.pastille { text-decoration: none; }

/* ================= Notifications ================= */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; }
.toast { display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 550; box-shadow: var(--sh-3); animation: monte .2s ease-out; }
.toast button { height: 36px; padding: 0 14px; border-radius: 9px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 600; cursor: pointer; }
.toast button i { font-style: normal; opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }
.coche { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; pointer-events: none; background: rgba(246,246,244,.55); animation: fondu .12s; }
.coche svg { width: 112px; height: 112px; }
.coche circle { fill: var(--surface); stroke: var(--blue); stroke-width: 2.5; }
.coche path { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: trace .35s .08s ease-out forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
.roue { width: 34px; height: 34px; margin: 8px auto 12px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.micro { width: 88px; height: 88px; margin: 8px auto; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #fff; background: var(--orange-mark); animation: pouls 1.2s ease-in-out infinite; }
@keyframes pouls { 50% { box-shadow: 0 0 0 18px rgba(213, 94, 0, .12); } }

/* ================= Tablette : accueil ================= */
.titre-ecran { font-size: 30px; margin: 8px 0 24px; }
.vide { max-width: 520px; margin: 8vh auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.vide-icone { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); color: var(--muted); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 17px; background: var(--subtle); border: 1px solid var(--line); color: var(--text); }
.avatar.petit { width: 28px; height: 28px; font-size: 12px; }
.tuile.personne { flex-direction: row; align-items: center; gap: 16px; min-height: 96px; }
.lien-qui { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 550; cursor: pointer; }
.barre-dates { margin-bottom: 8px; }
.titre-jour { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 24px 0 4px; }
.titre-jour h1 { font-size: 30px; }
.titre-jour h1::first-letter, .saisie-titre .mini::first-letter { text-transform: uppercase; }
h2 .compte, h2 .mini { font-weight: 500; color: var(--muted); margin-left: 6px; font-size: 15px; }
.tuile .chevron { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 26px; color: var(--faint); }
.tuile .titre { padding-right: 24px; }

/* calendrier */
.mois { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 18px; }
.jsem { text-align: center; font-size: 12px; font-weight: 600; color: var(--faint); }
.jour { height: 58px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.jour b { font-size: 16px; } .jour i { font-style: normal; font-size: 12px; }
.jour.ok i { color: var(--blue); } .jour.partiel i { color: #8A5A00; } .jour.manque { background: var(--orange-soft); border-color: #F5CDB6; } .jour.manque i { color: var(--orange); }
.jour.choisi { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ================= Tablette : saisie guidée ================= */
.saisie-tete { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.saisie-titre h1 { font-size: 24px; } .saisie-titre .mini { display: inline-block; }
.etapes { position: relative; display: flex; gap: 4px; overflow-x: auto; padding: 4px; margin-bottom: 18px; background: var(--subtle); border: 1px solid var(--line); border-radius: 16px; scrollbar-width: none; }
.etape { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.etape i { font-style: normal; font-weight: 450; font-size: 12px; color: var(--faint); }
.etape .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface); border: 1px solid var(--line); }
.etape.remplie .ic { color: var(--blue); border-color: #C6DDEC; background: var(--blue-soft); }
.etape.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.etape.active .ic { background: var(--ink); color: #fff; border-color: var(--ink); }
.progression { position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: linear-gradient(to right, var(--ink) var(--p), transparent var(--p)); border-radius: 2px; transition: background .3s; }
.saisie-grille { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.champs-colonne { display: flex; flex-direction: column; gap: 12px; }
.champ-n { position: relative; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.champ-n.actif { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 23, 26, .08), var(--sh-2); }
.champ-n.avert { border-color: var(--orange-mark); background: linear-gradient(var(--orange-soft), var(--orange-soft)); }
.champ-n.ia:not(.actif) { border-style: dashed; border-color: var(--blue); }
.champ-l { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 600; }
.champ-l .u { color: var(--faint); font-weight: 500; }
.champ-v { display: flex; align-items: center; min-height: 48px; margin-top: 2px; }
.champ-v b { font-size: 38px; line-height: 1.1; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.champ-v b.fantome { color: #C9C9C4; font-weight: 500; }
.champ-n.actif .curseur { width: 2px; height: 34px; margin-left: 4px; background: var(--ink); animation: clignote 1s steps(2) infinite; }
@keyframes clignote { 50% { opacity: 0; } }
.champ-aide { font-size: 13px; color: var(--faint); margin-top: 2px; }
.champ-aide.ia { color: var(--blue); font-weight: 550; }
.avis:empty { display: none; }
.avis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: 14px; }
.avis-texte { color: var(--orange); font-weight: 550; flex: 1; min-width: 200px; }
.avis-ok { color: var(--blue); font-weight: 600; }
.puce { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--orange-mark); background: var(--surface); color: var(--orange); font-weight: 600; font-size: 14px; cursor: pointer; }
.pave { position: sticky; top: 92px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 20px; background: var(--subtle); border: 1px solid var(--line); }
.touche { height: 72px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 28px; font-weight: 550; box-shadow: 0 1px 0 rgba(17,17,19,.06); cursor: pointer; font-variant-numeric: tabular-nums; transition: background .08s, transform .08s; }
.touche:active { background: var(--subtle); }
.touche.efface { font-size: 22px; color: var(--muted); }
.touche.sec { height: 56px; font-size: 15px; font-weight: 600; color: var(--muted); }
.touche.plein { grid-column: 1 / -1; height: 60px; font-size: 17px; font-weight: 650; background: var(--ink); color: #fff; border-color: var(--ink); }
.verif .kpis { margin-bottom: 16px; }
.verif-groupe dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; margin: 12px 0 0; }
.verif-groupe dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--subtle); }
.verif-groupe dl > div.avert dd { color: var(--orange); font-weight: 650; }
.verif-groupe dt { color: var(--muted); } .verif-groupe dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .saisie-grille { grid-template-columns: 1fr; } .pave { position: sticky; top: auto; bottom: 84px; z-index: 5; box-shadow: var(--sh-2); } }

/* contraste élevé (poulailler mal éclairé) */
body.contraste { --bg: #FFFFFF; --line: #8A8A8F; --line-2: #4A4A50; --muted: #2C2C30; --faint: #4A4A50; }
body.contraste .champ-v b.fantome { color: #8A8A8F; }
body.contraste .tuile, body.contraste .champ-n, body.contraste .touche { border-width: 2px; }

/* ================= Gestion : recherche, alertes, cartes ================= */
.recherche { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--subtle); color: var(--muted); font-size: 13px; cursor: pointer; }
.recherche kbd { font: 600 11px/1 Inter, sans-serif; padding: 4px 6px; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.boite-palette { max-width: 640px !important; padding: 0 !important; overflow: hidden; }
.palette input { width: 100%; height: 60px; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; padding: 0 20px !important; font-size: 17px !important; box-shadow: none !important; outline: none; }
.pal-res { max-height: 50vh; overflow: auto; padding: 8px; }
.pal-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14px; font-weight: 500; cursor: pointer; }
.pal-item.sel { background: var(--subtle); }
.pal-item.ia span:first-child { color: var(--blue); font-weight: 600; }
.pal-pied { padding: 10px 20px; border-top: 1px solid var(--line); }
.reponse-ia { padding: 16px 20px; border-radius: var(--r); background: var(--subtle); border: 1px solid var(--line); line-height: 1.6; }
.reponse-ia p { margin: 0 0 10px; }

.fil { display: flex; flex-direction: column; gap: 8px; margin: 24px 0 28px; }
.alerte { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--sh-1); transition: border-color .12s, transform .12s; }
.alerte:hover { border-color: var(--line-2); transform: translateX(2px); }
.alerte .al-ic { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: 14px; }
.alerte.critique .al-ic { background: var(--orange-soft); color: var(--orange); }
.alerte.attention .al-ic { background: var(--amber-soft); color: #8A5A00; }
.alerte.calme .al-ic, .alerte.info .al-ic { background: var(--blue-soft); color: var(--blue); }
.al-corps { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 14px; }
.al-corps span { color: var(--muted); font-size: 13px; }
.alerte .chevron { color: var(--faint); font-size: 20px; }
.grille-bat { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.carte.bat { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.bat-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bat-tete h2 { margin: 0 0 2px; font-size: 18px; letter-spacing: -.015em; }
.puce-etat { flex: none; height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--subtle); color: var(--muted); }
.puce-etat.ok { background: var(--blue-soft); color: var(--blue); } .puce-etat.non { background: var(--orange-soft); color: var(--orange); } .puce-etat.att { background: var(--amber-soft); color: #8A5A00; }
.spark { width: 100%; height: 56px; display: block; margin-top: 6px; }
.spark .ligne { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark .aire { fill: rgba(23, 23, 26, .05); }
.spark .ref { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.spark circle { fill: var(--ink); }
.spark-vide { height: 56px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; margin-top: 6px; }
.bat-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.bat-kpis > div { background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.bat-kpis > div > span { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.bat-kpis b .num-u { font-size: .7em; }
.bat-kpis b { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v { font-style: normal; font-size: 11px; margin-left: 2px; } .v.ok { color: var(--blue); } .v.att { color: #8A5A00; } .v.non { color: var(--orange); }
.bat-pied { border-top: 1px solid var(--subtle); padding-top: 12px; }

/* comparateur */
.comparer { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.comparer aside { position: sticky; top: 80px; }
.case { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; padding: 6px 0; color: var(--text) !important; font-size: 14px !important; cursor: pointer; flex-wrap: wrap; }
.graphe { width: 100%; height: auto; margin-top: 12px; }
.graphe .grille { stroke: var(--subtle); stroke-width: 1; }
.graphe .axe { fill: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.graphe .etiquette { font-size: 12px; font-weight: 650; }
.graphe .etiquette.gris { fill: var(--faint); }
.charte { fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-dasharray: 5 5; }
.legende { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legende span { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 800px) { .comparer { grid-template-columns: 1fr; } .comparer aside { position: static; } .bat-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ================= Gestion : mode sombre automatique ================= */
@media (prefers-color-scheme: dark) {
  body.gest { --bg: #0E0E10; --surface: #17171A; --subtle: #1F1F23; --hover: #1C1C20; --line: #2A2A2F; --line-2: #3A3A40; --text: #EDEDEF; --muted: #A0A0A8; --faint: #6E6E76; --ink: #EDEDEF; --ink-2: #FFFFFF;
    --blue: #56B4E9; --blue-soft: #0F2A3A; --orange: #F08A4B; --orange-mark: #F08A4B; --orange-soft: #33190C; --amber-soft: #2E2410;
    --sh-1: none; --sh-2: 0 8px 24px -8px rgba(0,0,0,.6); --sh-3: 0 24px 64px -16px rgba(0,0,0,.8); }
  body.gest header { background: rgba(14,14,16,.85); }
  body.gest .btn.plein, body.gest .btn.choisi { color: #0E0E10; }
  body.gest .toast { background: #EDEDEF; color: #0E0E10; } body.gest .toast button { background: rgba(0,0,0,.08); color: #0E0E10; }
  body.gest .spark .aire { fill: rgba(237,237,239,.06); }
  body.gest .graphe [stroke="#000000"] { stroke: #EDEDEF; } body.gest .graphe [fill="#000000"] { fill: #EDEDEF; }
  body.gest .bandeau.info { color: #CFE6F5; border-color: #1E4A63; } body.gest .bandeau.alerte { color: #FAD3BD; border-color: #5A2A12; }
  body.gest .marque::before { box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
}

/* ================= Signature, chiffres, squelettes, illustrations ================= */
.num-u, .champ-v .u2 { font-size: .46em; font-weight: 550; color: var(--faint); margin-left: .25em; letter-spacing: 0; align-self: baseline; }
.champ-v { align-items: baseline; }
.kpi b, .bat-kpis b, .calc b, .champ-v b { font-feature-settings: 'tnum', 'cv01', 'cv05'; letter-spacing: -.035em; }
.squelette { position: relative; overflow: hidden; background: var(--subtle); border-radius: 10px; }
.squelette::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: brille 1.3s ease-in-out infinite; }
@keyframes brille { to { transform: translateX(100%); } }
.sq-titre { height: 30px; width: 260px; margin-bottom: 10px; } .sq-ligne { height: 14px; width: 180px; margin-bottom: 28px; }
.sq-alerte { height: 64px; margin-bottom: 8px; border-radius: var(--r); }
.sq-carte { height: 300px; border-radius: var(--r-lg); } .sq-table { height: 420px; border-radius: var(--r-lg); margin-top: 16px; }
.illus { width: 150px; height: 104px; color: var(--line-2); margin: 0 auto 4px; display: block; }
.vide .illus { color: var(--faint); }
.alerte.calme .illus { width: 64px; height: 44px; margin: 0; color: var(--blue); }

/* célébration de fin de journée */
.celebration { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; border-radius: var(--r-lg); background: var(--nuit-soft); border: 1px solid #CDD6E6; color: #15233B; }
.celebration .grand-coche { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #15233B; color: #fff; font-size: 20px; }
.celebration b { font-size: 17px; } .celebration span { display: block; font-size: 14px; color: #3A4A66; margin-top: 2px; }
@media (prefers-reduced-motion: no-preference) { .celebration { animation: entree .5s cubic-bezier(.2,.8,.2,1); } .celebration .grand-coche { animation: rebond .6s .1s cubic-bezier(.3,1.6,.5,1) both; } }
@keyframes rebond { from { transform: scale(.4); opacity: 0; } }

/* écran de veille */
.veille { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; background: #0E1626; color: #F2F4F8; text-align: center; padding: 32px; animation: fondu .4s; cursor: pointer; }
.veille .heure { font-size: 128px; line-height: 1; font-weight: 300; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.veille .bat { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.veille .etats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.veille .etat-v { min-width: 180px; padding: 18px 22px; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); font-size: 20px; font-weight: 600; }
.veille .etat-v small { display: block; font-size: 14px; font-weight: 500; opacity: .6; margin-bottom: 6px; }
.veille .etat-v.ok { border-color: rgba(86,180,233,.6); } .veille .etat-v.non { border-color: rgba(240,138,75,.7); }
.veille .toucher { position: absolute; bottom: 32px; font-size: 15px; opacity: .45; }

/* mode grand (lecture à bout de bras) */
body.grand { font-size: 19px; }
body.grand .champ-v b { font-size: 46px; } body.grand .touche { height: 82px; font-size: 32px; }
body.grand .tuile .titre { font-size: 23px; } body.grand .tuile, body.grand .champ-n, body.grand .touche { border-width: 2px; }
body.grand .titre-jour h1 { font-size: 34px; }

/* transitions partagées (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
::view-transition-group(carte-active) { animation-duration: .34s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }

@media (max-width: 1320px) { body.gest header .qui { display: none; } }
@media (max-width: 1180px) { .recherche { font-size: 0; gap: 0; padding: 0 10px; } .recherche::before { content: '⌕'; font-size: 15px; } .recherche kbd { display: none; } }

/* ---------- aide : bulles, présentation, panneau FAQ ---------- */
.btn-aide { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 16px; cursor: pointer; color: var(--ink); }
.btn-aide:hover { background: var(--nuit-soft); }
body.tab .btn-aide { width: 44px; height: 44px; font-size: 20px; }
.coach { position: fixed; inset: 0; z-index: 200; }
.coach-trou { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 18, 32, .62); transition: all .35s cubic-bezier(.2,.8,.2,1); pointer-events: auto; outline: 3px solid #fff; }
.coach.sans-cible .coach-trou { width: 0 !important; height: 0 !important; left: 50% !important; top: 50% !important; outline: 0; }
.coach-doigt { position: fixed; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid #fff; background: rgba(230, 159, 0, .55); pointer-events: none; transition: all .35s cubic-bezier(.2,.8,.2,1); }
.coach.sans-cible .coach-doigt { display: none; }
.coach-bulle { position: fixed; background: var(--surface); color: var(--text); border-radius: var(--r-lg); padding: 16px 18px 12px; box-shadow: var(--sh-3); transition: top .35s, left .35s; }
.coach-bulle p { margin: 4px 0 10px; font-size: 15px; line-height: 1.45; }
body.tab .coach-bulle p { font-size: 18px; }
.coach-num { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.coach-ex { background: var(--nuit-soft); border-radius: var(--r-sm); padding: 8px 10px; font-size: 14px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.coach-actions { display: flex; gap: 8px; align-items: center; }
.intro { position: fixed; inset: 0; z-index: 210; background: rgba(10, 18, 32, .55); display: grid; place-items: center; padding: 16px; }
.intro-boite { background: var(--surface); border-radius: 20px; max-width: 520px; width: 100%; padding: 24px; box-shadow: var(--sh-3); }
.intro-boite h2 { margin: 12px 0 6px; font-size: 22px; letter-spacing: -.01em; }
.intro-boite p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; font-size: 16px; }
.intro-scene { background: var(--nuit-soft); border-radius: 14px; padding: 12px; }
.intro-points { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.intro-points i { width: 8px; height: 8px; border-radius: 99px; background: var(--line-2); transition: width .25s; }
.intro-points i.on { width: 22px; background: var(--ink); }
.intro.sort, .aide-fond.sort { opacity: 0; transition: opacity .2s; }
.aide-fond { position: fixed; inset: 0; z-index: 150; background: rgba(10, 18, 32, .35); display: flex; justify-content: flex-end; }
.aide-panneau { width: min(440px, 100%); height: 100%; overflow: auto; background: var(--surface); padding: 20px; box-shadow: var(--sh-3); display: flex; flex-direction: column; gap: 12px; }
.aide-q { height: 44px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 14px; font-size: 15px; }
.aide-panneau h3 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.aide-item { border: 1px solid var(--line); border-radius: var(--r); padding: 0 14px; margin-bottom: 8px; }
.aide-item summary { cursor: pointer; padding: 12px 0; font-weight: 550; list-style: none; }
.aide-item summary::before { content: '›'; display: inline-block; width: 16px; transition: transform .2s; color: var(--muted); }
.aide-item[open] summary::before { transform: rotate(90deg); }
.aide-item p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.aide-item .btn { margin-bottom: 12px; }
.aide-revoir { margin-top: auto; }
/* scènes animées */
.scene { width: 100%; height: auto; display: block; }
.sc-cadre { fill: var(--surface); stroke: var(--ink); stroke-width: 3; }
.sc-ligne { fill: var(--line-2); } .sc-tuile { fill: #fff; stroke: var(--line-2); stroke-width: 1.5; }
.sc-coche, .sc-coche-n { fill: var(--blue); font-size: 22px; font-weight: 700; text-anchor: middle; opacity: 0; }
.sc-champ { fill: #fff; stroke: var(--blue); stroke-width: 2; } .sc-chiffres, .sc-tape { font-size: 16px; font-weight: 650; fill: var(--ink); }
.sc-touche { fill: #fff; stroke: var(--line-2); } .sc-ok { fill: var(--ink); } .sc-ok-t { fill: #fff; font-weight: 700; font-size: 13px; }
.sc-avis { fill: var(--amber-soft); stroke: var(--amber); } .sc-avis-t { font-size: 11px; font-weight: 600; fill: #7a5200; }
.sc-nuage { fill: #fff; stroke: var(--ink); stroke-width: 3; } .sc-p { fill: var(--amber); } .sc-legende { font-size: 11px; fill: var(--muted); }
.sc-courbe { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 400; } .sc-courbe.d2 { stroke: var(--orange-mark); stroke-dasharray: 6 5; }
.sc-charte { fill: none; stroke: var(--faint); stroke-width: 2; stroke-dasharray: 3 4; } .sc-axe { stroke: var(--line-2); stroke-width: 2; }
.sc-alerte { fill: var(--amber-soft); } .sc-reponse { fill: #fff; stroke: var(--line-2); }
@media (prefers-reduced-motion: no-preference) {
  .coach-bulle.apparait { animation: bulle .32s cubic-bezier(.2,.9,.3,1.3); }
  .coach-doigt { animation: doigt 1.3s ease-in-out infinite; }
  .intro-boite { animation: entree .35s cubic-bezier(.2,.8,.2,1); }
  .aide-panneau { animation: glisse-g .28s cubic-bezier(.2,.8,.2,1); }
  .sc-tuile { animation: pulse-t 4s infinite; } .sc-tuile.t2 { animation-delay: 1s; } .sc-tuile.t3 { animation-delay: 2s; } .sc-tuile.t4 { animation-delay: 3s; }
  .sc-coche { animation: coche-sc 4s infinite; } .c2 { animation-delay: 1s !important; } .c3 { animation-delay: 2s !important; } .c4 { animation-delay: 3s !important; }
  .sc-chiffres { animation: tape 3s steps(4) infinite; clip-path: inset(0 100% 0 0); }
  .sc-touche { animation: touche 3s infinite; } .k1 { animation-delay: .4s; } .k5 { animation-delay: .9s; } .k3 { animation-delay: 1.4s; } .k7 { animation-delay: 1.9s; }
  .sc-ok { animation: touche 3s 2.4s infinite; } .sc-avis, .sc-avis-t { animation: apparait 3s infinite; }
  .sc-p { animation: paquet 2.4s infinite; } .p2 { animation-delay: .8s; } .p3 { animation-delay: 1.6s; } .sc-coche-n { animation: apparait 2.4s 1s infinite; }
  .sc-courbe { animation: trace 3.5s infinite; } .sc-courbe.long { stroke-dasharray: 400; } .sc-courbe.d2 { animation: none; }
  .sc-alerte { animation: apparait 3s infinite; } .sc-alerte.a2 { animation-delay: .6s; }
  .sc-tape { animation: tape 3s steps(26) infinite; clip-path: inset(0 100% 0 0); } .sc-ligne.l1, .sc-ligne.l2, .sc-ligne.l3 { animation: apparait 3s 1.5s infinite; transform-box: fill-box; }
}
@keyframes bulle { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes doigt { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .55; } }
@keyframes glisse-g { from { transform: translateX(40px); opacity: 0; } }
@keyframes pulse-t { 0%, 20% { fill: #fff; } 25%, 100% { fill: var(--blue-soft); } }
@keyframes coche-sc { 0%, 22% { opacity: 0; transform: scale(.4); } 28%, 92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes tape { 0% { clip-path: inset(0 100% 0 0); } 60%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes touche { 0%, 8% { fill: #fff; } 4% { fill: var(--blue-soft); } }
@keyframes apparait { 0%, 30% { opacity: 0; } 40%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes paquet { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 80% { transform: translateX(50px); opacity: 1; } 100% { transform: translateX(56px); opacity: 0; } }
@keyframes trace { 0% { stroke-dashoffset: 400; } 60%, 100% { stroke-dashoffset: 0; } }

/* ---------- gestion : barre du bas (cellulaire), lot à onglets, sélecteur, vivant ---------- */
.barre-bas { display: none; }
@media (max-width: 760px) {
  body.gest header nav { display: none; }
  body.gest main { padding-bottom: 92px; }
  .barre-bas { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .barre-bas a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 550; padding: 4px 0; border-radius: 10px; }
  .barre-bas a i { font-style: normal; font-size: 20px; line-height: 24px; }
  .barre-bas a.actif { color: var(--ink); background: var(--nuit-soft); }
  .barre-bas .pastille-n { position: absolute; }
}
.selecteur-bat { height: 34px; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 12px; background: var(--surface); font-size: 13px; font-weight: 550; max-width: 200px; }
.vivant { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.vivant::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: var(--blue); }
.vivant.hors::before { background: var(--amber); }
@media (prefers-reduced-motion: no-preference) { .vivant.frais::before { animation: doigt 1s 2; } }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 18px; overflow-x: auto; }
.onglets a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 550; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.onglets a.actif { color: var(--text); border-bottom-color: var(--ink); }
.taches { display: grid; gap: 8px; margin-bottom: 18px; }
.tache { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; text-decoration: none; cursor: pointer; text-align: left; width: 100%; }
.tache .t-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--nuit-soft); color: var(--ink); font-weight: 700; flex: none; }
.tache b { display: block; font-size: 14px; } .tache span.mini { display: block; }
.flux { display: grid; gap: 2px; }
.flux-jour { margin: 18px 0 6px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.evt { display: flex; gap: 12px; padding: 10px 12px; border-radius: var(--r); align-items: flex-start; }
.evt:hover { background: var(--hover); }
.evt .avatar { flex: none; width: 32px; height: 32px; font-size: 12px; }
.evt p { margin: 0; line-height: 1.45; font-size: 14px; } .evt .chg { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.evt .quand { margin-left: auto; font-size: 12px; color: var(--faint); white-space: nowrap; }
table.edition td input { width: 100%; min-width: 56px; height: 30px; border: 1px solid transparent; background: transparent; text-align: right; padding: 0 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
table.edition td input:hover { border-color: var(--line-2); }
table.edition td input:focus { outline: 2px solid var(--blue); background: #fff; }
table.edition td input.change { background: var(--amber-soft); border-color: var(--amber); }
.barre-edition { position: sticky; bottom: 12px; display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; border-radius: var(--r); padding: 10px 14px; box-shadow: var(--sh-3); margin-top: 12px; }
@media (max-width: 760px) { .barre-edition { bottom: 84px; } }
.barre-edition .btn { background: #fff; color: var(--ink); }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
/* tablette : tournée */
.tournee-barre { display: flex; align-items: center; gap: 10px; background: var(--nuit-soft); border-radius: var(--r); padding: 10px 14px; margin-bottom: 12px; font-weight: 600; }
.tournee-barre .pas { display: flex; gap: 4px; } .tournee-barre .pas i { width: 22px; height: 6px; border-radius: 3px; background: var(--line-2); } .tournee-barre .pas i.fait { background: var(--blue); } .tournee-barre .pas i.ici { background: var(--ink); }
.btn-tournee { width: 100%; justify-content: center; min-height: 64px; font-size: 20px; margin: 6px 0 18px; }
.recap td, .recap th { font-size: 17px; }
/* en-tête de gestion plus compact */
body.gest header { gap: 8px 12px; }
body.gest header .lien-qui .qui { display: none; }
.selecteur-bat { max-width: 170px; }
@media (max-width: 1500px) { body.gest .recherche { font-size: 0; gap: 0; padding: 0 10px; } body.gest .recherche::before { content: '⌕'; font-size: 15px; } body.gest .recherche kbd { display: none; } }
@media (max-width: 760px) { body.gest #vtab { display: none; } .selecteur-bat { flex: 1; max-width: none; } body.gest header { padding: 8px 14px; } }
.coach-doigt { background: transparent; border-color: var(--amber); border-width: 3px; width: 44px; height: 44px; margin: -22px 0 0 -22px; }
body.gest main select:not(.selecteur-bat) { height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 10px; background: var(--surface); font-size: 14px; }

/* ---------- Nido, le poussin ---------- */
.piou { position: fixed; right: 16px; bottom: calc(var(--bas, 18px) + env(safe-area-inset-bottom)); z-index: 120; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; }
@media (max-width: 760px) { body.gest .piou { bottom: calc(86px + env(safe-area-inset-bottom)); right: 10px; } }
body.tab .piou { bottom: 100px; }
.piou-btn { pointer-events: auto; width: 76px; height: 76px; border: 0; background: none; padding: 0; cursor: pointer; }
body.tab .piou-btn { width: 92px; height: 92px; }
.piou-bulle { pointer-events: auto; position: relative; max-width: min(320px, calc(100vw - 120px)); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px 16px 4px 16px; padding: 12px 30px 12px 14px; box-shadow: var(--sh-3); margin-bottom: 40px; }
.piou-bulle p { margin: 0; font-size: 14.5px; line-height: 1.45; }
body.tab .piou-bulle p { font-size: 17px; }
.piou-bulle::after { content: ''; position: absolute; right: -8px; bottom: 10px; width: 14px; height: 14px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(-45deg); }
.piou-x { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.piou-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.piou-svg { width: 100%; height: 100%; overflow: visible; }
.p-corps, .p-tete { fill: #F7C948; stroke: #15233B; stroke-width: 2.5; }
.p-ventre { fill: #FBE29A; } .p-aile { fill: #EDB52E; stroke: #15233B; stroke-width: 2.2; stroke-linejoin: round; }
.p-houppe { fill: #F7C948; stroke: #15233B; stroke-width: 2; stroke-linejoin: round; }
.p-yeux ellipse { fill: #15233B; } .p-reflet { fill: #fff; }
.p-yeux-fermes { fill: none; stroke: #15233B; stroke-width: 2.5; stroke-linecap: round; opacity: 0; }
.p-bec { fill: #E67E22; stroke: #15233B; stroke-width: 1.8; stroke-linejoin: round; }
.p-joue { fill: #F2A07B; opacity: .7; } .p-pattes path { stroke: #E67E22; stroke-width: 3; stroke-linecap: round; fill: none; }
.p-ombre { fill: rgba(17, 17, 19, .12); } .p-zzz, .p-point { font: 700 14px Inter, sans-serif; fill: #15233B; opacity: 0; }
.p-corps-g, .p-aile, .p-yeux { transform-box: fill-box; }
.p-aile.g { transform-origin: 90% 20%; } .p-aile.d { transform-origin: 10% 20%; }
.p-yeux { transform-origin: center; }
[data-humeur="dort"] .p-yeux { opacity: 0; } [data-humeur="dort"] .p-yeux-fermes { opacity: 1; } [data-humeur="dort"] .p-zzz { opacity: 1; }
[data-humeur="surpris"] .p-point { opacity: 1; } [data-humeur="surpris"] .p-yeux { transform: scale(1.25); }
[data-humeur="content"] .p-yeux { opacity: 0; } [data-humeur="content"] .p-yeux-fermes { opacity: 1; transform: scaleY(-1); transform-box: fill-box; transform-origin: center; }
.coach-piou { position: fixed; width: 64px; height: 64px; z-index: 2; pointer-events: none; transition: top .35s cubic-bezier(.2,.8,.2,1), left .35s cubic-bezier(.2,.8,.2,1); }
body.tab .coach-piou { width: 78px; height: 78px; }
.intro-piou { width: 74px; height: 74px; margin: -60px auto 6px; }
.aide-piou { display: flex; gap: 12px; align-items: center; background: var(--nuit-soft); border-radius: var(--r); padding: 10px 12px; }
.aide-piou-img { width: 56px; height: 56px; flex: none; } .aide-piou p { margin: 0; font-size: 14px; line-height: 1.4; }
@media (prefers-reduced-motion: no-preference) {
  .piou .p-corps-g, .aide-piou-img .p-corps-g { animation: piou-respire 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
  .piou-svg .p-yeux { animation: piou-cligne 4.6s infinite; }
  [data-humeur="parle"] .p-aile.g { animation: piou-aile-g .5s ease-in-out 3; } [data-humeur="parle"] .p-aile.d { animation: piou-aile-d .5s ease-in-out 3; }
  [data-humeur="parle"] .p-bec { animation: piou-bec .3s ease-in-out 6; transform-box: fill-box; transform-origin: top; }
  [data-humeur="content"] .p-aile.g { animation: piou-aile-g .35s ease-in-out 6; } [data-humeur="content"] .p-aile.d { animation: piou-aile-d .35s ease-in-out 6; }
  [data-humeur="dort"] .p-zzz { animation: piou-zzz 2.4s infinite; } [data-humeur="dort"] .p-zzz.z2 { animation-delay: 1.2s; }
  .saute .piou-svg, .coach-piou.saute .piou-svg { animation: piou-saut .55s cubic-bezier(.3,1.6,.5,1); }
  .intro-piou .piou-svg { animation: piou-saut .6s .1s cubic-bezier(.3,1.6,.5,1) both; }
  .piou-bulle.apparait { animation: bulle .3s cubic-bezier(.2,.9,.3,1.3); transform-origin: 100% 100%; }
}
@keyframes piou-respire { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
@keyframes piou-cligne { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes piou-aile-g { 50% { transform: rotate(-28deg); } } @keyframes piou-aile-d { 50% { transform: rotate(28deg); } }
@keyframes piou-bec { 50% { transform: scaleY(.6); } }
@keyframes piou-saut { 0% { transform: translateY(0); } 40% { transform: translateY(-18px) rotate(-4deg); } 70% { transform: translateY(0) scale(1.06, .94); } 100% { transform: none; } }
@keyframes piou-zzz { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.coach-doigt { display: none; }
body.tab.en-saisie .piou { right: auto; left: 12px; bottom: 96px; flex-direction: row-reverse; }
body.tab.en-saisie .piou-btn { width: 68px; height: 68px; }
body.tab.en-saisie .piou-bulle { border-radius: 16px 16px 16px 4px; }
body.tab.en-saisie .piou-bulle::after { right: auto; left: -8px; transform: rotate(135deg); }

/* ---------- panneau d'aide : lisible, sections marquées ---------- */
.aide-panneau { background: var(--subtle); gap: 10px; }
.aide-panneau > .rang h2 { font-size: 22px; }
.aide-q { background: var(--surface); border: 2px solid var(--line-2); }
.aide-q:focus { outline: none; border-color: var(--ink); }
.aide-panneau h3 { margin: 16px 0 6px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.aide-item { background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--ink); border-radius: var(--r); padding: 0 14px; margin-bottom: 8px; box-shadow: var(--sh-1); }
.aide-item summary { display: flex; align-items: center; gap: 10px; padding: 14px 0; font-weight: 650; font-size: 15px; color: var(--text); text-transform: none; letter-spacing: 0; }
.aide-item summary::-webkit-details-marker { display: none; }
.aide-item summary::before { content: '?'; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--nuit-soft); color: var(--ink); font-size: 14px; font-weight: 800; transform: none !important; }
.aide-item summary::after { content: '›'; margin-left: auto; font-size: 22px; color: var(--ink); transition: transform .2s; }
.aide-item[open] summary::after { transform: rotate(90deg); }
.aide-item[open] { border-left-color: var(--blue); }
.aide-item[open] summary::before { content: '✓'; background: var(--blue); color: #fff; }
.aide-item p { color: var(--text); font-size: 15px; line-height: 1.5; margin: 0 0 12px; padding-left: 36px; }
.aide-item .btn { margin: 0 0 14px 36px; }
.aide-panneau .interrupteur { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; font-weight: 600; }
.aide-piou { background: var(--surface); border: 1px solid var(--line-2); }
body.tab .aide-panneau { width: min(560px, 100%); }
body.tab .aide-item summary { font-size: 18px; padding: 16px 0; }
body.tab .aide-item p { font-size: 17px; }
body.tab .aide-panneau h3 { font-size: 15px; }
body.tab .aide-q { height: 52px; font-size: 18px; }
body.contraste .aide-item { border-width: 2px; border-color: #000; border-left-width: 6px; }
/* poussin de profil : regarde vers sa bulle */
.p-queue { fill: #EDB52E; stroke: #15233B; stroke-width: 2.2; stroke-linejoin: round; }
.p-flip { transform-box: view-box; transform-origin: 60px 60px; }
body.tab.en-saisie .piou .p-flip, .coach-piou .p-flip { transform: scaleX(-1); }
.p-aile.d { transform-origin: 15% 40%; }
.pastille.formation { background: var(--amber-soft); color: #7a5200; border-color: var(--amber); font-weight: 700; }
.prev-bande { fill: rgba(17, 17, 19, .07); stroke: none; }
.prev-ligne { fill: none; stroke: #111113; stroke-width: 2; stroke-dasharray: 2 4; stroke-linecap: round; }
.prev-pt { fill: #fff; stroke: #111113; stroke-width: 1.5; }
.courriel-ligne { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 4px; }
.apercu-courriel { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; margin: 8px 0; }
.carte-mx details summary { cursor: pointer; margin-top: 6px; }
.obs-photo { max-width: 220px; max-height: 160px; border-radius: var(--r-sm); border: 1px solid var(--line); margin-top: 6px; display: block; object-fit: cover; }
/* rapport de lot */
.rapport { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; margin-top: 12px; }
.rapport h1 { margin: 4px 0; } .rapport h2 { font-size: 16px; margin: 22px 0 8px; }
.r-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.r-kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; } .r-kpi span { display: block; font-size: 12px; color: var(--muted); } .r-kpi b { font-size: 18px; font-variant-numeric: tabular-nums; }
.r-table { width: 100%; border-collapse: collapse; font-size: 13px; } .r-table th, .r-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; } .r-table th:first-child, .r-table td:first-child { text-align: left; }
.r-graphe { margin-top: 18px; }
.rapport footer { margin-top: 18px; }
@media (max-width: 760px) { .r-grille { grid-template-columns: repeat(2, 1fr); } }
@media print {
  header, #barre-bas, .barre-bas, .piou, .onglets, .no-print, #toast, body.gest main > .rang { display: none !important; }
  body, html { background: #fff !important; } main { padding: 0 !important; max-width: none !important; }
  .rapport { border: 0; padding: 0; } .r-kpi { break-inside: avoid; } .r-table tr { break-inside: avoid; }
}
.obs-apercu { max-height: 90px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.aide-action { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--ink); color: #fff; border: 0; border-radius: var(--r); padding: 14px 16px; cursor: pointer; box-shadow: var(--sh-2); }
.aide-action b { display: block; font-size: 16px; } .aide-action span span { display: block; font-size: 13px; opacity: .8; margin-top: 2px; }
.aide-action-ic { width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 15px; }
.aide-action .chevron { margin-left: auto; color: #fff; font-size: 24px; }
body.tab .aide-action b { font-size: 18px; }
.champ-texte { width: 100%; height: 56px; font-size: 20px; border: 2px solid var(--line-2); border-radius: var(--r); padding: 0 14px; }
.champ-texte:focus { outline: none; border-color: var(--ink); }
.verif-avis { display: block; } .verif-avis b { font-weight: 700; }
.verif-ligne { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(194, 65, 12, .25); font-size: 16px; }
body.tab .verif-ligne .btn { min-height: 48px; font-size: 16px; }
@media (prefers-reduced-motion: no-preference) { .secoue { animation: secoue .4s; } }
@keyframes secoue { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
