/* =========================================================================
   Test Ident — feuille de style
   Direction : manuel de reconnaissance. Olive sombre, laiton, encre papier.
   Titres condensés, données en mono, filets fins, coins de viseur.
   ========================================================================= */

:root {
  --bg: #0e110f;
  --bg-2: #141815;
  --bg-3: #1b201c;
  --bg-4: #232924;
  --line: #2a312b;
  --line-2: #39423a;
  --text: #ebe7db;
  --text-2: #bdbfb3;
  --muted: #858d82;
  --accent: #d9a83e;
  --accent-2: #f0c565;
  --accent-ink: #1a1305;
  --accent-soft: rgba(217, 168, 62, .12);
  --ok: #9ccf72;
  --ok-soft: rgba(156, 207, 114, .14);
  --danger: #e2685a;
  --danger-soft: rgba(226, 104, 90, .12);
  --grid: rgba(235, 231, 219, .035);
  --scrim: rgba(8, 10, 9, .72);

  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-head: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r: 6px;
  --r-lg: 10px;
  --gutter: 16px;
  --nav-h: 64px;
  --rail-w: 88px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 140ms;
  --t: 240ms;
  --t-slow: 420ms;

  /* Zones système : variables injectées par Capacitor (Android), sinon env() du navigateur */
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --sal: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --sar: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}

/* Thème clair (projection en salle, plein jour) */
:root[data-theme="light"] {
  --bg: #efebe0;
  --bg-2: #f7f4ec;
  --bg-3: #e6e1d3;
  --bg-4: #dcd6c5;
  --line: #d3cdbc;
  --line-2: #bdb6a3;
  --text: #1c1f1b;
  --text-2: #3d423b;
  --muted: #6b7068;
  --accent: #9a6a0c;
  --accent-2: #b27d14;
  --accent-ink: #fff8e8;
  --accent-soft: rgba(154, 106, 12, .1);
  --ok: #3f7d2a;
  --ok-soft: rgba(63, 125, 42, .12);
  --danger: #b23a2c;
  --danger-soft: rgba(178, 58, 44, .1);
  --grid: rgba(28, 31, 27, .045);
  --scrim: rgba(28, 31, 27, .5);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15.5px/1.5 var(--f-body);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 .8em; }
h1, h2, h3 {
  font-family: var(--f-head); font-weight: 600; line-height: 1.05;
  letter-spacing: .01em; margin: 0;
}
h1 { font-size: clamp(1.9rem, 4.2vw, 2.6rem); text-transform: uppercase; letter-spacing: .02em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
[hidden] { display: none !important; }
img { -webkit-user-drag: none; }
.mono { font-family: var(--f-mono); font-feature-settings: "zero" 1; }
.muted { color: var(--muted); }
.small { font-size: .86em; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Icônes (sprite SVG) */
.ico { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: -4px; }
.ico.sm { width: 16px; height: 16px; vertical-align: -3px; }
.ico.lg { width: 26px; height: 26px; }

/* Étiquette technique : petit texte mono en capitales */
.kicker {
  font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.kicker.accent { color: var(--accent); }

/* =========================================================================
   Structure : barre du bas (téléphone), rail (tablette), barre latérale (PC)
   ========================================================================= */

.shell { min-height: 100dvh; }

.nav {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--sab));
  padding: 0 calc(var(--sar) + 4px) var(--sab) calc(var(--sal) + 4px);
  display: flex; align-items: stretch;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--line);
}
.nav .brand { display: none; }
.nav a.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-family: var(--f-head); font-weight: 600; font-size: .82rem;
  letter-spacing: .06em; text-transform: uppercase; position: relative;
  transition: color var(--t-fast) var(--ease);
}
.nav a.tab .ico { width: 22px; height: 22px; transition: transform var(--t) var(--ease-out); }
.nav a.tab.active { color: var(--accent); }
.nav a.tab.active .ico { transform: translateY(-1px); }
.nav a.tab::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform var(--t) var(--ease-out);
}
.nav a.tab.active::before { transform: scaleX(1); }

main {
  max-width: 1240px; margin: 0 auto;
  padding: calc(var(--sat) + 18px) calc(var(--sar) + var(--gutter)) calc(var(--nav-h) + var(--sab) + 32px) calc(var(--sal) + var(--gutter));
}

