/* ============================================================
   BLACKTOP ÉQUIPEMENT — Styles de l'application
   Complète css/style.css (palette et polices communes).
   ============================================================ */

:root {
  --ok:         #4C9A5E;
  --surveiller: #D6A93B;
  --remplacer:  #D9544D;
  --surface-2:  #232323;
  --radius-lg:  12px;
}

body { padding-bottom: 80px; }

/* ─── BARRE SUPÉRIEURE ─── */
.app-bar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-bar-inner {
  position: relative;
  max-width: 1100px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
/* Le logo de marque, en image. La signature « RIDE YOUR STYLE » a été retirée
   de cette déclinaison : haute de 27 px sur 259 dans le fichier source, elle
   ne formerait plus qu'une bavure de 4 px à la taille d'une barre. */
.app-logo { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.app-logo img { display: block; height: 34px; width: auto; }
.app-logo .logo-mono { display: none; }
.app-logo small {
  font-family: var(--font-titre); font-size: 9px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--text-dim); font-weight: 500;
  padding-left: 11px; border-left: 1px solid var(--border);
}

/* Sur l'écran de connexion, le logo respire : il est seul en scène. */
.app-logo.est-grand { flex-direction: column; gap: 10px; }
.app-logo.est-grand img { height: 56px; }
.app-logo.est-grand small { padding: 0; border: 0; letter-spacing: 4px; }

/* Écran étroit : le monogramme seul, pour laisser la place au menu. */
@media (max-width: 560px) {
  .app-logo { gap: 9px; }
  .app-logo .logo-complet { display: none; }
  .app-logo .logo-mono { display: block; height: 30px; }
  .app-logo small { padding-left: 9px; font-size: 8px; letter-spacing: 2px; }
}
/* ─── MENU DÉROULANT ───
   La navigation tient derrière un bouton qui porte le nom de la page ouverte :
   il sert à la fois de repère et de commande. Le même comportement partout,
   téléphone comme ordinateur — sept entrées alignées débordaient déjà de la
   barre sur un écran large, et la moindre rubrique ajoutée aggraverait le cas. */
/* Le bouton disait le nom de la page ouverte : à l'essai, il se lisait comme
   un titre et personne n'y voyait une commande. Il dit maintenant « Menu »,
   avec les trois barres que tout le monde reconnaît, et devient « Fermer »
   une fois déplié. La page où l'on se trouve reste indiquée dans la liste. */
.app-menu-btn {
  display: inline-flex; align-items: center; gap: 10px;
  margin-left: auto; min-height: 42px; padding: 0 17px;
  border: 1px solid var(--or); border-radius: 8px;
  background: rgba(200,169,110,.12); color: var(--or); cursor: pointer;
  font-family: var(--font-titre); font-size: 12.5px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase; white-space: nowrap;
  transition: background .15s;
}
.app-menu-btn:hover { background: rgba(200,169,110,.22); }
.app-menu-btn svg {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.app-menu-btn .icone-fermer { display: none; }
.app-bar.menu-ouvert .app-menu-btn .icone-ouvrir { display: none; }
.app-bar.menu-ouvert .app-menu-btn .icone-fermer { display: block; }
.app-bar.menu-ouvert .app-menu-btn { background: var(--or); color: var(--asphalte); }

.app-nav {
  display: none;
  position: absolute; z-index: 110; top: calc(100% + 8px); left: 14px; right: 14px;
  flex-direction: column; align-items: stretch; gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 18px 44px rgba(0,0,0,.6);
}
.app-bar.menu-ouvert .app-nav { display: flex; }
.app-nav a {
  padding: 13px 14px; border-radius: 8px; font-size: 15px; color: var(--text-dim);
  transition: background .15s, color .15s;
}
.app-nav a:hover { background: var(--surface-2); color: var(--text); }
.app-nav a[aria-current="page"] {
  background: var(--surface-2); color: var(--or); font-weight: 600;
}
.app-nav .lien-gestion { color: var(--or); }

/* La déconnexion n'est pas une rubrique : un filet la met à part. */
#btn-deconnexion {
  width: 100%; margin: 7px 0 0; padding-top: 13px;
  border-top: 1px solid var(--border);
}

/* Sur écran large, le panneau n'a aucune raison de traverser toute la barre. */
@media (min-width: 641px) {
  .app-nav { left: auto; right: 24px; width: 290px; }
}

.app-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

/* ─── EN-TÊTE DE PAGE ─── */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 28px;
}
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.page-head p { color: var(--text-dim); font-size: 14px; margin-top: 6px; max-width: 60ch; }

