/* Thèmes clair (par défaut) et sombre : bleu et rouge, style Pokémon Center.
   Chargé après clair-auto.css / sombre-auto.css (couleurs converties
   automatiquement) pour les éléments dessinés à la main : en-têtes illustrés,
   barre du bas, tickets. La mise en page est commune ; les couleurs propres à
   chaque thème sont des variables (sombre : css/theme-sombre.css). */
/* Design system : valeurs claires par défaut, valeurs sombres ci-dessous.
   Les noms historiques (--bg, --card…) restent disponibles pour l'existant. */
:root {
  /* Palette sémantique et identité bleu-cyan-vert */
  --ds-color-background: #ffffff;
  --ds-color-surface: #fff;
  --ds-color-surface-muted: #f4f7fc;
  --ds-color-border: #dfe6f2;
  --ds-color-text: #13204a;
  --ds-color-text-muted: #5d6a88;
  --ds-color-accent: #1463e6;
  --ds-color-success: #157c53; /* 4,6:1 au moins sur les fonds clairs (WCAG AA) */
  --ds-color-warning: #9b6300;
  --ds-color-error: #d51821; /* 4,6:1 au moins sur les fonds clairs (WCAG AA) */
  --ds-brand-blue: #168dff;
  --ds-brand-cyan: #18cbd5;
  --ds-brand-green: #39ed98;

  /* Typographie */
  --ds-font-size-xs: 12px;
  --ds-font-size-sm: 14px;
  --ds-font-size-md: 16px;
  --ds-font-size-lg: 20px;
  --ds-font-size-xl: 26px;
  --ds-font-size-display: 36px;

  /* Espacements (multiples de 4px) */
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-8: 32px;

  /* Quatre arrondis et trois ombres */
  --ds-radius-sm: 8px;
  --ds-radius-md: 12px;
  --ds-radius-lg: 18px;
  --ds-radius-xl: 22px;
  --ds-shadow-card: 0 6px 18px -14px #13204a59;
  --ds-shadow-nav: 0 -6px 24px #13204a14;
  --ds-shadow-ticket: 0 14px 26px -18px #0f4fd0;
}