/* Tablette : rail latéral */
@media (min-width: 720px) {
  .nav {
    top: 0; right: auto; width: calc(var(--rail-w) + var(--sal)); height: auto;
    flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: calc(var(--sat) + 14px) 8px calc(var(--sab) + 14px) calc(var(--sal) + 8px);
    border-top: 0; border-right: 1px solid var(--line);
  }
  .nav .brand { display: grid; place-items: center; height: 56px; margin-bottom: 10px; }
  .nav .brand img { width: 34px; height: 34px; }
  .nav .brand span { display: none; }
  .nav a.tab { flex: none; height: 68px; border-radius: var(--r); }
  .nav a.tab:hover { color: var(--text); background: var(--bg-3); }
  .nav a.tab.active { background: var(--accent-soft); }
  .nav a.tab::before { top: 14px; bottom: 14px; left: -8px; right: auto; width: 3px; height: auto; transform: scaleY(0); }
  .nav a.tab.active::before { transform: scaleY(1); }
  main {
    margin-left: calc(var(--rail-w) + var(--sal));
    padding: calc(var(--sat) + 28px) calc(var(--sar) + 28px) calc(var(--sab) + 48px) 28px;
  }
}

/* PC : barre latérale avec libellés */
@media (min-width: 1180px) {
  :root { --rail-w: 220px; }
  .nav { padding-left: calc(var(--sal) + 14px); padding-right: 14px; }
  .nav .brand { display: flex; justify-content: flex-start; gap: 10px; padding: 0 10px; place-items: initial; align-items: center; }
  .nav .brand span { display: inline; font-family: var(--f-head); font-weight: 700; font-size: 1.35rem; letter-spacing: .04em; text-transform: uppercase; }
  .nav a.tab { flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 14px; font-size: .95rem; }
  .nav a.tab::before { top: 10px; bottom: 10px; left: -14px; }
  main { margin-left: calc(var(--rail-w) + var(--sal)); margin-right: auto; padding-left: 40px; padding-right: 40px; }
  .nav .nav-foot { margin-top: auto; padding: 0 12px; }
}
.nav .nav-foot { display: none; }
@media (min-width: 1180px) { .nav .nav-foot { display: block; } }

/* =========================================================================
   En-têtes de page
   ========================================================================= */

.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .titles { display: grid; gap: 6px; min-width: 0; }
.page-head .actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px; color: var(--muted);
  font-family: var(--f-head); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; font-size: .9rem;
  margin-bottom: 10px; padding: 6px 0;
}
.back-link:hover { color: var(--text); }

.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { text-transform: uppercase; letter-spacing: .04em; font-size: 1.2rem; }
.section-head .rule { flex: 1; height: 1px; background: var(--line); min-width: 30px; align-self: center; }

/* =========================================================================
   Boutons, champs, puces
   ========================================================================= */

.btn {
  --b-bg: var(--bg-3); --b-fg: var(--text); --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--b-line); background: var(--b-bg); color: var(--b-fg);
  font: 600 .95rem/1 var(--f-head); letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn.primary { --b-bg: var(--accent); --b-fg: var(--accent-ink); --b-line: var(--accent); }
.btn.primary:hover { --b-bg: var(--accent-2); --b-line: var(--accent-2); }
.btn.ghost { --b-bg: transparent; --b-line: transparent; color: var(--text-2); }
.btn.ghost:hover { --b-bg: var(--bg-3); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { --b-bg: var(--danger-soft); --b-line: var(--danger); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r);
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* Bouton lecture rond */
.play-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none;
  border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  transition: transform var(--t) var(--ease-out), background var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
  box-shadow: 0 0 0 0 var(--accent-soft);
}
.play-btn .ico { width: 20px; height: 20px; margin-left: 2px; fill: currentColor; }
.play-btn:hover { background: var(--accent-2); box-shadow: 0 0 0 6px var(--accent-soft); }
.play-btn:active { transform: scale(.9); }
.play-btn:disabled { background: var(--bg-4); color: var(--muted); box-shadow: none; cursor: default; }