/* ─── CARTES ─── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.card h2 + * { margin-top: 16px; }

.grid { display: grid; gap: 16px; }
.grid-equip { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid-stats  { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* ─── COMPTEURS ─── */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.stat b { font-family: var(--font-titre); font-size: 30px; line-height: 1; display: block; }
.stat span { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.stat.is-ok b         { color: var(--ok); }
.stat.is-surveiller b { color: var(--surveiller); }
.stat.is-remplacer b  { color: var(--remplacer); }

/* ─── PASTILLE DE STATUT ─── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok         { color: var(--ok);         background: rgba(76,154,94,.12); }
.pill-surveiller { color: var(--surveiller); background: rgba(214,169,59,.12); }
.pill-remplacer  { color: var(--remplacer);  background: rgba(217,84,77,.12); }
.pill-retire     { color: var(--text-dim);   background: rgba(163,158,145,.12); }

/* ─── FICHE ÉQUIPEMENT ─── */
.equip {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.equip:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.equip-photo {
  aspect-ratio: 4/3; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; overflow: hidden;
}
.equip-photo img { width: 100%; height: 100%; object-fit: cover; }
.equip-body { padding: 16px; }
.equip-body h3 { font-size: 15px; margin-bottom: 4px; }
.equip-cat { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.equip-reason { font-size: 13px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; }
.equip.is-retire { opacity: .55; }

/* ─── LISTE D'ALERTES ─── */
.alert-list { display: flex; flex-direction: column; }
.alert {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.alert:last-child { border-bottom: 0; }
.alert-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--surveiller); flex: none; }
.alert.is-remplacer .alert-bar { background: var(--remplacer); }
.alert-main { flex: 1; min-width: 0; }
.alert-main b { display: block; font-size: 14px; font-weight: 600; }
.alert-main span { font-size: 12.5px; color: var(--text-dim); }
.alert-when { font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--surveiller); }
.alert.is-remplacer .alert-when, .alert.is-late .alert-when { color: var(--remplacer); }

/* Une échéance à plus d'un mois n'est pas une alerte : elle s'efface.

   Sans cette règle, un contrôle visuel reporté à l'année prochaine gardait
   la barre ambre et le mot « Surveiller » d'une échéance dépassée. Juste
   après un clic sur « C'est fait », la récurrence recrée immédiatement la
   ligne suivante : même titre, même couleur, même bouton, seule la date
   changeait. On avait donc toutes les raisons de croire que le clic
   n'avait rien fait. */
.alert.is-lointain .alert-bar  { background: var(--border); }
.alert.is-lointain .alert-when { color: var(--text-dim); font-weight: 600; }
.alert.is-lointain .alert-main b { font-weight: 500; }

/* ─── LES TROIS GROUPES D'ÉCHÉANCES ───────────────────────
   Ce qui appelle un geste, ce qui viendra, ce qui est fait.

   Les deux derniers sont repliés mais ANNONCÉS : le nombre et la
   date de la prochaine figurent dans l'intitulé, si bien qu'on
   sait ce qu'il y a derrière sans avoir à l'ouvrir. Replier sans
   annoncer reviendrait à cacher. */

.rien-a-faire {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(76,154,94,.35);
  border-radius: 10px;
  background: rgba(76,154,94,.06);
}
.rien-a-faire b    { font-size: 14.5px; color: var(--ok); }
.rien-a-faire span { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

.groupe-echeances > summary {
  cursor: pointer; list-style: none;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 9px;
  transition: border-color .15s;
}
.groupe-echeances > summary::-webkit-details-marker { display: none; }
.groupe-echeances > summary:hover { border-color: var(--border-hover); }
.groupe-echeances > summary b    { font-size: 13.5px; color: var(--text-dim); font-weight: 600; }
.groupe-echeances > summary span { font-size: 12.5px; color: var(--text-dim); opacity: .8; }

/* Ouvert, l'intitulé s'accroche visuellement à son contenu. */
.groupe-echeances[open] > summary { border-color: var(--border-hover); }

/* ─── BOUTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border: 1px solid var(--or); border-radius: 6px;
  background: var(--or); color: var(--asphalte); cursor: pointer;
  font-size: 14px; font-weight: 700; letter-spacing: .5px;
  transition: opacity .15s, background .15s;
}
.btn:hover:not(:disabled) { opacity: .85; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-hover); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); opacity: 1; }
.btn-danger { background: transparent; color: var(--remplacer); border-color: rgba(217,84,77,.4); }
.btn-danger:hover:not(:disabled) { background: rgba(217,84,77,.1); opacity: 1; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── FORMULAIRES ─── */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim); margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-family: inherit; font-size: 15px;
  background: var(--asphalte); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--or);
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── CHECKLIST ─── */
.check {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.check + .check { margin-top: 10px; }
.check:hover { border-color: var(--border-hover); }
.check input { width: 22px; height: 22px; accent-color: var(--or); flex: none; margin-top: 1px; cursor: pointer; }
.check.is-done { border-color: rgba(76,154,94,.45); background: rgba(76,154,94,.06); }
.check b { display: block; font-size: 15px; font-weight: 600; }
.check span { font-size: 13px; color: var(--text-dim); }

/* ─── JOURNAL ─── */
.log { list-style: none; }
.log li { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.log time { font-size: 12px; color: var(--text-dim); width: 118px; flex: none; padding-top: 2px; }
.log p { font-size: 14px; line-height: 1.5; }
.log small { color: var(--text-dim); font-size: 12px; }

/* ─── DIVERS ─── */
.empty { text-align: center; padding: 56px 24px; color: var(--text-dim); }
.empty .icon { font-size: 44px; margin-bottom: 14px; }
.empty p { margin-bottom: 20px; max-width: 44ch; margin-inline: auto; }

.note {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.6;
  border-left: 2px solid var(--border-hover); padding-left: 14px;
}
.source { font-size: 12px; color: var(--text-dim); font-style: italic; line-height: 1.5; }

.suggest {
  margin-top: 14px; padding: 14px; border-radius: 8px;
  background: rgba(200,169,110,.08); border: 1px solid rgba(200,169,110,.25);
  font-size: 13px; line-height: 1.6;
}
.suggest a { color: var(--or); font-weight: 700; }
.suggest code {
  background: var(--asphalte); padding: 2px 7px; border-radius: 4px;
  font-size: 12px; letter-spacing: 1px;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 120%);
  background: var(--surface); border: 1px solid var(--border-hover);
  border-radius: 8px; padding: 14px 22px; font-size: 14px; z-index: 999;
  transition: transform .25s ease; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.show { transform: translate(-50%, 0); }
.toast.is-error { border-color: rgba(217,84,77,.5); color: #ffb4b0; }

.spinner {
  width: 26px; height: 26px; margin: 60px auto; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--or);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.table-files { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-files td { padding: 11px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-files tr:last-child td { border-bottom: 0; }
.table-files .mono { font-family: ui-monospace, monospace; font-size: 11px; color: var(--text-dim); }

@media (max-width: 640px) {
  /* La barre occupait un tiers de l'écran d'un téléphone : on la compacte. */
  .app-bar-inner { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .app-logo { font-size: 14px; letter-spacing: 3px; }
  .app-logo small { font-size: 8px; letter-spacing: 2px; }
  .field-row { grid-template-columns: 1fr; }
  .app-main { padding: 24px 16px; }
  .log li { flex-direction: column; gap: 4px; }
  .log time { width: auto; }
}

/* ============================================================
   COUCHE VISUELLE — silhouette, illustrations, grandes cartes
   ============================================================ */

/* ─── SILHOUETTE ─── */
.silhouette { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }

.silhouette .zone path {
  fill: #181818; stroke: #2C2C2C;
  transition: fill .2s, stroke .2s, filter .2s;
}
.silhouette .zone { cursor: pointer; outline: none; }
.silhouette .zone-ok path         { fill: rgba(76,154,94,.16);  stroke: var(--ok); }
.silhouette .zone-surveiller path { fill: rgba(214,169,59,.16); stroke: var(--surveiller); }
.silhouette .zone-remplacer path  { fill: rgba(217,84,77,.16);  stroke: var(--remplacer); }

.silhouette .zone:hover path,
.silhouette .zone:focus-visible path { filter: brightness(1.45); }
.silhouette .zone:focus-visible path { stroke-width: 4.5; }

/* Une pièce à remplacer bat doucement — impossible de passer à côté. */
.silhouette .zone-remplacer path { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { fill: rgba(217,84,77,.34); } }
@media (prefers-reduced-motion: reduce) { .silhouette .zone-remplacer path { animation: none; } }

.scene {
  background: radial-gradient(ellipse at 50% 36%, #1A1A1A 0%, var(--asphalte) 72%);
  border: 1px solid var(--border); border-radius: 18px; padding: 18px 12px 14px;
}
.scene-legende {
  display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
  margin-top: 12px; font-size: 11px; color: var(--text-dim);
}
.scene-legende b { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.scene-legende i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ─── HÉROS DU TABLEAU DE BORD ─── */
.bilan { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: 24px; align-items: stretch; }
.bilan-droite { display: flex; flex-direction: column; gap: 14px; }

.verdict {
  border-radius: 18px; padding: 26px; border: 1px solid var(--border);
  background: var(--surface); flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.verdict-titre {
  font-family: var(--font-titre); font-size: clamp(1.4rem, 3.6vw, 2rem);
  line-height: 1.15; letter-spacing: .02em;
}
.verdict p { color: var(--text-dim); font-size: 14.5px; margin-top: 10px; line-height: 1.6; }
.verdict .btn { margin-top: 18px; align-self: flex-start; }
.verdict.is-ok         { border-color: rgba(76,154,94,.4);  background: linear-gradient(160deg, rgba(76,154,94,.10), var(--surface) 60%); }
.verdict.is-ok .verdict-titre         { color: var(--ok); }
.verdict.is-surveiller { border-color: rgba(214,169,59,.4); background: linear-gradient(160deg, rgba(214,169,59,.10), var(--surface) 60%); }
.verdict.is-surveiller .verdict-titre { color: var(--surveiller); }
.verdict.is-remplacer  { border-color: rgba(217,84,77,.45); background: linear-gradient(160deg, rgba(217,84,77,.12), var(--surface) 60%); }
.verdict.is-remplacer .verdict-titre  { color: var(--remplacer); }

/* ─── ACTIONS RAPIDES ─── */
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 18px 12px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, transform .15s, background .15s;
}
.action:hover { border-color: var(--or); transform: translateY(-2px); background: var(--surface-2); }
.action svg { color: var(--or); }
.action b { font-size: 13.5px; font-weight: 600; }
.action span { font-size: 11.5px; color: var(--text-dim); }

/* ─── GRANDES CARTES ÉQUIPEMENT ─── */
.grid-gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }

.gear {
  position: relative; display: block; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--border); background: var(--surface);
  transition: transform .18s, border-color .18s;
}
.gear:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.gear.is-remplacer  { border-color: rgba(217,84,77,.45); }
.gear.is-surveiller { border-color: rgba(214,169,59,.4); }

.gear-visuel {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #202020, #131313);
  color: var(--chrome);
}
.gear-visuel img { width: 100%; height: 100%; object-fit: cover; }
.gear.is-ok         .gear-visuel { color: var(--ok); }
.gear.is-surveiller .gear-visuel { color: var(--surveiller); }
.gear.is-remplacer  .gear-visuel { color: var(--remplacer); }

.gear-etiquette { padding: 14px 14px 16px; }
.gear-etiquette h3 { font-size: 14.5px; margin-bottom: 3px; }
.gear-etiquette .cat {
  font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim);
}
.gear-etiquette .motif { font-size: 12px; color: var(--text-dim); margin-top: 8px; line-height: 1.45; }
.gear-point {
  position: absolute; top: 12px; right: 12px; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--asphalte); background: var(--chrome);
}
.gear.is-ok         .gear-point { background: var(--ok); }
.gear.is-surveiller .gear-point { background: var(--surveiller); }
.gear.is-remplacer  .gear-point { background: var(--remplacer); }
.gear.is-retire     { opacity: .45; }

/* Case « ajouter », même gabarit que les autres */
.gear-ajout {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 230px; border: 1.5px dashed var(--border-hover); border-radius: 16px;
  color: var(--text-dim); background: transparent; transition: border-color .15s, color .15s;
}
.gear-ajout:hover { border-color: var(--or); color: var(--or); }
.gear-ajout b { font-size: 13.5px; }

/* ─── CHOIX DE CATÉGORIE ─── */
.chooser { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 14px; }
.chooser button {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 12px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--chrome); cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s, transform .15s, background .15s;
}
.chooser button:hover { border-color: var(--or); color: var(--or); transform: translateY(-3px); background: var(--surface-2); }
.chooser button b { font-size: 13.5px; color: var(--text); font-weight: 600; }

/* ─── TUILES DE CHECKLIST ─── */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.tuile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px 14px 20px; border-radius: 16px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: center; color: var(--chrome);
  transition: border-color .15s, background .15s, transform .12s, color .15s;
}
.tuile:hover { border-color: var(--border-hover); }
.tuile:active { transform: scale(.97); }
.tuile b { font-size: 13.5px; color: var(--text); font-weight: 600; line-height: 1.35; }
.tuile-aide { font-size: 11.5px; color: var(--text-dim); line-height: 1.45; }
.tuile input { position: absolute; opacity: 0; pointer-events: none; }
.tuile:focus-within { border-color: var(--or); }
.tuile.is-done {
  border-color: var(--ok); background: linear-gradient(160deg, rgba(76,154,94,.14), var(--surface) 70%);
  color: var(--ok);
}
.tuile-coche {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border-hover); display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent; font-weight: 700;
}
.tuile.is-done .tuile-coche { background: var(--ok); border-color: var(--ok); color: var(--asphalte); }

/* ─── ANNEAU ─── */
.anneau-bloc { position: relative; display: inline-grid; place-items: center; }
.anneau-bloc .anneau { grid-area: 1/1; }
.anneau-valeur {
  grid-area: 1/1; text-align: center; font-family: var(--font-titre);
  font-size: 24px; font-weight: 800; line-height: 1;
}
.anneau-valeur small {
  display: block; font-size: 9.5px; letter-spacing: 1.2px; color: var(--text-dim);
  margin-top: 5px; font-weight: 500; text-transform: uppercase;
}

/* ─── DÉTAIL REPLIÉ ─── */
.pourquoi { margin-top: 12px; }
.pourquoi summary {
  cursor: pointer; font-size: 12.5px; color: var(--text-dim); list-style: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.pourquoi summary::-webkit-details-marker { display: none; }
.pourquoi summary::after { content: '\203A'; transition: transform .15s; display: inline-block; }
.pourquoi[open] summary::after { transform: rotate(90deg); }
.pourquoi p { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-top: 8px; }

/* Un <details> fermé masque son contenu via la feuille du navigateur, que toute
   règle d'auteur posant display (ici .field-row en grid) écrase. On le rétablit. */
.pourquoi:not([open]) > *:not(summary) { display: none; }

.illu { flex: none; }

/* ─── RAPPELS COMPACTS ─── */
.rappel {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--chrome);
}
.rappel + .rappel { margin-top: 10px; }
.rappel.is-remplacer { border-color: rgba(217,84,77,.4);  color: var(--remplacer); }
.rappel.is-surveiller{ border-color: rgba(214,169,59,.35); color: var(--surveiller); }
.rappel-texte { flex: 1; min-width: 0; }
.rappel-texte b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.rappel-texte span { font-size: 12px; color: var(--text-dim); }
.rappel-delai { font-size: 12.5px; font-weight: 700; white-space: nowrap; }

@media (max-width: 760px) {
  .bilan { grid-template-columns: 1fr; }
  .silhouette { max-width: 200px; }
  .verdict { padding: 22px; }
}

/* ─── FICHE EN LECTURE ───
   Un équipement enregistré se consulte d'abord : ce qu'il reste à faire en
   haut, les informations déclarées ensuite, et rien d'autre à l'écran. */
.fiche-liste {
  display: grid; grid-template-columns: max-content 1fr; gap: 11px 24px;
  font-size: 14.5px; margin-top: 16px;
}
.fiche-liste dt { color: var(--text-dim); }
.fiche-liste dd { margin: 0; color: var(--text); line-height: 1.55; }

@media (max-width: 520px) {
  .fiche-liste { grid-template-columns: 1fr; gap: 0; }
  .fiche-liste dt { margin-top: 14px; font-size: 12.5px; }
  .fiche-liste dt:first-child { margin-top: 0; }
}

/* Un bloc secondaire se replie, pour que la page tienne dans un écran. */
.bloc-repli > summary {
  cursor: pointer; list-style: none;
  font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); font-family: var(--font-titre);
}
.bloc-repli > summary::-webkit-details-marker { display: none; }
.bloc-repli > summary::after { content: ' +'; color: var(--or); }
.bloc-repli[open] > summary::after { content: ' –'; }
.bloc-repli:not([open]) > *:not(summary) { display: none; }