html[data-theme="clair"] {
  color-scheme: light;
  --card: var(--ds-color-surface);
  --card-shadow: var(--ds-shadow-card);
  --field-bg: #fff;
  --field-line: #d5deee;
  --placeholder: #7d89a6;
  --nav-bg: #fffffff5;
  --nav-line: #e3e9f4;
  --nav-ink: #2a3552;
  --nav-shadow: var(--ds-shadow-nav);
  --ticket-border: 0;
  --ticket-value: #fff;
  --ticket-shadow: var(--ds-shadow-ticket);
  --bar-bg: #13204a1a;
  --icon-bg: #e8f1ff;
  --icon-ink: #0f4fd0;
  --switch-bg: #f1f5fc;
  --switch-on: linear-gradient(160deg, #2b8dff, #1463e6);
  --switch-on-ink: #fff;
  --price-ink: #0f4fd0;
  --wish-new-ink: #17734f;
  --backdrop: #13204a66;
  --bg: var(--ds-color-background);
  --panel: var(--ds-color-surface-muted);
  --line: var(--ds-color-border);
  --muted: var(--ds-color-text-muted);
  --accent: var(--ds-color-accent);
  --ink: var(--ds-color-text);
  --blue: #1f7bff;
  --blue-deep: #0f4fd0;
  --red: var(--ds-color-error);
  --green: var(--ds-color-success);
  --ticket: linear-gradient(135deg, #2b8dff 0%, #1767ea 55%, #0f4fd0 100%);
}
html[data-theme] {
  --pokeball: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='15' fill='%23e8333c'/%3E%3Crect x='1' y='14' width='30' height='4' fill='%23fff'/%3E%3Ccircle cx='16' cy='16' r='7' fill='%23fff'/%3E%3Ccircle cx='16' cy='16' r='3.4' fill='%23e8333c'/%3E%3C/svg%3E");
  --ball-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23fff' stroke-opacity='.16' stroke-width='9'%3E%3Ccircle cx='50' cy='50' r='44'/%3E%3Cpath d='M6 50h30M64 50h30'/%3E%3Ccircle cx='50' cy='50' r='14'/%3E%3C/svg%3E");
  --notch: radial-gradient(circle 11px at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 11px at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
}
html[data-theme="sombre"] {
  color-scheme: dark;
  /* Variantes du même design system pour le mode nuit */
  --ds-color-background: #0a1629;
  --ds-color-surface: #13213a;
  --ds-color-surface-muted: #13213a;
  --ds-color-border: #273859;
  --ds-color-text: #f3f6ff;
  --ds-color-text-muted: #9fb0cf;
  --ds-color-accent: #85f7c4;
  --ds-color-success: #85f7c4;
  --ds-color-warning: #ffd45c;
  --ds-color-error: #ff4652;
  --ds-shadow-card: none;
  --ds-shadow-nav: 0 -6px 24px #0006;
  --ds-shadow-ticket: 0 14px 26px -18px #000;
  --bg: var(--ds-color-background);
  --panel: var(--ds-color-surface-muted);
  --line: var(--ds-color-border);
  --muted: var(--ds-color-text-muted);
  --accent: var(--ds-color-accent);
  --ink: var(--ds-color-text);
  --blue: #2f7bff;
  --blue-deep: #0b3fa8;
  --red: var(--ds-color-error);
  --green: var(--ds-color-success);
  --ticket: linear-gradient(135deg, #0e4fc0 0%, #0a3c9c 55%, #082f80 100%);
  --card: var(--ds-color-surface);
  --card-shadow: var(--ds-shadow-card);
  --field-bg: #13213a;
  --field-line: #2c3d5f;
  --placeholder: #8494b4;
  --nav-bg: #0b1529f5;
  --nav-line: #1f2d4a;
  --nav-ink: #e6ecfa;
  --nav-shadow: var(--ds-shadow-nav);
  --ticket-border: 1.5px solid #2f74e6;
  --ticket-value: #8af7c8;
  --ticket-shadow: var(--ds-shadow-ticket);
  --bar-bg: #ffffff1f;
  --icon-bg: #1a2c4f;
  --icon-ink: #85f7c4;
  --switch-bg: #13213a;
  --switch-on: #85f7c4;
  --switch-on-ink: #0a1629;
  --price-ink: #8af7c8;
  --wish-new-ink: #85f7c4;
  --backdrop: #000a;
}
html[data-theme] body {
  background: var(--bg);
  color: var(--ink);
  font-family: Nunito, "DM Sans", sans-serif;
}
html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3 {
  color: var(--ink);
  font-weight: 800;
}

/* ---------- En-tête de page : illustration + titre avec Poké Ball ---------- */
html[data-theme] .page-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-align: left;
}
html[data-theme] .page-header h1::before {
  flex: none;
  width: 0.95em;
  height: 0.95em;
  background: var(--pokeball) center / contain no-repeat;
  content: "";
}
html[data-theme] .page-header {
  justify-content: start;
}
@media (max-width: 650px) {
  html[data-theme] .page-header {
    margin-bottom: 12px;
  }
  html[data-theme] .page-header h1 {
    font-size: var(--ds-font-size-xl);
  }
}
/* L'illustration (prolongée par le reflet du sol) passe derrière le titre et
   le haut de la page, puis se fond dans le blanc. */
html[data-theme] body[data-art] .app {
  position: relative;
  isolation: isolate;
}
html[data-theme] body[data-art] .app::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  aspect-ratio: var(--art-ratio);
  background: var(--art) center top / 100% auto no-repeat;
  content: "";
  pointer-events: none;
}
html[data-theme] body[data-art] .page-header {
  align-items: end;
  padding-top: calc(var(--art-top) * 100vw - 52px);
}
html[data-theme] body[data-art] .page-header h1 {
  font-size: var(--ds-font-size-display);
  text-shadow: 0 0 14px var(--bg), 0 0 4px var(--bg);
}
html[data-theme] body[data-art] {
  --art-ratio: 852 / 725;
  --art-top: 0.4754;
}
html[data-theme="clair"] body[data-art] {
  --art: url("../img/entetes/accueil.webp?v=2");
}
html[data-theme="sombre"] body[data-art] {
  --art: url("../img/entetes/accueil-nuit.webp?v=2");
}
html[data-theme] body[data-art="classeurs"] {
  --art-ratio: 852 / 611;
  --art-top: 0.4;
}
html[data-theme="clair"] body[data-art="classeurs"] {
  --art: url("../img/entetes/classeurs.webp?v=2");
}
html[data-theme="sombre"] body[data-art="classeurs"] {
  --art: url("../img/entetes/classeurs-nuit.webp?v=1");
}
html[data-theme] body[data-art="souhaits"] {
  --art-ratio: 852 / 770;
  --art-top: 0.5282;
}
html[data-theme="clair"] body[data-art="souhaits"] {
  --art: url("../img/entetes/souhaits.webp?v=2");
}
html[data-theme="sombre"] body[data-art="souhaits"] {
  --art: url("../img/entetes/souhaits-nuit.webp?v=1");
}
/* Décors de nuit des maquettes sombres (le thème clair garde l'accueil). */
html[data-theme="sombre"] body[data-art="doubles"] {
  --art: url("../img/entetes/doubles-nuit.webp?v=1");
  --art-ratio: 852 / 657;
  --art-top: 0.3955;
}
html[data-theme="sombre"] body[data-art="statistiques"] {
  --art: url("../img/entetes/statistiques-nuit.webp?v=1");
  --art-ratio: 852 / 620;
  --art-top: 0.3521;
}
html[data-theme="sombre"] body[data-art="illustrateurs"] {
  --art: url("../img/entetes/illustrateurs-nuit.webp?v=1");
  --art-ratio: 852 / 760;
  --art-top: 0.5164;
}
@media (min-width: 651px) {
  html[data-theme] body[data-art] .app::before {
    max-height: 520px;
    background-size: cover;
    -webkit-mask-image: linear-gradient(#000 65%, #0000);
    mask-image: linear-gradient(#000 65%, #0000);
  }
  html[data-theme] body[data-art] .page-header {
    padding-top: 250px;
  }
}

/* ---------- Barre du bas ---------- */
html[data-theme] #bottomnav:not([hidden]) {
  border-color: var(--nav-line);
  background: var(--nav-bg);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(10px);
}
html[data-theme] .dock-button {
  color: var(--nav-ink);
}
html[data-theme] .dock-button[aria-current="page"] {
  color: var(--red);
}
html[data-theme] .dock-button[aria-current="page"] .dock-icon {
  background: none;
}
html[data-theme] .dock-button[aria-current="page"]::after {
  bottom: 2px;
  width: 30px;
  height: 3px;
  border-radius: 3px;
  background: var(--red);
}
html[data-theme] .dock-scanner,
html[data-theme] .dock-scanner[aria-current="page"] {
  color: var(--nav-ink);
}
html[data-theme] .dock-scanner .dock-icon,
html[data-theme] .dock-scanner[aria-current="page"] .dock-icon {
  border-radius: 14px;
  background: linear-gradient(160deg, #3d9bff, #1463e6);
  color: #fff;
  box-shadow: 0 6px 14px -6px #1463e6;
}
html[data-theme] .dock-scanner[aria-current="page"]::after {
  display: none;
}
@media (hover: hover) {
  html[data-theme] .dock-button:hover {
    color: var(--blue-deep);
  }
  html[data-theme] .dock-button[aria-current="page"]:hover {
    color: var(--red);
  }
}
html[data-theme] .nav-badge {
  border-color: var(--bg);
  background: var(--red);
}

/* ---------- Recherche ---------- */
html[data-theme] .search input,
html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea {
  border-color: var(--field-line);
  background: var(--field-bg);
  color: var(--ink);
}
html[data-theme] input::placeholder {
  color: var(--placeholder);
}
html[data-theme] .searchgo {
  border-radius: var(--ds-radius-md);
  background: linear-gradient(160deg, #2fa8ff, #1677f0);
  color: #fff;
}

/* ---------- Tickets bleus (collection, classeurs, souhaits) ---------- */
html[data-theme] .hero-summary,
html[data-theme] .collectionitem,
html[data-theme] .collectionitem[data-color]:not([data-color="classic"]),
html[data-theme] .wish-list-card {
  border: var(--ticket-border);
  border-radius: var(--ds-radius-xl);
  background:
    var(--ball-mark) right -26px top -22px / 118px no-repeat,
    var(--ticket);
  color: #fff;
  -webkit-mask: var(--notch);
  mask: var(--notch);
}
html[data-theme] .collectionitem h3,
html[data-theme] .wish-list-card strong,
html[data-theme] .hero-summary b {
  color: #fff;
}
html[data-theme] .collectionitem small,
html[data-theme] .wish-list-card small,
html[data-theme] .wish-info > span,
html[data-theme] .hero-facts,
html[data-theme] .hero-label {
  color: #dbe8ff;
}
html[data-theme] .collectionitem .arrow,
html[data-theme] .wish-list-card .arrow {
  color: #fff;
}
html[data-theme] .binder-value,
html[data-theme] .wish-value {
  color: #fff;
  font-weight: 800;
}
html[data-theme] .wish-progress {
  background: #ffffff33;
}
html[data-theme] .wish-progress i {
  background: linear-gradient(90deg, #4fe3c1, #36ed99);
}
html[data-theme] .hero-summary {
  padding: var(--ds-space-5) var(--ds-space-6);
}
html[data-theme] .hero-label {
  color: #fff;
  font-size: var(--ds-font-size-lg);
  font-weight: 800;
}
html[data-theme] .hero-value {
  background: none;
  color: var(--ticket-value);
  -webkit-text-fill-color: var(--ticket-value);
  font-size: clamp(34px, 10vw, 44px);
  font-weight: 900;
}
html[data-theme] .hero-facts {
  font-size: var(--ds-font-size-sm);
}
html[data-theme] .hero-more {
  top: 22px;
  right: 24px;
  padding-left: 12px;
  border-left: 2px dotted #ffffff80;
  color: #fff;
}
html[data-theme] .hero-spark path {
  stroke: #4fe3c1;
  stroke-width: 2.5;
}
html[data-theme] .hero-trend .up {
  color: #6ff0b4;
}
html[data-theme] .hero-trend .down {
  color: #ffc2c8;
}
html[data-theme] .hero-trend small {
  color: #dbe8ff;
}

/* Meilleure extension : ticket doré. */
html[data-theme] .hero-best {
  border: 0;
  border-radius: 20px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23fff' stroke-opacity='.45' stroke-width='9'%3E%3Ccircle cx='50' cy='50' r='44'/%3E%3Cpath d='M6 50h30M64 50h30'/%3E%3Ccircle cx='50' cy='50' r='14'/%3E%3C/svg%3E")
      right -22px top -18px / 100px no-repeat,
    linear-gradient(120deg, #fff6cf, #ffe486);
  color: var(--ink);
  box-shadow: 0 10px 22px -16px #b98a00;
}
html[data-theme] .hero-best small,
html[data-theme] .hero-best strong,
html[data-theme] .hero-best-count {
  color: var(--ink);
}
html[data-theme] .hero-best .bar,
html[data-theme] .bar {
  background: var(--bar-bg);
}
html[data-theme] .bar i {
  background: linear-gradient(90deg, #1677f0, #36e0b0);
}

/* Cartes blanches bordées : doubles, extensions, réglages. */
html[data-theme] .doubles-link,
html[data-theme] .group,
html[data-theme] .set,
html[data-theme] .tile,
html[data-theme] .empty,
html[data-theme] .wish-empty {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--card-shadow);
}

/* ---------- Cartes à ranger, suggestions ---------- */
html[data-theme] .unfiled-set h3 {
  color: var(--green);
}
html[data-theme] .unfiled-card strong {
  color: var(--ink);
}
html[data-theme] .unfiled-card small {
  color: var(--muted);
}

/* ---------- Boutons ---------- */
html[data-theme] .secondary {
  border-color: var(--field-line);
  background: var(--card);
  color: var(--ink);
}
html[data-theme] .wish-new {
  border: 1.5px solid #1f9a6a;
  background: var(--card);
  color: var(--wish-new-ink);
}

/* ---------- Fenêtres ---------- */
html[data-theme] dialog {
  color: var(--ink);
}
html[data-theme] dialog::backdrop {
  background: var(--backdrop);
}
html[data-theme] footer {
  color: var(--muted);
}

/* ---------- Raccourcis de l'accueil ---------- */
html[data-theme] .home-image-tiles {
  gap: 10px;
  aspect-ratio: auto;
  background: none;
}
html[data-theme] .home-image-tiles button {
  display: grid;
  justify-items: center;
  gap: var(--ds-space-2);
  margin: 0;
  padding: 16px 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--ds-radius-lg);
  background: var(--card);
  box-shadow: var(--card-shadow);
}
html[data-theme] .home-image-tiles .tile-icon {
  display: block;
  width: 44px;
  height: 44px;
  padding: 9px;
  border-radius: 14px;
  background: var(--icon-bg);
  fill: none;
  stroke: var(--icon-ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme] .home-image-tiles .tile-name {
  display: block;
  color: var(--ink);
  font-size: var(--ds-font-size-sm);
  font-weight: 800;
}

/* ---------- Fond, choix segmentés ---------- */
html[data-theme],
html[data-theme] body.auth-page {
  background: var(--bg);
}
html[data-theme] .view-switch {
  border-color: var(--line);
  background: var(--switch-bg);
}
html[data-theme] .view-switch [aria-pressed="true"] {
  background: var(--switch-on);
  color: var(--switch-on-ink);
  box-shadow: 0 6px 14px -8px #1463e6;
}

/* ---------- Autres tickets : compte, valeur, doubles ---------- */
html[data-theme] .account-social .account-hero,
html[data-theme] .account-hero,
html[data-theme] .value-hero,
html[data-theme] .doubles-hero {
  border: var(--ticket-border);
  border-radius: 22px;
  background:
    var(--ball-mark) right -26px top -22px / 118px no-repeat,
    var(--ticket);
  color: #fff;
  box-shadow: var(--ticket-shadow);
}
html[data-theme] .account-hero :is(h2, p, small, span, b, strong),
html[data-theme] .value-hero :is(small, span, b, strong),
html[data-theme] .doubles-hero :is(h2, p, small, span, b, strong) {
  color: #fff;
}
html[data-theme] .value-hero strong {
  background: none;
  color: var(--ticket-value);
  -webkit-text-fill-color: var(--ticket-value);
}
html[data-theme] .account-handle {
  color: #cfe0ff;
}
html[data-theme] .account-privacy-chip,
html[data-theme] .account-gear {
  border-color: #ffffff55;
  background: #ffffff26;
  color: #fff;
}
html[data-theme] .account-gear svg {
  stroke: #fff;
}
html[data-theme] .doubles-hero button {
  border: 0;
  background: #fff;
  color: var(--blue-deep);
}
html[data-theme] .account-page,
html[data-theme] .account-social {
  background: none;
}
html[data-theme] .wish-info em {
  color: #fff;
  font-weight: 800;
}
html[data-theme] .collectionitem .arrow,
html[data-theme] .wish-list-card .arrow {
  margin-right: 12px;
}
html[data-theme] .hero-summary {
  padding-inline: 26px;
}

/* Pastille de confidentialité lisible sur le ticket bleu. */
html[data-theme] .account-privacy-chip,
html[data-theme] .account-privacy-chip.open {
  color: #fff;
}

/* ---------- Fiche d'une carte ---------- */
html[data-theme] .detail-price {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--card-shadow);
}
html[data-theme] .detail-price-main strong {
  background: none;
  color: var(--price-ink);
  -webkit-text-fill-color: var(--price-ink);
}
html[data-theme] .detail-price-grid > * {
  background: var(--panel);
}
html[data-theme] .price-change.up {
  color: var(--green);
}
html[data-theme] .price-change.down {
  color: var(--red);
}
html[data-theme] .detail-owned {
  color: var(--green);
}
html[data-theme] .card-detail-controls .detail-add {
  border: 0;
  background: linear-gradient(160deg, #2b8dff, #1463e6);
  color: #fff;
  box-shadow: 0 6px 14px -8px #1463e6;
}

/* ---------- Réglage du thème (⚙) ---------- */
html[data-theme] .account-theme {
  padding: 10px;
}
html[data-theme] .account-theme .view-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
html[data-theme] .account-theme .view-switch button {
  min-width: 0;
  padding: 10px 4px;
  font-size: 13px;
  white-space: nowrap;
}
html[data-theme] .account-theme .note {
  margin: 8px 4px 2px;
}

/* Le même décor traverse l'en-tête et le contenu. Le premier plan reste
   interactif et la page peut continuer au-delà de l'illustration. */
html[data-theme="clair"] {
  --salle-voile: 255 251 245;
  --salle-voile-mobile: rgb(255 251 245 / 22%);
  --salle-encre: #172b46;
  --salle-ombre-texte: 0 1px 4px #fff, 0 0 10px #fff;
  --hall-art: url("../img/entetes/hall.webp?v=1");
  --floor-art: url("../img/entetes/sol.webp?v=2");
  --garden-art: url("../img/entetes/jardin.webp?v=1");
  --scene-panel: rgb(255 252 247 / 89%);
  --floor-veil: rgb(255 251 245 / 32%);
  --rail-surface: rgb(255 252 247 / 70%);
  --garden-tint: rgb(255 255 255 / 57%);
}
html[data-theme="sombre"] {
  --salle-voile: 9 20 41;
  --salle-voile-mobile: rgb(9 20 41 / 38%);
  --salle-encre: #fff;
  --salle-ombre-texte: 0 1px 4px #08142b, 0 1px 10px #08142b;
  --hall-art: url("../img/entetes/hall-nuit.webp?v=1");
  --floor-art: url("../img/entetes/sol-nuit.webp?v=2");
  --garden-art: url("../img/entetes/jardin-nuit.webp?v=1");
  --scene-panel: rgb(12 25 48 / 89%);
  --floor-veil: rgb(9 22 43 / 34%);
  --rail-surface: rgb(12 25 48 / 75%);
  --garden-tint: rgb(9 22 43 / 63%);
}
html[data-theme] body[data-art] .app::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0 0 auto;
  z-index: -2;
  height: max(100svh, 760px);
  background:
    linear-gradient(to bottom, transparent 15%, var(--floor-veil) 50%, var(--floor-veil) 85%, var(--bg)),
    var(--floor-art) center bottom / cover no-repeat;
}
html[data-theme] body[data-art] .app::before {
  mask-image: linear-gradient(#000 42%, transparent 86%);
}
html[data-theme] body[data-art] :is(.hero-recent, .wish-suggest, .unfiled-section) {
  padding: 12px;
  border-radius: 17px;
  background: var(--rail-surface);
}
html[data-theme] body[data-art] :is(.wish-head, #main > .sectionhead) > .note {
  color: var(--ink);
  background: var(--scene-panel);
  border-radius: 20px;
  padding: 4px 9px;
}
html[data-theme] body[data-art] .hero-best :is(small, strong, .hero-best-count) {
  color: #443410;
}
html[data-theme] #modal.gallery-dialog {
  color: var(--ink);
  background: var(--bg) var(--garden-art) center top / cover no-repeat;
}
html[data-theme] #modal.gallery-dialog .card-detail-heading {
  background: linear-gradient(100deg, var(--scene-panel), var(--garden-tint) 62%, transparent);
  border: 0;
}
html[data-theme] #modal.gallery-dialog .card-detail-heading p {
  color: var(--ink);
}
html[data-theme] #modal.gallery-dialog .card-stage {
  background: transparent;
}
html[data-theme] #modal.gallery-dialog .card-stage::before,
html[data-theme] #modal.gallery-dialog .card-stage::after {
  content: none;
}
html[data-theme] #modal.gallery-dialog .gallery-index {
  width: fit-content;
  margin: 13px auto 0;
  padding: 4px 12px;
  border-radius: 16px;
  color: var(--ink);
  background: var(--scene-panel);
}
html[data-theme] #modal.gallery-dialog .gallery-index span {
  color: inherit;
}
html[data-theme] #modal.gallery-dialog .card-detail-controls {
  margin: 10px 12px 16px;
  padding: 12px;
  border-radius: 20px;
  background: var(--scene-panel);
}
html[data-theme] #modal.gallery-dialog .detail-price-main {
  border-radius: 12px;
  margin-top: 10px;
  padding: 10px 13px;
  background: var(--ticket);
}
html[data-theme] #modal.gallery-dialog .detail-price-main :is(small, strong, .price-change) {
  color: white;
  -webkit-text-fill-color: white;
}
@media (max-width: 650px) {
  html[data-theme] body[data-art] .app::after {
    height: max(105svh, 205vw);
  }
  html[data-theme] body[data-art="accueil"] .app::before {
    aspect-ratio: 1;
    background: var(--hall-art) center -12vw / 100% auto no-repeat;
    mask-image: linear-gradient(#000 65%, transparent);
  }
  html[data-theme] body[data-art="accueil"] .page-header {
    padding-top: clamp(138px, 40vw, 196px);
  }
  html[data-theme] body[data-art] .page-header h1 {
    font-size: clamp(27px, 7vw, 34px);
  }
  html[data-theme] #modal.gallery-dialog {
    background-size: cover;
  }
}