input[type=text], input[type=search], input[type=number], input[type=password], select, textarea {
  font: 400 1rem/1.3 var(--f-body); color: var(--text); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 10px 12px; min-height: 46px; width: 100%;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
input[type=number] { font-family: var(--f-mono); }
textarea { min-height: 110px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

.search {
  position: relative; display: flex; align-items: center;
}
.search .ico { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px; }

label.field { display: grid; gap: 6px; }
label.field > .lbl, .field-lbl {
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
label.field > .hint { font-size: .82rem; color: var(--muted); }
.grid-form { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* Case à cocher sur mesure */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--line-2); background: var(--bg);
  display: inline-grid; place-items: center; cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
input[type=checkbox]::after {
  content: ""; width: 10px; height: 6px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform var(--t-fast) var(--ease-out);
}
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
input[type=checkbox]:indeterminate { background: var(--accent-soft); border-color: var(--accent); }
input[type=checkbox]:indeterminate::after { width: 10px; height: 0; border: 0; border-top: 2px solid var(--accent); transform: none; }
.check { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; min-height: 36px; }

/* Interrupteur */
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; min-height: 48px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative; width: 44px; height: 26px; border-radius: 13px; flex: none;
  background: var(--bg-4); border: 1px solid var(--line-2);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-2); transition: transform var(--t) var(--ease-out), background var(--t) var(--ease);
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Puces / contrôle segmenté */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  border-radius: 999px; padding: 0 14px; min-height: 38px;
  font: 600 .88rem/1 var(--f-head); letter-spacing: .07em; text-transform: uppercase; cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { font-family: var(--f-mono); font-weight: 500; font-size: .78rem; opacity: .65; letter-spacing: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 .7rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--text-2);
}
.badge.local { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.badge.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }

/* Panneau */
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel.pad { padding: 18px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; }
.panel-body { padding: 18px; }

.notice {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; margin-bottom: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); border-radius: var(--r-lg);
}
.notice .ico { color: var(--accent); margin-top: 2px; }
.notice p { margin: 4px 0 12px; color: var(--text-2); }

.empty {
  text-align: center; color: var(--muted); padding: 44px 16px;
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
}
.empty > .ico { width: 30px; height: 30px; margin-bottom: 8px; opacity: .7; }

/* =========================================================================
   Séries
   ========================================================================= */

/* Bandeau d'accueil */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--line);
  padding: 22px 20px; margin-bottom: 30px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(115deg, var(--bg-2), var(--bg-3));
}
.hero .reticle {
  position: absolute; right: -40px; top: 50%; width: 220px; height: 220px; transform: translateY(-50%);
  color: var(--accent); opacity: .16; pointer-events: none;
}
.hero h1 { margin: 8px 0 6px; }
.hero .stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; }
.hero .stat .v { font: 500 1.5rem/1 var(--f-mono); color: var(--text); }
.hero .stat .k { margin-top: 4px; }
.hero .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; position: relative; }

