/* BLC Link — feuille de style du site client */
:root {
  --bg: #0a1120;
  --bg-soft: #0d1526;
  --panel: #121c31;
  --panel-2: #16223a;
  --line: #1f2d4a;
  --text: #e9eefb;
  --muted: #a3b2d2;
  --accent: #35b9ff;
  --accent-2: #2ee6a8;
  --accent-soft: rgba(53, 185, 255, .12);
  --ok: #2ee6a8;
  --warn: #ffb454;
  --bad: #ff6b7d;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(2, 8, 20, .45);
  /* Surfaces de verre : redéfinies par le thème clair « plein soleil ». */
  --glass-a: rgba(22, 34, 58, .62);
  --glass-b: rgba(13, 21, 38, .58);
  --glass-border: rgba(151, 182, 236, .13);
  --topbar-bg: rgba(10, 17, 32, .82);
  --drawer-bg: rgba(10, 17, 32, .8);
  --modal-bg: rgba(18, 28, 49, .82);
  --overlay: rgba(4, 9, 18, .55);
  --sheet-bg: rgba(10, 17, 32, .88);
  /* Couleurs de marque : remplacées selon le préfixe du numéro de série. */
  --brand: #2f7de1;
  --brand-2: #46b4ff;
  --brand-soft: rgba(47, 125, 225, .16);
  font-size: 16px;
}

/* BLC : bleu, blanc, noir (défaut) */
[data-brand="blc"], [data-brand=""] {
  --brand: #2f7de1; --brand-2: #46b4ff; --brand-soft: rgba(47, 125, 225, .16);
}
/* Keryon : violet, noir, blanc */
[data-brand="keryon"] {
  --brand: #8a4fd3; --brand-2: #c084fc; --brand-soft: rgba(138, 79, 211, .18);
}
/* Recycle Bike : vert d'eau */
[data-brand="recycle_bike"] {
  --brand: #2fbfa3; --brand-2: #7ce0cd; --brand-soft: rgba(47, 191, 163, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(53, 185, 255, .14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(46, 230, 168, .08), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 60; background: var(--panel); padding: 8px 14px; border-radius: 10px; }

/* --- Fond « verre liquide » : réseau neuronal animé derrière l'interface ------------- */
.aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  opacity: .9; transition: opacity .7s ease;
}
.bg-net { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Sur les écrans de connexion/inscription, le fond s'intensifie pour nourrir le verre. */
body:has(.auth-card) .aurora { opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Barre supérieure ------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-name { font-size: 1.1rem; letter-spacing: .04em; font-weight: 300; white-space: nowrap; }
.brand-name b { font-weight: 700; color: var(--brand-2); transition: color .3s ease; }
.top-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --- Menu latéral (téléphone) ------------------------------------------------------- */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.nav-toggle svg { width: 21px; height: 21px; }
.nav-toggle:active { transform: scale(.94); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: var(--overlay);
  opacity: 0; transition: opacity .28s ease; }
.drawer-backdrop.open { opacity: 1; }
.nav-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(80vw, 320px);
  background: var(--drawer-bg); border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(1.35); -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: -18px 0 40px rgba(0, 0, 0, .35);
  transform: translateX(102%); transition: transform .28s cubic-bezier(.3, .8, .3, 1);
  display: flex; flex-direction: column; }
.nav-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.drawer-nav { display: flex; flex-direction: column; padding: 8px; overflow-y: auto; }
.drawer-nav a, .drawer-nav button { display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 15px 14px; border: 0; border-radius: 12px; background: transparent; color: var(--text);
  font-size: 1rem; text-decoration: none; text-align: left; cursor: pointer;
  transition: background .16s ease, transform .16s ease; }
.drawer-nav a:active, .drawer-nav button:active { background: var(--bg-soft); transform: scale(.98); }
.drawer-nav svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.drawer-user { display: flex; align-items: center; gap: 12px; padding: 14px; margin: 6px 4px 12px;
  border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--line); }
.drawer-avatar { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 700; font-size: 1.05rem; flex: none; }

/* Bouton « Partager » (barre du haut et tiroir) : l'icône se soulève au survol
   et fait un « pop » au clic avant la feuille de partage / la copie du lien. */
#share-btn svg, #drawer-share svg { transition: transform .25s ease; }
#share-btn:hover svg, #drawer-share:hover svg { transform: translateY(-2px); }
svg.share-pop { animation: share-pop .55s cubic-bezier(.3, .8, .3, 1.35); }
@keyframes share-pop {
  30% { transform: translateY(-3px) scale(1.35) rotate(-8deg); }
  55% { transform: translateY(0) scale(.85) rotate(6deg); }
  75% { transform: scale(1.12); }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .top-nav { display: none; }
}