html[data-theme] #modal.gallery-dialog .card-facts > .rarity-mark {
  background: var(--card);
  color: var(--ink);
}

/* Décors des statistiques, des doubles et des illustrateurs. */
html[data-theme] body[data-art="statistiques"] {
  --art-ratio: 852 / 620;
  --art-top: 0.3521;
}
html[data-theme] body[data-art="doubles"] {
  --art-ratio: 852 / 657;
  --art-top: 0.3955;
}
html[data-theme] body[data-art="illustrateurs"] {
  --art-ratio: 852 / 760;
  --art-top: 0.5164;
}
html[data-theme="clair"] body[data-art="statistiques"] {
  --art: url("../img/entetes/statistiques.webp?v=1");
}
html[data-theme="sombre"] body[data-art="statistiques"] {
  --art: url("../img/entetes/statistiques-nuit.webp?v=1");
}
html[data-theme="clair"] body[data-art="doubles"] {
  --art: url("../img/entetes/doubles.webp?v=1");
}
html[data-theme="sombre"] body[data-art="doubles"] {
  --art: url("../img/entetes/doubles-nuit.webp?v=1");
}
html[data-theme="clair"] body[data-art="illustrateurs"] {
  --art: url("../img/entetes/illustrateurs.webp?v=1");
}
/* Petits textes posés sur le décor : lisibles sur le sol. */
html[data-theme] body[data-art] #main > p.note {
  width: fit-content;
  padding: 5px 11px;
  border-radius: 14px;
  background: var(--scene-panel);
  color: var(--ink);
}