/* Liste de séries (lignes) */
.series-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .series-list.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.series-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t) var(--ease-out);
  position: relative; min-width: 0;
}
.series-row:hover { border-color: var(--line-2); background: var(--bg-3); }
.series-row .dom {
  width: 40px; height: 40px; flex: none; border-radius: var(--r); display: grid; place-items: center;
  background: var(--bg-3); color: var(--accent); border: 1px solid var(--line);
}
.series-row .body { min-width: 0; flex: 1; display: grid; gap: 3px; }
.series-row .name { font: 600 1.12rem/1.15 var(--f-head); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-row .meta { font: 400 .78rem/1.3 var(--f-mono); color: var(--muted); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-row .tools { display: flex; gap: 2px; }
.series-row .desc { font-size: .86rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Groupes repliables */
details.fold { border-top: 1px solid var(--line); }
details.fold:last-child { border-bottom: 1px solid var(--line); }
details.fold > summary {
  display: flex; align-items: center; gap: 12px; padding: 14px 4px; cursor: pointer; list-style: none;
  font: 600 1.1rem/1.1 var(--f-head); letter-spacing: .04em; text-transform: uppercase;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .ico.chev { color: var(--muted); transition: transform var(--t) var(--ease-out); }
details.fold[open] > summary .ico.chev { transform: rotate(90deg); color: var(--accent); }
details.fold > summary .count { margin-left: auto; font: 400 .78rem var(--f-mono); color: var(--muted); letter-spacing: .04em; text-transform: none; }
details.fold > .fold-body { padding: 2px 0 18px; }
details.fold[open] > .fold-body { animation: fold-in var(--t-slow) var(--ease-out); }
@keyframes fold-in { from { opacity: 0; transform: translateY(-6px); } }

/* =========================================================================
   Catalogue
   ========================================================================= */

.filters {
  position: sticky; top: 0; z-index: 5; display: grid; gap: 10px;
  margin: 0 calc(-1 * var(--gutter)) 18px; padding: calc(var(--sat) + 10px) var(--gutter) 12px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) { .filters { margin-left: -28px; margin-right: -28px; padding-left: 28px; padding-right: 28px; } }
.filters .row { flex-wrap: nowrap; }
.filters select { width: auto; max-width: 46%; flex: none; }

.cat-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; } }
.cat-item {
  position: relative; display: block; border-radius: var(--r-lg); overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--line); aspect-ratio: 4 / 3.4;
  transition: transform var(--t) var(--ease-out), border-color var(--t-fast) var(--ease);
}
.cat-item:hover { border-color: var(--line-2); }
.cat-item:active { transform: scale(.975); }
.cat-item .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-item::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(6, 8, 7, .92) 0%, rgba(6, 8, 7, .55) 34%, transparent 62%);
}
.cat-item .info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 10px 11px; display: grid; gap: 3px; color: #f1eee4; }
.cat-item .name { font: 600 1.06rem/1.1 var(--f-head); letter-spacing: .02em; }
.cat-item .sub { font: 400 .7rem/1.3 var(--f-mono); color: rgba(241, 238, 228, .7); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item .count {
  position: absolute; top: 8px; right: 8px; z-index: 1; font: 500 .68rem/1 var(--f-mono);
  padding: 4px 6px; border-radius: 3px; background: rgba(6, 8, 7, .6); color: #f1eee4;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.cat-item .count.local { color: #b5e08f; }
.cat-item.noimg { display: grid; place-items: center; color: var(--muted); }

/* Image qui apparaît en fondu au chargement */
img.fade { opacity: 0; transition: opacity var(--t-slow) var(--ease); }
img.fade.loaded { opacity: 1; }
.shimmer {
  background: linear-gradient(100deg, var(--bg-3) 30%, var(--bg-4) 50%, var(--bg-3) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }

/* Fiche matériel */
.item-hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000;
  aspect-ratio: 16 / 10; max-height: 62vh; width: 100%; margin-bottom: 12px; border: 1px solid var(--line);
}
.item-hero img { width: 100%; height: 100%; object-fit: contain; display: block; }
.strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.strip button { flex: none; width: 108px; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; padding: 0; border: 2px solid transparent; background: var(--bg-3); cursor: pointer; scroll-snap-align: start; transition: border-color var(--t-fast) var(--ease); }
.strip button.on { border-color: var(--accent); }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .item-layout { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; } }
.facts { display: grid; gap: 0; }
.facts .fact { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts .fact:last-child { border-bottom: 0; }
.facts dt { font: 500 .72rem/1.6 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; }

/* Coins de viseur */
.reticle-frame { position: relative; }
.reticle-frame::before, .reticle-frame::after {
  content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none; z-index: 2;
  border: 2px solid var(--accent); opacity: .85;
}
.reticle-frame::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.reticle-frame::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gallery .gimg { position: relative; border-radius: var(--r); overflow: hidden; background: var(--bg-3); aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--t) var(--ease), filter var(--t) var(--ease); }
.gallery .gimg.off img { opacity: .25; filter: grayscale(1); }
.gallery .gimg button {
  position: absolute; top: 6px; right: 6px; border: 0; border-radius: 4px; padding: 5px 8px;
  background: rgba(6, 8, 7, .78); color: #f1eee4; font: 500 .7rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}

.lightbox {
  position: fixed; inset: 0; z-index: 120; background: rgba(4, 5, 4, .96);
  display: grid; place-items: center; cursor: zoom-out; animation: fade-in var(--t) var(--ease);
}
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; animation: zoom-in var(--t-slow) var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.96); } }

/* =========================================================================
   Constructeur de série
   ========================================================================= */

