/* L'ossature de la coquille et des blocs communs : le rail, la scène, l'en-tête, les panneaux, les boutons, les pastilles, les
   champs, les volets flottants, l'avis, le bandeau du service injoignable. Une seule structure, que Nocturne et Régie habillent par les jetons de charte.css :
   aucune couleur ne s'écrit ici. Le balisage et les classes sont ceux de la maquette (.app, .rail, .scene, .haut, .bouton,
   .pastille, .segment) pour que les vues de la maquette s'y posent telles quelles. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; zoom: var(--t-facteur); background: var(--t-fond); } /* la taille de l'affichage : un seul facteur, posé dans la charte, réglé par appareil (Coquille RG-4) */
body { margin: 0; background: var(--t-fond); color: var(--t-texte); font: var(--t-corps); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--t-focus); outline-offset: 2px; border-radius: 6px; }
.symboles { position: absolute; width: 0; height: 0; } /* les symboles SVG ne prennent aucune ligne dans la page (sinon 22 px, et la scène déborde) */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.discret { color: var(--t-texte-3); font-size: 13px; }

/* ── la coque : le rail à gauche, la scène à droite ── */
.app { display: grid; grid-template-columns: var(--t-rail-largeur) minmax(0, 1fr); min-height: var(--t-hauteur-ecran); background: var(--t-fond-degrade); }
.rail { position: sticky; top: 0; height: var(--t-hauteur-ecran); display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 18px; border-right: 1px solid var(--t-filet); background: var(--t-rail-fond); }
.marque { display: flex; align-items: center; gap: 11px; padding: 0 10px; font: 600 18px/1 var(--t-sans); letter-spacing: -.02em; color: var(--t-marque); }
.marque svg { width: 26px; height: 26px; color: var(--t-marque-signe); }
.marque .point { fill: var(--t-marque-point); }
.rail__nav, .rail__bas, .rail__pied { display: grid; gap: 2px; }
.rail__pied { margin-top: auto; }
/* le bas du menu, comme la maquette : « Thème : Nocturne / Régie » (le réglage des Préférences, à portée de main) et le nom salué de l'appareil */
.rail a.rail__compte { margin-top: 8px; padding-top: 12px; height: auto; border-top: 1px solid var(--t-filet); border-radius: 0; color: var(--t-texte); }
.rail a.rail__compte:hover { background: none; }
.rail__compte .av { width: 26px; height: 26px; font-size: 11px; }
.rail a { display: flex; align-items: center; gap: 12px; height: var(--t-rail-ligne); padding: 0 10px; border-radius: var(--t-rail-rayon); font-weight: 500; font-size: 14px; color: var(--t-rail-texte); }
.rail a:hover { color: var(--t-texte); background: var(--t-rail-survol); }
.rail a[aria-current] { color: var(--t-texte); background: var(--t-rail-courant); box-shadow: var(--t-rail-courant-ombre); }
.rail__mot { padding: 0 10px 8px; font-size: 12.5px; color: var(--t-texte-3); }

.scene { min-width: 0; padding: var(--t-scene-pad); }
.haut { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; margin-bottom: 28px; }
.haut__date { font: 500 12.5px/1 var(--t-mono); color: var(--t-texte-3); }
.haut h1 { margin: 14px 0 12px; font: var(--t-h1); letter-spacing: var(--t-h1-chasse); color: var(--t-h1-couleur); }
.haut__phrase { font: var(--t-sous-titre); color: var(--t-texte-2); letter-spacing: -.005em; max-width: 60ch; }