/* ---------- Intérieur d'un classeur : décor, boutons ronds, vrai classeur ---------- */
html[data-theme] .binder-view .binder-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "back . menu" "title title title";
  align-items: center;
  gap: 2px 8px;
  margin: 0 0 4px;
}
html[data-theme] .binder-topbar .binder-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--scene-panel, var(--card));
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 16px -10px #13204a80;
  backdrop-filter: blur(8px);
}
html[data-theme] .binder-topbar .binder-pill span {
  font-size: 18px;
  line-height: 1;
}
html[data-theme] #bindersback {
  grid-area: back;
}
html[data-theme] #bindermenu {
  grid-area: menu;
}
html[data-theme] .binder-topbar .binder-heading {
  grid-area: title;
}
html[data-theme] .binder-topbar h1 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 6.4vw, 30px);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 0 14px var(--bg), 0 0 4px var(--bg);
  overflow-wrap: anywhere;
}
html[data-theme] .binder-topbar h1::before {
  flex: none;
  width: 0.9em;
  height: 0.9em;
  background: var(--pokeball) center / contain no-repeat;
  content: "";
}
/* Vitrine en verre fumé teintée par la couleur choisie du classeur. */
html[data-theme] .binder-view [data-color="classic"] {
  --cover-tone: #2a3c5e;
  --cover-accent: #5f7fb8;
}
html[data-theme] .binder-view :is(.binder-canvas, .binder-pagination) {
  --vitrine-rivet: radial-gradient(circle at 35% 30%, #fff4cb 0%, #c99b60 35%, #61422b 65%, transparent 75%);
  --vitrine-verre: color-mix(in srgb, var(--cover-tone, #2a3c5e) 66%, #0a1322);
  --vitrine-bords: inset 1px 0 #cdab78, inset -1px 0 #a78357;
  background:
    var(--vitrine-rivet) left 5px var(--vitrine-bout) 5px / 5px 5px no-repeat,
    var(--vitrine-rivet) right 5px var(--vitrine-bout) 5px / 5px 5px no-repeat,
    linear-gradient(135deg, #ffffff16, transparent 45%),
    var(--vitrine-verre);
}
html[data-theme] .binder-view .binder-canvas {
  --vitrine-bout: top;
  position: relative;
  padding: 8px 8px 2px 30px;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--vitrine-bords), inset 0 1px #efd6a8, inset 0 3px #ffffff12;
}
html[data-theme] .binder-view .binder-pagination {
  --vitrine-bout: bottom;
  width: 100%;
  margin: 0;
  padding: 0 8px 4px 30px;
  border-radius: 0 0 12px 12px;
  box-shadow: var(--vitrine-bords), inset 0 -1px #e4b87d, 0 10px 20px -12px #030811;
}
html[data-theme] .binder-view .binder-pagination button {
  height: 36px;
}
html[data-theme] .binder-view .binder-pagination button,
html[data-theme] .binder-view .binder-pagination select {
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
}
html[data-theme] .binder-view .binder-pagination select {
  flex: 1;
  width: auto;
  min-width: 0;
  max-width: 220px;
  text-align: center;
  text-align-last: center;
  font-size: 17px;
}
html[data-theme] .binder-view .binder-pagination select option {
  color: #13204a;
}
html[data-theme] .binder-view .binder-pagination button:disabled {
  background: transparent;
  opacity: 0.35;
}
/* Inventaire : cadre semi-transparent sur le décor. */
html[data-theme] .binder-view #bindertray {
  margin-top: 6px;
  padding: 8px 10px;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--scene-panel, var(--card));
  backdrop-filter: blur(10px);
}
html[data-theme] .binder-view #bindertray .tray-label {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}
html[data-theme] .binder-view #bindertray .tray-hint {
  margin: 0;
  font-size: 11px;
}
html[data-theme] .binder-view #bindertray .tray-add {
  border: 1.5px solid #1f9a6a;
  background: var(--card);
  color: var(--wish-new-ink);
}
/* Outils du classeur dans « Options ». */
html[data-theme] .binder-tools {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
}
html[data-theme] .binder-tools button {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
html[data-theme] .binder-tools button span {
  width: 20px;
  text-align: center;
}

/* Sur téléphone, les pochettes donnent sa hauteur au classeur. Le contenu
   peut défiler sur un écran court sans rétrécir les cartes dans la couverture. */
@media (max-width: 650px) {
  html[data-theme] .binder-view #main {
    grid-template-rows: repeat(5, auto);
    align-content: start;
    min-height: 0;
  }
  html[data-theme] .binder-view .binder-topbar {
    min-height: clamp(112px, 36vw, 160px);
    align-content: space-between;
    row-gap: 12px;
    margin-bottom: 8px;
  }
  html[data-theme] .binder-view .binder-topbar h1 {
    white-space: normal;
    font-size: clamp(20px, 5.5vw, 26px);
  }
  html[data-theme] .binder-view #main:has(.binder-sheet.cols-3) {
    --binder-width: clamp(290px, calc(72svh - 252px), 100%);
  }
  html[data-theme] .binder-view .binder-canvas,
  html[data-theme] .binder-view .binder-pagination {
    width: min(100%, var(--binder-width, 100%));
    justify-self: center;
  }
  html[data-theme] .binder-view .binder-canvas {
    container-type: normal;
    padding: 8px 9px 4px 23px;
  }
  html[data-theme] .binder-view .binder-sheet {
    width: 100%;
    gap: 5px;
    background: transparent;
  }
  html[data-theme] .binder-view .binder-pagination {
    padding: 0 9px 3px 23px;
    border: 0;
  }
  html[data-theme] .binder-view #bindertray .tray-card {
    flex-basis: 46px;
    width: 46px;
  }
  html[data-theme] .binder-view #bindertray .tray-card .cardart,
  html[data-theme] .binder-view #bindertray .tray-placeholder {
    height: 63px;
  }
}