/* Un élément marqué caché doit l'être, quelle que soit la règle d'affichage
   que porte sa classe par ailleurs. */
[hidden] { display: none !important; }

/* Le motif d'un statut se cale sur la pastille en grand écran, et reprend le
   fil de lecture normal dès que la barre passe sous le titre. */
.statut-motif {
  font-size: 13px; line-height: 1.55; color: var(--text-dim);
  margin-top: 8px; max-width: 34ch; text-align: right;
}
@media (max-width: 640px) {
  .statut-motif { text-align: left; max-width: none; }
}

/* Sur écran étroit, une ligne d'échéance s'empile : l'intitulé et sa date en
   premier, les commandes dessous — plutôt que trois colonnes écrasées. */
@media (max-width: 560px) {
  .alert { flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; }
  .alert-main { flex: 1 1 calc(100% - 17px); }
  .alert-when { margin-left: 17px; align-self: center; }
  .alert [data-fait] { margin-left: auto; }
}

/* ─── FRISE CHRONOLOGIQUE ───
   L'axe court de la plus ancienne date connue à la dernière échéance. La part
   vécue est pleine, le reste est creux, et un trait doré marque aujourd'hui. */
.frise { margin-top: 6px; }

.frise-piste {
  position: relative; height: 10px; margin: 46px 12px 0;
  background: var(--surface-2); border-radius: 5px;
}
.frise-vecu {
  position: absolute; top: 0; bottom: 0; left: 0; border-radius: 5px;
  background: linear-gradient(90deg, rgba(200,169,110,.18), rgba(200,169,110,.55));
}
.frise-jour {
  position: absolute; top: -10px; bottom: -10px; width: 2px;
  background: var(--or); border-radius: 1px;
}
.frise-jour::after {
  content: "aujourd'hui";
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .6px; color: var(--or); white-space: nowrap;
}