.builder { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .builder { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); align-items: start; } }
.builder .side { display: grid; gap: 14px; }
@media (min-width: 1000px) { .builder .side { position: sticky; top: calc(var(--sat) + 20px); } }

.seg { display: flex; padding: 3px; gap: 3px; border-radius: var(--r); background: var(--bg-3); border: 1px solid var(--line); margin-bottom: 16px; }
.seg button {
  flex: 1; min-height: 40px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer;
  font: 600 .9rem var(--f-head); letter-spacing: .07em; text-transform: uppercase;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg button.on { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
@media (min-width: 1000px) { .seg.mobile-only { display: none; } }
@media (max-width: 999px) { .builder [data-pane][data-hide="1"] { display: none; } }

.tree { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.tree .node { border-bottom: 1px solid var(--line); }
.tree .node:last-child { border-bottom: 0; }
.tree .node-row { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; min-height: 52px; }
.tree .node-row .count { margin-left: auto; font: 400 .76rem var(--f-mono); color: var(--muted); white-space: nowrap; }
.tree .toggle { border: 0; background: none; color: var(--muted); width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; flex: none; border-radius: var(--r); }
.tree .toggle:hover { background: var(--bg-3); color: var(--text); }
.tree .toggle .ico { transition: transform var(--t) var(--ease-out); }
.tree .node.open > .node-row .toggle .ico { transform: rotate(90deg); color: var(--accent); }
.tree .lvl1 > .node-row { font: 600 1.08rem var(--f-head); letter-spacing: .05em; text-transform: uppercase; }
.tree .lvl1 > .node-row .dom-ico { color: var(--accent); }
.tree .lvl2 { border-bottom: 0; border-top: 1px solid var(--line); }
.tree .lvl2 > .node-row { padding-left: 26px; font-weight: 500; }
.tree .children { background: var(--bg); }
.tree .items { padding: 4px 14px 12px 68px; display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); animation: fold-in var(--t) var(--ease-out); }
.tree .items .check { font-size: .94rem; min-height: 40px; }
.tree .items .nat { font: 400 .72rem var(--f-mono); color: var(--muted); }
@media (max-width: 600px) {
  .tree .items { padding-left: 22px; grid-template-columns: 1fr; }
  .tree .lvl2 > .node-row { padding-left: 12px; }
}

.sel-count { display: flex; align-items: baseline; gap: 8px; }
.sel-count .v { font: 500 2rem/1 var(--f-mono); color: var(--accent); }

/* Barre d'action collante (téléphone) */
.action-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--sab) + 10px); z-index: 6;
  display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 10px 10px 16px;
  border-radius: var(--r-lg); border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg-2) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .55);
}
@media (min-width: 720px) { .action-bar { bottom: calc(var(--sab) + 16px); } }
.action-bar .sum { font: 400 .8rem var(--f-mono); color: var(--muted); min-width: 0; }
.action-bar .sum b { color: var(--text); font-weight: 500; }

/* =========================================================================
   Réglages (liste de lignes)
   ========================================================================= */

.settings-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.list-rows > .lrow { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 60px; }
.list-rows > .lrow:last-child { border-bottom: 0; }
.lrow .l-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lrow .l-title { font-weight: 500; }
.lrow .l-sub { font: 400 .76rem var(--f-mono); color: var(--muted); }
.lrow .l-ctl { flex: none; }
.lrow .l-ctl input[type=number] { width: 92px; text-align: center; min-height: 42px; }
.lrow .l-ctl select { min-height: 42px; width: auto; max-width: 220px; }
.lrow.stack { flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.stepper button { width: 40px; height: 42px; border: 0; background: var(--bg-3); color: var(--text); font: 500 1.1rem var(--f-mono); cursor: pointer; }
.stepper button:active { background: var(--bg-4); }
.stepper input[type=number] { border: 0; border-radius: 0; width: 64px !important; min-height: 42px; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .unit { padding: 0 10px 0 0; font: 400 .78rem var(--f-mono); color: var(--muted); background: var(--bg); align-self: stretch; display: grid; place-items: center; }

.meter { height: 6px; background: var(--bg-4); border-radius: 3px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width var(--t) var(--ease); }
.meter.ok > div { background: var(--ok); }

/* =========================================================================
   Lecteur de test
   ========================================================================= */

#player {
  position: fixed; inset: 0; z-index: 100; background: #050605; color: #f1eee4;
  display: flex; flex-direction: column; user-select: none; -webkit-user-select: none;
  animation: fade-in var(--t) var(--ease);
  --accent: #d9a83e; --ok: #9ccf72;
}
.p-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; }
.p-stage .frame { position: absolute; inset: 0; display: grid; place-items: center; }
.p-stage img.slide {
  width: 100%; height: 100%; object-fit: contain; display: block;
  will-change: transform, opacity;
}
.p-stage img.slide.enter { animation: slide-in var(--t-slow) var(--ease-out) both; }
.p-stage img.slide.enter.back { animation-name: slide-in-back; }
@keyframes slide-in { from { opacity: 0; transform: translateX(3%) scale(1.01); } }
@keyframes slide-in-back { from { opacity: 0; transform: translateX(-3%) scale(1.01); } }