/* ======================= Retouches de l'audit ======================= */
/* Boutons principaux : bleu MyVault (fini l'ancien dégradé turquoise). */
html[data-theme] .primary,
html[data-theme] .searchgo,
html[data-theme] .cardactions button {
  border: 0;
  background: linear-gradient(160deg, #2b8dff, #1463e6);
  color: #fff;
  box-shadow: 0 8px 18px -10px #1463e6;
}
html[data-theme] .primary:disabled {
  opacity: 0.5;
  box-shadow: none;
}
/* Réglages : pas de bloc coloré derrière le titre. */
html[data-theme] .account-settings-sheet {
  background: none;
}
html[data-theme] .account-theme .view-switch button {
  padding-inline: 2px;
  font-size: 12.5px;
}
/* Pied de page « MYVAULT » inutile dans l'appli. */
html[data-theme] .app > footer {
  display: none;
}
/* Barre du bas : les cinq libellés sur la même ligne. */
@media (max-width: 650px) {
  html[data-theme] .dock-button,
  html[data-theme] .dock-scanner {
    justify-content: flex-end;
    gap: 3px;
    padding: 0 0 9px;
  }
  html[data-theme] .dock-button[aria-current="page"]::after {
    bottom: 2px;
  }
}
/* Liens de retour posés sur le décor : petite pastille lisible. */
html[data-theme] body[data-art] .catalog-selection-tools button,
html[data-theme] body[data-art] #main > .back {
  border: 0;
  min-height: 34px;
  width: fit-content;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--scene-panel, var(--card));
  color: var(--ink);
  font-weight: 800;
}
/* Résumé des badges sur Compte : titre puis chiffres en dessous. */
html[data-theme] .badge-strip-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
html[data-theme="clair"] .badge-strip-head small {
  color: #8a6100;
}
/* Page de connexion aux couleurs de MyVault, devant le hall du Centre. */
html[data-theme] body.auth-page {
  background:
    linear-gradient(#0000 25%, var(--bg) 92%) center top / 100% 150vw no-repeat,
    var(--hall-art) center top / 100% auto no-repeat,
    var(--bg);
}
html[data-theme] .auth-shell {
  border: 1px solid var(--line);
  background: var(--scene-panel, var(--card));
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px -30px #13204a80;
}
html[data-theme] .auth-brand {
  color: var(--ink);
  font-weight: 900;
  background: none;
  -webkit-text-fill-color: currentColor;
}
html[data-theme] .auth-ball {
  display: inline-block;
  vertical-align: -4px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: url("../assets/myvault.svg") center / cover no-repeat;
}
html[data-theme] #sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  color: var(--ink);
  -webkit-text-fill-color: currentColor;
}
html[data-theme] .auth-page .auth-link,
html[data-theme] .auth-page .auth-forgot {
  color: var(--accent);
}

html[data-theme] body[data-art="compte"] {
  --art-ratio: 852 / 770;
  --art-top: calc(450 / 852);
}
html[data-theme="clair"] body[data-art="compte"] {
  --art: url("../img/entetes/compte.webp?v=1");
}
html[data-theme="sombre"] body[data-art="compte"] {
  --art: url("../img/entetes/compte-nuit.webp?v=1");
}

html[data-theme] body[data-art="badges"] {
  --art-ratio: 852 / 770;
  --art-top: calc(450 / 852);
}
html[data-theme="clair"] body[data-art="badges"] {
  --art: url("../img/entetes/badges.webp?v=1");
}
html[data-theme="sombre"] body[data-art="badges"] {
  --art: url("../img/entetes/badges-nuit.webp?v=1");
}