.frise-point {
  position: absolute; top: 50%; transform: translate(-50%, calc(-50% + var(--dy, 0px)));
  width: 17px; height: 17px; padding: 0; border-radius: 50%;
  border: 2px solid var(--asphalte); background: var(--text-dim);
  display: grid; place-items: center; cursor: pointer;
  font-size: 9px; font-weight: 900; color: var(--asphalte); line-height: 1;
  transition: transform .12s;
}
.frise-point:hover, .frise-point:focus-visible {
  transform: translate(-50%, calc(-50% + var(--dy, 0px))) scale(1.25);
}
.frise-point.est-repere     { background: var(--or); }
.frise-point.est-fait       { background: var(--ok); }
.frise-point.est-chute      { background: var(--remplacer); }
.frise-point.est-surveiller { background: var(--surveiller); }
.frise-point.est-remplacer  { background: var(--remplacer); }
.frise-point.est-fin        { background: var(--text-dim); }
/* Une échéance dépassée porte un halo : elle doit accrocher l'œil. */
.frise-point.est-retard { box-shadow: 0 0 0 5px rgba(217,84,77,.22); }

.frise-info {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: none; z-index: 6; min-width: 112px; max-width: 200px;
  padding: 9px 11px; border-radius: 8px; text-align: center;
  background: var(--surface); border: 1px solid var(--border-hover);
  box-shadow: 0 12px 28px rgba(0,0,0,.55);
  font-size: 11.5px; font-weight: 500; line-height: 1.45; color: var(--text);
  white-space: normal;
}
.frise-info b { display: block; margin-top: 3px; color: var(--text-dim); font-weight: 500; }
.frise-point:hover .frise-info,
.frise-point:focus .frise-info,
.frise-point.est-ouvert .frise-info { display: block; }
.frise-point.est-ouvert { z-index: 7; }
/* Au ras d'un bord, l'infobulle s'aligne vers l'intérieur. */
.frise-point.vers-droite .frise-info { left: 0; transform: none; }
.frise-point.vers-gauche .frise-info { left: auto; right: 0; transform: none; }