/* Coins de viseur du lecteur */
.p-corners { position: absolute; inset: max(14px, var(--sat)) max(14px, var(--sar)) max(14px, var(--sab)) max(14px, var(--sal)); pointer-events: none; }
.p-corners i { position: absolute; width: 28px; height: 28px; border: 2px solid rgba(241, 238, 228, .38); transition: border-color var(--t) var(--ease); }
.p-corners i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.p-corners i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.p-corners i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.p-corners i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
#player.reveal .p-corners i { border-color: var(--ok); }
#player.warn .p-corners i { border-color: var(--accent); }

.p-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--sat) + 10px) calc(var(--sar) + 12px) 24px calc(var(--sal) + 12px);
  background: linear-gradient(rgba(5, 6, 5, .78), transparent);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
#player.idle .p-hud { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.p-hud .p-title { min-width: 0; display: grid; gap: 1px; margin: 0 6px; }
.p-hud .p-title .t { font: 600 1.05rem/1.1 var(--f-head); letter-spacing: .04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-hud .p-title .n { font: 500 .78rem var(--f-mono); color: rgba(241, 238, 228, .65); letter-spacing: .06em; }
.p-hud .icon-btn { color: #f1eee4; background: rgba(241, 238, 228, .08); }
.p-hud .icon-btn:hover { background: rgba(241, 238, 228, .16); }
.p-hud .ctl { display: flex; gap: 6px; margin-left: auto; }
@media (max-width: 600px) { .p-hud .ctl .hide-sm { display: none; } }

/* Anneau de temps */
.p-ring { position: absolute; z-index: 3; right: calc(var(--sar) + 18px); bottom: calc(var(--sab) + 22px); width: 76px; height: 76px; transition: opacity var(--t) var(--ease); }
.p-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.p-ring circle { fill: none; stroke-width: 4; }
.p-ring .bgc { stroke: rgba(241, 238, 228, .14); fill: rgba(5, 6, 5, .55); }
.p-ring .fg { stroke: #f1eee4; stroke-linecap: round; transition: stroke var(--t) var(--ease); }
#player.warn .p-ring .fg { stroke: var(--accent); }
#player.reveal .p-ring .fg { stroke: var(--ok); }
.p-ring .v { position: absolute; inset: 0; display: grid; place-items: center; font: 500 1.55rem/1 var(--f-mono); }
#player.warn .p-ring .v { color: var(--accent); animation: tick 1s var(--ease) infinite; }
@keyframes tick { 0% { transform: scale(1.12); } 30% { transform: scale(1); } }
#player.untimed .p-ring { display: none; }

/* Barre de progression segmentée */
.p-progress { position: absolute; z-index: 3; left: calc(var(--sal) + 14px); right: calc(var(--sar) + 14px); bottom: calc(var(--sab) + 8px); display: flex; gap: 3px; height: 3px; }
.p-progress i { flex: 1; background: rgba(241, 238, 228, .16); border-radius: 2px; transition: background var(--t) var(--ease); }
.p-progress i.done { background: rgba(241, 238, 228, .62); }
.p-progress i.cur { background: var(--accent); }
.p-progress.cont { background: rgba(241, 238, 228, .16); border-radius: 2px; }
.p-progress.cont > b { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width var(--t) var(--ease); }

/* Révélation */
.p-reveal {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  padding: 60px calc(var(--sar) + 110px) calc(var(--sab) + 28px) calc(var(--sal) + 24px);
  background: linear-gradient(transparent, rgba(5, 6, 5, .9) 45%);
}
.p-reveal .rk { color: var(--ok); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.p-reveal .rk::after { content: ""; height: 1px; width: 60px; background: var(--ok); transform-origin: left; animation: line-in var(--t-slow) var(--ease-out) .1s both; }
.p-reveal .rname {
  font: 700 clamp(2rem, 7vw, 4.4rem)/.95 var(--f-head); letter-spacing: .01em; text-transform: uppercase;
  color: #fff; animation: wipe-in 520ms var(--ease-out) both;
}
.p-reveal .rsub { margin-top: 10px; font: 400 clamp(.82rem, 2vw, 1.05rem)/1.4 var(--f-mono); color: rgba(241, 238, 228, .78); animation: rise-in var(--t-slow) var(--ease-out) .12s both; }
@keyframes wipe-in { from { clip-path: inset(0 100% 0 0); transform: translateX(-10px); } to { clip-path: inset(0 0 0 0); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes line-in { from { transform: scaleX(0); } }

.p-paused {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none;
  background: rgba(5, 6, 5, .5); animation: fade-in var(--t-fast) var(--ease);
}
.p-paused div { display: grid; place-items: center; gap: 10px; font: 600 1.2rem var(--f-head); letter-spacing: .3em; text-transform: uppercase; }
.p-paused .ico { width: 54px; height: 54px; fill: currentColor; opacity: .9; }

.p-countdown { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2; }
.p-countdown .k { margin-bottom: 14px; color: rgba(241, 238, 228, .6); }
.p-countdown .t { font: 600 clamp(1.5rem, 4vw, 2.3rem)/1.05 var(--f-head); letter-spacing: .04em; text-transform: uppercase; max-width: 80vw; }
.p-countdown .d { font: 500 clamp(5rem, 22vw, 11rem)/1 var(--f-mono); color: var(--accent); margin-top: 18px; }
.p-countdown .d.pop { animation: pop 900ms var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: scale(1.6); } 40% { opacity: 1; transform: scale(1); } }
.p-countdown .hint { margin-top: 24px; font: 400 .78rem var(--f-mono); color: rgba(241, 238, 228, .45); letter-spacing: .06em; }

/* Écran de fin */
.p-end { overflow: auto; flex: 1; background: var(--bg); color: var(--text); padding: calc(var(--sat) + 22px) calc(var(--sar) + var(--gutter)) calc(var(--sab) + 40px) calc(var(--sal) + var(--gutter)); }
.p-end .inner { max-width: 1180px; margin: 0 auto; }
.p-end .end-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.p-end .end-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.answers { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .answers { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; } }
.answer { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.answer .a-img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-3); }
.answer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.answer .a-num { position: absolute; top: 8px; left: 8px; font: 500 .74rem/1 var(--f-mono); padding: 5px 7px; border-radius: 3px; background: rgba(6, 8, 7, .72); color: #f1eee4; }
.answer .a-body { padding: 10px 12px 12px; }
.answer .a-name { font: 600 1.05rem/1.15 var(--f-head); letter-spacing: .02em; }
.answer .a-sub { font: 400 .72rem/1.4 var(--f-mono); color: var(--muted); margin-top: 3px; }

/* =========================================================================
   Animations d'entrée, toast, divers
   ========================================================================= */

.stagger > * { animation: rise-in var(--t-slow) var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 14) * 28ms); }
.view-enter { animation: view-in var(--t-slow) var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

::view-transition-old(root) { animation: vt-out 160ms var(--ease) both; }
::view-transition-new(root) { animation: vt-in 300ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

#toast {
  position: fixed; left: 50%; z-index: 200; bottom: calc(var(--nav-h) + var(--sab) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: var(--r);
  font: 500 .92rem/1.3 var(--f-body);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .6);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease-out);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 720px) { #toast { bottom: calc(var(--sab) + 26px); left: calc(50% + var(--rail-w) / 2); } }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { width: 90px; height: 68px; object-fit: cover; border-radius: var(--r); }

/* Écran de connexion (application) */
.connect { min-height: calc(100dvh - 120px); display: grid; place-items: center; }
.connect .box { width: min(460px, 100%); }
.connect .logo { display: block; width: 64px; height: 64px; margin-bottom: 16px; }

/* Barre de défilement discrète (PC) */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 2px solid var(--bg); }
  ::-webkit-scrollbar-track { background: transparent; }
}

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

/* Boîte de dialogue */
.modal {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px;
  background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade-in var(--t) var(--ease);
}
.modal-box {
  width: min(440px, 100%); padding: 22px; border-radius: var(--r-lg);
  background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
  animation: zoom-in var(--t) var(--ease-out);
}
.modal-box h2 { text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.modal-box p { color: var(--text-2); margin-bottom: 20px; }
.modal.out { animation: fade-out 180ms var(--ease) forwards; }
@keyframes fade-out { to { opacity: 0; } }

/* Autres vues du matériel pendant un test */
.p-hud .p-alt { position: relative; }
.p-hud .p-alt .p-alt-n {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  font: 500 .62rem/16px var(--f-mono); background: var(--accent); color: #1a1305;
}
.p-views {
  position: absolute; z-index: 3; left: calc(var(--sal) + 18px); bottom: calc(var(--sab) + 22px);
  font: 500 .74rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 7px 10px; border-radius: 4px; background: rgba(5, 6, 5, .62); color: var(--accent);
  border: 1px solid rgba(217, 168, 62, .45); animation: fade-in var(--t) var(--ease);
}
#player.reveal .p-views { bottom: auto; top: calc(var(--sat) + 72px); }
.p-stage img.slide.swap { animation: view-swap 320ms var(--ease-out) both; }
@keyframes view-swap { from { opacity: 0; transform: translateY(2%) scale(.995); } }

/* Page de connexion : pas de navigation */
.auth .nav { display: none; }
.auth main { margin-left: auto !important; padding-left: calc(var(--sal) + var(--gutter)) !important; padding-bottom: 40px !important; }

/* Auto-évaluation pendant la révélation */
.p-eval { display: flex; gap: 10px; margin-top: 18px; pointer-events: auto; flex-wrap: wrap; }
.p-eval button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: var(--r);
  border: 1px solid rgba(156, 207, 114, .6); background: rgba(156, 207, 114, .14); color: #e6f5da;
  font: 600 1rem var(--f-head); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  animation: rise-in var(--t-slow) var(--ease-out) .2s both; transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.p-eval button.ko { border-color: rgba(226, 104, 90, .6); background: rgba(226, 104, 90, .14); color: #fbe1dd; }
.p-eval button:active { transform: scale(.95); }
.p-eval button.on { background: var(--ok); color: #10200a; }
.p-eval button.ko.on { background: var(--danger); color: #2a0d09; }
.p-eval kbd { font: 500 .7rem var(--f-mono); opacity: .6; border: 1px solid currentColor; border-radius: 3px; padding: 1px 4px; }
@media (pointer: coarse) { .p-eval kbd { display: none; } }

/* Correction notée */
.answer { position: relative; transition: border-color var(--t) var(--ease); }
.answer.ok { border-color: color-mix(in srgb, var(--ok) 70%, transparent); }
.answer.ko { border-color: color-mix(in srgb, var(--danger) 70%, transparent); }
.answer.ok .a-img::after, .answer.ko .a-img::after {
  content: "✓"; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font: 700 .9rem var(--f-body); background: var(--ok); color: #10200a;
}
.answer.ko .a-img::after { content: "✗"; background: var(--danger); color: #2a0d09; }
.a-eval { display: flex; gap: 6px; margin-top: 8px; }
.a-eval button {
  flex: 1; min-height: 36px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg-3); color: var(--text-2); cursor: pointer;
  display: grid; place-items: center;
}
.answer.ok .a-eval button[data-v="1"] { background: var(--ok); border-color: var(--ok); color: #10200a; }
.answer.ko .a-eval button[data-v="0"] { background: var(--danger); border-color: var(--danger); color: #2a0d09; }
.score { margin-bottom: 22px; }
.score-v { font: 500 2rem/1 var(--f-mono); }
.score-v b { color: var(--ok); font-weight: 500; }