html[data-theme] body[data-art="catalogue"] {
  --art-ratio: 852 / 770;
  --art-top: calc(450 / 852);
}
html[data-theme="clair"] body[data-art="catalogue"] {
  --art: url("../img/entetes/catalogue.webp?v=1");
}
html[data-theme="sombre"] body[data-art="catalogue"] {
  --art: url("../img/entetes/catalogue-nuit.webp?v=1");
}

/* ---------- Liste des extensions de l'accueil (séries dépliées) ---------- */
html[data-theme] details.group > .series,
html[data-theme] .group-grid > .series {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}
html[data-theme] .group .set {
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: none;
}
html[data-theme] .group .set .row {
  gap: 10px;
}
html[data-theme] .group .set .set-logo {
  flex: 0 0 72px;
  width: 72px;
  height: 42px;
}
html[data-theme] .group .set .code {
  min-width: 38px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: var(--icon-bg);
  color: var(--icon-ink);
  font-size: 10px;
}
html[data-theme] .group .set .setname {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme] .group .set .count {
  color: var(--muted);
  font-size: 12px;
}
html[data-theme] .group .set .count b {
  color: var(--ink);
}
html[data-theme] .group .set .bar {
  height: 6px;
  margin-top: 9px;
  border-radius: 6px;
}
/* Extension complète : ticket doré. */
html[data-theme] .group .set.complete {
  border-color: #f1c24a;
  background: linear-gradient(120deg, #fff6cf, #ffe486);
}
html[data-theme] .group .set.complete :is(.setname, .count, .count b) {
  color: #443410;
}
html[data-theme] .group .set.complete .bar i {
  background: linear-gradient(90deg, #f1b52c, #e0901b);
}
html[data-theme] .group .set.complete .code {
  background: #fff8;
  color: #6b4d00;
}
/* Titre de série : flèche ronde. */
html[data-theme] details.group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}
html[data-theme] details.group > summary::after {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--icon-bg);
  color: var(--icon-ink);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s;
}
html[data-theme] details.group[open] > summary::after {
  transform: rotate(180deg);
}
html[data-theme] .group .set .row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  grid-template-areas: "logo name count" "logo code count";
  align-items: center;
  column-gap: 12px;
  row-gap: 3px;
}
html[data-theme] .group .set .set-logo {
  grid-area: logo;
}
html[data-theme] .group .set .setname {
  grid-area: name;
  align-self: end;
}
html[data-theme] .group .set .code {
  grid-area: code;
  justify-self: start;
  align-self: start;
  min-width: 0;
  height: 20px;
  padding: 0 7px;
}
html[data-theme] .group .set .count {
  grid-area: count;
}

/* ---------- Champs actifs et choix cochés (clair) ---------- */
html[data-theme="clair"] :is(input, select, textarea):focus-visible,
html[data-theme="clair"] #auth-form input:focus {
  border-color: #1f7bff;
  outline-color: #1f7bff;
}

/* ---------- Ordinateur : barre latérale, décors, classeur ---------- */
@media (min-width: 651px) {
  html[data-theme] .navbtn {
    color: var(--muted);
    font-weight: 700;
  }
  html[data-theme] .navbtn[aria-current="page"] {
    background: var(--icon-bg);
    color: var(--red);
    box-shadow: inset 3px 0 var(--red);
  }
  html[data-theme] .navbtn.scan .nav-icon {
    background: linear-gradient(160deg, #3d9bff, #1463e6);
    color: #fff;
  }
  html[data-theme] #sidebar {
    border-color: var(--line);
    background: var(--card);
  }
  /* Le décor garde ses proportions et couvre toute la largeur. */
  html[data-theme] body[data-art] .app::before {
    aspect-ratio: auto;
    height: 460px;
    max-height: none;
    background-size: cover;
    background-position: center 35%;
  }
  html[data-theme] body[data-art] .page-header {
    padding-top: 230px;
  }
  /* Classeur : la couverture suit la largeur de la page du classeur. */
  html[data-theme] .binder-view #main {
    max-width: 640px;
    margin-inline: auto;
  }
  html[data-theme] .binder-view .binder-topbar .binder-heading {
    padding-top: 150px;
  }
}
/* Outils du classeur : même taille que les autres boutons d'Options. */
html[data-theme] .binder-tools button {
  font-size: 15px;
}
/* Liste des classeurs : le ticket prend la couleur choisie pour la couverture. */
html[data-theme] .collectionitem[data-color]:not([data-color="classic"]) {
  background:
    var(--ball-mark) right -26px top -22px / 118px no-repeat,
    linear-gradient(135deg, var(--cover-accent) -40%, var(--cover-tone) 70%);
}

/* Le décor est peint sous les commandes de la vue ouverte. */
html[data-theme="clair"] body.binder-view {
  --vitrine-mobile: url("../img/entetes/classeur-vitrine-portrait-jour.webp?v=1");
  --vitrine-large: url("../img/entetes/classeur-vitrine.webp?v=1");
  --vitrine-fond: #8ca2b8;
}
html[data-theme="sombre"] body.binder-view {
  --vitrine-mobile: url("../img/entetes/classeur-vitrine-portrait.webp?v=1");
  --vitrine-large: url("../img/entetes/classeur-vitrine-nuit.webp?v=1");
  --vitrine-fond: #0b1628;
}
html[data-theme] body.binder-view {
  background: var(--vitrine-fond);
}
html[data-theme] body.binder-view .app {
  background: var(--vitrine-fond) var(--vitrine-mobile) center top / 100% auto no-repeat;
}
@media (min-width: 651px) {
  /* Le décor paysage s'étend aussi dans les marges de la vue ordinateur. */
  html[data-theme] body.binder-view {
    isolation: isolate;
  }
  html[data-theme] body.binder-view::before {
    content: "";
    position: fixed;
    inset: 0 0 0 var(--sidebar-width, 0px);
    z-index: -1;
    pointer-events: none;
    background: var(--vitrine-large) center top / cover no-repeat;
    opacity: 0.84;
  }
  html[data-theme] body.binder-view .app {
    background: transparent;
  }
}
html[data-theme] body.binder-view .app::before,
html[data-theme] body.binder-view .app::after {
  display: none;
}
html[data-theme] body.binder-view .binder-topbar .binder-heading {
  padding-top: 4px;
}
html[data-theme] body.binder-view .binder-topbar {
  min-height: 0;
}
html[data-theme] body.binder-view .binder-topbar h1 {
  color: var(--salle-encre);
  text-shadow: var(--salle-ombre-texte);
}
body > .tray-card.tray-ghost {
  width: 58px;
}

/* Menu Options : aide en pastille, interrupteur pour les étiquettes. */
html[data-theme] .binder-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 48px;
}
html[data-theme] .binder-menu-head h2 {
  flex: 1;
  min-width: 0;
  margin: 12px 0 4px;
  overflow-wrap: anywhere;
}
html[data-theme] .help-pill {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 8px 0 0;
  padding: 0;
  border-radius: 50%;
  background: var(--icon-bg);
  color: var(--icon-ink);
  font-size: 17px;
  font-weight: 900;
}
html[data-theme] .switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
html[data-theme] .switch-row > i {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: #9aa6bf;
  transition: background 0.2s;
}
html[data-theme] .switch-row > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px #0004;
  content: "";
  transition: transform 0.2s;
}
html[data-theme] .switch-row > input:checked + i {
  background: #22b573;
}
html[data-theme] .switch-row > input:checked + i::after {
  transform: translateX(20px);
}
html[data-theme] .switch-row > input:focus-visible + i {
  outline: 3px solid #1f7bff;
  outline-offset: 2px;
}
/* Croix de fermeture : plus de cadre turquoise. */
html[data-theme] dialog .close {
  border-radius: 50%;
}
html[data-theme] dialog .close:focus-visible {
  outline-color: #4d82ff;
}