.frise-echelle { position: relative; height: 15px; margin: 30px 12px 0; }
.frise-echelle span {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 10.5px; color: var(--text-dim); white-space: nowrap;
}

.frise-legende {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 16px; font-size: 11.5px; color: var(--text-dim);
}
.frise-legende i {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; border-radius: 50%;
  margin-right: 7px; vertical-align: -3px; background: var(--text-dim);
  font-size: 8px; font-weight: 900; line-height: 1; color: var(--asphalte);
}
.frise-legende i.est-repere     { background: var(--or); }
.frise-legende i.est-fait       { background: var(--ok); }
.frise-legende i.est-chute      { background: var(--remplacer); }
.frise-legende i.est-surveiller { background: var(--surveiller); }
.frise-legende i.est-remplacer  { background: var(--remplacer); }

/* ─── INVITE D'INSTALLATION ───
   Discrète, en bas d'écran, refermable une fois pour toutes. */
.invite-install {
  position: fixed; z-index: 200; left: 14px; right: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--or);
  box-shadow: 0 16px 40px rgba(0,0,0,.6);
  transform: translateY(130%); transition: transform .28s ease;
}
.invite-install.est-visible { transform: translateY(0); }
.invite-install img { border-radius: 9px; flex: none; }

.invite-texte { flex: 1; min-width: 0; }
.invite-texte b { display: block; font-size: 14px; }
.invite-texte span {
  display: block; margin-top: 2px; font-size: 12.5px;
  line-height: 1.45; color: var(--text-dim);
}

