/* CAPTEUR THS (phase 0, 27/10/2026 ; parcours en quatre écrans au lot 3, même jour) — la page du capteur. Jetons de la
   charte (tokens.css), aucune couleur en dur : clair et sombre suivent `data-theme`. Pensée pour le pouce à 390 px :
   une colonne, des boutons hauts. */

.cap {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: var(--font-size)/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.cap-page {
    box-sizing: border-box;
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
}
.cap-titre { font-size: 1.35rem; margin: 4px 0 8px; }
.cap-sous-titre { font-size: 1.15rem; margin: 0 0 10px; }
.cap-intertitre { font-size: 1rem; margin: 18px 0 6px; }
.cap-texte { color: var(--text-2); margin: 0 0 14px; }

.cap-bloc {
    background: var(--surface);
    border: var(--border-width) solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin: 0 0 14px;
}
.cap-choix {
    border: 0;
    margin: 0 0 12px;
    padding: 0;
}
.cap-choix legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.cap-choix label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border-top: var(--border-width) solid var(--line);
}
.cap-choix input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }

.cap-bouton {
    box-sizing: border-box;
    min-height: 48px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: var(--border-width) solid var(--field-border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.cap-bouton--plein { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cap-bouton[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cap-bouton:disabled { color: var(--text-disabled); background: var(--surface-2); border-color: var(--line); cursor: not-allowed; }
/* Les gestes principaux prennent toute la largeur, sous le pouce. */
.cap-bouton--large { width: 100%; min-height: 52px; margin: 6px 0; }
.cap-rangee { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.cap-rangee .cap-bouton { flex: 1 1 140px; }

.cap-question { margin: 0; font-weight: 600; }
.cap-statut { color: var(--text-2); margin: 8px 0 0; min-height: 1.2em; }
.cap-rebours { font-size: 2rem; font-weight: 700; margin: 0; }
.cap-rebours--grand { font-size: 5rem; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; margin: 12px 0; }
.cap-texte--serre { margin: 10px 0 6px; }
.cap-trace {
    display: block;
    width: 100%;
    height: auto;
    margin: 10px 0 12px;
    border-radius: var(--radius-sm);
    border: var(--border-width) solid var(--line);
}

.cap-alerte {
    border: var(--border-width) solid var(--end);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 10px 12px;
    margin: 0 0 14px;
}
.cap-alerte p { margin: 0; }
.cap-alerte ul { margin: 6px 0 0; padding-left: 20px; }

.cap-table { width: 100%; border-collapse: collapse; }
.cap-table th, .cap-table td {
    text-align: left;
    vertical-align: top;
    padding: 6px 4px;
    border-top: var(--border-width) solid var(--line);
    overflow-wrap: anywhere;
}
.cap-table th { font-weight: 600; color: var(--text-2); width: 45%; }

/* La modale maison (« Recommencer » sur une prise non enregistrée) — jamais un confirm() natif. */
.cap-voile {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--overlay);
}
.cap-voile[hidden] { display: none; }
.cap-modale {
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    color: var(--text);
    border: var(--border-width) solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

/* « Analyser un fichier » : le champ fichier reste dans la page mais se cache ; son libellé fait le bouton. */
.cap-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cap-bouton--fichier { display: flex; align-items: center; justify-content: center; width: 100%; text-align: center; }
.cap-bloc:has(.cap-cache:focus-visible) .cap-bouton--fichier { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Les résultats (lot 2) : deux graphiques SVG, leurs couleurs par les jetons, leur bulle maison. */
.cap-legende { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-2); margin: 0 0 6px; }
.cap-pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-left: 6px; }
.cap-pastille--garde { background: var(--series-1); }
.cap-pastille--rejete { background: var(--warn); }
.cap-graphe { position: relative; margin: 0 0 10px; }
.cap-svg { display: block; max-width: 100%; height: auto; touch-action: pan-y; background: var(--surface-2); border-radius: var(--radius-sm); }
.cap-g-axe { stroke: var(--line-strong); stroke-width: 1; }
.cap-g-grille { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.cap-g-texte { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.cap-g-ligne { fill: none; stroke: var(--series-1); stroke-width: 1.6; stroke-linejoin: round; }
.cap-g-ligne--fine { stroke-width: 1; opacity: 0.5; }
.cap-g-garde { fill: var(--series-1); }
.cap-g-rejete { fill: var(--warn); }
.cap-g-battement { stroke: var(--accent); stroke-width: 1; opacity: 0.35; }
.cap-g-sommet { fill: var(--accent); }
.cap-g-repere { fill: none; stroke: var(--text); stroke-width: 2; }
.cap-bulle {
    position: absolute;
    z-index: 2;
    max-width: 240px;
    padding: 6px 9px;
    border: var(--border-width) solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    pointer-events: none;
}
.cap-bulle[hidden] { display: none; }
.cap-glisse { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.cap-glisse input { width: 100%; min-height: 44px; accent-color: var(--accent); margin: 0; }

/* ① La consigne en trois lignes, les réglages repliés, la phrase sur ce qui est gardé. */
.cap-consigne { margin: 0 0 14px; padding-left: 20px; }
.cap-consigne li { margin: 0 0 4px; }
.cap-replie { margin: 0 0 12px; border-top: var(--border-width) solid var(--line); }
.cap-replie > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    list-style: none;
}
/* Un résumé en `flex` perd son triangle : le chevron le remplace, et dit qu'on peut déplier. */
.cap-replie > summary::-webkit-details-marker { display: none; }
.cap-replie > summary::before {
    content: "›";
    display: inline-block;
    width: 1.2em;
    font-size: 1.3em;
    line-height: 1;
    color: var(--accent);
    transition: transform .15s;
}
.cap-replie[open] > summary::before { transform: rotate(90deg); }
.cap-replie[open] > summary { margin-bottom: 6px; }
.cap-garde { border-left: 3px solid var(--accent); padding-left: 10px; }

/* ② et ③ : l'aperçu en vignette, centré sous l'écran en cours. */
.cap-apercu { display: flex; justify-content: center; margin: 0 0 14px; }
.cap-apercu[hidden] { display: none; }

/* ④ Le résultat : deux tuiles en grand, la ligne de qualité, les trois choix. */
.cap-attente-calcul { font-size: 1.15rem; text-align: center; margin: 18px 0; }
.cap-tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 10px; }
.cap-tuile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    border: var(--border-width) solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.cap-tuile-nom { font-weight: 600; color: var(--text-2); }
.cap-tuile-nombre { font-size: 3.2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.cap-tuile-unite { color: var(--text-2); font-size: 0.95rem; }
.cap-qualite { margin: 0 0 10px; }
.cap-finaux { margin-top: 14px; border-top: var(--border-width) solid var(--line); padding-top: 10px; }
.cap-bouton--compte { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
#cap-calcul-erreur .cap-bouton { margin-top: 10px; }

/* La vidéo reste dans la page (sans quoi iOS ne lui donne pas d'images), en vignette. */
.cap-video {
    display: block;
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
/* (lot 4b, 27/10/2026) Le rangement dans le suivi (`#cap-suivi`) : ses boutons et liens cachés le restent, même quand leur classe
   impose un affichage (`.cap-bouton--compte` est en flex). */
.cap-suivi { margin-top: 14px; border-top: var(--border-width) solid var(--line); padding-top: 10px; }
.cap-suivi [hidden] { display: none; }

/* (lot 7, moteur 0.3, 27/10/2026) L'échelle des durées, la série du résultat, le tableau des fenêtres emboîtées. */
.cap-echelle-duree { font-weight: 600; min-width: 3.6em; }
.cap-echelle-libelle { color: var(--text-2); }
.cap-echelle-note { color: var(--text-2); font-size: .9em; }
.cap-serie { font-weight: 600; margin: 0 0 10px; }
.cap-table--fenetres th { width: auto; }
.cap-table--fenetres thead th { color: var(--text-2); font-weight: 600; }
.cap-table--fenetres td { white-space: nowrap; }
.cap-ligne-serie th, .cap-ligne-serie td { background: var(--surface-2); color: var(--text); }
.cap-tuiles[hidden], .cap-alerte[hidden] { display: none; }

/* (lot finitions, 28/10/2026) Sans compte : « garder cette prise » ou l'invitation, l'une ou l'autre — un lien caché le reste, même
   quand sa classe impose un affichage (`.cap-bouton--compte` est en flex). */
.cap-finaux [hidden] { display: none; }
.cap-garder .cap-garde { margin: 8px 0 0; }

/* (28/10/2026) Le pied de la page : un seul lien, « Comment ça marche ». (L'ancienne page « Méthode » vit dans le gabarit public.) */
.cap-lien-methode { margin: 18px 0 0; text-align: center; }
.cap-lien-methode a { color: var(--accent); }
/* (lot vitrine V1, 29/10/2026) En tête, sans suivi : « ← Retour au site ». Même encre que le lien du pied. */
.cap-retour { margin: 0; }
.cap-retour a { color: var(--accent); }