/* ---------- Menus en liste (Options du classeur, carte du classeur) ---------- */
html[data-theme] .menu-section {
  margin: 16px 2px 6px;
  color: var(--muted);
  font-size: var(--ds-font-size-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
html[data-theme] .menu-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
html[data-theme] .menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}
html[data-theme] .menu-row + .menu-row {
  border-top: 1px solid var(--line);
}
html[data-theme] .menu-row:not(.static):active {
  background: var(--panel);
}
@media (hover: hover) {
  html[data-theme] .menu-row:not(.static):hover {
    background: var(--panel);
  }
}
html[data-theme] .menu-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--icon-bg);
  color: var(--icon-ink);
  font-size: 16px;
}
html[data-theme] .menu-text {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
html[data-theme] .menu-text small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
html[data-theme] .menu-row > i:last-child:not(:empty) {
  color: var(--muted);
  font-size: 20px;
  font-style: normal;
}
html[data-theme] .menu-row.danger {
  color: var(--red);
}
html[data-theme] .menu-row.danger .menu-ico {
  background: #e8333c1f;
  color: var(--red);
}
html[data-theme] .menu-row.static {
  cursor: default;
}
html[data-theme] .menu-row.static label {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
html[data-theme] .variant-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}
html[data-theme] .variant-line select {
  width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0 10px;
  font-size: 14px;
}
html[data-theme] .variant-line .secondary {
  width: auto;
  height: 40px;
  min-height: 0;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}
html[data-theme] .detail-place .menu-list {
  margin-top: 10px;
}
/* L'interrupteur dans une ligne de menu. */
html[data-theme] .menu-row.switch-row {
  cursor: pointer;
}

/* ---------- Fenêtres : rien ne déborde, la croix reste en haut à droite ---------- */
html[data-theme] dialog {
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
html[data-theme] dialog:focus {
  outline: none;
}
html[data-theme].page-locked,
html[data-theme].page-locked body {
  overflow: hidden;
  overscroll-behavior: none;
}
html[data-theme] #modal:not(.gallery-dialog, .card-view) > .close {
  position: sticky;
  z-index: 3;
  top: 0;
  float: right;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -12px -12px 0 8px;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}
html[data-theme] #modalbody {
  min-width: 0;
}
html[data-theme] #modalbody > h2:first-child,
html[data-theme] #modalbody > :first-child h2:first-child {
  margin-top: 0;
}
html[data-theme] .binder-menu-head {
  padding-right: 0;
}
html[data-theme] .binder-menu-head h2 {
  margin: 0;
}
html[data-theme] .help-pill {
  margin: 0;
}
/* Interrupteur : la case cachée reste dans sa ligne. */
html[data-theme] .switch-row {
  position: relative;
}
html[data-theme] .switch-row > input {
  inset: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
html[data-theme] .menu-text {
  overflow-wrap: anywhere;
}

/* ---------- Thème sombre : fond uni, illustration lumineuse ----------
   La couleur vient de l'illustration et des éléments ; le fond reste un bleu
   nuit uni (plus de reflet de carrelage), dans lequel l'illustration se fond. */
html[data-theme="sombre"] body[data-art] .app::after {
  display: none;
}
html[data-theme="sombre"] body[data-art] .app::before {
  filter: brightness(1.2) saturate(1.35) contrast(1.04);
  -webkit-mask-image: linear-gradient(#000 58%, transparent 97%);
  mask-image: linear-gradient(#000 58%, transparent 97%);
}
html[data-theme="sombre"] body[data-art] {
  background: var(--bg);
}

/* ---------- En-têtes Classeurs / Souhaits et tickets (maquettes) ----------
   Le bouton de création remonte sur la ligne du titre, le nombre de
   classeurs ou de listes passe en petit sous le titre. */
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"])
  #main
  > :is(.sectionhead, .wish-head) {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  margin-top: var(--head-pull, -50px);
}
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"])
  #main
  > :is(.sectionhead, .wish-head)
  > .note {
  grid-row: 2;
  margin: -12px 0 0 2px;
  padding: 0;
  background: none;
  color: var(--muted);
  font-size: var(--ds-font-size-sm);
  font-weight: 700;
}
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"])
  #main
  > :is(.sectionhead, .wish-head)
  > #new {
  grid-row: 1;
  grid-column: 2;
  margin: 0;
}
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"])
  #main
  > :is(.sectionhead, .wish-head)
  > #new {
  padding-inline: 16px;
}
/* Petits téléphones : « Créer un classeur » ne tient pas à côté du titre ;
   il reste sur la ligne du nombre de classeurs. */
@media (max-width: 374px) {
  html[data-theme] body[data-art="classeurs"] #main > .sectionhead {
    margin-top: 0;
  }
  html[data-theme] body[data-art="classeurs"] #main > .sectionhead > .note {
    grid-row: 1;
    margin-top: 0;
  }
}
/* Bouton « Créer un classeur » aux couleurs MyVault (cyan → vert). */
html[data-theme="sombre"] body[data-art="classeurs"] #main > .sectionhead > #new {
  border: 0;
  background: linear-gradient(100deg, #22c4f2, #3cec9c);
  color: #06213a;
  box-shadow: 0 8px 22px -12px #22c4f2;
}
/* Tickets : un trait sépare l'icône du texte ; en sombre, la valeur en vert. */
html[data-theme] .collectionitem > .binder-avatar + div {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 16px;
  border-left: 1px solid rgb(255 255 255 / 22%);
}
html[data-theme="sombre"] .binder-value,
html[data-theme="sombre"] .wish-value {
  color: #5cf0a8;
}
html[data-theme="sombre"] .collectionitem small {
  color: #a9d4ff;
}

/* ---------- Cartes à ranger (maquettes) ----------
   Plus de cadre : un titre avec le nombre à droite, souligné d'un trait, puis
   les cartes par extension directement sur le fond. En clair, le cadre reste :
   sans lui, les petits textes passeraient sur le carrelage coloré. */