/* ── les panneaux : un titre, un compte, un corps ── */
.panneaux { display: grid; gap: var(--t-ecart); max-width: 980px; }
.panneau { min-width: 0; border-radius: var(--t-rayon); background: var(--t-surface); box-shadow: var(--t-ombre); }
.panneau__tete { display: flex; align-items: center; gap: 12px; min-height: var(--t-tete-h); padding: var(--t-tete-pad); border-bottom: var(--t-tete-filet); }
.panneau__tete h2 { font: var(--t-titre); letter-spacing: -.01em; color: var(--t-texte); }
.panneau__compte { font-size: 12.5px; color: var(--t-texte-3); }
.panneau__fin { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.panneau__corps { padding: var(--t-corps-pad); display: grid; gap: 18px; }
.panneau__corps h3 { font: 600 13px/1.3 var(--t-sans); letter-spacing: .02em; text-transform: uppercase; color: var(--t-texte-3); margin-top: 6px; }
.note { font-size: 13.5px; line-height: 1.5; color: var(--t-texte-2); max-width: 70ch; }
.note--attention { color: var(--t-attente); }

/* ── les commandes ── */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: var(--t-rayon-p); font: 600 14px/1 var(--t-sans); letter-spacing: -.005em; transition: filter .15s, background .15s; }
.bouton--principal { background: var(--t-plein); color: var(--t-plein-texte); box-shadow: var(--t-plein-ombre); }
.bouton--principal:hover { filter: brightness(1.07); }
.bouton--second { background: var(--t-second); color: var(--t-second-texte); box-shadow: var(--t-second-ombre); }
.bouton--second:hover { background: var(--t-second-survol); }
.bouton:disabled { opacity: .5; cursor: default; filter: none; }
.bouton--petit { height: 32px; padding: 0 12px; font-size: 13px; }
.gestes { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.segment { display: inline-flex; padding: 3px; border-radius: var(--t-rayon-p); background: var(--t-creux); }
.segment button { height: 28px; padding: 0 12px; border: 0; border-radius: calc(var(--t-rayon-p) - 2px); background: none; font: 500 12.5px/1 var(--t-sans); color: var(--t-texte-2); white-space: nowrap; }
.segment button[aria-pressed="true"] { background: var(--t-segment); color: var(--t-texte); box-shadow: var(--t-segment-ombre); }

/* ── les états ── */
.pastille { display: inline-flex; align-items: center; gap: 8px; font: 600 12.5px/1 var(--t-sans); color: var(--t-texte-2); white-space: nowrap; }
.pastille::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pastille--direct { color: var(--t-pastille-direct); }
.pastille--direct::before { background: var(--t-direct); box-shadow: var(--t-pastille-direct-ombre); animation: bat 2s ease-in-out infinite; }
.pastille--attente { color: var(--t-pastille-attente); }
.pastille--attente::before { background: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.pastille--repos { color: var(--t-pastille-repos); }
.pastille--termine { color: var(--t-net); }
.pastille--bloque { color: var(--t-defaut); }
.pastille--avous { height: 24px; padding: 0 10px; border-radius: 12px; background: var(--t-avous-plein); color: var(--t-avous-plein-texte); font-weight: 700; }
.pastille--avous::before { display: none; }
@keyframes bat { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── les champs d'un formulaire ── */
.formulaire { display: grid; gap: 22px; }
.champ { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.champ legend, .champ > label { padding: 0; margin-bottom: 4px; font: 600 13.5px/1.3 var(--t-sans); color: var(--t-texte); }
.champ--ligne { grid-template-columns: 11rem minmax(0, 320px); align-items: center; }
.champ--ligne > label { margin: 0; }
.tuiles-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tuile-choix { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--t-rayon-carte); background: var(--t-carte); box-shadow: var(--t-carte-ombre); cursor: pointer; }
.tuile-choix:hover { background: var(--t-survol); }
.tuile-choix input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tuile-choix:has(input:checked) { background: var(--t-choisi); box-shadow: var(--t-choisi-ombre), inset 0 0 0 1.5px var(--t-coche); }
.tuile-choix:has(input:focus-visible) { outline: 2px solid var(--t-focus); outline-offset: 2px; }
.tuile-choix__coche { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--t-filet-fort); color: var(--t-coche-texte); }
.tuile-choix__coche svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tuile-choix:has(input:checked) .tuile-choix__coche { background: var(--t-coche); box-shadow: none; }
.tuile-choix:has(input:checked) .tuile-choix__coche svg { opacity: 1; }
.tuile-choix b { display: block; font: 600 14px/1.3 var(--t-sans); color: var(--t-texte); }
.tuile-choix small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--t-texte-2); }
.saisie, select.saisie { height: 38px; padding: 0 12px; border: 0; border-radius: var(--t-rayon-p); background: var(--t-champ); box-shadow: var(--t-champ-ombre); color: var(--t-texte); }
.saisie::placeholder { color: var(--t-texte-3); }