/* --- Boutons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  color: var(--text);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2b8fff 60%, var(--accent-2));
  color: #04101f; box-shadow: 0 8px 24px rgba(53, 185, 255, .28);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--panel); }
.btn-danger { background: transparent; border-color: rgba(255, 107, 125, .45); color: var(--bad); }
.btn-danger:hover { background: rgba(255, 107, 125, .08); }
.btn-small { padding: 7px 14px; font-size: .9rem; border-radius: 10px; }
.btn-full { width: 100%; }
.btn-big { padding: 15px 28px; font-size: 1.08rem; border-radius: 14px; }
.btn[disabled] { opacity: .55; cursor: wait; }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--text); cursor: pointer;
}
.icon-button svg { width: 19px; height: 19px; }
.icon-button:hover { background: var(--panel); }

/* --- Bandeau démo -------------------------------------------------------------- */
.demo-banner {
  padding: 9px clamp(16px, 4vw, 40px);
  background: linear-gradient(90deg, rgba(255, 180, 84, .22), rgba(255, 180, 84, .08));
  border-bottom: 1px solid rgba(255, 180, 84, .45);
  color: #ffdfae; font-size: .92rem; text-align: center; font-weight: 500;
}

/* --- Contenu ------------------------------------------------------------------- */
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 40px); }
.loading { color: var(--muted); padding: 40px; text-align: center; }

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--glass-a), var(--glass-b));
  border: 1px solid rgba(151, 182, 236, .13);
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  padding: 22px;
}
/* Liseré lumineux du verre, commun à toutes les cases. */
.panel::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .07), transparent 30%, transparent 70%, rgba(255, 255, 255, .04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(255, 255, 255, .03);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel { background: linear-gradient(180deg, var(--panel), var(--bg-soft)); border-color: var(--line); }
  .panel::after { display: none; }
}
@media (max-width: 640px) {
  .panel, details.more { backdrop-filter: blur(10px) saturate(1.25); -webkit-backdrop-filter: blur(10px) saturate(1.25); }
}

h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }
h3 { font-size: 1.02rem; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
p { line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* --- Accueil public ---------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 36px; align-items: center; padding: clamp(10px, 3vw, 30px) 0 30px; }
.hero-copy .tag {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 600;
  margin-bottom: 18px;
}
.hero-copy h1 span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-stage { display: flex; justify-content: center; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0; }
.feature { padding: 20px; }
.feature .feature-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 12px;
}
.feature .feature-icon svg { width: 22px; height: 22px; }
.how { margin: 26px 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; padding: 20px 20px 20px 58px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 18px; top: 20px;
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04101f; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* --- Formulaires ------------------------------------------------------------------ */
.form { display: grid; gap: 14px; max-width: 430px; margin: 0 auto; }
.form-wide { max-width: 560px; }
.field label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
  font: inherit;
}
.field input:focus { border-color: var(--accent); outline: none; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.form-error {
  background: rgba(255, 107, 125, .1); border: 1px solid rgba(255, 107, 125, .35);
  color: #ffb3bd; border-radius: 12px; padding: 11px 14px; font-size: .92rem;
}
.form-ok {
  background: rgba(46, 230, 168, .1); border: 1px solid rgba(46, 230, 168, .35);
  color: #a9f5da; border-radius: 12px; padding: 11px 14px; font-size: .92rem;
}
.auth-card { max-width: 480px; margin: 30px auto; }
/* Carte en « verre liquide » : translucide, elle laisse deviner les lueurs du fond. */
.auth-card .panel {
  padding: 30px; position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--glass-a), var(--glass-b));
  border: 1px solid rgba(168, 205, 255, .2);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
}
/* Liseré lumineux sur le pourtour du verre (un peu plus marqué que les autres cases). */
.auth-card .panel::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .1), transparent 28%, transparent 72%, rgba(255, 255, 255, .06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(255, 255, 255, .04);
}
.auth-alt { text-align: center; margin-top: 16px; color: var(--muted); font-size: .92rem; }
.auth-alt a { color: var(--accent); }

/* --- Page de connexion : logo animé + entrées vivantes ------------------------------ */
.auth-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-brand-mark { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px;
  border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 30px rgba(53, 185, 255, .35);
  animation: logo-in .55s cubic-bezier(.3, .8, .3, 1.2) both, logo-float 3.6s ease-in-out .6s infinite; }