html[data-theme="sombre"] body[data-art] .unfiled-section {
  margin-top: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
html[data-theme] .unfiled-head {
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
html[data-theme] .unfiled-head h2 {
  font-size: 24px;
  font-weight: 800;
}
html[data-theme] .unfiled-head > span {
  font-size: var(--ds-font-size-sm);
}
html[data-theme] .unfiled-set h3 {
  font-size: 18px;
  font-weight: 800;
}
html[data-theme="sombre"] .unfiled-set h3 {
  color: #5cf0a8;
}
html[data-theme] .unfiled-card strong {
  font-size: 15px;
}

/* ---------- Suggestions de la page Souhaits (maquettes) ----------
   Chaque rangée a une petite icône de cartes et un trait la sépare de la
   précédente. En sombre, plus de cadre (comme « Cartes à ranger »). */
html[data-theme="sombre"] body[data-art] .wish-suggest {
  padding: 0;
  border-radius: 0;
  background: none;
}
html[data-theme] .wish-suggest > h2 {
  font-size: 24px;
  font-weight: 800;
}
html[data-theme] .suggest-rail-block + .suggest-rail-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
html[data-theme] .suggest-rail-block h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}
html[data-theme] .suggest-rail-block h3::before {
  flex: none;
  width: 26px;
  height: 26px;
  background: currentColor;
  content: "";
  -webkit-mask: var(--icon-cards) center / contain no-repeat;
  mask: var(--icon-cards) center / contain no-repeat;
}
html[data-theme] .wish-suggest {
  --icon-cards: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='3' y='6.5' width='11' height='15' rx='2' transform='rotate(-12 8.5 14)'/%3E%3Cpath d='M10.5 4.2l8.6 1.8a2 2 0 0 1 1.5 2.4l-2.5 11.7a2 2 0 0 1-2.4 1.5l-3.6-.8'/%3E%3C/svg%3E");
}
html[data-theme] .suggest-rail-block .note {
  margin-left: 36px;
  font-size: var(--ds-font-size-sm);
}
html[data-theme] .suggest-card b {
  font-size: 13px;
}
html[data-theme] .suggest-card small {
  font-size: 13px;
}
html[data-theme="clair"] .suggest-card small {
  color: var(--green);
}

/* Un seul décor du logo jusqu'aux carreaux : aucune découpe ne dépend du
   nombre de cartes. Les lumières sont dessinées dans l'image, pas filtrées. */
html[data-theme="clair"] body[data-art="classeurs"]:not(.binder-view) {
  --salle: url("../img/entetes/classeurs-salle.webp?v=1");
}
html[data-theme="sombre"] body[data-art="classeurs"]:not(.binder-view) {
  --salle: url("../img/entetes/classeurs-salle-nuit.webp?v=1");
}
html[data-theme="clair"] body[data-art="salon"] {
  --salle: url("../img/entetes/compte-salon.webp?v=1");
}
html[data-theme="sombre"] body[data-art="salon"] {
  --salle: url("../img/entetes/compte-salon-nuit.webp?v=1");
}
html[data-theme="clair"] body[data-art="souhaits"] {
  --salle: url("../img/entetes/souhaits-salle.webp?v=1");
}
html[data-theme="sombre"] body[data-art="souhaits"] {
  --salle: url("../img/entetes/souhaits-salle-nuit.webp?v=1");
}
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) {
  --salle-hauteur: max(150vw, calc(100svh - var(--dock-top)));
  --salle-titre: 56vw;
}
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) .app::before {
  height: var(--salle-hauteur);
  max-height: none;
  aspect-ratio: auto;
  background:
    linear-gradient(to bottom, transparent 28%, rgb(var(--salle-voile) / 36%) 55%, rgb(var(--salle-voile) / 12%)),
    var(--salle) center top / cover no-repeat;
  filter: none;
  -webkit-mask-image: linear-gradient(#000 86%, transparent);
  mask-image: linear-gradient(#000 86%, transparent);
}
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) .app::after {
  content: none;
}
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) .page-header {
  padding-top: calc(var(--salle-titre) - 28px);
}
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) .page-header h1,
html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) #main > :is(.sectionhead, .wish-head) > .note {
  color: var(--salle-encre);
  text-shadow: var(--salle-ombre-texte);
}

@media (max-width: 650px) {
  /* Les 600 premières lignes du WebP (sur 1024 px de large) gardent leur
     échelle exacte. Le reste du sol occupe la place disponible sous le comptoir. */
  html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) .app::before {
    background: none;
    border-image: var(--salle) 600 0 0 fill / 58.59375vw 0 0 / 0 stretch;
  }
  html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) .app::after {
    content: "";
    display: block;
    z-index: -1;
    height: var(--salle-hauteur);
    background: linear-gradient(transparent 20%, var(--salle-voile-mobile) 52%, transparent 96%);
  }
}
@media (min-width: 651px) {
  html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) .app {
    container-type: inline-size;
  }
  html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) {
    --salle-hauteur: clamp(650px, 90cqw, 1180px);
    --salle-titre: 48cqw;
  }
  html[data-theme] body:is([data-art="classeurs"], [data-art="souhaits"], [data-art="salon"]):not(.binder-view) #main > :is(.sectionhead, .wish-head) {
    margin-top: 0;
  }
}

/* La carte de dresseur et ses deux entrées gardent les couleurs du salon
   nocturne dans les deux thèmes. */
html[data-theme] body[data-art="salon"] .account-social .trainer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: clamp(16px, 4vw, 24px);
  background:
    var(--ball-mark) right -30px top -14px / 135px no-repeat,
    linear-gradient(115deg, #233d66, #142947 65%, #0c1b32);
  border: 1px solid #d4a85f;
  border-inline-start-width: 3px;
}
.trainer-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.trainer-identity .account-handle {
  overflow-wrap: anywhere;
}
.trainer-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #ffffff55;
}
.trainer-stats > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding-inline: 4px;
  text-align: center;
}
.trainer-stats > div + div {
  border-inline-start: 1px solid #ffffff45;
}
.trainer-stats dt {
  color: #d3deef;
  font-size: 14px;
}
.trainer-stats dd {
  order: -1;
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 750;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
html[data-theme] body[data-art="salon"] .trainer-link {
  display: grid;
  grid-template-columns: 24px 1fr auto 12px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid #50617c;
  border-radius: 16px;
  background: #13223bed;
  color: #f5f8ff;
  font: inherit;
  text-align: start;
  cursor: pointer;
  list-style: none;
}
#account-friends > summary::after {
  content: none;
}
.trainer-link::-webkit-details-marker {
  display: none;
}
.trainer-friends-icon {
  width: 22px;
  height: 22px;
}
.trainer-link > i {
  color: #bccbe1;
  font: 24px/1 system-ui, sans-serif;
  text-align: center;
}
#account-friends[open] > summary i {
  transform: rotate(90deg);
}
#account-friends[open] > #friends-host {
  margin-top: 10px;
}
html[data-theme] body[data-art="salon"] .friends-title {
  width: fit-content;
  padding: 4px 12px;
  border-radius: 8px;
  background: #152943;
  color: #fff;
}
html[data-theme] body[data-art="salon"] .friends-title small {
  color: #edcd98;
}
html[data-theme] body[data-art="salon"] .friends-soon {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}

/* Saisie compacte sur le fond du salon, dans les deux thèmes. */
.friends-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.friends-list-heading .friends-title:first-of-type {
  margin: 0;
}
html[data-theme] .friend-share {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #526783;
  border-radius: 50%;
  background: #152943;
  color: #eef4ff;
}
html[data-theme] .account-social .friends-add {
  margin: 0;
  padding: 6px;
  border: 1px solid #526783;
  border-radius: 16px;
  background: #152943;
}
.friends-add-row {
  align-items: center;
}
html[data-theme] #friend-handle {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 16px;
}
html[data-theme] #friend-handle::placeholder {
  color: #c6d4e8;
  opacity: 1;
}
html[data-theme] #friend-handle:focus-visible,
html[data-theme] .friend-share:focus-visible {
  outline: 2px solid #7addff;
  outline-offset: -2px;
}
html[data-theme] .friends-add .primary {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
}
html[data-theme] .friends-add .auth-error:not(:empty) {
  margin: 0;
  padding: 0 8px 4px;
  color: #ffb9c5;
}