.invite-fermer {
  flex: none; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--text-dim); font-size: 19px; line-height: 1; cursor: pointer;
}
.invite-fermer:hover { background: var(--surface-2); color: var(--text); }

@media (min-width: 640px) {
  .invite-install { left: auto; width: 420px; right: 24px; bottom: 24px; }
}

/* ─── CHAMP DE MOT DE PASSE : ŒIL DE RELECTURE ─── */
.champ-secret { position: relative; display: block; }
.champ-secret > input { width: 100%; padding-right: 48px; }

.voir-secret {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--text-dim); cursor: pointer;
  transition: color .15s, background .15s;
}
.voir-secret:hover { color: var(--or); background: var(--surface-2); }
.voir-secret svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.champ-secret .oeil-barre { display: none; }
.champ-secret.est-visible .oeil-ouvert { display: none; }
.champ-secret.est-visible .oeil-barre  { display: block; }
.champ-secret.est-visible .voir-secret { color: var(--or); }

/* ─── PAGE « MES ÉQUIPEMENTS » ───
   Une section par type de pièce. Le liseré du titre porte le pire statut de
   la section : on repère la famille qui pose problème sans rien lire. */
.section-categorie + .section-categorie { margin-top: 16px; }
/* La barre est collante : sans cette marge, un defilement vers une section
   ferait passer son titre dessous. */