.auth-brand-mark svg { width: 34px; height: 34px; }
@keyframes logo-in { from { opacity: 0; transform: translateY(-14px) scale(.7); } }
@keyframes logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.auth-panel { animation: rise .45s ease both .08s; }
.auth-alt { animation: rise .4s ease both .18s; }
.auth-card .field input { transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.auth-card .field input:focus { border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(53, 185, 255, .16); }
.auth-card .btn-full { transition: transform .15s ease, filter .2s ease; }
.auth-card .btn-full:hover { filter: brightness(1.07); }
.auth-card .btn-full:active { transform: scale(.97); }
.auth-forgot { display: block; text-align: center; margin-top: 14px; padding: 10px;
  border-radius: 10px; color: var(--accent); font-size: .92rem; text-decoration: none;
  border: 1px dashed var(--line); transition: background .16s ease, border-color .16s ease; }
.auth-forgot:hover { background: rgba(53, 185, 255, .07); border-color: var(--accent); }
.form-error-hint { margin-top: 8px; }
.form-error-hint a { color: var(--accent); }
.shake { animation: shake .4s ease; }
@keyframes shake {
  20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}

/* --- Jauge à vagues ---------------------------------------------------------------- */
/* inherits: true est INDISPENSABLE : la valeur est posée sur .gauge (racine) et
   consommée par .fill (descendant). Avec false, le liquide reste à 0 %. */
@property --fill { syntax: "<percentage>"; inherits: true; initial-value: 0%; }

.gauge { position: relative; width: 148px; height: 238px; flex: none; display: flex; flex-direction: column; align-items: center; }
.gauge-cap {
  width: 46px; height: 13px; border-radius: 8px 8px 0 0; margin-bottom: -1px; z-index: 1; flex: none;
  background: linear-gradient(180deg, #2f4570, #223250);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .35);
}
.gauge-body {
  position: relative; width: 100%; flex: 1; overflow: hidden;
  border: 4px solid #223250; border-radius: 18px;
  background: radial-gradient(circle at 35% 20%, #1b2a47, #0c1425);
  box-shadow: inset 0 6px 18px rgba(0, 0, 0, .45), 0 0 0 1px rgba(53, 185, 255, .18);
}
/* Animation interne reprise du CodePen « Battery level » (raphael_octau / PButcher) :
   colonne inversée, remplissage en hauteur, 4 couches de vagues « gentle-wave »
   qui défilent en translate(-90px → 85px) à des vitesses différentes. */
.acid {
  position: absolute; inset: 0;
  display: flex; flex-direction: column-reverse;
}
.fill {
  width: 100%; height: var(--fill); flex: none;
  background: linear-gradient(180deg, var(--liquid-hi, #46d4ff), var(--liquid-lo, #2ee6a8));
  transition: height 2s ease-in-out;
}
.waves {
  position: relative; margin-bottom: -1px;
  width: 100%; height: 10px; flex: none;
}
.waves svg { width: 100%; height: 100%; display: block; }
.wave-1 use { animation: move-forever 12s linear infinite; }
.wave-2 use { animation: move-forever 5s linear -2s infinite; }
.wave-3 use { animation: move-forever 3s linear -3s infinite; }
.wave-4 use { animation: move-forever 2s linear -4s infinite; }
@keyframes move-forever {
  0% { transform: translate(-90px, 0); }
  100% { transform: translate(85px, 0); }
}

.gauge-reading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-shadow: 0 2px 10px rgba(3, 10, 22, .85);
}
.gauge-reading .value { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.gauge-reading .value small { font-size: .55em; }
.gauge-reading .unit { font-size: .78rem; color: #d5def2; margin-top: 4px; text-shadow: 0 2px 8px rgba(3, 10, 22, .85); }
.gauge.small { width: 64px; height: 104px; }
.gauge.small .gauge-cap { width: 22px; height: 8px; border-radius: 5px 5px 0 0; }
.gauge.small .gauge-body { border-width: 3px; border-radius: 10px; }
.gauge.small .gauge-reading .value { font-size: 1rem; }
.gauge.small .gauge-reading .unit { display: none; }
.gauge.small .waves { height: 7px; }

.soc-ok { --liquid-hi: var(--brand-2); --liquid-lo: var(--brand); --liquid-top: #9fd8ff; }
.soc-warn { --liquid-hi: #ffc86e; --liquid-lo: #ff9d3f; --liquid-top: #ffe3ae; }
.soc-bad { --liquid-hi: #ff8fa0; --liquid-lo: #ff5d72; --liquid-top: #ffc9d2; }

/* --- Cartes batterie ---------------------------------------------------------------- */
.battery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.battery-card { display: flex; gap: 18px; align-items: center; cursor: pointer; text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease; border-left: 4px solid var(--brand); }
.battery-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.brand-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-2); background: var(--brand-soft);
}
.theft-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; color: #ffd9de;
  background: rgba(255, 93, 114, .18); border: 1px solid rgba(255, 107, 125, .55);
}
.theft-chip svg { width: 13px; height: 13px; }
.theft-chip.live { animation: theft-pulse 1.6s ease-in-out infinite; }
@keyframes theft-pulse { 50% { box-shadow: 0 0 0 5px rgba(255, 93, 114, .16); } }
.battery-card .meta { min-width: 0; flex: 1; }
.battery-card .name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battery-card .serial { color: var(--muted); font-size: .85rem; margin: 3px 0 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--panel-2); color: var(--muted);
}
.badge.ok { color: var(--ok); background: rgba(46, 230, 168, .1); }
.badge.warn { color: var(--warn); background: rgba(255, 180, 84, .1); }
.badge.bad { color: var(--bad); background: rgba(255, 107, 125, .1); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.empty-state { text-align: center; padding: 46px 20px; }
.empty-state .big { font-size: 2.4rem; margin-bottom: 10px; }

/* --- Fiche batterie ------------------------------------------------------------------ */
.battery-hero { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
/* Le verre (backdrop-filter) donne à chaque panneau son propre contexte d'empilement :
   quand le menu d'options est ouvert, il faut élever TOUT le panneau hero au-dessus
   des tuiles de mesures qui suivent, sinon sa bulle z-index 30 reste prisonnière
   du contexte du hero et passe derrière elles. */
.battery-hero:has(.bubble-menu:not([hidden])) { z-index: 20; }
.battery-hero .titles { flex: 1; min-width: 220px; }
.battery-hero .titles .serial { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.measure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.measure { padding: 16px; }
.measure .label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.measure .val { font-size: 1.45rem; font-weight: 700; margin-top: 4px; }
.measure .val small { font-size: .85rem; color: var(--muted); font-weight: 400; }

.section { margin-top: 26px; }
.chart-card svg { width: 100%; height: 190px; }
.chart-empty { color: var(--muted); padding: 30px; text-align: center; }

.cells-list { display: grid; gap: 7px; }
.cell-row { display: grid; grid-template-columns: 64px 1fr 74px; align-items: center; gap: 10px; font-size: .88rem; }
.cell-row .idx { color: var(--muted); font-variant-numeric: tabular-nums; }
.cell-row .bar { height: 9px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.cell-row .bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.cell-row .mv { text-align: right; font-variant-numeric: tabular-nums; }
.cells-summary { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: .88rem; }
.cells-summary b { color: var(--text); }

#battery-map { height: 320px; border-radius: 14px; z-index: 1; }
.map-fallback { padding: 26px; text-align: center; color: var(--muted); }
/* Les SVG du helper icon() n'ont pas de dimensions propres : sans cette
   garde, ils s'affichent à la taille par défaut du navigateur (300×150). */
h3 svg, .badge svg, .map-fallback svg { width: 18px; height: 18px; vertical-align: -3px; }

.event-list { display: grid; gap: 10px; }
.event { display: flex; gap: 12px; padding: 13px 16px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); }
.event .when { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.event .what b { display: block; }
.event .what span { color: var(--muted); font-size: .88rem; }

.timeline { display: grid; gap: 8px; }
.timeline .entry { display: flex; gap: 12px; color: var(--muted); font-size: .9rem; }
.timeline .entry b { color: var(--text); }

.kv-list { display: grid; gap: 9px; }
.kv-list .row { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kv-list .row:last-child { border-bottom: none; }
.kv-list .k { color: var(--muted); }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* --- Compte ---------------------------------------------------------------------------- */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* --- Dialogue (overlay maison, sans <dialog> natif) ------------------------------------ */
.modal-root {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-root[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: min(520px, 100%); max-height: calc(100vh - 60px); overflow-y: auto;
  border: 1px solid rgba(151, 182, 236, .15); border-radius: var(--radius);
  background: var(--modal-bg);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  color: var(--text);
  box-shadow: var(--shadow);
}
.dialog-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.dialog-top h2 { margin: 0; font-size: 1.15rem; }
#dialog-body { padding: 16px 22px 24px; }
#dialog-body .form { margin: 0; }
/* Carte de sélection d'une zone de surveillance, dans la fenêtre d'ajout :
   un clic pose le centre, le rayon s'y dessine en direct. */
.zone-pick-map { height: clamp(180px, 32vh, 260px); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; background: var(--bg-soft); }
.zone-pick-map .leaflet-container { background: var(--bg-soft); }
.transfer-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.7rem; letter-spacing: .14em; text-align: center;
  background: var(--bg-soft); border: 1px dashed var(--accent);
  border-radius: 14px; padding: 18px; margin: 14px 0; color: var(--accent-2);
  user-select: all;
}
.warning-box {
  background: rgba(255, 180, 84, .08); border: 1px solid rgba(255, 180, 84, .3);
  border-radius: 12px; padding: 12px 14px; font-size: .92rem; color: #ffd9a3;
}
.warning-box svg { width: 17px; height: 17px; flex: none;
  vertical-align: -3px; margin-right: 5px; }
/* Icônes enfilées dans une phrase (indices des formulaires, notes sous les
   cartes) : taille du texte, jamais la taille par défaut du SVG. */
.hint svg, p.muted.small svg { width: 14px; height: 14px; vertical-align: -2px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* --- Toast --------------------------------------------------------------------------------- */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 20px; box-shadow: var(--shadow); z-index: 70;
  max-width: min(560px, calc(100vw - 40px)); font-size: .95rem;
}
#toast.error { border-color: rgba(255, 107, 125, .5); }
#toast.success { border-color: rgba(46, 230, 168, .5); }

/* --- Pied de page --------------------------------------------------------------------------- */
.footer {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line);
  color: var(--muted); font-size: .88rem;
}

/* --- Fiche batterie : accent de marque et mode vol ---------------------------------- */
.battery-hero { border-top: 3px solid var(--brand); }
.btn-theft {
  background: transparent; border-color: rgba(255, 107, 125, .5); color: var(--bad);
}
.btn-theft:hover { background: rgba(255, 107, 125, .09); }
.btn-theft.active {
  background: linear-gradient(135deg, #ff5d72, #ff8fa0); color: #2a0510;
  border-color: transparent; animation: theft-pulse 1.6s ease-in-out infinite;
}
.theft-live-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(255, 93, 114, .1); border: 1px solid rgba(255, 107, 125, .45);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; color: #ffd0d7;
}
.theft-live-banner svg { width: 18px; height: 18px; color: #ff8fa0; flex: none; }
.theft-live-banner b { color: #fff; }
.theft-live-banner .spacer { flex: 1; }

/* --- Sections repliables « Voir plus » ------------------------------------------------ */
details.more {
  position: relative;
  background: linear-gradient(180deg, var(--glass-a), var(--glass-b));
  border: 1px solid rgba(151, 182, 236, .13);
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  margin-top: 26px;
  overflow: hidden;
}
details.more::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .07), transparent 30%, transparent 70%, rgba(255, 255, 255, .04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(255, 255, 255, .03);
}
details.more summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary .summary-title {
  display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem;
}
details.more summary .summary-title svg { width: 18px; height: 18px; color: var(--brand-2); }
details.more summary .summary-hint { color: var(--muted); font-size: .88rem; text-align: right; }
details.more summary .toggle {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-2); font-weight: 600; font-size: .9rem;
}
details.more summary .toggle svg { width: 16px; height: 16px; transition: transform .18s ease; }
details.more[open] summary .toggle svg { transform: rotate(90deg); }
details.more .more-body { padding: 0 22px 22px; border-top: 1px dashed var(--line); padding-top: 16px; }
details.more.attention { border-color: rgba(255, 180, 84, .55); }
details.more.attention summary .summary-title { color: var(--warn); }
.badge-attention {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; color: #ffd9a3;
  background: rgba(255, 180, 84, .12); border: 1px solid rgba(255, 180, 84, .4);
}

/* --- Marque blanche : logo dynamique selon la batterie ------------------------------- */
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-2);
  transition: background .3s ease, color .3s ease;
}
.brand-mark svg { width: 17px; height: 17px; }

/* --- Menu d'options en bulle ---------------------------------------------------------- */
.options-wrap { position: relative; }
.bubble-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 230px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 7px;
  animation: bubble-in .18s ease both;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.bubble-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 10px; background: transparent;
  color: var(--text); font: inherit; font-size: .95rem; cursor: pointer; text-align: left;
}
.bubble-menu button svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.bubble-menu button:hover { background: var(--bg-soft); }
.bubble-menu button.danger { color: var(--bad); }
.bubble-menu button.danger svg { color: var(--bad); }
.bubble-menu .separator { height: 1px; background: var(--line); margin: 6px 4px; }

/* Périodes de la courbe de charge (24 h / 48 h / 7 j / 30 j) */
.chart-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; }
.period-tabs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--line); }
.period-tabs button { border: 0; background: transparent; color: var(--muted);
  padding: 4px 10px; border-radius: 8px; font: inherit; font-size: .8rem; cursor: pointer;
  transition: background .16s ease, color .16s ease; }
.period-tabs button:hover { color: var(--text); }
.period-tabs button.active { background: var(--brand); color: #fff; }

/* Santé du parc (administration) */
.health-cat { margin-top: 12px; display: grid; gap: 4px; }
.health-cat > b { font-size: .85rem; color: var(--warn); }
.health-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
  transition: background .16s ease; }
.health-row:hover { background: var(--bg-soft); }
.health-row .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }

/* Sur téléphone, la rangée d'actions passe à la ligne : ancrée au petit bouton
   Options, la bulle sortirait de l'écran. Elle s'ancre au panneau hero bord à
   bord et apparaît juste sous la carte, toujours entière. */
@media (max-width: 820px) {
  .options-wrap { position: static; }
  .bubble-menu { left: 12px; right: 12px; min-width: 0; }
}

/* --- Zones de surveillance ------------------------------------------------------------ */
.zones-list { display: grid; gap: 10px; }
.zone-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.zone-row .zone-name { font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.zone-row .zone-name svg { width: 15px; height: 15px; color: var(--brand-2); }
.zone-row .spacer { flex: 1; }
.zone-row.armed-true .zone-name::after {
  content: "armée"; font-size: .68rem; font-weight: 700; letter-spacing: .05em;
  color: var(--warn); background: rgba(255, 180, 84, .12);
  border: 1px solid rgba(255, 180, 84, .35); border-radius: 999px; padding: 2px 8px;
}
.btn-power-off { color: var(--bad); border-color: rgba(255, 107, 125, .45); }
.btn-power-off:hover { background: rgba(255, 107, 125, .08); }

/* --- Double authentification ---------------------------------------------------------- */
.recovery-codes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem;
  letter-spacing: .08em;
}
.recovery-codes span {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; text-align: center; user-select: all;
}
.text-button { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

/* --- Administration ------------------------------------------------------------------- */
.admin-table-wrap { overflow-x: auto; margin-top: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.admin-table th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--line); }
.admin-table td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr:hover { background: var(--panel-2); }
.field select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font: inherit;
}
.field select:focus { border-color: var(--accent); outline: none; }

/* --- Rapports imprimables --------------------------------------------------------------- */
.report-page {
  background: #fff; color: #16181d; border-radius: var(--radius);
  padding: clamp(20px, 4vw, 44px); box-shadow: var(--shadow);
}
.report-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid #16181d; padding-bottom: 14px; }
.report-brand { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #555; margin-bottom: 8px; }
.report-page h1 { color: #16181d; margin: 0; font-size: 1.6rem; }
.report-sub { color: #555; margin: 4px 0 0; }
.report-meta { color: #555; font-size: .85rem; text-align: right; white-space: nowrap; }
.report-page h2 { color: #16181d; margin: 26px 0 10px; font-size: 1.05rem; border-bottom: 1px solid #ddd; padding-bottom: 6px; }
.report-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.report-table th { text-align: left; color: #555; font-weight: 600; padding: 7px 10px; background: #f2f3f5; border: 1px solid #ddd; }
.report-table td { padding: 7px 10px; border: 1px solid #ddd; }
.report-foot { margin-top: 26px; color: #777; font-size: .78rem; border-top: 1px solid #ddd; padding-top: 10px; }
.report-actions { margin-top: 18px; display: flex; gap: 10px; }
.report-page .muted { color: #666; }
@media print {
  body { background: #fff; }
  .topbar, .demo-banner, .footer, .no-print, #toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .report-page { box-shadow: none; border-radius: 0; padding: 0; }
}

/* --- Animations d'apparition ----------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.view-anim > * { animation: rise .4s ease both; }
.battery-card { animation: rise .45s ease both; }
.battery-card:nth-child(2) { animation-delay: .07s; }
.battery-card:nth-child(3) { animation-delay: .14s; }
.battery-card:nth-child(4) { animation-delay: .21s; }
.battery-card:nth-child(n+5) { animation-delay: .28s; }
.measure-grid .measure { animation: rise .4s ease both; }
.measure-grid .measure:nth-child(2) { animation-delay: .06s; }
.measure-grid .measure:nth-child(3) { animation-delay: .12s; }
.measure-grid .measure:nth-child(4) { animation-delay: .18s; }
.detail-grid .panel, .detail-grid details.more { animation: rise .45s ease both; }
.detail-grid > *:nth-child(2) { animation-delay: .1s; }
details.more { animation: rise .45s ease both .12s; }
.auth-card, .panel.empty-state { animation: rise .4s ease both; }

.modal-card { animation: modal-in .22s cubic-bezier(.3, .8, .3, 1.1) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
#toast { animation: toast-in .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* --- Disposition bureau : deux colonnes pour la fiche -------------------------------- */
.detail-grid { display: grid; gap: 18px; margin-top: 18px; }

@media (min-width: 1000px) {
  main { max-width: 1200px; }
  .detail-grid.two-col { grid-template-columns: 1.25fr 1fr; align-items: start; }
  .detail-grid.two-col > * { min-width: 0; margin-top: 0; }
  .detail-grid.two-col .chart-card, .detail-grid.two-col .panel { margin-top: 0; }
  .detail-grid.two-col > .section, .detail-grid.two-col > details.more { margin-top: 0; }
  .battery-hero { padding: 26px 28px; }
}

/* --- Responsive ------------------------------------------------------------------------------ */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stage { order: -1; }
  .features, .steps { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .battery-hero { gap: 18px; }
}
@media (max-width: 560px) {
  .topbar { padding: 10px 14px; }
  .brand-name { font-size: 1rem; }
  .top-nav .btn { padding: 9px 14px; font-size: .9rem; }
  .gauge { width: 128px; height: 206px; }
  main { padding: 18px 14px 30px; }
}

/* Formulaires admin : deux champs côte à côte (cellules / capacité) */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

/* Carte du parc (administration) */
.pending-list { display: grid; gap: 10px; margin-top: 14px; }
.pending-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.pending-row .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: .95rem; }
.pending-row .spacer { flex: 1; }
.fleet-map { height: 430px; border-radius: 12px; margin-top: 12px; border: 1px solid var(--line);
  z-index: 0; position: relative; }
.fleet-map .leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
/* Note posée sur la carte quand le parc n'a encore aucune position. */
.map-empty-note { position: absolute; z-index: 650; top: 12px; left: 50%; transform: translateX(-50%);
  max-width: min(92%, 540px); text-align: center; pointer-events: none;
  background: var(--sheet-bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; font-size: .85rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
@media (max-width: 700px) { .fleet-map { height: 320px; } }

/* --- Thème clair « plein soleil » --------------------------------------------------
   Bascule depuis la barre du haut (icône soleil) ; préférence mémorisée
   localement. Les surfaces de verre deviennent opaques claires, les textes
   foncés ; la jauge reste sombre comme la batterie réelle. */
[data-theme="light"] {
  --bg: #e9eef8; --bg-soft: #f5f8fd; --panel: #ffffff; --panel-2: #ffffff;
  --line: #c9d5e9; --text: #1b2740; --muted: #56688c;
  --accent-soft: rgba(47, 125, 225, .10);
  --ok: #0f9e73; --warn: #b06f10; --bad: #d64560;
  --shadow: 0 12px 30px rgba(23, 43, 88, .12);
  --glass-a: rgba(255, 255, 255, .82); --glass-b: rgba(243, 247, 253, .74);
  --glass-border: rgba(47, 125, 225, .16);
  --topbar-bg: rgba(255, 255, 255, .88);
  --drawer-bg: rgba(252, 253, 255, .95);
  --modal-bg: rgba(255, 255, 255, .92);
  --overlay: rgba(23, 43, 88, .32);
  --sheet-bg: rgba(255, 255, 255, .94);
}
[data-theme="light"] body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(53, 185, 255, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(46, 230, 168, .07), transparent 55%),
    var(--bg);
}
[data-theme="light"] .aurora { opacity: .5; }
[data-theme="light"] .topbar { border-bottom: 1px solid var(--line); }
[data-theme="light"] .panel { box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .6); }
[data-theme="light"] .panel::after {
  background: linear-gradient(115deg, rgba(47, 125, 225, .05), transparent 30%, transparent 70%, rgba(47, 125, 225, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
[data-theme="light"] .chart-grid { stroke: #d8e1f0; }
[data-theme="light"] .chart-label { fill: #56688c; }
/* Les bandeaux gardent leur teinte mais passent en texte foncé (les couleurs
   inline sont écrasées par !important pour rester lisibles sur fond clair). */
[data-theme="light"] .theft-live-banner { color: #533a2c !important; }
[data-theme="light"] .theft-live-banner b { color: #1b2740; }
[data-theme="light"] .theft-live-banner svg { color: #b06f10; }
[data-theme="light"] .form-error { color: #a3323f; background: rgba(214, 69, 96, .08); border-color: rgba(214, 69, 96, .3); }
[data-theme="light"] .form-ok { color: #177a56; background: rgba(15, 158, 115, .08); border-color: rgba(15, 158, 115, .3); }
[data-theme="light"] .warning-box { color: #6b4a12; background: rgba(176, 111, 16, .08); border-color: rgba(176, 111, 16, .3); }
[data-theme="light"] .auth-brand-mark { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
[data-theme="light"] .skip-link { color: #fff; }

/* --- Cloche des alertes non lues -------------------------------------------------- */
#bell-wrap .btn { position: relative; }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}
#bell-menu button { display: flex; align-items: center; gap: 10px; }
#bell-menu button svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

/* --- Résumé santé de l'espace ------------------------------------------------------ */
.space-health { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; padding: 14px 18px; }
.health-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: rgba(255, 180, 84, .12); border: 1px solid rgba(255, 180, 84, .4); color: var(--warn);
}
.health-chip svg { width: 14px; height: 14px; }
.health-chip.live { background: var(--accent-soft); border-color: var(--brand); color: var(--brand); }

/* Couleurs de la courbe pilotées par le thème (classes posées dans socChart). */
.chart-grid { stroke: #1f2d4a; }
.chart-label { fill: #93a3c4; }

/* --- Étiquette d'activation (impression) --------------------------------------------
   À l'écran : la carte vit dans la fenêtre de dialogue. À l'impression :
   seule l'étiquette sort, aux dimensions d'une étiquette 62 × 40 mm env. */
.label-sheet {
  border: 2px dashed var(--line); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 14px;
}
.label-brand { font-weight: 700; letter-spacing: .08em; font-size: .8rem; text-transform: uppercase; color: var(--muted); }
.label-serial { font-size: 1.25rem; font-weight: 700; letter-spacing: .06em; }
.label-code { font-size: 1.05rem; }
.label-code b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.label-url { font-size: .8rem; color: var(--muted); }
.label-sheet img { border-radius: 8px; }
@media print {
  body.printing-label > *:not(.print-only) { display: none !important; }
  .print-only {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    background: #fff; color: #000; border: 0; margin: 0; padding: 0;
  }
  .print-only * { color: #000 !important; border-color: #000 !important; }
}

/* --- Animations d'interface (compteurs, squelettes, révélations, effervescence) --- */
.skel {
  position: relative; overflow: hidden; border-radius: 8px;
  background: var(--bg-soft); min-height: 10px;
}
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(151, 182, 236, .10), transparent);
  animation: skel-sweep 1.4s ease-in-out infinite;
}
@keyframes skel-sweep { to { transform: translateX(100%); } }

.reveal { opacity: 0; transform: translateY(12px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .45s ease, transform .45s cubic-bezier(.3, .8, .3, 1);
}

/* Effervescence de charge : bulles qui montent dans le liquide. */
.gauge .fill { position: relative; }
.gauge .bub {
  position: absolute; bottom: 6px; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .38); box-shadow: 0 0 4px rgba(255, 255, 255, .25);
  animation: bub-rise linear infinite; opacity: 0;
}
.gauge.small .bub { width: 3px; height: 3px; bottom: 3px; }
@keyframes bub-rise {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: .9; }
  85% { opacity: .7; }
  100% { transform: translateY(-160px) scale(1.15); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skel::after { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .gauge .bub { display: none; }
}

/* --- Pages légales ------------------------------------------------------------------ */
.legal-body h3 { margin: 22px 0 8px; font-size: 1.02rem; }
.legal-body h3:first-child { margin-top: 0; }
.legal-body p, .legal-body li { font-size: .93rem; line-height: 1.65; color: var(--text); }
.legal-body ul { padding-left: 20px; margin: 8px 0; }
.legal-body li { margin: 4px 0; }
.legal-body i { color: var(--muted); }