/* ── les listes et les tables ── */
.lignes li { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--t-table-filet); font-size: 14px; }
.lignes li:first-child { border-top: 0; }
.lignes li > span:first-child { flex: 1; min-width: 0; }
.lignes small { font-size: 12.5px; color: var(--t-texte-3); }
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; padding: 0 12px 8px 0; font: 600 12px/1.3 var(--t-sans); letter-spacing: .02em; text-transform: uppercase; color: var(--t-texte-3); }
.tableau td { padding: 10px 12px 10px 0; border-top: 1px solid var(--t-table-filet); vertical-align: top; }
.tableau th.nombre, .tableau td.nombre { text-align: right; padding-right: 0; font-family: var(--t-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau td small { display: block; font-size: 12px; color: var(--t-texte-3); }
.total { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.total__mot { font-size: 13.5px; color: var(--t-texte-2); }
.total__valeur { font: var(--t-chiffre); letter-spacing: var(--t-chiffre-chasse); color: var(--t-texte); font-variant-numeric: tabular-nums; }
.code-appairage { font: 500 22px/1 var(--t-mono); letter-spacing: .1em; color: var(--t-code); }
.champ--suite { grid-column: 2; margin-top: -4px; }

/* ── l'abonnement : une jauge par fenêtre ── */
.fenetres { display: grid; gap: 14px; }
.fenetre { display: grid; grid-template-columns: 12rem minmax(120px, 320px) auto; gap: 6px 16px; align-items: center; font-size: 14px; }
.fenetre__nom { font-weight: 600; color: var(--t-texte); }
.fenetre__part { font-family: var(--t-mono); font-variant-numeric: tabular-nums; color: var(--t-texte); }
.fenetre small { grid-column: 2 / -1; font-size: 12.5px; color: var(--t-texte-3); }
.jauge { display: block; height: 8px; border-radius: 4px; background: var(--t-creux); overflow: hidden; }
.jauge i { display: block; height: 100%; border-radius: 4px; background: var(--t-jalon); }
.fenetre--warning .jauge i { background: var(--t-attente); }
.fenetre--rejected .jauge i { background: var(--t-defaut); }
.fenetre--rejected .fenetre__part { color: var(--t-defaut); }
.fenetres--perimees .jauge i { opacity: .3; } /* un relevé de plus de cinq heures ne dit plus le moment (Panneau RG-1) */
.fenetres--perimees .fenetre__nom, .fenetres--perimees .fenetre__part { color: var(--t-texte-3); }
.jauge--35 { width: 35%; }
.jauge--85 { width: 85%; }
.jauge--100 { width: 100%; }

/* ── ce qui s'ouvre à la demande, et l'avis ── */
.flottant { position: absolute; z-index: 40; padding: 10px; border-radius: var(--t-rayon-carte); background: var(--t-flottant); box-shadow: var(--t-flottant-ombre); }
.avis { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translateX(-50%); max-width: min(680px, calc(var(--t-largeur-ecran) - 48px)); padding: 12px 18px; border-radius: var(--t-rayon-carte); background: var(--t-avis-fond); color: var(--t-avis-texte); box-shadow: var(--t-avis-ombre); font: 500 13.5px/1.45 var(--t-sans); }
.avis--defaut { box-shadow: var(--t-avis-ombre), inset 0 0 0 1.5px var(--t-defaut); }
.avis--exemple { position: static; transform: none; display: inline-block; }
.bandeau { position: fixed; top: 0; left: var(--t-rail-largeur); right: 0; z-index: 90; padding: 11px 18px; background: var(--t-avis-fond); color: var(--t-avis-texte); box-shadow: var(--t-avis-ombre), inset 0 -1.5px 0 var(--t-defaut); font: 500 13.5px/1.45 var(--t-sans); text-align: center; } /* le service injoignable, sur toutes les pages (Coquille RG-2) */
.bandeau--exemple { position: static; }
[data-injoignable] .scene[data-page] { padding-top: 62px; } /* la scène descend sous le bandeau : rien n'est couvert */
.porte-volet { position: relative; }
.volet-exemple { top: calc(100% + 6px); left: 0; width: min(480px, 100%); }

/* ── le téléphone (module Accès des appareils, Pages servies RG-9 : l'exception nommée) : choisi par une capacité, tactile et sans
   survol, jamais par une largeur seule ; au poste (pointeur fin), même étroit, rien de ce bloc ne s'applique. Le rail se replie
   derrière un bouton et s'ouvre par-dessus la page ; la scène prend toute la largeur. ── */
.rail__menu { display: none; }
@media (hover: none) and (pointer: coarse) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset: 0 auto 0 0; z-index: 80; width: min(var(--t-rail-largeur), 82vw); height: auto; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--t-flottant-ombre); }
  .app[data-menu-ouvert] .rail { transform: none; }
  .rail { background-color: var(--t-fond); } /* par-dessus la page : opaque, quel que soit le thème (la Nocturne le voile) */
  .rail .marque { padding-left: 52px; }
  .rail .marque svg { display: none; } /* la marque est sur le bouton, juste à côté */
  .rail__menu { position: fixed; top: 12px; left: 12px; z-index: 85; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--t-rayon-p); background: var(--t-second); color: var(--t-second-texte); box-shadow: var(--t-second-ombre); }
  .rail__menu .ic { width: 24px; height: 24px; color: var(--t-marque-signe); }
  .rail__menu .point { fill: var(--t-marque-point); }
  .scene { padding: 68px 14px 24px; }
  .haut { margin-bottom: 18px; }
  .bandeau { left: 0; }
  /* hors du poste, le bandeau dit trois causes et le geste, sur plusieurs lignes : la scène et le bouton du menu descendent d'autant */
  [data-injoignable] .scene[data-page] { padding-top: calc(var(--t-bandeau, 62px) + 12px); }
  [data-injoignable] .rail__menu { top: calc(var(--t-bandeau, 62px) + 12px); }
  /* l'appareil qui attend d'être désigné au poste (remarque 3) : une carte à la place de la page, rien de vide autour */
  .attente-designation { margin-top: 8px; padding: 22px 20px; border-radius: var(--t-rayon); background: var(--t-surface); box-shadow: var(--t-ombre); }
  .attente-designation h2 { margin-bottom: 10px; font: var(--t-titre); color: var(--t-texte); }
  .attente-designation p { font-size: 15px; line-height: 1.55; color: var(--t-texte-2); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