.section-categorie { scroll-margin-top: 84px; }

.section-titre {
  display: flex; align-items: center; gap: 13px;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.section-titre h2 { flex: 1; min-width: 0; }
.section-visuel { flex: none; display: grid; place-items: center; color: var(--text-dim); }
.section-categorie.is-ok         .section-visuel { color: var(--ok); }
.section-categorie.is-surveiller .section-visuel { color: var(--surveiller); }
.section-categorie.is-remplacer  .section-visuel { color: var(--remplacer); }

.section-compte {
  flex: none; min-width: 24px; height: 24px; padding: 0 7px;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--surface-2); color: var(--text-dim);
  font-size: 12px; font-weight: 700;
}
.section-ajout { flex: none; }

/* Arrivée depuis la silhouette : la section visée s'annonce, puis s'efface. */
.section-categorie.est-visee { border-color: var(--or); }

/* ─── PIÈCES ABSENTES ─── */
.manquants { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.manquant {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 10px;
  border: 1px dashed var(--border-hover); color: var(--text-dim);
  transition: border-color .15s, color .15s;
}
.manquant:hover { border-color: var(--or); color: var(--text); }
.manquant b { flex: 1; font-size: 14px; font-weight: 600; }
.manquant span { font-size: 12px; color: var(--or); }

@media (max-width: 560px) {
  .section-titre { flex-wrap: wrap; gap: 10px; }
  .section-titre h2 { flex: 1 0 auto; }
  /* Le bouton passe a la ligne mais reste discret, cale a droite : repete
     cinq fois, un bouton pleine largeur ecraserait la page. */
  .section-ajout { flex: 0 0 auto; margin-left: auto; }
}

/* ══════════════════════════════════════════════════════════════
   LE DIDACTICIEL
   Un voile sombre, un trou de lumière sur l'élément dont on
   parle, une bulle à côté. Le trou est creusé par une ombre
   portée démesurée plutôt que par un masque : c'est la seule
   technique qui reste nette sur tous les navigateurs, et qui
   laisse l'élément réellement visible dessous.
   ══════════════════════════════════════════════════════════════ */

.didac { position: fixed; inset: 0; z-index: 9000; }

.didac-voile {
  position: absolute; inset: 0;
  background: rgba(10, 10, 10, .78);
  backdrop-filter: blur(1.5px);
  animation: didac-apparait .22s ease-out;
}

.didac-lumiere {
  position: fixed;
  border-radius: 10px;
  /* L'ombre immense EST le voile : le rectangle reste transparent. */
  box-shadow: 0 0 0 9999px rgba(10, 10, 10, .78);
  border: 1.5px solid var(--or, #C8A96E);
  transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease;
  pointer-events: none;
}

/* Quand la lumière est là, le voile plein ferait double emploi : c'est
   l'ombre portée de la lumière qui assombrit déjà tout le reste.
   La classe est posée par le script — un sélecteur de voisinage ne
   pouvait pas marcher, le voile PRÉCÈDE la lumière dans le document. */
.didac.a-cible .didac-voile { background: transparent; backdrop-filter: none; }

.didac-bulle {
  position: fixed;
  width: min(340px, calc(100vw - 24px));
  background: var(--carbone, #1C1C1C);
  border: 1px solid rgba(200, 169, 110, .35);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  animation: didac-monte .24s ease-out;
}

.didac-bulle.est-centree {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.didac-compteur {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--or, #C8A96E); font-weight: 700;
}

.didac-titre {
  margin: 10px 0 8px;
  font-size: 18px; line-height: 1.3; color: var(--titane, #F5F5F3);
}

.didac-texte {
  margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--chrome, #A39E91);
}

.didac-pieds {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 20px;
}

.didac-passer {
  background: none; border: 0; padding: 6px 2px;
  color: var(--chrome, #A39E91); font: inherit; font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.didac-passer:hover { color: var(--titane, #F5F5F3); }

.didac-points { display: flex; gap: 6px; }
.didac-points i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(163, 158, 145, .3);
}
.didac-points i.est-ici { background: var(--or, #C8A96E); width: 18px; border-radius: 3px; }

@keyframes didac-apparait { from { opacity: 0 } to { opacity: 1 } }
@keyframes didac-monte {
  from { opacity: 0; transform: translateY(8px) }
  to   { opacity: 1; transform: translateY(0) }
}
.didac-bulle.est-centree { animation: didac-apparait .24s ease-out; }

/* Une animation qui se déplace sous les yeux gêne plus qu'elle n'aide
   ceux qui l'ont demandé. */
@media (prefers-reduced-motion: reduce) {
  .didac-voile, .didac-bulle, .didac-lumiere { animation: none; transition: none; }
}

/* ── Un réglage isolé, hors formulaire ─────────────────────────
   Les listes déroulantes n'étaient stylées que dans .field : hors
   d'un formulaire, on retombait sur le rendu natif du navigateur,
   illisible sur fond noir. */

.reglage-select {
  background: var(--surface-2, #232323);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.reglage-select:focus { outline: none; border-color: var(--or); }
.reglage-select:disabled { opacity: .45; cursor: default; }

/* .hint vivait uniquement dans .field ; il sert aussi seul. */
.hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }

/* ─── LE RAPPEL DE DÉPART ───────────────────────────────────
   Les jours de la semaine et les dates de sortie. Des pastilles
   plutôt qu'une liste déroulante : on veut voir d'un coup d'œil
   ce qui est coché, et en cocher plusieurs sans rouvrir un menu
   sept fois de suite. */

/* Une grille de sept, et non une rangée souple : à 430 px de large, le
   dernier jour passait seul à la ligne sur toute la largeur. Sept colonnes
   égales tiennent sur une seule ligne quel que soit l'écran. */
.jours-semaine { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.jour-chip {
  padding: 11px 2px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-dim);
  font: inherit; font-size: 13px; font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.jour-chip:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text); }

/* aria-pressed porte l'état : le style suit l'accessibilité, et non l'inverse.
   Une classe en plus se serait désynchronisée le jour où l'une des deux est
   oubliée dans un coin du script. */
.jour-chip[aria-pressed="true"] {
  background: rgba(198,160,74,.14);
  border-color: var(--or);
  color: var(--text);
}
.jour-chip:disabled { opacity: .45; cursor: default; }

.depart-heure { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.depart-heure label { font-size: 14px; color: var(--text-dim); }

/* L'ajout d'une date. En colonne sur téléphone : trois champs côte à côte
   sur 360 px donneraient trois champs illisibles. */
.date-ajout { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.date-ajout .reglage-select { flex: 1 1 130px; min-width: 0; }
.date-ajout input[type="date"] { color-scheme: dark; }
.date-ajout .date-note { flex: 2 1 190px; cursor: text; }

.dates-liste { list-style: none; margin: 16px 0 0; padding: 0; }
.dates-liste li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
}
.dates-liste li + li { margin-top: 8px; }
.dates-liste .quand { font-weight: 600; }
.dates-liste .quoi  { color: var(--text-dim); font-size: 13px; }

/* Une date déjà annoncée reste visible mais s'efface : la retirer d'office
   ferait croire à un oubli de l'application. */
.dates-liste li.est-passee { opacity: .5; }

.dates-liste .retirer {
  margin-left: auto; flex: none;
  width: 30px; height: 30px; line-height: 1;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-dim); font-size: 16px; cursor: pointer;
}
.dates-liste .retirer:hover { border-color: var(--remplacer); color: var(--remplacer); }

@media (max-width: 480px) {
  .date-ajout .reglage-select, .date-ajout .btn { flex: 1 1 100%; }
}

/* ─── LA NOTE EN ÉTOILES ─────────────────────────────
   Les boutons radio restent de VRAIS boutons radio, simplement
   cachés : la note se donne au doigt comme au clavier, et un
   lecteur d'écran annonce « 3 sur 5 ». Une rangée de <div>
   cliquables aurait été plus courte à écrire et inutilisable
   pour qui ne voit pas l'écran.

   La rangée est retournée (row-reverse) et le HTML va de 5 à 1 :
   c'est le seul moyen, en CSS, d'allumer les étoiles JUSQU'À
   celle qu'on désigne — le sélecteur de frères ne regarde
   qu'en avant. */

.note-etoiles {
  display: flex; flex-direction: row-reverse; justify-content: flex-end;
  gap: 4px; margin-top: 18px;
}
.note-etoiles input { position: absolute; opacity: 0; width: 0; height: 0; }

.note-etoiles label {
  font-size: 40px; line-height: 1;
  color: var(--border); cursor: pointer;
  padding: 2px 3px;
  transition: color .12s, transform .12s;
  user-select: none;
}

/* Allumées : celle qui est cochée, et toutes celles qui la suivent
   dans le DOM — c'est-à-dire les plus petites notes. */
.note-etoiles input:checked ~ label,
.note-etoiles label:hover,
.note-etoiles label:hover ~ label { color: var(--or); }

.note-etoiles label:hover { transform: scale(1.08); }

/* Le focus clavier doit se voir : sans cela, naviguer aux flèches
   revient à choisir en aveugle. */
.note-etoiles input:focus-visible + label {
  outline: 2px solid var(--or); outline-offset: 3px; border-radius: 4px;
}

@media (max-width: 420px) {
  .note-etoiles label { font-size: 34px; }
}
