@charset "UTF-8";
/* =============================================================================
   SEND 4 RADIO · v2 · Design system « Régie » (version finale)
   -----------------------------------------------------------------------------
   Un seul fichier de style pour toute l'application.
   Ordre : tokens → base → typographie → gabarit → coquille → composants → états.

   Règles (sans exception) :
     · aucune feuille propre à une page, aucun bloc <style>, aucun style="" ;
     · aucune couleur écrite en dur hors des blocs de tokens ci-dessous ;
     · les composants s'adaptent à leur CONTENEUR (@container) : un même
       composant va dans une colonne, une modale ou la pleine largeur.

   Polices (Google Fonts, une seule superfamille) :
     IBM Plex Sans            → tout le texte d'interface (chiffres tabulaires)
     IBM Plex Sans Condensed  → libellés « console » : groupes de navigation,
                                étiquettes d'afficheurs, voyant ON AIR
     IBM Plex Mono            → uniquement afficheurs, heure antenne, touches
                                et identifiants à copier

   Couleur :
     · Dégradé cyan → violet : identité (logo, entrée active, onglet actif),
       l'UNIQUE bouton principal d'un écran, et les endroits « vivants »
       (repère Maintenant, forme d'onde, progression). Jamais décoratif.
     · Statuts : vert = livré / actif · ambre = à vérifier · rouge = en échec
       · cyan = en production · gris = programmé / en pause / inactif.
   ========================================================================== */


/* =============================================================================
   1. TOKENS
   ========================================================================== */

/* 1.1 Invariants : marque, typographie, espace, formes, profondeur, mouvement */
:root {
  /* Marque (identité uniquement) */
  --brand-cyan: #00b8ff;
  --brand-violet: #784eee;
  --grad-brand: linear-gradient(90deg, #00b8ff 0%, #784eee 100%);
  --grad-brand-v: linear-gradient(180deg, #00b8ff 0%, #784eee 100%);
  /* Action principale : même dégradé assombri → texte blanc AA (4,95:1 et 6,28:1) */
  --grad-action: linear-gradient(95deg, #0773c2 0%, #3a5ad6 48%, #6541dc 100%);
  --text-on-action: #ffffff;

  /* Typographie */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "Arial Narrow", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --text-xs: 12px;   /* réservé : touches, étiquettes de console, pavés de date */
  --text-sm: 13px;   /* minimum pour toute information (méta, aides) */
  --text-md: 14px;   /* contrôles, navigation, tableaux denses */
  --text-base: 15px; /* texte courant */
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;  /* titre de page */
  --text-4xl: 40px;  /* prix */

  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-base: 1.55;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --track-caps: .1em;
  --track-tight: -.015em;
  --track-title: -.022em;

  /* Espacements (grille de 4 px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Rayons : précis, jamais « bulle » */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 999px;

  /* Tailles de contrôles et d'icônes */
  --control-h: 38px;
  --control-h-sm: 32px;
  --control-h-lg: 44px;
  --icon-btn: 38px;
  --play-size: 36px;
  --hit-min: 44px;
  --icon-sm: 14px;
  --icon-md: 16px;
  --icon-lg: 18px;
  --icon-xl: 24px;
  --border-w: 1px;

  /* Gabarit */
  --sidebar-w: 248px;
  --rail-w: 72px;
  --topbar-h: 60px;
  --player-h: 68px;
  --tabbar-h: 62px;
  --content-max: 1320px;
  --content-narrow: 960px;
  --aside-w: 340px;
  --gutter: var(--space-8);

  /* Profondeur */
  --z-sticky: 20;
  --z-sidebar: 30;
  --z-player: 40;
  --z-tabbar: 45;
  --z-popover: 60;
  --z-scrim: 70;
  --z-drawer: 80;
  --z-toast: 90;

  /* Mouvement */
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 280ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* Pictogrammes CSS (masques : la couleur vient de currentColor) */
  --mask-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --mask-chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  --mask-sort: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  --mask-sort-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3Cpath d='M12 19V5'/%3E%3C/svg%3E");
  --mask-sort-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='m19 12-7 7-7-7'/%3E%3C/svg%3E");
  --mask-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --mask-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
  --mask-calendar-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M10 14l4 4M14 14l-4 4'/%3E%3C/svg%3E");
  --mask-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E");
  --mask-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
}

/* 1.2 Thème sombre (par défaut) — réappliqué aux zones .scheme-dark en thème clair */
:root,
[data-theme="light"] .scheme-dark {
  color-scheme: dark;

  /* Fond noir bleuté (accordé au contour marine du logo) + halos de marque discrets */
  --bg: #080c18;
  --bg-glow:
    radial-gradient(1000px 460px at 0% -8%, rgba(0, 184, 255, .07), transparent 62%),
    radial-gradient(900px 440px at 100% -14%, rgba(120, 78, 238, .085), transparent 60%);
  --surface-inset: #060913;
  --surface-1: #0c1222;
  --surface-2: #111830;
  --surface-3: #172039;
  --glass: rgba(8, 12, 24, .86);
  --overlay: rgba(3, 5, 12, .66);

  --line-soft: #131b30;
  --line: #1b2540;
  --line-strong: #2a3656;
  --line-hover: #3a4870;

  --text: #e8edf7;
  --text-2: #a8b2c8;
  --text-3: #8d98b3;         /* ≥ 5,5:1 sur toutes les surfaces, 5,2:1 sur les fonds teintés */
  --text-disabled: #505b78;
  --text-inverse: #080c18;

  /* Sélection (choix coché, jour coché, colonne du jour) */
  --accent: #38c6ff;
  --accent-soft: rgba(56, 198, 255, .11);
  --accent-line: rgba(56, 198, 255, .45);

  --brand-soft: rgba(120, 78, 238, .14);
  --brand-cyan-soft: rgba(0, 184, 255, .12);
  --brand-text: #b9a6ff;

  /* Statuts */
  --ok: #3ad083;
  --ok-soft: rgba(58, 208, 131, .12);
  --ok-line: rgba(58, 208, 131, .36);
  --ok-glow: rgba(58, 208, 131, .5);

  --warn: #ffb224;
  --warn-soft: rgba(255, 178, 36, .12);
  --warn-line: rgba(255, 178, 36, .38);
  --warn-glow: rgba(255, 178, 36, .45);
  --warn-tint: rgba(255, 178, 36, .045);

  --fail: #ff6b6b;
  --fail-soft: rgba(255, 107, 107, .12);
  --fail-line: rgba(255, 107, 107, .42);
  --fail-glow: rgba(255, 107, 107, .5);
  --fail-tint: rgba(255, 107, 107, .045);

  --live: #38c6ff;
  --live-soft: rgba(56, 198, 255, .11);
  --live-line: rgba(56, 198, 255, .42);
  --live-glow: rgba(56, 198, 255, .5);

  --idle: #939db3;
  --idle-soft: rgba(147, 157, 179, .1);
  --idle-line: #2d3957;

  --focus: #5fd0ff;
  --focus-ring: 0 0 0 3px rgba(95, 208, 255, .24);
  --selection: rgba(0, 184, 255, .3);

  /* Ombres */
  --shadow-panel: inset 0 1px 0 rgba(255, 255, 255, .03), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-pop: 0 18px 44px -10px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .35);
  --shadow-modal: 0 32px 80px -12px rgba(0, 0, 0, .8);
  --shadow-action: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 22px -10px rgba(0, 184, 255, .55), 0 10px 26px -12px rgba(120, 78, 238, .75);
  --shadow-action-hover: inset 0 1px 0 rgba(255, 255, 255, .26), 0 10px 28px -10px rgba(0, 184, 255, .7), 0 14px 34px -12px rgba(120, 78, 238, .95);
  --shadow-raised: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-dot-ring: 0 0 0 2px var(--bg);

  --past-fill: rgba(255, 255, 255, .03);
  --track-grid: rgba(148, 163, 194, .08);
  --skeleton-a: #111830;
  --skeleton-b: #1a2442;

  /* Chevron du <select> : suit le thème */
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d98b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* Affiches BO ciné (placeholders sans image externe) */
  --poster-1: linear-gradient(160deg, rgba(0, 184, 255, .32), rgba(8, 12, 24, 0) 62%), linear-gradient(20deg, #101a33, #1d2748);
  --poster-2: linear-gradient(200deg, rgba(120, 78, 238, .38), rgba(8, 12, 24, 0) 60%), linear-gradient(160deg, #141733, #231c46);
  --poster-3: linear-gradient(140deg, rgba(58, 208, 131, .22), rgba(8, 12, 24, 0) 60%), linear-gradient(200deg, #0f1d2a, #13283a);
  --poster-4: linear-gradient(180deg, rgba(255, 178, 36, .22), rgba(8, 12, 24, 0) 60%), linear-gradient(20deg, #1c1a27, #2b2236);
}

/* 1.3 Thème clair (secondaire). La barre latérale reste sombre (.scheme-dark). */
[data-theme="light"] {
  color-scheme: light;

  --bg: #eef1f6;
  --bg-glow:
    radial-gradient(1000px 460px at 0% -8%, rgba(0, 184, 255, .08), transparent 62%),
    radial-gradient(900px 440px at 100% -14%, rgba(120, 78, 238, .07), transparent 60%);
  --surface-inset: #f3f5f9;
  --surface-1: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #e9edf3;
  --glass: rgba(238, 241, 246, .9);
  --overlay: rgba(12, 18, 30, .4);

  --line-soft: #eaedf2;
  --line: #dfe4eb;
  --line-strong: #cbd2dd;
  --line-hover: #aeb8c7;

  --text: #0b1220;
  --text-2: #3e485a;
  --text-3: #586275;
  --text-disabled: #9aa3b2;
  --text-inverse: #ffffff;

  --accent: #03679e;
  --accent-soft: rgba(3, 103, 158, .08);
  --accent-line: rgba(3, 103, 158, .42);

  --brand-soft: rgba(120, 78, 238, .1);
  --brand-cyan-soft: rgba(0, 150, 220, .1);
  --brand-text: #5a3cc8;

  --ok: #086b3b;
  --ok-soft: rgba(8, 107, 59, .09);
  --ok-line: rgba(8, 107, 59, .32);
  --ok-glow: rgba(8, 107, 59, .28);

  --warn: #875000;
  --warn-soft: rgba(196, 118, 0, .11);
  --warn-line: rgba(135, 80, 0, .36);
  --warn-glow: rgba(196, 118, 0, .28);
  --warn-tint: rgba(196, 118, 0, .04);

  --fail: #b52323;
  --fail-soft: rgba(181, 35, 35, .08);
  --fail-line: rgba(181, 35, 35, .34);
  --fail-glow: rgba(181, 35, 35, .28);
  --fail-tint: rgba(181, 35, 35, .035);

  --live: #035c8f;
  --live-soft: rgba(3, 92, 143, .08);
  --live-line: rgba(3, 92, 143, .34);
  --live-glow: rgba(3, 92, 143, .28);

  --idle: #535e71;
  --idle-soft: rgba(83, 94, 113, .08);
  --idle-line: #cbd2dd;

  --focus: #03679e;
  --focus-ring: 0 0 0 3px rgba(3, 103, 158, .18);
  --selection: rgba(3, 103, 158, .18);

  --shadow-panel: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-pop: 0 18px 44px -14px rgba(15, 23, 42, .28), 0 0 0 1px rgba(15, 23, 42, .04);
  --shadow-modal: 0 32px 80px -16px rgba(15, 23, 42, .36);
  --shadow-action: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 20px -10px rgba(7, 115, 194, .45), 0 10px 24px -12px rgba(101, 65, 220, .55);
  --shadow-action-hover: inset 0 1px 0 rgba(255, 255, 255, .26), 0 10px 24px -10px rgba(7, 115, 194, .6), 0 14px 30px -12px rgba(101, 65, 220, .7);
  --shadow-raised: 0 1px 2px rgba(15, 23, 42, .1);
  --shadow-dot-ring: 0 0 0 2px var(--bg);

  --past-fill: rgba(15, 23, 42, .04);
  --track-grid: rgba(15, 23, 42, .07);
  --skeleton-a: #eef1f5;
  --skeleton-b: #e0e5ec;

  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23586275' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  --poster-1: linear-gradient(160deg, rgba(0, 184, 255, .35), rgba(255, 255, 255, 0) 62%), linear-gradient(20deg, #dde6f3, #c9d6ea);
  --poster-2: linear-gradient(200deg, rgba(120, 78, 238, .35), rgba(255, 255, 255, 0) 60%), linear-gradient(160deg, #e3e0f3, #d2cbef);
  --poster-3: linear-gradient(140deg, rgba(58, 208, 131, .3), rgba(255, 255, 255, 0) 60%), linear-gradient(200deg, #dcece6, #c8e0d6);
  --poster-4: linear-gradient(180deg, rgba(255, 178, 36, .3), rgba(255, 255, 255, 0) 60%), linear-gradient(20deg, #efe8dc, #e6d9c3);
}

/* 1.4 Écrans tactiles : cibles de 44 px, champs à 16 px (pas de zoom iOS) */
@media (pointer: coarse) {
  :root {
    --control-h: 44px;
    --control-h-sm: 40px;
    --icon-btn: 44px;
    --play-size: 44px;
  }
}

@media (max-width: 767px) {
  :root {
    --gutter: var(--space-4);
    --player-h: 60px;
    --topbar-h: 56px;
  }
}


/* =============================================================================
   2. BASE
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
  scroll-padding-top: calc(var(--topbar-h) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--bg-glow);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--lh-base);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, h5, p, ul, ol, figure, dl, dd, blockquote, fieldset {
  margin: 0;
}

fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

sup {
  font-size: .72em;
  line-height: 0;
  vertical-align: .45em;
}

hr {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--line);
}

::selection {
  background: var(--selection);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Icônes Lucide : monochromes, une seule graisse */
.lucide {
  width: var(--icon-md);
  height: var(--icon-md);
  flex: none;
  stroke-width: 1.75;
}

/* Accessibilité */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--text);
  font-weight: var(--weight-semibold);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: none;
}


/* =============================================================================
   3. TYPOGRAPHIE ET UTILITAIRES DE TEXTE
   ========================================================================== */

/* Libellé de console (petites capitales condensées) : à utiliser avec parcimonie */
.eyebrow {
  color: var(--text-3);
  font-family: var(--font-cond);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}

.h1 { font-size: var(--text-3xl); font-weight: var(--weight-semibold); line-height: 1.15; letter-spacing: var(--track-title); }
.h2 { font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--lh-tight); letter-spacing: var(--track-tight); }
.h3 { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--lh-snug); }

/* Utilitaires de texte (.text-sm, .text-2, .text-fail, .strong, .nowrap…) : voir § 29, en fin de fichier,
   pour qu'ils l'emportent toujours sur la couleur ou la taille d'un composant. */

/* Heures, durées, montants : IBM Plex Sans en chiffres tabulaires (pas de zéro pointé) */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

/* Identifiants à copier (hôte FTP, clé de licence, code studio) */
.code {
  font-family: var(--font-mono);
  font-size: .94em;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-color: var(--line-hover);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.link:hover {
  text-decoration-color: currentColor;
}

.link--quiet {
  color: var(--text-2);
  text-decoration: none;
}

.link--quiet:hover {
  color: var(--text);
}

.link .lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

/* Lien externe : ajoute la flèche ↗ automatiquement */
.link--external::after {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: var(--mask-external) center / contain no-repeat;
  mask: var(--mask-external) center / contain no-repeat;
  opacity: .8;
}

.kbd {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--space-1);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}

/* Texte long (CGU, FAQ, aide) */
.prose {
  max-width: 72ch;
  color: var(--text-2);
}

.prose > * + * {
  margin-top: var(--space-3);
}

.prose h2,
.prose h3 {
  margin-top: var(--space-6);
  color: var(--text);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
}

.prose h2 { font-size: var(--text-lg); }
.prose h3 { font-size: var(--text-base); }

.prose ul,
.prose ol {
  padding-left: var(--space-5);
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li + li {
  margin-top: var(--space-1);
}

.prose strong {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-hover);
  text-underline-offset: 3px;
}

/* Métadonnées en ligne : « Chronique · voix Claire · 2:10 » */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta__item .lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.meta__item strong {
  color: var(--text-2);
  font-weight: var(--weight-medium);
}


/* =============================================================================
   4. MISE EN PAGE
   Coquille : barre latérale fixe · barre haute fixe · page · lecteur · onglets
   ========================================================================== */

/* La coquille réserve sa place en CSS : aucun saut quand s4r.js l'insère. */
body:not([data-layout="auth"]) {
  padding-top: var(--topbar-h);
  padding-left: var(--sidebar-w);
}

body.has-player:not([data-layout="auth"]) {
  padding-bottom: var(--player-h);
}

/* Page : colonne centrée, blocs espacés de 24 px.
   La page et ses colonnes sont des conteneurs : un composant posé hors carte
   (alerte autonome, liste, réglages) s'adapte quand même à la place disponible. */
.page {
  container: page / inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-12);
}

.page:focus {
  outline: none;
}

.page--narrow {
  max-width: calc(var(--content-narrow) + 2 * var(--gutter));
}

/* En-tête de page : titre, description utile, actions (un seul bouton principal) */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}

.page-header__titles {
  display: flex;
  flex: 1 1 420px;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.page-header__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  color: var(--text);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  line-height: 1.15;
  letter-spacing: var(--track-title);
}

.page-header__desc {
  max-width: 72ch;
  color: var(--text-2);
  font-size: var(--text-base);
  line-height: var(--lh-snug);
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.page-header__media {
  display: grid;
  flex: none;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text-2);
}

.page-header__media .lucide {
  width: 26px;
  height: 26px;
}

.page-header__lead {
  display: flex;
  flex: 1 1 420px;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

/* Titre de section hors carte */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.section-head__titles {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
}

.section-title .lucide {
  color: var(--text-3);
}

.section-desc {
  color: var(--text-2);
  font-size: var(--text-md);
}

.section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Primitives de composition */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.stack--xs { gap: var(--space-1); }
.stack--sm { gap: var(--space-2); }
.stack--md { gap: var(--space-3); }
.stack--lg { gap: var(--space-6); }
.stack--xl { gap: var(--space-8); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.cluster--xs { gap: var(--space-1); }
.cluster--lg { gap: var(--space-4); }
.cluster--between { justify-content: space-between; }
.cluster--end { justify-content: flex-end; }
.cluster--top { align-items: flex-start; }
.cluster--nowrap { flex-wrap: nowrap; }

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-5);
  align-items: start;
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 264px), 1fr)); gap: var(--space-4); align-items: stretch; }
.grid--posters { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--space-5); align-items: stretch; }
.grid--dense { gap: var(--space-3); }
.grid--stretch { align-items: stretch; }

@media (max-width: 1199px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* Colonne principale + colonne latérale (gabarits tableau de bord et fiche) */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--aside-w);
  gap: var(--space-5);
  align-items: start;
}

.split__main,
.split__aside {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

@media (max-width: 1439px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .split__aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 899px) {
  .split__aside {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .page {
    gap: var(--space-5);
    padding-top: var(--space-4);
    padding-bottom: var(--space-10);
  }

  .page-header__title {
    font-size: var(--text-2xl);
  }

  .page-header__actions {
    width: 100%;
  }

  .page-header__actions > .btn,
  .page-header__actions > .popover-anchor:has(> .btn:not(.btn--icon)) {
    flex: 1 1 auto;
  }

  .page-header__actions > .popover-anchor > .btn:not(.btn--icon) {
    width: 100%;
  }

  .page-header__media {
    width: 44px;
    height: 44px;
  }

  .page-header__media .lucide {
    width: 22px;
    height: 22px;
  }
}


/* =============================================================================
   5. BARRE LATÉRALE ET NAVIGATION
   ≥ 1024 px : barre complète · 768–1023 px : rail d'icônes · < 768 px : tiroir
   ========================================================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  background: var(--surface-inset);
  border-right: 1px solid var(--line);
  color: var(--text-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--topbar-h);
  padding: var(--space-3) var(--space-3) var(--space-2) var(--space-5);
}

.sidebar__brand {
  display: block;
  border-radius: var(--radius-sm);
}

.sidebar__logo {
  width: 168px;
  height: auto;
}

.sidebar__mark {
  display: none;
  width: 30px;
  height: 30px;
}

.sidebar .sidebar__close {
  display: none;
}

.sidebar__tag {
  margin: 0 var(--space-5) var(--space-2);
}

.sidebar__foot {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) 0 var(--space-5);
  border-top: 1px solid var(--line);
}

/* Carte « station » : la radio + l'état global de l'antenne */
.station {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-1) var(--space-3) var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-panel);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.station:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.station__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.station__name {
  color: var(--text);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-tight);
}

.station__state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-2);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.station__state--fail { color: var(--fail); }
.station__state--warn { color: var(--warn); }
.station__state--ok { color: var(--ok); }

.station__chevron {
  color: var(--text-3);
}

.nav {
  flex: 1;
  padding-bottom: var(--space-4);
}

.nav__label {
  padding: var(--space-5) var(--space-5) var(--space-2);
  color: var(--text-3);
  font-family: var(--font-cond);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nav__list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 36px;
  margin: 0 var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: var(--text-md);
  line-height: var(--lh-tight);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.nav__link .lucide {
  width: 17px;
  height: 17px;
  color: var(--text-3);
  transition: color var(--dur-fast) var(--ease);
}

.nav__text {
  min-width: 0;
}

.nav__link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav__link:hover .lucide {
  color: var(--text-2);
}

.nav__link[aria-current="page"] {
  background: var(--surface-3);
  color: var(--text);
  font-weight: var(--weight-medium);
}

.nav__link[aria-current="page"] .lucide {
  color: var(--text);
}

/* Entrée active : filet au dégradé de marque */
.nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: calc(-1 * var(--space-3));
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--grad-brand-v);
}

/* Entrée de tête d'un groupe (Mises à jour des contenus) : encadrée, puis un filet avant les contenus */
.nav__lead {
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
}

.nav__link--lead {
  border: 1px solid var(--line-strong);
  background: var(--brand-soft);
  color: var(--text);
  font-weight: var(--weight-medium);
}

.nav__link--lead .lucide {
  color: var(--brand-text);
}

.nav__link--lead:hover {
  border-color: var(--line-hover);
}

.nav__link--small {
  min-height: 32px;
  color: var(--text-3);
  font-size: var(--text-sm);
}

.nav__link--small::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: auto;
  background: currentColor;
  -webkit-mask: var(--mask-external) center / contain no-repeat;
  mask: var(--mask-external) center / contain no-repeat;
}

.nav__meta {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.nav__link .count {
  margin-left: auto;
}

/* État des services Send4Radio (pied de barre) */
.service-state {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 var(--space-3) var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: var(--text-sm);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.service-state:hover {
  background: var(--surface-2);
  color: var(--text);
}

.service-state::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: auto;
  background: var(--text-3);
  -webkit-mask: var(--mask-external) center / contain no-repeat;
  mask: var(--mask-external) center / contain no-repeat;
}

/* Voile derrière le tiroir mobile */
.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: var(--overlay);
  backdrop-filter: blur(3px);
}

/* Rail d'icônes (tablette) */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --sidebar-w: var(--rail-w);
  }

  .sidebar__head {
    justify-content: center;
    padding: var(--space-3) 0;
  }

  .sidebar__logo,
  .station__body,
  .station__chevron,
  .sidebar__foot,
  .sidebar__tag {
    display: none;
  }

  .sidebar__mark {
    display: block;
  }

  .station {
    grid-template-columns: auto;
    justify-content: center;
    margin: 0 var(--space-3) var(--space-2);
    padding: var(--space-2) 0;
  }

  .nav__label {
    height: 1px;
    margin: var(--space-3) var(--space-4);
    padding: 0;
    overflow: hidden;
    background: var(--line);
    color: transparent;
  }

  .nav__link {
    justify-content: center;
    width: 48px;
    min-height: 44px;
    margin: 0 auto;
    padding: 0;
  }

  .nav__link[aria-current="page"]::before {
    left: -12px;
  }

  .nav__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .nav__link .count,
  .nav__meta {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
  }

  .nav__link .count {
    min-width: 10px;
    width: 10px;
    height: 10px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    box-shadow: 0 0 0 2px var(--surface-inset);
  }
}

/* Tiroir (mobile) */
@media (max-width: 767px) {
  body:not([data-layout="auth"]) {
    padding-left: 0;
    padding-bottom: var(--tabbar-h);
  }

  body.has-player:not([data-layout="auth"]) {
    padding-bottom: calc(var(--tabbar-h) + var(--player-h));
  }

  .sidebar {
    z-index: var(--z-drawer);
    width: min(300px, 86vw);
    box-shadow: var(--shadow-modal);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
  }

  .sidebar.is-open {
    transform: none;
    visibility: visible;
    transition: transform var(--dur-slow) var(--ease-out), visibility 0s;
  }

  .sidebar .sidebar__close {
    display: inline-flex;
  }

  .nav__link {
    min-height: 44px;
  }
}


/* =============================================================================
   6. BARRE HAUTE : fil d'Ariane · heure antenne · recherche · nouveautés · compte
   ========================================================================== */

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-w);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(14px);
}

.topbar .topbar__menu,
.topbar .topbar__back {
  display: none;
}

.topbar__crumbs {
  flex: 1;
  min-width: 0;
}

.topbar__tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
}

/* Fil d'Ariane */
.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.breadcrumb li {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-3);
  font-size: var(--text-md);
  white-space: nowrap;
}

.breadcrumb li + li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  background: currentColor;
  opacity: .7;
  -webkit-mask: var(--mask-chevron-right) center / contain no-repeat;
  mask: var(--mask-chevron-right) center / contain no-repeat;
}

.breadcrumb a {
  color: var(--text-2);
  border-radius: var(--radius-xs);
  transition: color var(--dur-fast) var(--ease);
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb [aria-current="page"] {
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--text);
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
}

/* Heure antenne (afficheur) : mise à jour à la minute, jamais à la seconde */
.clock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-inset);
}

.clock__label {
  color: var(--text-3);
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.clock__value {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  line-height: 1;
}

.clock__date {
  color: var(--text-2);
  font-size: var(--text-sm);
}

.clock__time {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
}

/* Déclencheur de la recherche rapide (Ctrl K) */
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: 224px;
  height: var(--control-h);
  padding: 0 var(--space-2) 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text-3);
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.search-trigger:hover {
  border-color: var(--line-hover);
  color: var(--text-2);
}

.search-trigger__text {
  flex: 1;
  font-size: var(--text-md);
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-h);
  padding: 0 var(--space-2) 0 var(--space-1);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  background: var(--surface-2);
  border-color: var(--line);
}

.account-trigger .lucide {
  color: var(--text-3);
}

@media (max-width: 1199px) {
  .clock {
    display: none;
  }
}

@media (max-width: 1279px) {
  .search-trigger {
    width: auto;
  }

  .search-trigger__text {
    display: none;
  }
}

@media (max-width: 1023px) {
  .account-trigger__name {
    display: none;
  }
}

@media (max-width: 767px) {
  .topbar {
    left: 0;
    gap: var(--space-1);
    padding: 0 var(--space-2);
  }

  .topbar .topbar__menu {
    display: inline-flex;
  }

  .topbar .topbar__back {
    display: inline-flex;
  }

  .topbar__back + .topbar__crumbs {
    margin-left: calc(-1 * var(--space-1));
  }

  .breadcrumb li:not(:last-child) {
    display: none;
  }

  .breadcrumb li + li::before {
    display: none;
  }

  .breadcrumb li {
    font-size: var(--text-base);
  }

  .search-trigger {
    width: var(--icon-btn);
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: none;
    color: var(--text-2);
  }

  .search-trigger:hover {
    background: var(--surface-2);
  }

  .search-trigger .kbd,
  .account-trigger > .lucide {
    display: none;
  }

  .topbar__tools {
    gap: 0;
  }
}


/* =============================================================================
   7. NAVIGATION MOBILE : barre d'onglets + sous-navigation de rubrique
   ========================================================================== */

.tabbar,
.subnav {
  display: none;
}

@media (max-width: 767px) {
  .tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-tabbar);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: var(--tabbar-h);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: var(--surface-inset);
  }

  .tabbar__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: var(--hit-min);
    color: var(--text-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    transition: color var(--dur-fast) var(--ease);
  }

  .tabbar__item .lucide {
    width: 20px;
    height: 20px;
  }

  .tabbar__item:focus-visible {
    outline-offset: -3px;
  }

  .tabbar__item[aria-current="page"] {
    color: var(--text);
  }

  .tabbar__item[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 28%;
    right: 28%;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--grad-brand);
  }

  .tabbar__badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
  }

  /* Sous-navigation de la rubrique (Contenus, Livraison, Compte) */
  .subnav {
    display: flex;
    align-self: stretch;
    max-width: 100vw;
    gap: var(--space-2);
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .subnav::-webkit-scrollbar {
    display: none;
  }

  .subnav__link {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 var(--space-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-full);
    color: var(--text-2);
    font-size: var(--text-md);
    white-space: nowrap;
  }

  .subnav__link .lucide {
    width: var(--icon-sm);
    height: var(--icon-sm);
  }

  .subnav__link[aria-current="page"] {
    border-color: var(--accent-line);
    background: var(--accent-soft);
    color: var(--text);
    font-weight: var(--weight-medium);
  }
}


/* =============================================================================
   8. BOUTONS
   Principal (dégradé, UN SEUL par écran) · secondaire · discret · danger · icône
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-h);
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.btn .lucide {
  width: var(--icon-md);
  height: var(--icon-md);
}

.btn:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--grad-action);
  color: var(--text-on-action);
  box-shadow: var(--shadow-action);
}

.btn--primary:hover {
  box-shadow: var(--shadow-action-hover);
}

.btn--secondary {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}

.btn--secondary:hover {
  border-color: var(--line-hover);
  background: var(--surface-2);
}

.btn--ghost {
  color: var(--text-2);
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn--danger {
  border-color: var(--fail-line);
  background: var(--fail-soft);
  color: var(--fail);
}

.btn--danger:hover {
  border-color: var(--fail);
}

.btn--sm {
  height: var(--control-h-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
}

.btn--lg {
  height: var(--control-h-lg);
  padding: 0 var(--space-5);
  font-size: var(--text-base);
}

.btn--icon {
  width: var(--icon-btn);
  height: var(--icon-btn);
  padding: 0;
}

.btn--icon .lucide {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

.btn--icon.btn--sm {
  width: var(--control-h-sm);
  height: var(--control-h-sm);
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn:disabled:active,
.btn[aria-disabled="true"]:active {
  transform: none;
}

/* Chargement : l'icône laisse place à un indicateur (ajouter aussi aria-busy="true") */
.btn.is-busy {
  cursor: progress;
  pointer-events: none;
}

.btn.is-busy .lucide {
  display: none;
}

.btn.is-busy::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

/* Pastille « non lu » posée sur un bouton icône */
.dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-cyan);
  box-shadow: var(--shadow-dot-ring);
  pointer-events: none;
}

/* Choisir un fichier sous forme de bouton : <label class="btn btn--secondary"><input class="sr-only" type="file">…</label> */
label.btn:has(> input[type="file"]:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Icône qui tourne (traitement en cours dans une alerte, une liste) */
.icon-spin,
.lucide.icon-spin {
  animation: spin 1.1s linear infinite;
}

/* Groupe de boutons */
.btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}


/* -----------------------------------------------------------------------------
   8.1 Bouton ▶ de pré-écoute : même forme, même place dans toutes les listes.
   Les icônes (lecture, pause, chargement) sont injectées par s4r.js.
   -------------------------------------------------------------------------- */

.play {
  --play: var(--play-size);
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--play);
  height: var(--play);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}

.play > * {
  grid-area: 1 / 1;
}

.play .lucide {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.play .icon-play,
.play .icon-pause {
  fill: currentColor;
}

.play .icon-play {
  margin-left: 2px;
}

.play .icon-pause,
.play .icon-busy {
  display: none;
}

.play:hover {
  border-color: var(--text-2);
  background: var(--surface-3);
}

/* En écoute : le seul autre endroit « vivant » en dégradé */
.play[aria-pressed="true"] {
  border-color: transparent;
  background: var(--grad-action);
  color: var(--text-on-action);
  box-shadow: var(--shadow-action);
}

.play[aria-pressed="true"] .icon-play {
  display: none;
}

.play[aria-pressed="true"] .icon-pause {
  display: block;
}

/* Fichier en production : indicateur de chargement, pas encore écoutable */
.play.is-busy {
  border-color: var(--live-line);
  background: var(--live-soft);
  color: var(--live);
  cursor: progress;
}

.play.is-busy .icon-play,
.play.is-busy .icon-pause {
  display: none;
}

.play.is-busy .icon-busy {
  display: block;
  fill: none;
  animation: spin 1.1s linear infinite;
}

/* Pas encore produit : contour pointillé */
.play:disabled:not(.is-busy) {
  border-style: dashed;
  background: none;
  color: var(--text-disabled);
  cursor: not-allowed;
}

.play--sm { --play: 30px; }
.play--lg { --play: 44px; }

.play--lg .lucide {
  width: 16px;
  height: 16px;
}

@media (pointer: coarse) {
  .play--sm { --play: 40px; }
}


/* =============================================================================
   9. CHAMPS DE FORMULAIRE
   ========================================================================== */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field__label {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.field__optional {
  color: var(--text-3);
  font-weight: var(--weight-regular);
}

.field__hint {
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fail);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.field__error::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--mask-alert) center / contain no-repeat;
  mask: var(--mask-alert) center / contain no-repeat;
}

.field__foot {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.field__counter {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.input,
.select,
.textarea {
  width: 100%;
  height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background-color: var(--surface-inset);
  color: var(--text);
  font-size: var(--text-base);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.textarea {
  height: auto;
  min-height: 120px;
  padding: var(--space-3);
  line-height: var(--lh-base);
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-hover);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: var(--focus-ring);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--fail);
  box-shadow: 0 0 0 3px var(--fail-soft);
}

.input:disabled,
.select:disabled,
.textarea:disabled,
.input[readonly] {
  background-color: var(--surface-2);
  color: var(--text-2);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.input--code {
  font-family: var(--font-mono);
  font-size: var(--text-md);
}

.input--time {
  width: auto;
  min-width: 96px;
}

.select {
  appearance: none;
  padding-right: var(--space-8);
  background-image: var(--icon-chevron);
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

.select--auto {
  width: auto;
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

@media (pointer: coarse) {
  .input,
  .select,
  .textarea {
    font-size: 16px;
  }
}

/* Champ avec préfixe / suffixe / bouton accolé (copier, afficher) */
.input-group {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.input-group > .input,
.input-group > .select {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 0;
}

.input-group > :first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.input-group > :last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.input-group > * + * {
  margin-left: -1px;
}

.input-group > .btn {
  flex: none;
  height: auto;
  min-height: var(--control-h);
  border-color: var(--line-strong);
  border-radius: 0;
}

.input-group > .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group > .input:focus-visible,
.input-group > .select:focus-visible {
  position: relative;
  z-index: 1;
}

.input-group__addon {
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--text-md);
  white-space: nowrap;
}

/* Recherche avec loupe */
.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  background: var(--text-3);
  pointer-events: none;
  -webkit-mask: var(--mask-search) center / contain no-repeat;
  mask: var(--mask-search) center / contain no-repeat;
}

.search .input {
  padding-left: 38px;
}

.search--wide {
  flex: 1 1 280px;
  max-width: 420px;
}

/* Heure (heure + minutes) */
.time-field {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.time-field__sep {
  color: var(--text-3);
  font-weight: var(--weight-semibold);
}

.time-field .select {
  width: auto;
  min-width: 84px;
}

/* Case à cocher et bouton radio */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: var(--control-h-sm);
  padding: 5px 0;
  color: var(--text);
  line-height: var(--lh-snug);
  cursor: pointer;
}

.check input,
.choice__input {
  appearance: none;
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border: 1px solid var(--line-hover);
  border-radius: var(--radius-xs);
  background: var(--surface-inset);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.check input[type="radio"],
.choice__input[type="radio"] {
  border-radius: 50%;
}

.check input::after,
.choice__input::after {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--text-on-action);
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-out);
  -webkit-mask: var(--mask-check) center / contain no-repeat;
  mask: var(--mask-check) center / contain no-repeat;
}

.check input[type="radio"]::after,
.choice__input[type="radio"]::after {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  -webkit-mask: none;
  mask: none;
}

.check input:checked,
.choice__input:checked {
  border-color: transparent;
  background: var(--grad-action);
}

.check input:checked::after,
.choice__input:checked::after {
  transform: none;
}

.check input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.check:has(input:disabled) {
  color: var(--text-3);
  cursor: not-allowed;
}

.check__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check__desc {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.checks {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.checks--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

/* Interrupteur (button role="switch" aria-checked) */
.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line-hover);
  border-radius: var(--radius-full);
  background: var(--surface-3);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform var(--dur) var(--ease-out), background-color var(--dur) var(--ease);
}

.switch[aria-checked="true"],
[aria-checked="true"] > .switch {
  border-color: transparent;
  background: var(--grad-action);
}

.switch[aria-checked="true"]::after,
[aria-checked="true"] > .switch::after {
  background: var(--text-on-action);
  transform: translateX(18px);
}

.switch:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (pointer: coarse) {
  button.switch {
    position: relative;
  }

  button.switch::before {
    content: "";
    position: absolute;
    inset: -11px -4px;
  }
}

/* Interrupteur avec libellé visible */
.switch-field {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-h-sm);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
}

/* Pastilles à cocher : jours de la semaine, minutes (10 / 30 / 45), options courtes */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  position: relative;
  display: inline-flex;
}

.pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pill__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 52px;
  height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-inset);
  color: var(--text-2);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  pointer-events: none;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.pill:hover .pill__label {
  border-color: var(--line-hover);
  color: var(--text);
}

.pill input:checked + .pill__label {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}

.pill input:checked + .pill__label::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--accent);
  -webkit-mask: var(--mask-check) center / contain no-repeat;
  mask: var(--mask-check) center / contain no-repeat;
}

.pill input:focus-visible + .pill__label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.pill input:disabled {
  cursor: not-allowed;
}

.pill input:disabled + .pill__label {
  opacity: .4;
  text-decoration: line-through;
}

/* Cartes de choix (voix, mode de livraison, formule) : radio + ▶ facultatif */
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: var(--space-3);
}

/* Deux colonnes fixes (4 voix = 2 × 2), une seule colonne sur mobile */
.choices--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 599px) {
  .choices--2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.choice:hover {
  border-color: var(--line-hover);
}

.choice:has(.choice__input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.choice:has(.choice__input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.choice:has(.choice__input:disabled) {
  opacity: .5;
}

.choice__label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  cursor: pointer;
}

/* Toute la carte est cliquable ; ▶ et boutons restent au-dessus */
.choice__label::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.choice > .play,
.choice > .btn,
.choice > .link,
.choice > .status {
  position: relative;
  z-index: 1;
}

.choice__title {
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.choice__desc {
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.choice__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-2);
}

.choice__icon .lucide {
  width: 20px;
  height: 20px;
}

.choice--block {
  align-items: flex-start;
  flex-direction: column;
  padding: var(--space-4);
}

.choice--block .choice__input {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

/* Dépôt de fichier (MP3) : vide · glisser · valide · refusé */
.upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-4);
  border: 1px dashed var(--line-hover);
  border-radius: var(--radius-lg);
  background: var(--surface-inset);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.upload__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.upload:hover,
.upload.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload:has(.upload__input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.upload__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-2);
}

.upload__icon .lucide {
  width: 20px;
  height: 20px;
}

.upload__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.upload__title {
  color: var(--text);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.upload__hint {
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.upload__status {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}

.upload__status .lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.upload__action {
  position: relative;
  z-index: 1;
  flex: none;
}

/* « Retirer » n'apparaît qu'une fois un fichier choisi */
.upload:not(.is-valid):not(.is-invalid) > [data-upload-clear] {
  display: none;
}

.upload.is-valid {
  border-style: solid;
  border-color: var(--ok-line);
  background: var(--surface-1);
}

.upload.is-valid .upload__icon {
  border-color: var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok);
}

.upload.is-valid .upload__status {
  display: flex;
  color: var(--ok);
}

.upload.is-invalid {
  border-style: solid;
  border-color: var(--fail-line);
  background: var(--fail-tint);
}

.upload.is-invalid .upload__icon {
  border-color: var(--fail-line);
  background: var(--fail-soft);
  color: var(--fail);
}

.upload.is-invalid .upload__status {
  display: flex;
  color: var(--fail);
}

.upload.is-busy .upload__status {
  display: flex;
  color: var(--live);
}

.upload.is-valid .upload__hint,
.upload.is-invalid .upload__hint,
.upload.is-busy .upload__hint {
  display: none;
}

/* Fichier attendu mais absent (ex. titre introuvable du Hit des Auditeurs) */
.upload.is-missing {
  border-color: var(--warn-line);
  background: var(--warn-tint);
}

.upload.is-missing .upload__icon {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
}

.upload--compact {
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
}

.upload--compact .upload__icon {
  width: 32px;
  height: 32px;
}

.upload--compact .upload__icon .lucide {
  width: 16px;
  height: 16px;
}

.upload--compact .upload__title {
  font-size: var(--text-md);
}

/* Curseur (durée du mixage 1 → 10) */
.range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.range-field__value {
  min-width: 40px;
  color: var(--text);
  font-weight: var(--weight-semibold);
  text-align: right;
}

.range {
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  accent-color: var(--brand-cyan);
  cursor: pointer;
  appearance: none;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--line-strong);
}

.range::-moz-range-track {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--line-strong);
}

.range::-moz-range-progress {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--grad-brand);
}

.range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 2px solid var(--surface-1);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px var(--line-hover);
  appearance: none;
}

.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--surface-1);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px var(--line-hover);
}

.range:focus-visible {
  outline: none;
}

.range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px var(--line-hover), 0 0 0 4px var(--focus);
}

.range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 1px var(--line-hover), 0 0 0 4px var(--focus);
}


/* =============================================================================
   10. CARTES
   ========================================================================== */

.card {
  container: card / inline-size;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-panel);
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-height: 56px;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--line);
}

.card__head--plain {
  border-bottom: 0;
  padding-bottom: 0;
}

.card__heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card__title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
}

.card__title .lucide {
  color: var(--text-3);
}

/* Sous-titre à l'intérieur d'une carte (h3) : un cran sous .card__title */
.card__subtitle {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
}

.card__desc {
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.card__meta {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* Filtres + recherche dans l'en-tête d'une carte : le groupe prend la place restante, aligné à droite */
.card__head > .toolbar__group {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.card__body--flush {
  display: block;
  padding: 0;
}

.card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--text-sm);
}

.card--inset {
  background: var(--surface-inset);
  box-shadow: none;
}

.card--muted {
  background: var(--surface-2);
  box-shadow: none;
}

/* Carte-lien entière */
.card--link {
  position: relative;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.card--link:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

@container card (max-width: 480px) {
  .card__head,
  .card__body,
  .card__foot {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* Tuile de catalogue (chronique, émission) : lien étiré + ▶ démo + action */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-panel);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.tile:hover {
  border-color: var(--line-strong);
}

.tile:has(.tile__link:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.tile__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}

.tile__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--text-2);
}

.tile__icon .lucide {
  width: 20px;
  height: 20px;
}

.tile__title {
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
}

.tile__link:focus-visible {
  outline: none;
}

.tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.tile__desc {
  flex: 1;
  color: var(--text-2);
  font-size: var(--text-md);
  line-height: var(--lh-snug);
}

.tile__meta {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.tile__meta--fail { color: var(--fail); }
.tile__meta--warn { color: var(--warn); }
.tile__meta--live { color: var(--live); }

.tile__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: var(--space-2) calc(-1 * var(--space-4)) calc(-1 * var(--space-4));
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.tile__demo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-2);
  font-size: var(--text-sm);
}

.tile__head > .status,
.tile__head > .tag {
  position: relative;
  z-index: 1;
}

.tile--muted {
  background: var(--surface-inset);
}

.tile--muted .tile__icon {
  background: var(--surface-2);
}

/* Affiche (BO ciné) : placeholder dégradé, jamais d'image externe */
.poster {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-1);
  aspect-ratio: 2 / 3;
  padding: var(--space-4);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--poster-1);
  color: var(--text);
}

.poster--2 { background: var(--poster-2); }
.poster--3 { background: var(--poster-3); }
.poster--4 { background: var(--poster-4); }

.poster__icon {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  color: var(--text-2);
}

.poster__icon .lucide {
  width: 22px;
  height: 22px;
}

.poster__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
}

.poster__sub {
  color: var(--text-2);
  font-size: var(--text-sm);
}

.media-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.media-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.media-card__title {
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
}

/* Téléphone : l'affiche passe en bandeau (une affiche 2:3 occuperait tout l'écran) */
@media (max-width: 599px) {
  .media-card .poster {
    aspect-ratio: 16 / 9;
  }
}

/* Carte de prix (abonnement unique) */
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-8) var(--space-6) var(--space-6);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 70% at 100% 0%, var(--brand-soft) 0%, transparent 62%),
    radial-gradient(90% 60% at 0% 0%, var(--brand-cyan-soft) 0%, transparent 60%),
    var(--surface-1);
  box-shadow: var(--shadow-panel);
}

.price-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--grad-brand);
}

.price-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.price-card__name {
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.price-card__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.price-card__amount {
  color: var(--text);
  font-size: var(--text-4xl);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: -.03em;
}

.price-card__period {
  color: var(--text-2);
  font-size: var(--text-base);
}

.price-card__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.price-card__features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--text-2);
  line-height: var(--lh-snug);
}

.price-card__features li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background: var(--ok);
  -webkit-mask: var(--mask-check) center / contain no-repeat;
  mask: var(--mask-check) center / contain no-repeat;
}

.price-card__note {
  color: var(--text-3);
  font-size: var(--text-sm);
  text-align: center;
}


/* =============================================================================
   11. INDICATEURS : LED · VOYANT « ON AIR » · STATUT · PUCE · ÉTIQUETTE · COMPTEUR
   ========================================================================== */

.led {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--idle);
}

.led--ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft), 0 0 8px var(--ok-glow); }
.led--warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft), 0 0 8px var(--warn-glow); }
.led--fail { background: var(--fail); box-shadow: 0 0 0 3px var(--fail-soft), 0 0 8px var(--fail-glow); }
.led--live { background: var(--live); box-shadow: 0 0 0 3px var(--live-soft); animation: blink 1.6s var(--ease) infinite; }
.led--idle { background: transparent; box-shadow: inset 0 0 0 1.5px var(--idle); }

/* Voyant de régie : l'état global en deux mots */
.tally {
  --tally-c: var(--idle);
  --tally-bg: var(--idle-soft);
  --tally-bd: var(--idle-line);
  --tally-glow: transparent;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 26px;
  padding: 0 var(--space-3) 0 10px;
  border: 1px solid var(--tally-bd);
  border-radius: var(--radius-sm);
  background: var(--tally-bg);
  color: var(--tally-c);
  box-shadow: 0 0 22px -8px var(--tally-glow);
  font-family: var(--font-cond);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tally--ok { --tally-c: var(--ok); --tally-bg: var(--ok-soft); --tally-bd: var(--ok-line); --tally-glow: var(--ok-glow); }
.tally--warn { --tally-c: var(--warn); --tally-bg: var(--warn-soft); --tally-bd: var(--warn-line); --tally-glow: var(--warn-glow); }
.tally--fail { --tally-c: var(--fail); --tally-bg: var(--fail-soft); --tally-bd: var(--fail-line); --tally-glow: var(--fail-glow); }

/* Badge de statut : vocabulaire unique pour toute l'application */
.status {
  --st-c: var(--text-2);
  --st-bg: transparent;
  --st-bd: var(--line-strong);
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px 0 8px;
  border: 1px solid var(--st-bd);
  border-radius: var(--radius-sm);
  background: var(--st-bg);
  color: var(--st-c);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}

.status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status .lucide {
  width: 13px;
  height: 13px;
}

.status--delivered,
.status--active { --st-c: var(--ok); --st-bg: var(--ok-soft); --st-bd: var(--ok-line); }
.status--ready { --st-c: var(--ok); --st-bd: var(--ok-line); }
.status--live { --st-c: var(--live); --st-bg: var(--live-soft); --st-bd: var(--live-line); }
.status--warn { --st-c: var(--warn); --st-bg: var(--warn-soft); --st-bd: var(--warn-line); }
.status--failed { --st-c: var(--fail); --st-bg: var(--fail-soft); --st-bd: var(--fail-line); }
.status--planned { --st-c: var(--text-2); --st-bd: var(--line-strong); }
.status--paused { --st-c: var(--text-3); --st-bd: var(--line); --st-bg: var(--surface-2); }
.status--off { --st-c: var(--text-2); --st-bd: var(--line-strong); --st-bg: var(--surface-2); }
.status--holiday { --st-c: var(--text-2); --st-bd: var(--line-hover); --st-bg: var(--idle-soft); border-style: dashed; }

.status--ready::before,
.status--planned::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.status--live::before {
  animation: blink 1.6s var(--ease) infinite;
}

.status--paused::before {
  width: 6px;
  height: 8px;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 2px 0 0 currentColor, inset -2px 0 0 currentColor;
}

.status--off::before {
  display: none;
}

.status--holiday::before {
  width: 12px;
  height: 12px;
  border-radius: 0;
  -webkit-mask: var(--mask-calendar-x) center / contain no-repeat;
  mask: var(--mask-calendar-x) center / contain no-repeat;
}

/* Puce neutre : canal de livraison, catégorie, voix */
.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: 1;
  white-space: nowrap;
}

.chip .led {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.chip .lucide {
  width: 13px;
  height: 13px;
}

/* Étiquette (Nouveau, Saisonnier, Bientôt, Recommandé) */
.tag {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}

.tag .lucide {
  width: 12px;
  height: 12px;
}

.tag--accent { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tag--brand { background: var(--brand-soft); color: var(--brand-text); }
.tag--ok { background: var(--ok-soft); color: var(--ok); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--fail { background: var(--fail-soft); color: var(--fail); }

/* Compteur : n'apparaît que s'il y a quelque chose à traiter (jamais pour une taille de catalogue) */
.count {
  display: inline-grid;
  flex: none;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
}

.count--fail { background: var(--fail); color: var(--text-inverse); }
.count--warn { background: var(--warn); color: var(--text-inverse); }

/* Monogramme de la radio */
.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--font-cond);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: .04em;
}

.avatar--lg {
  width: 36px;
  height: 36px;
  font-size: var(--text-md);
}

/* Pavé d'icône neutre (listes, alertes, cartes) */
.icon-tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-2);
}

.icon-tile--ok { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.icon-tile--warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.icon-tile--fail { border-color: var(--fail-line); background: var(--fail-soft); color: var(--fail); }
.icon-tile--live { border-color: var(--live-line); background: var(--live-soft); color: var(--live); }


/* =============================================================================
   12. BANDEAU D'ÉTAT ANTENNE + CHIFFRES CLÉS
   ========================================================================== */

.status-banner {
  --banner-c: var(--idle);
  --banner-soft: var(--idle-soft);
  position: relative;
  container: banner / inline-size;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 140% at 0% 0%, var(--banner-soft) 0%, transparent 60%),
    var(--surface-1);
  box-shadow: var(--shadow-panel);
}

/* Liseré lumineux « ON AIR » */
.status-banner::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--banner-c);
  box-shadow: 0 0 16px var(--banner-c);
}

.status-banner--ok { --banner-c: var(--ok); --banner-soft: var(--ok-soft); }
.status-banner--warn { --banner-c: var(--warn); --banner-soft: var(--warn-soft); }
.status-banner--fail { --banner-c: var(--fail); --banner-soft: var(--fail-soft); }
.status-banner--holiday { --banner-c: var(--idle); --banner-soft: var(--idle-soft); }

.status-banner__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-5) var(--space-8);
  padding: var(--space-6) var(--space-6) var(--space-5);
}

.status-banner__lead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.status-banner__statement {
  color: var(--text);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

.status-banner__detail {
  max-width: 64ch;
  color: var(--text-2);
  font-size: var(--text-base);
}

.status-banner__detail strong {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.status-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.status-banner__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6) var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface-inset);
}

.status-banner__legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.checked-at {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.checked-at .btn--icon {
  width: 30px;
  height: 30px;
}

.checked-at .btn--icon .lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

@container banner (max-width: 760px) {
  .status-banner__top {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-5) var(--space-5) var(--space-4);
  }

  .status-banner__statement {
    font-size: var(--text-xl);
  }

  .status-banner__bottom {
    padding: var(--space-4) var(--space-5);
  }

  .status-banner__actions,
  .status-banner__actions .btn {
    width: 100%;
  }

  .status-banner__actions .btn {
    height: var(--control-h-lg);
  }
}

/* Chiffres clés (afficheurs) */
.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 112px;
  padding: var(--space-1) var(--space-5);
  border-left: 1px solid var(--line);
}

.stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.stat__label {
  color: var(--text-3);
  font-family: var(--font-cond);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stat__value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-medium);
  line-height: 1;
  letter-spacing: -.03em;
  white-space: nowrap;
}

.stat__unit {
  margin-left: 2px;
  color: var(--text-3);
  font-size: var(--text-lg);
  letter-spacing: 0;
}

.stat__sub {
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: var(--lh-tight);
}

.stat--ok .stat__value { color: var(--ok); }
.stat--warn .stat__value { color: var(--warn); }
.stat--fail .stat__value { color: var(--fail); }
.stat--live .stat__value { color: var(--live); }

/* Variante « cartes » (hors bandeau) */
.stats--cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: var(--space-4);
}

.stats--cards .stat {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-panel);
}

.stats--cards .stat:first-child {
  padding-left: var(--space-5);
  border-left: 1px solid var(--line);
}

.stats--cards .stat__value {
  font-size: var(--text-2xl);
}

/* Mobile : les chiffres clés restent sur deux colonnes (jamais 4 cartes empilées) */
@media (max-width: 767px) {
  .stats--cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .stats--cards .stat {
    min-width: 0;
    padding: var(--space-3) var(--space-4);
  }

  .stats--cards .stat:first-child {
    padding-left: var(--space-4);
  }

  .stats--cards .stat__label {
    white-space: normal;
    line-height: 1.25;
  }

  .stats--cards .stat__value {
    font-size: var(--text-xl);
  }
}

@container banner (max-width: 760px) {
  .status-banner .stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
  }

  .status-banner .stat {
    min-width: 0;
    padding: 0 var(--space-3);
  }

  .status-banner .stat:first-child {
    padding-left: 0;
  }

  .status-banner .stat__value {
    font-size: var(--text-2xl);
  }

  .status-banner .stat__label {
    white-space: normal;
  }
}

/* Ligne discrète d'information (ex. compte) */
.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: var(--text-md);
}

.strip__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.strip__item strong {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.strip__sep {
  width: 1px;
  height: 14px;
  background: var(--line-strong);
}

.strip__end {
  margin-left: auto;
}

@media (max-width: 767px) {
  .strip {
    padding: var(--space-3) var(--space-4);
  }

  .strip__sep {
    display: none;
  }

  .strip__end {
    margin-left: 0;
  }
}


/* =============================================================================
   13. FRISE DE LA JOURNÉE (générée par s4r.js depuis le conducteur)
   ========================================================================== */

.timeline {
  --tl-label-w: 88px;
  display: grid;
  grid-template-columns: var(--tl-label-w) minmax(0, 1fr);
  column-gap: var(--space-3);
  min-width: 0;
}

.timeline__lanes {
  display: flex;
  flex-direction: column;
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
}

.timeline__lane {
  display: flex;
  align-items: center;
  height: 28px;
  white-space: nowrap;
}

.timeline__plot {
  min-width: 0;
}

.timeline__svg {
  width: 100%;
  overflow: visible;
}

.tl-frame { fill: var(--surface-1); stroke: var(--line); stroke-width: 1; }
.tl-grid { stroke: var(--track-grid); stroke-width: 1; }
.tl-lane-sep { stroke: var(--line-soft); stroke-width: 1; }
.tl-past { fill: var(--past-fill); }
.tl-hour { fill: var(--text-3); font-family: var(--font-sans); font-size: 12px; font-weight: 500; }
.tl-mark { shape-rendering: crispEdges; }
.tl-mark--ok { fill: var(--ok); }
.tl-mark--fail { fill: var(--fail); }
.tl-mark--warn { fill: var(--warn); }
.tl-mark--live { fill: var(--live); animation: blink 1.6s var(--ease) infinite; }
.tl-mark--idle { fill: var(--surface-3); stroke: var(--idle); stroke-width: 1; }
.tl-mark--paused { fill: none; stroke: var(--idle); stroke-width: 1; stroke-dasharray: 2 2; }
.tl-now { stroke: var(--live); stroke-width: 1.5; }
.tl-now-head { fill: var(--live); }

@container (max-width: 560px) {
  .timeline {
    --tl-label-w: 72px;
    column-gap: var(--space-2);
  }
}

/* Légende */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  color: var(--text-2);
  font-size: var(--text-sm);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--idle);
}

.legend__swatch--ok { background: var(--ok); }
.legend__swatch--fail { background: var(--fail); }
.legend__swatch--warn { background: var(--warn); }
.legend__swatch--live { background: var(--live); }
.legend__swatch--idle { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--idle); }
/* Légende de la grille : filet des flashs, créneau en pause, créneau passé */
.legend__swatch--flash { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.legend__swatch--paused { background: transparent; box-shadow: none; border: 1px dashed var(--idle); }
.legend__swatch--past { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); opacity: .6; }

.legend__value {
  color: var(--text);
  font-weight: var(--weight-semibold);
}


/* =============================================================================
   14. GRILLE DE LA SEMAINE · CRÉNEAUX · PAVÉS DE DATE
   ========================================================================== */

.week {
  container: week / inline-size;
  min-width: 0;
}

.week__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-panel);
}

.week__day {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--line);
}

.week__day:first-child {
  border-left: 0;
}

.week__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 64px;
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-inset);
}

.week__name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-tight);
}

.week__sub {
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
}

.week__head .count {
  margin-left: auto;
}

.week__day.is-today .week__head {
  box-shadow: inset 0 2px 0 var(--accent);
}

.week__day.is-today .week__name {
  color: var(--accent);
}

.week__day.is-holiday {
  background: repeating-linear-gradient(135deg, transparent 0 10px, var(--past-fill) 10px 20px);
}

.week__slots {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
}

.week__note {
  padding: var(--space-3);
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.slot {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 2px var(--space-2);
  min-width: 0;
  padding: 6px var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

a.slot:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.slot__time {
  color: var(--text);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.slot__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.slot__meta {
  grid-column: 2;
  color: var(--text-3);
  font-size: var(--text-sm);
}

.slot--flash {
  box-shadow: inset 2px 0 0 var(--accent);
}

.slot--past .slot__time {
  color: var(--text-3);
}

.slot--failed {
  border-color: var(--fail-line);
  background: var(--fail-tint);
}

.slot--failed .slot__time {
  color: var(--fail);
}

.slot--live {
  border-color: var(--live-line);
  background: var(--live-soft);
}

.slot--paused {
  background: transparent;
  border-color: var(--line);
  border-style: dashed;
  color: var(--text-3);
}

.slot--paused .slot__time {
  color: var(--text-3);
}

/* À vérifier (titres manquants, accès FTP à corriger avant le créneau) */
.slot--warn {
  border-color: var(--warn-line);
  background: var(--warn-tint);
}

.slot--warn .slot__time,
.slot--warn .slot__meta {
  color: var(--warn);
}

/* Filtre appliqué : un jour sans créneau correspondant le dit (et se replie quand la grille est empilée) */
.week__day.is-empty .week__slots::before {
  content: "Aucun créneau";
  padding: var(--space-2);
  color: var(--text-3);
  font-size: var(--text-sm);
}

@container week (max-width: 959px) {
  .week__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .week__day {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .week__day:first-child {
    border-top: 0;
  }

  .week__head {
    min-height: 52px;
  }

  .week__slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  }

  .week__day.is-empty {
    display: none;
  }
}

/* Pavé de date façon calendrier */
.date-tile {
  display: inline-flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-height: 52px;
  padding: var(--space-1) 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-inset);
  line-height: 1.1;
}

.date-tile__day,
.date-tile__month {
  color: var(--text-3);
  font-size: var(--text-xs);
}

.date-tile__num {
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.date-tile--today {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.date-tile--today .date-tile__day {
  color: var(--accent);
  font-weight: var(--weight-semibold);
}

.date-tile--holiday {
  border-style: dashed;
}

.date-tile--holiday .date-tile__num {
  color: var(--text-2);
}


/* =============================================================================
   15. ALERTES · ENCADRÉS
   Alerte = ce qui se passe · « À l'antenne : » ce que ça change · le bouton pour corriger
   ========================================================================== */

.alerts {
  display: flex;
  flex-direction: column;
}

.alert {
  --a-c: var(--fail);
  --a-soft: var(--fail-soft);
  --a-line: var(--fail-line);
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: var(--space-4);
  padding: var(--space-5);
}

.alert + .alert {
  border-top: 1px solid var(--line);
}

/* Filet latéral de couleur (pas de cadre rouge complet) */
.alert::before {
  content: "";
  position: absolute;
  top: var(--space-5);
  bottom: var(--space-5);
  left: 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--a-c);
}

.alert--warn { --a-c: var(--warn); --a-soft: var(--warn-soft); --a-line: var(--warn-line); }
.alert--info { --a-c: var(--live); --a-soft: var(--live-soft); --a-line: var(--live-line); }
.alert--ok { --a-c: var(--ok); --a-soft: var(--ok-soft); --a-line: var(--ok-line); }

/* Hors carte : l'alerte s'adapte à la colonne qui la contient (.page, .split__main…) */
.alert--standalone {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, var(--a-soft), transparent 42%),
    var(--surface-1);
  box-shadow: var(--shadow-panel);
}

.alert__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--a-soft);
  color: var(--a-c);
}

.alert__icon .lucide {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

.alert__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.alert__title {
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
}

.alert__text {
  color: var(--text-2);
}

.alert__impact {
  margin-top: var(--space-1);
  color: var(--text);
}

.alert__impact-label {
  color: var(--a-c);
  font-weight: var(--weight-semibold);
}

.alert__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--space-2);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.alert__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alert__meta .lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.alert__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: start;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* Variante compacte : une ligne (bandeau de page, rappel) */
.alert--compact {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.alert--compact::before {
  top: var(--space-2);
  bottom: var(--space-2);
}

.alert--compact .alert__icon {
  width: 28px;
  height: 28px;
}

.alert--compact .alert__icon .lucide {
  width: var(--icon-md);
  height: var(--icon-md);
}

.alert--compact .alert__title {
  font-size: var(--text-base);
}

.alert--compact .alert__actions {
  align-self: center;
}

@container (max-width: 720px) {
  .alert {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--space-3) var(--space-4);
    padding: var(--space-4);
  }

  .alert::before {
    top: var(--space-4);
    bottom: var(--space-4);
  }

  .alert__actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .alert--compact {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

@container (max-width: 440px) {
  .alert {
    grid-template-columns: minmax(0, 1fr);
  }

  .alert__icon {
    display: none;
  }

  .alert__actions {
    grid-column: 1;
  }

  .alert__actions .btn {
    flex: 1 1 auto;
    height: var(--control-h-lg);
  }

  .alert--compact .alert__icon {
    display: grid;
  }

  .alert--compact {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .alert--compact .alert__actions {
    grid-column: 1 / -1;
  }
}

/* Encadré d'information (règle, rappel, conseil) */
.callout {
  --c-c: var(--live);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-md);
  line-height: var(--lh-snug);
}

.callout > .lucide {
  width: var(--icon-md);
  height: var(--icon-md);
  margin-top: 1px;
  color: var(--c-c);
}

.callout__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.callout__title {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.callout--ok { --c-c: var(--ok); }
.callout--warn { --c-c: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.callout--fail { --c-c: var(--fail); border-color: var(--fail-line); background: var(--fail-soft); }
.callout--neutral { --c-c: var(--text-3); }


/* =============================================================================
   16. TABLEAU
   Tri · ligne cliquable · ligne « Maintenant » · passé replié · état vide ·
   liste de cartes quand le CONTENEUR fait moins de 750 px
   ========================================================================== */

.table-wrap {
  container: table / inline-size;
  min-width: 0;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-md);
}

.table th {
  height: 40px;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-align: left;
  white-space: nowrap;
}

.table td {
  height: 60px;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  transition: background-color var(--dur-fast) var(--ease);
}

.table tbody:last-child tr:last-child > td {
  border-bottom: 0;
}

.table th:first-child,
.table td:first-child {
  padding-left: var(--space-5);
}

.table th:last-child,
.table td:last-child {
  padding-right: var(--space-4);
}

.table tbody tr:hover > td {
  background: var(--surface-2);
}

.table--compact td {
  height: 48px;
}

.table--fixed {
  table-layout: fixed;
}

/* Largeurs de colonnes (avec <colgroup>) : la colonne sans classe prend le reste */
.col-play { width: 60px; }
.col-time { width: 76px; }
.col-date { width: 132px; }
.col-num { width: 72px; }
.col-status { width: 148px; }
.col-channel { width: 136px; }
.col-amount { width: 112px; }
.col-actions { width: 60px; }
.col-actions-wide { width: 148px; }

@media (pointer: coarse) {
  .col-play { width: 68px; }
  .col-actions { width: 64px; }
}

.table .cell-play {
  width: 60px;
  padding-right: 0;
}

.table .cell-time {
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.table .cell-num {
  color: var(--text-2);
  font-size: var(--text-md);
  white-space: nowrap;
}

.table .cell-right {
  text-align: right;
}

.table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

.cell-actions__inner {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* Un statut long (« Relivraison en cours ») passe à la ligne dans sa colonne au lieu de déborder */
.table .status {
  height: auto;
  min-height: 24px;
  padding-top: 3px;
  padding-bottom: 3px;
  line-height: 1.2;
  white-space: normal;
}

/* États de ligne */
.table tr.is-warn > td {
  background: var(--warn-tint);
}

.table tr.is-warn > td:first-child {
  box-shadow: inset 2px 0 0 var(--warn);
}

.table tr.is-failed > td {
  background: var(--fail-tint);
}

.table tr.is-failed > td:first-child {
  box-shadow: inset 2px 0 0 var(--fail);
}

.table tr.is-live > td {
  background: var(--live-soft);
}

.table tr.is-live > td:first-child {
  box-shadow: inset 2px 0 0 var(--live);
}

.table tr.is-playing > td {
  background: var(--accent-soft);
}

.table tr.is-past:not(.is-failed) .cell-time {
  color: var(--text-3);
  font-weight: var(--weight-medium);
}

.table tr[data-href] {
  cursor: pointer;
}

/* Titre de ligne : nom + précision (jamais tronqué) */
.row-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.row-title__name {
  width: fit-content;
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--lh-tight);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) var(--ease);
}

a.row-title__name:hover {
  text-decoration-color: var(--line-hover);
}

.row-title__meta {
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.row-title__meta--fail { color: var(--fail); }
.row-title__meta--warn { color: var(--warn); }
.row-title__meta--live { color: var(--live); }

/* En-tête triable */
.table__sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin: 0 -6px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.table__sort:hover {
  background: var(--surface-2);
  color: var(--text);
}

.table__sort::after {
  content: "";
  width: 13px;
  height: 13px;
  background: currentColor;
  opacity: .55;
  -webkit-mask: var(--mask-sort) center / contain no-repeat;
  mask: var(--mask-sort) center / contain no-repeat;
}

th[aria-sort="ascending"] .table__sort,
th[aria-sort="descending"] .table__sort {
  color: var(--text);
}

th[aria-sort="ascending"] .table__sort::after {
  opacity: 1;
  -webkit-mask-image: var(--mask-sort-up);
  mask-image: var(--mask-sort-up);
}

th[aria-sort="descending"] .table__sort::after {
  opacity: 1;
  -webkit-mask-image: var(--mask-sort-down);
  mask-image: var(--mask-sort-down);
}

/* Ligne « Maintenant » : tête de lecture du conducteur (filet en dégradé) */
.table tr.table__marker > td {
  height: auto;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  background: var(--surface-inset);
}

.table tr.table__marker:hover > td {
  background: var(--surface-inset);
}

.now-marker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.now-marker::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
}

/* Ligne de regroupement (éléments passés repliés) */
.table tr.table__group > td {
  height: auto;
  padding: 0;
}

.table tr.table__group:hover > td {
  background: none;
}

.group-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-4) 0 var(--space-5);
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: var(--text-md);
  text-align: left;
}

.group-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.group-toggle:focus-visible {
  outline-offset: -2px;
}

.group-toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: var(--text-3);
  transition: transform var(--dur) var(--ease);
  -webkit-mask: var(--mask-chevron-right) center / contain no-repeat;
  mask: var(--mask-chevron-right) center / contain no-repeat;
}

.group-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.group-toggle__action {
  margin-left: auto;
  color: var(--text);
  font-weight: var(--weight-medium);
}

/* Libellés qui changent selon l'état ouvert / fermé d'un déclencheur */
[aria-expanded="true"] [data-when-closed],
[aria-expanded="false"] [data-when-open] {
  display: none;
}

/* État vide dans un tableau */
.table tr.table__empty > td {
  height: auto;
  padding: 0;
}

.table tr.table__empty:hover > td {
  background: none;
}

/* Liste de cartes quand le conteneur est étroit (< 750 px) */
@container table (max-width: 749px) {
  .table--cards thead,
  .table--cards colgroup {
    display: none;
  }

  .table--cards,
  .table--cards tbody {
    display: block;
  }

  .table--cards tbody[hidden] {
    display: none;
  }

  .table--cards tbody tr {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-2) var(--space-3);
    min-height: 68px;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--line-soft);
  }

  .table--cards tbody tr[hidden] {
    display: none;
  }

  /* Coupure de ligne après titre + actions */
  .table--cards tbody tr::after {
    content: "";
    order: 3;
    flex-basis: 100%;
    height: 0;
    margin-top: calc(-1 * var(--space-2));
  }

  .table--cards tbody tr:has(> [data-cell="play"]) {
    padding-left: calc(var(--space-4) + var(--play-size) + var(--space-3));
  }

  .table--cards tbody tr:hover > td,
  .table--cards tr.is-live > td,
  .table--cards tr.is-failed > td,
  .table--cards tr.is-warn > td,
  .table--cards tr.is-playing > td {
    background: none;
  }

  .table--cards tbody tr:hover {
    background: var(--surface-2);
  }

  .table--cards td {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    order: 4;
    height: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    font-size: var(--text-sm);
  }

  .table--cards td:first-child,
  .table--cards td:last-child {
    padding-left: 0;
    padding-right: 0;
  }

  .table--cards td[data-label]::before {
    content: attr(data-label);
    color: var(--text-3);
  }

  .table--cards td[data-cell="play"] {
    position: absolute;
    top: var(--space-3);
    left: var(--space-4);
    width: auto;
  }

  .table--cards td[data-cell="time"] {
    order: 0;
    padding-top: 1px;
    font-size: var(--text-base);
    line-height: var(--lh-tight);
  }

  /* Avec un ▶ : l'heure se place sous le bouton, à gauche (comme sur ordinateur) */
  .table--cards tbody tr:has(> [data-cell="play"]):has(> [data-cell="time"]) {
    min-height: calc(var(--play-size) + 50px);
  }

  .table--cards tr:has(> [data-cell="play"]) > td[data-cell="time"] {
    position: absolute;
    top: calc(var(--space-3) + var(--play-size) + 6px);
    left: var(--space-2);
    justify-content: center;
    width: calc(var(--play-size) + 2 * var(--space-2));
    padding: 0;
    font-size: var(--text-md);
  }

  /* Base de 112 px : si une date longue occupe la ligne, le titre passe dessous au lieu de déborder */
  .table--cards td[data-cell="title"] {
    display: block;
    flex: 1 1 112px;
    order: 1;
    font-size: var(--text-base);
  }

  .table--cards td[data-cell="actions"] {
    order: 2;
    margin: -6px -8px -6px 0;
  }

  .table--cards td[data-card="hide"] {
    display: none;
  }

  .table--cards tr.is-failed {
    background: var(--fail-tint);
    box-shadow: inset 2px 0 0 var(--fail);
  }

  .table--cards tr.is-live {
    background: var(--live-soft);
    box-shadow: inset 2px 0 0 var(--live);
  }

  .table--cards tr.is-playing {
    background: var(--accent-soft);
  }

  .table--cards tr.is-warn {
    background: var(--warn-tint);
    box-shadow: inset 2px 0 0 var(--warn);
  }

  .table--cards tr.is-failed > td:first-child,
  .table--cards tr.is-warn > td:first-child,
  .table--cards tr.is-live > td:first-child {
    box-shadow: none;
  }

  .table--cards tbody tr.table__marker,
  .table--cards tbody tr.table__group,
  .table--cards tbody tr.table__empty {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .table--cards tbody tr.table__marker::after,
  .table--cards tbody tr.table__group::after,
  .table--cards tbody tr.table__empty::after {
    display: none;
  }

  .table--cards tr.table__marker > td,
  .table--cards tr.table__group > td,
  .table--cards tr.table__empty > td {
    display: block;
  }

  .table--cards tr.table__marker > td {
    padding: var(--space-2) var(--space-4);
  }

  .table--cards .group-toggle {
    padding-left: var(--space-4);
  }
}


/* =============================================================================
   17. LISTES · HISTORIQUE D'ENVOIS · LISTE DE DÉFINITIONS · RÉGLAGES
   ========================================================================== */

.list > li + li,
.list > .list__item + .list__item {
  border-top: 1px solid var(--line-soft);
}

.list__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.list__item--center {
  align-items: center;
}

a.list__item {
  transition: background-color var(--dur-fast) var(--ease);
}

a.list__item:hover {
  background: var(--surface-2);
}

.list__main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.list__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  color: var(--text);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.list__text {
  color: var(--text-2);
  font-size: var(--text-md);
  line-height: var(--lh-snug);
}

.list__text strong {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.list__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.list--plain .list__item {
  padding-left: 0;
  padding-right: 0;
}

@container (max-width: 480px) {
  .list__item {
    padding: var(--space-4);
  }

  .list--plain .list__item {
    padding-left: 0;
    padding-right: 0;
  }

  .list__item:has(> .list__aside) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .list__aside {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* 10 derniers envois (mini VU-mètre) */
.history {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.history__bits {
  display: inline-flex;
  gap: 2px;
}

.history__bit {
  width: 6px;
  height: 14px;
  border-radius: 1px;
  background: var(--idle-line);
}

.history__bit--ok { background: var(--ok); opacity: .85; }
.history__bit--fail { background: var(--fail); }
.history__bit--warn { background: var(--warn); }

/* Liste de définitions (configuration actuelle, coordonnées) */
.dl {
  display: flex;
  flex-direction: column;
}

.dl__row {
  display: grid;
  grid-template-columns: minmax(120px, 34%) minmax(0, 1fr);
  gap: var(--space-4);
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.dl__row:last-child {
  border-bottom: 0;
}

.dl dt {
  color: var(--text-3);
  font-size: var(--text-md);
}

.dl dd {
  min-width: 0;
  color: var(--text);
  font-size: var(--text-md);
  overflow-wrap: anywhere;
}

@container (max-width: 420px) {
  .dl__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* Lignes de réglage : libellé + description à gauche, contrôle à droite */
.settings > .setting + .setting {
  border-top: 1px solid var(--line-soft);
}

.setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-4) var(--space-5);
}

.setting__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.setting__title {
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.setting__desc {
  color: var(--text-2);
  font-size: var(--text-md);
  line-height: var(--lh-snug);
}

.setting__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.setting__extra {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.setting--stack {
  grid-template-columns: minmax(0, 1fr);
}

.setting--stack .setting__control {
  justify-content: flex-start;
}

@container (max-width: 560px) {
  .setting {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-4);
  }

  .setting__control {
    justify-content: flex-start;
  }
}


/* =============================================================================
   18. FILTRES : contrôle segmenté · puces de filtre · barre d'outils
   ========================================================================== */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.toolbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-inset);
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented__btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.segmented__btn:hover {
  color: var(--text);
}

.segmented__btn:focus-visible {
  outline-offset: -2px;
}

.segmented__btn[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-raised);
}

.segmented__count {
  min-width: 20px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 18px;
  text-align: center;
}

.segmented__btn[aria-pressed="true"] .segmented__count {
  background: var(--surface-1);
  color: var(--text-2);
}

.segmented__count--fail,
.segmented__btn[aria-pressed="true"] .segmented__count--fail {
  background: var(--fail-soft);
  color: var(--fail);
}

@media (pointer: coarse) {
  .segmented__btn {
    height: 38px;
  }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-2);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.filter-chip:hover {
  border-color: var(--line-hover);
  color: var(--text);
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}

.filter-chip .segmented__count {
  background: var(--surface-3);
}

@media (pointer: coarse) {
  .filter-chip {
    height: 40px;
  }
}


/* =============================================================================
   19. ONGLETS
   ========================================================================== */

.tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs__tab {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}

.tabs__tab .lucide {
  width: var(--icon-md);
  height: var(--icon-md);
  color: var(--text-3);
}

.tabs__tab:hover {
  color: var(--text);
}

.tabs__tab:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.tabs__tab[aria-selected="true"] {
  color: var(--text);
}

.tabs__tab[aria-selected="true"] .lucide {
  color: var(--text);
}

.tabs__tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: var(--space-2);
  bottom: 0;
  left: var(--space-2);
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--grad-brand);
}

.tabs__panel {
  container-type: inline-size;
  padding-top: var(--space-5);
  /* Lien page.html#panneau : la barre d'onglets reste visible au-dessus du panneau */
  scroll-margin-top: 52px;
}

/* Barre plus large que l'écran : fondu sur le bord pour signaler les onglets suivants */
.tabs.is-overflowing:not(.is-scrolled-end) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
}

.tabs__panel:focus-visible {
  outline-offset: 4px;
}

/* Onglets posés dans l'en-tête d'une carte */
.card > .tabs {
  padding: 0 var(--space-3);
}

.card > .tabs__panel {
  padding-top: 0;
}


/* =============================================================================
   20. ACCORDÉON (<details>) — FAQ, aide
   ========================================================================== */

.accordion {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-panel);
}

.accordion__item + .accordion__item {
  border-top: 1px solid var(--line);
}

.accordion__summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-3) var(--space-5);
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
  list-style: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}

.accordion__summary::-webkit-details-marker {
  display: none;
}

.accordion__summary:hover {
  background: var(--surface-2);
}

.accordion__summary:focus-visible {
  outline-offset: -2px;
}

.accordion__summary::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: auto;
  background: var(--text-3);
  transition: transform var(--dur) var(--ease);
  -webkit-mask: var(--mask-chevron-down) center / contain no-repeat;
  mask: var(--mask-chevron-down) center / contain no-repeat;
}

.accordion__item[open] > .accordion__summary::after {
  transform: rotate(180deg);
}

.accordion__body {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text-2);
}

.accordion__body > * + * {
  margin-top: var(--space-3);
}


/* =============================================================================
   21. ÉTAPES · PROGRESSION
   ========================================================================== */

/* Étapes numérotées (mise en route, inscription) */
.stepper {
  display: flex;
  flex-direction: column;
  counter-reset: step;
}

.stepper__step {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: var(--space-3);
  padding-bottom: var(--space-5);
  counter-increment: step;
}

.stepper__step:last-child {
  padding-bottom: 0;
}

.stepper__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 32px;
  bottom: 4px;
  left: 13.5px;
  width: 1px;
  background: var(--line-strong);
}

.stepper__marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-1);
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.stepper__marker::before {
  content: counter(step);
}

.stepper__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 3px;
  min-width: 0;
}

.stepper__title {
  color: var(--text-2);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.stepper__desc {
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.stepper__action {
  margin-top: var(--space-2);
}

.stepper__step.is-done .stepper__marker {
  border-color: var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok);
}

.stepper__step.is-done .stepper__marker::before {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: var(--mask-check) center / contain no-repeat;
  mask: var(--mask-check) center / contain no-repeat;
}

.stepper__step.is-done::after {
  background: var(--ok-line);
}

.stepper__step.is-current .stepper__marker {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.stepper__step.is-current .stepper__title,
.stepper__step.is-done .stepper__title {
  color: var(--text);
}

/* Variante horizontale (au-dessus de 720 px d'écran) */
@media (min-width: 720px) {
  .stepper--horizontal {
    flex-direction: row;
  }

  .stepper--horizontal .stepper__step {
    flex: 1 1 0;
    grid-template-columns: minmax(0, 1fr);
    padding-right: var(--space-4);
    padding-bottom: 0;
  }

  .stepper--horizontal .stepper__step:not(:last-child)::after {
    top: 13.5px;
    right: var(--space-3);
    bottom: auto;
    left: 40px;
    width: auto;
    height: 1px;
  }
}

/* Chaîne de fabrication en 3 temps (Hit des Auditeurs : Classement › Montage › Livraison) */
.pipeline {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: var(--space-2);
}

.pipeline__step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.pipeline__step::before {
  content: "";
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
}

.pipeline__step strong {
  display: block;
  color: var(--text-2);
  font-weight: var(--weight-semibold);
}

.pipeline__step.is-done::before {
  background: var(--grad-brand);
}

.pipeline__step.is-current::before {
  background: linear-gradient(90deg, var(--brand-cyan) 0 50%, var(--line-strong) 50% 100%);
}

.pipeline__step.is-current strong,
.pipeline__step.is-done strong {
  color: var(--text);
}

.pipeline__step.is-warn::before {
  background: linear-gradient(90deg, var(--warn) 0 50%, var(--line-strong) 50% 100%);
}

.pipeline__step.is-failed::before {
  background: var(--fail);
}

/* Barre de progression (<progress class="progress" value="3" max="10">) */
.progress {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--line-strong);
  color: var(--brand-cyan);
  appearance: none;
}

.progress::-webkit-progress-bar {
  border-radius: var(--radius-full);
  background: var(--line-strong);
}

.progress::-webkit-progress-value {
  border-radius: var(--radius-full);
  background: var(--grad-brand);
}

.progress::-moz-progress-bar {
  border-radius: var(--radius-full);
  background: var(--grad-brand);
}

.progress--ok::-webkit-progress-value { background: var(--ok); }
.progress--ok::-moz-progress-bar { background: var(--ok); }
.progress--warn::-webkit-progress-value { background: var(--warn); }
.progress--warn::-moz-progress-bar { background: var(--warn); }
.progress--fail::-webkit-progress-value { background: var(--fail); }
.progress--fail::-moz-progress-bar { background: var(--fail); }

.progress-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress-field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-2);
  font-size: var(--text-sm);
}

.progress-field__value {
  color: var(--text);
  font-weight: var(--weight-semibold);
}


/* =============================================================================
   22. MENUS DÉROULANTS ET PANNEAUX FLOTTANTS
   ========================================================================== */

.popover-anchor {
  position: relative;
  display: inline-flex;
}

.popover {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: var(--z-popover);
  min-width: 248px;
  max-width: calc(100vw - 2 * var(--space-4));
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-size: var(--text-md);
  text-align: left;
  white-space: normal;
  animation: pop-in var(--dur) var(--ease-out);
}

.popover--start {
  right: auto;
  left: 0;
}

.popover--up {
  top: auto;
  bottom: calc(100% + var(--space-2));
}

.popover--wide {
  width: min(380px, calc(100vw - 2 * var(--space-4)));
}

/* Menu sorti de sa zone (tableau défilant, tuile, grille) : positionné par s4r.js au-dessus de tout */
.popover--fixed {
  position: fixed;
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
  max-height: calc(100dvh - var(--topbar-h) - var(--space-8));
  overflow-y: auto;
}

/* Tuile dont le menu est ouvert : passe au-dessus des tuiles voisines */
.tile:has(.popover:not([hidden])) {
  z-index: 2;
}

.popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 -6px 6px;
  padding: var(--space-2) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--line);
}

.popover__title {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.popover__sub {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.popover__label {
  padding: var(--space-2) var(--space-3) var(--space-1);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-2);
  font-size: var(--text-md);
  line-height: var(--lh-tight);
  text-align: left;
  cursor: pointer;
}

.menu__item .lucide {
  color: var(--text-3);
}

.menu__item:hover,
.menu__item:focus-visible {
  background: var(--surface-3);
  color: var(--text);
}

.menu__item:focus-visible {
  outline-offset: -2px;
}

.menu__item:hover .lucide,
.menu__item:focus-visible .lucide {
  color: var(--text-2);
}

.menu__item[aria-disabled="true"] {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.menu__item[aria-disabled="true"]:hover {
  background: none;
  color: var(--text-disabled);
}

.menu__item[aria-disabled="true"] .lucide {
  color: var(--text-disabled);
}

.menu__item--danger,
.menu__item--danger .lucide,
.menu__item--danger:hover {
  color: var(--fail);
}

.menu__item--external::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: auto;
  background: var(--text-3);
  -webkit-mask: var(--mask-external) center / contain no-repeat;
  mask: var(--mask-external) center / contain no-repeat;
}

.menu__item-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu__hint {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.menu__item[aria-disabled="true"] .menu__hint {
  color: var(--text-3);
}

.menu__item-end {
  margin-left: auto;
}

.menu__sep {
  height: 1px;
  margin: 6px -6px;
  background: var(--line);
}

@media (pointer: coarse) {
  .menu__item {
    min-height: 44px;
  }
}

/* Éléments de menu visibles seulement en navigation compacte (rail, mobile) */
@media (min-width: 1024px) {
  .menu__compact-only {
    display: none;
  }
}

/* Nouveautés (panneau de la cloche) */
.news {
  display: flex;
  flex-direction: column;
}

/* Date au-dessus du titre : les dates des nouveautés sont longues (« 19 juin 2026 ») */
.news__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: var(--space-3);
}

.news__item + .news__item {
  border-top: 1px solid var(--line);
}

.news__date {
  color: var(--text-3);
  font-size: var(--text-xs, .75rem);
  line-height: 1.5;
  text-transform: none;
}

.news__title {
  color: var(--text);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.news__text {
  margin-top: 2px;
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.news__item.is-unread .news__title::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: var(--space-2);
  border-radius: 50%;
  background: var(--brand-cyan);
  vertical-align: middle;
}

/* Info-bulle (CSS) : data-tip="texte". Le texte doit aussi exister pour les lecteurs d'écran. */
[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: var(--z-popover);
  width: max-content;
  max-width: 260px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  line-height: var(--lh-snug);
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 250ms;
}

[data-tip-pos="bottom"]::after {
  top: calc(100% + 8px);
  bottom: auto;
}

[data-tip-pos="end"]::after {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

[data-tip-pos="end"]:hover::after,
[data-tip-pos="end"]:focus-visible::after {
  transform: none;
}

.tip-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--text-3);
  cursor: help;
  vertical-align: middle;
}

.tip-icon .lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}


/* =============================================================================
   23. FENÊTRES : modale · panneau latéral · recherche rapide
   (toujours des <dialog> ; ouverture par data-open="id", fermeture data-close)
   ========================================================================== */

.modal,
.drawer,
.palette {
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  color: var(--text);
  box-shadow: var(--shadow-modal);
}

.modal::backdrop,
.drawer::backdrop,
.palette::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(6px) saturate(120%);
}

/* Modale */
.modal {
  width: min(560px, calc(100vw - 2 * var(--space-4)));
  max-height: calc(100dvh - 2 * var(--space-8));
  border-radius: var(--radius-xl);
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: pop-in var(--dur) var(--ease-out);
}

.modal--sm { width: min(440px, calc(100vw - 2 * var(--space-4))); }
.modal--lg { width: min(780px, calc(100vw - 2 * var(--space-4))); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-3) var(--space-6);
}

.modal__heading {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.modal__title {
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
}

.modal__desc {
  margin-top: var(--space-1);
  color: var(--text-2);
  font-size: var(--text-md);
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-6) var(--space-5);
  overflow-y: auto;
  color: var(--text-2);
}

.modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--line);
  background: var(--surface-inset);
}

@media (max-width: 767px) {
  .modal,
  .modal--sm,
  .modal--lg {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: 0;
  }

  .modal__foot .btn {
    flex: 1 1 auto;
    height: var(--control-h-lg);
  }
}

/* Panneau latéral (drawer) */
.drawer {
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
}

.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: drawer-in var(--dur-slow) var(--ease-out);
}

.drawer--wide {
  width: min(640px, 100vw);
}

.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--line);
}

.drawer__title {
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-snug);
}

.drawer__desc {
  margin-top: var(--space-1);
  color: var(--text-2);
  font-size: var(--text-md);
}

.drawer__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  overflow-y: auto;
}

.drawer__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--line);
  background: var(--surface-inset);
}

/* Recherche rapide (Ctrl K) */
.palette {
  width: min(640px, calc(100vw - 2 * var(--space-4)));
  max-height: min(580px, calc(100dvh - 120px));
  margin-top: 14vh;
  border-radius: var(--radius-xl);
}

.palette[open] {
  display: flex;
  flex-direction: column;
  animation: pop-in var(--dur) var(--ease-out);
}

.palette__search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 64px;
  padding: var(--space-3) var(--space-5) var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
}

.palette__search .lucide {
  width: 20px;
  height: 20px;
}

.palette__input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: var(--text-lg);
}

.palette__input::placeholder {
  color: var(--text-3);
}

.palette__input:focus-visible {
  outline: none;
}

.palette__list {
  flex: 1;
  padding: var(--space-2) var(--space-3) var(--space-3);
  overflow-y: auto;
}

.palette__group {
  padding: var(--space-4) var(--space-3) var(--space-2);
}

.palette__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-2);
  cursor: pointer;
}

.palette__option .lucide {
  color: var(--text-3);
}

.palette__hint {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--text-sm);
}

.palette__option:hover,
.palette__option[aria-selected="true"] {
  background: var(--surface-3);
  color: var(--text);
}

.palette__option[aria-selected="true"] .lucide {
  color: var(--text);
}

.palette__empty {
  padding: var(--space-8) var(--space-4);
  color: var(--text-3);
  text-align: center;
}

.palette__foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.palette__foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 767px) {
  .palette {
    margin-top: var(--space-4);
    max-height: calc(100dvh - 2 * var(--space-4));
  }

  .palette__foot {
    display: none;
  }
}


/* =============================================================================
   24. AUDIO : lecteur global (fixé en bas) · pistes · lecteur compact
   ========================================================================== */

.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: var(--sidebar-w);
  z-index: var(--z-player);
  display: grid;
  grid-template-columns: auto minmax(160px, 280px) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  height: var(--player-h);
  padding: 0 var(--space-4) 0 var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: saturate(140%) blur(14px);
  animation: toast-in var(--dur-slow) var(--ease-out);
}

.player__toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--text-inverse);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}

.player__toggle > * {
  grid-area: 1 / 1;
}

.player__toggle:hover {
  box-shadow: 0 0 0 4px var(--line-strong);
}

.player__toggle:active {
  transform: scale(.96);
}

.player__toggle .lucide {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke-width: 2;
}

.player__toggle .icon-play {
  margin-left: 2px;
}

.player__toggle .icon-pause,
.player__toggle[aria-pressed="true"] .icon-play {
  display: none;
}

.player__toggle[aria-pressed="true"] .icon-pause {
  display: block;
}

.player__info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
  min-width: 0;
}

.player__title {
  overflow: hidden;
  color: var(--text);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__meta {
  grid-column: 1 / -1;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mini VU-mètre : s'anime uniquement pendant la lecture */
.vu {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.player.is-playing .vu {
  opacity: 1;
}

.vu span {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: var(--line-strong);
  transform: scaleY(.3);
  transform-origin: bottom;
}

.player.is-playing .vu span {
  background: var(--live);
  animation: vu 900ms var(--ease) infinite alternate;
}

.player.is-playing .vu span:nth-child(2) { animation-duration: 640ms; animation-delay: -200ms; }
.player.is-playing .vu span:nth-child(3) { animation-duration: 1120ms; animation-delay: -400ms; }
.player.is-playing .vu span:nth-child(4) { animation-duration: 760ms; animation-delay: -120ms; }

.player__scrub {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.player__time {
  min-width: 36px;
  color: var(--text-2);
  font-size: var(--text-sm);
  text-align: center;
}

.player__actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.player__line {
  display: none;
}

.player__line-track { fill: var(--line); }
.player__line-fill { fill: var(--brand-cyan); }

/* Forme d'onde : dégradé cyan → violet pour la partie écoutée */
.wave {
  position: relative;
  height: 36px;
  min-width: 0;
}

.wave__svg {
  width: 100%;
  height: 36px;
}

.wave__base { fill: var(--line-strong); }
.wave__stop--a { stop-color: var(--brand-cyan); }
.wave__stop--b { stop-color: var(--brand-violet); }

.wave__seek {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.wave:has(.wave__seek:focus-visible) {
  border-radius: var(--radius-xs);
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

/* Pages sans coquille (inscription) : lecteur pleine largeur, sans actions de contenu */
body[data-layout="auth"] .player {
  left: 0;
  bottom: 0;
}

body[data-layout="auth"] .player__actions .btn:not([data-player-close]) {
  display: none;
}

body[data-layout="auth"].has-player {
  padding-bottom: var(--player-h);
}

@media (max-width: 1100px) and (min-width: 768px) {
  .player {
    grid-template-columns: auto minmax(140px, 220px) minmax(0, 1fr) auto;
  }
}

@media (max-width: 767px) {
  body[data-layout="auth"] .player {
    bottom: 0;
  }

  .player {
    bottom: var(--tabbar-h);
    left: 0;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: var(--space-3);
    padding: 0 var(--space-2) 0 var(--space-4);
  }

  .player__scrub {
    display: contents;
  }

  .player__scrub > .player__time:first-child,
  .player .wave {
    display: none;
  }

  .player__line {
    display: block;
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 2px;
  }

  .player__actions .btn:not([data-player-close]) {
    display: none;
  }

  .player__toggle {
    width: 36px;
    height: 36px;
  }
}

/* Piste (ligne avec ▶) : voix, bandes-annonces, séquences du Hit des Auditeurs */
.tracks {
  container: tracks / inline-size;
}

.tracks > .track + .track {
  border-top: 1px solid var(--line-soft);
}

.track {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3) var(--space-5);
}

.tracks--plain .track {
  padding-left: 0;
  padding-right: 0;
}

.track.is-playing {
  background: var(--accent-soft);
}

.track__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.track__title {
  color: var(--text);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.track__meta {
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.track__end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.track__time {
  color: var(--text-2);
  font-size: var(--text-sm);
  white-space: nowrap;
}

/* L'onde n'apparaît que si la liste est assez large (sélecteur renforcé : .wave-mini ne la réaffiche pas) */
.track > .track__wave {
  display: none;
}

@container tracks (min-width: 560px) {
  .track {
    grid-template-columns: auto minmax(0, 1fr) minmax(80px, 180px) auto;
  }

  .track > .track__wave {
    display: block;
  }
}

/* Lecteur compact en ligne : ▶ + onde décorative + durée */
.audio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.audio__time {
  color: var(--text-2);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.wave-mini {
  display: block;
  width: 120px;
  height: 28px;
  color: var(--line-hover);
}

.track__wave.wave-mini {
  width: 100%;
}

.wave-mini svg {
  width: 100%;
  height: 100%;
}

.wave-mini path {
  fill: currentColor;
}

.is-playing .wave-mini,
.audio.is-playing .wave-mini {
  color: var(--accent);
}


/* =============================================================================
   25. NOTIFICATIONS · CHARGEMENT · ÉTATS VIDES · PAGINATION
   ========================================================================== */

/* La zone passe au premier plan (popover) pour rester visible au-dessus des fenêtres */
.toast-region {
  position: fixed;
  top: auto;
  right: var(--gutter);
  bottom: var(--space-4);
  left: auto;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(420px, calc(100vw - 2 * var(--gutter)));
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: inherit;
  pointer-events: none;
}

body.has-player .toast-region {
  bottom: calc(var(--player-h) + var(--space-4));
}

.toast {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-size: var(--text-md);
  pointer-events: auto;
  animation: toast-in var(--dur-slow) var(--ease-out);
}

.toast__icon {
  padding-top: 1px;
  color: var(--ok);
}

.toast__icon .lucide {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

.toast--info .toast__icon { color: var(--live); }
.toast--warn .toast__icon { color: var(--warn); }
.toast--fail .toast__icon { color: var(--fail); }

.toast__text {
  padding-top: 1px;
  line-height: var(--lh-snug);
}

.toast__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: -4px 0;
}

.toast__actions .btn--icon {
  width: 30px;
  height: 30px;
}

.toast__actions .btn--icon .lucide {
  width: 15px;
  height: 15px;
}

@media (max-width: 767px) {
  .toast-region {
    right: var(--space-3);
    bottom: calc(var(--tabbar-h) + var(--space-3));
    width: calc(100vw - 2 * var(--space-3));
  }

  body.has-player .toast-region {
    bottom: calc(var(--tabbar-h) + var(--player-h) + var(--space-3));
  }

  body[data-layout="auth"] .toast-region {
    bottom: var(--space-3);
  }

  body[data-layout="auth"].has-player .toast-region {
    bottom: calc(var(--player-h) + var(--space-3));
  }
}

/* Squelettes de chargement (plutôt qu'un voile plein écran) */
.skeleton {
  display: block;
  height: 12px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--skeleton-a) 0%, var(--skeleton-b) 50%, var(--skeleton-a) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton--title { width: 42%; height: 18px; }
.skeleton--text { width: 100%; }
.skeleton--short { width: 58%; }
.skeleton--block { height: 88px; border-radius: var(--radius-md); }
.skeleton--circle { width: var(--play-size); height: var(--play-size); border-radius: 50%; }

.skeleton-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
}

.skeleton-row + .skeleton-row {
  border-top: 1px solid var(--line-soft);
}

/* État vide : une phrase, une action */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-10) var(--space-5);
  color: var(--text-2);
  text-align: center;
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-3);
}

.empty__icon .lucide {
  width: 22px;
  height: 22px;
}

.empty__icon--ok {
  border-color: var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok);
}

.empty__title {
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.empty__text {
  max-width: 48ch;
  font-size: var(--text-md);
}

.empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.empty--compact {
  padding: var(--space-6) var(--space-4);
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.pagination__info {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.pagination__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.pagination__btn {
  display: inline-grid;
  place-items: center;
  min-width: var(--control-h-sm);
  height: var(--control-h-sm);
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
}

.pagination__btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.pagination__btn[aria-current="page"] {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}

.pagination__btn[aria-disabled="true"] {
  opacity: .4;
  pointer-events: none;
}

.pagination__gap {
  color: var(--text-3);
}


/* =============================================================================
   26. PAGES SANS COQUILLE (connexion, inscription) : <body data-layout="auth">
   ========================================================================== */

.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-10) var(--space-4);
}

.auth__brand {
  display: block;
  border-radius: var(--radius-lg);
}

.auth__brand img {
  width: 184px;
  height: auto;
}

[data-theme="light"] .auth__brand {
  padding: var(--space-3) var(--space-4);
  background: var(--surface-inset);
}

.auth__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: min(440px, 100%);
  padding: var(--space-8);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  box-shadow: var(--shadow-modal);
}

.auth--wide .auth__card {
  width: min(760px, 100%);
}

.auth__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth__title {
  color: var(--text);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-title);
}

.auth__desc {
  color: var(--text-2);
}

.auth__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.auth__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.auth__foot a:hover {
  color: var(--text);
}

/* Mentions légales en pied de page (version réelle) */
.app-foot {
  margin-top: var(--space-8, 3rem);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border, rgba(255, 255, 255, .08));
  color: var(--text-3);
  font-size: var(--text-xs, .75rem);
  line-height: 1.6;
  text-align: center;
}

.app-foot p {
  margin: 0;
}

[data-layout="auth"] .app-foot {
  margin-top: var(--space-5);
  border-top: 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

@media (max-width: 767px) {
  .auth {
    justify-content: flex-start;
    padding-top: var(--space-8);
  }

  .auth__card {
    padding: var(--space-6) var(--space-5);
  }
}


/* =============================================================================
   27. DOCUMENTATION DU DESIGN SYSTEM (composants.html uniquement)
   ========================================================================== */

.doc-toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.doc-toc a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: var(--text-sm);
}

.doc-toc a:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.doc-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

.doc-section__title {
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-tight);
}

.doc-section__desc {
  max-width: 80ch;
  color: var(--text-2);
}

.specimen {
  container: card / inline-size;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.specimen__stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg);
}

.specimen__stage--column {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}

.specimen__stage > .grid {
  flex: 1 1 100%;
}

.specimen__caption {
  padding: var(--space-3) var(--space-5);
  border-top: 1px dashed var(--line-strong);
  background: var(--surface-inset);
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

.specimen__caption code,
.doc-code {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-3);
  width: 100%;
}

.swatch {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.swatch__chip {
  height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.swatch__name {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.swatch__token {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.swatch--bg .swatch__chip { background: var(--bg); }
.swatch--inset .swatch__chip { background: var(--surface-inset); }
.swatch--s1 .swatch__chip { background: var(--surface-1); }
.swatch--s2 .swatch__chip { background: var(--surface-2); }
.swatch--s3 .swatch__chip { background: var(--surface-3); }
.swatch--line .swatch__chip { background: var(--line-strong); }
.swatch--text .swatch__chip { background: var(--text); }
.swatch--text2 .swatch__chip { background: var(--text-2); }
.swatch--text3 .swatch__chip { background: var(--text-3); }
.swatch--ok .swatch__chip { background: var(--ok); }
.swatch--warn .swatch__chip { background: var(--warn); }
.swatch--fail .swatch__chip { background: var(--fail); }
.swatch--live .swatch__chip { background: var(--live); }
.swatch--idle .swatch__chip { background: var(--idle); }
.swatch--brand .swatch__chip { background: var(--grad-brand); }
.swatch--action .swatch__chip { background: var(--grad-action); }

.type-scale {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

.type-scale__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-4);
}

.type-scale__token {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.type-scale .t-xs { font-size: var(--text-xs); }
.type-scale .t-sm { font-size: var(--text-sm); }
.type-scale .t-md { font-size: var(--text-md); }
.type-scale .t-base { font-size: var(--text-base); }
.type-scale .t-lg { font-size: var(--text-lg); }
.type-scale .t-xl { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.type-scale .t-2xl { font-size: var(--text-2xl); font-weight: var(--weight-semibold); }
.type-scale .t-3xl { font-size: var(--text-3xl); font-weight: var(--weight-semibold); letter-spacing: var(--track-title); }
.type-scale .t-mono { font-family: var(--font-mono); font-size: var(--text-3xl); }


/* =============================================================================
   28. ANIMATIONS (discrètes, désactivées si l'utilisateur le demande)
   ========================================================================== */

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes drawer-in {
  from { opacity: .6; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes vu {
  0% { transform: scaleY(.2); }
  100% { transform: scaleY(1); }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

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


/* =============================================================================
   29. UTILITAIRES DE TEXTE (déclarés en dernier : ils priment sur les composants,
   ex. <p class="track__meta text-warn"> s'affiche bien en ambre)
   ========================================================================== */

.text-sm { font-size: var(--text-sm); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-1 { color: var(--text); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-fail { color: var(--fail); }
.text-live { color: var(--live); }
.strong { color: var(--text); font-weight: var(--weight-semibold); }
.nowrap { white-space: nowrap; }


/* =============================================================================
   30. IMPRESSION (grille de la semaine, conducteur, attestation)
   ========================================================================== */

@media print {
  /* Tokens d'impression : encre sombre sur papier blanc, quel que soit le thème */
  :root,
  [data-theme] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-glow: none;
    --surface-inset: #ffffff;
    --surface-1: #ffffff;
    --surface-2: #f4f6f9;
    --surface-3: #eceff4;
    --line-soft: #e3e7ee;
    --line: #d5dbe4;
    --line-strong: #b9c1ce;
    --text: #0b1220;
    --text-2: #333d4f;
    --text-3: #4f5a6d;
    --shadow-panel: none;
  }

  body,
  body:not([data-layout="auth"]) {
    padding: 0 !important;
  }

  .sidebar,
  .topbar,
  .tabbar,
  .subnav,
  .player,
  .toast-region,
  .scrim,
  .skip-link,
  .page-header__actions,
  .cell-actions,
  .play,
  .btn,
  .toolbar,
  .segmented,
  .filters,
  .search,
  .pagination,
  .alert__actions,
  .table__group,
  .no-print {
    display: none !important;
  }

  /* Le passé replié (conducteur) s'imprime quand même */
  .table > tbody[hidden] {
    display: table-row-group !important;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .card,
  .week__grid,
  .status-banner {
    box-shadow: none;
    break-inside: avoid;
  }
}


/* ==========================================================================
   Compléments v2 (branchement réel)
   ========================================================================== */
/* Affiches de la BO ciné : ratio fixe, recadrage propre */
.media-card > img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
/* Tableau en cartes : pas de défilement horizontal parasite des en-têtes de tri masqués */
@container table (max-width: 749px) {
  .table--cards .table__sort::after, .table--cards .table__sort::before { content: none; }
}
.table-wrap:has(> .table--cards) { overflow-x: clip; }

/* ==========================================================================
   Touches de couleur légères (demande du client, 28/09/2026) : violet et cyan de la marque,
   en fonds très doux et en icônes ; la mise en page et les couleurs d'état ne changent pas.
   ========================================================================== */
.page-header__media {
  border-color: rgba(120, 78, 238, .35);
  background: linear-gradient(135deg, var(--brand-cyan-soft), var(--brand-soft));
  color: var(--brand-text);
}

.card__title .lucide {
  color: var(--brand-text);
}

.card__head {
  background: linear-gradient(90deg, rgba(0, 184, 255, .045), rgba(120, 78, 238, .045) 60%, transparent);
}

.icon-tile {
  border-color: rgba(120, 78, 238, .28);
  background: var(--brand-soft);
  color: var(--brand-text);
}

.tile__icon {
  border-color: rgba(0, 184, 255, .28);
  background: var(--brand-cyan-soft);
  color: var(--brand-cyan);
}

.stats--cards .stat {
  background: linear-gradient(180deg, rgba(120, 78, 238, .07), transparent 70%), var(--surface-1);
}

.stat__label {
  color: var(--brand-text);
}

/* ==========================================================================
   Lot A — Accueil et accès (28/09/2026) : liste des avantages dans l'encart « Accès limité » de l'accueil.
   ========================================================================== */
.acces-limite__liste {
  margin-top: var(--space-2);
}

/* ==========================================================================
   Lot D — Émissions, Hit des Auditeurs, BO ciné (28/09/2026) : interrupteur Actif / Inactif et boutons en texte
   dans le pied des cartes d'émission (retour à la ligne sur carte étroite), bouton de dépôt en attente d'envoi.
   ========================================================================== */
body[data-page="emissions"] .tile__foot {
  flex-wrap: wrap;
}

body[data-page="hit-des-auditeurs"] .track__end > form,
body[data-page="hit-des-auditeurs"] .list__aside > form {
  display: flex;
}

label.btn.is-busy {
  pointer-events: none;
}

/* ==========================================================================
   Lot B — Livraison (28/09/2026) : encart « SMN FTP Professional » avec son bouton en tête de la carte FTP Send4Radio,
   « Réinitialiser l'accès » sous le mot de passe, résultat de « Vérifier la connexion » dans le panneau du FTP de la radio.
   ========================================================================== */
body[data-page="livraison"] .liv-smn {
  flex-wrap: wrap;
  align-items: center;
}

body[data-page="livraison"] .liv-smn > .callout__body {
  flex: 1 1 14rem;
}

body[data-page="livraison"] .liv-smn > .btn {
  margin-left: auto;
}

body[data-page="livraison"] .liv-reinit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
}

body[data-page="livraison"] .liv-ftp-resultat:empty {
  display: none;
}

/* ==========================================================================
   Lot E — Coquille et pages de compte (28/09/2026) : menu complet en tiroir sur tablette (plus de rail d'icônes),
   liens directs sous une entrée du menu (Flash Informations, Émissions › Le Hit des Auditeurs), étiquette « Nouveau »,
   « Mon compte » sur tablette, pied du panneau « Quoi de 9 ? », listes numérotées de l'aide.
   ========================================================================== */
.nav__sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 var(--space-1);
}

.nav__link--sub {
  min-height: 32px;
  padding-left: calc(2 * var(--space-3) + 17px);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.nav__link.is-parent-current {
  color: var(--text);
}

.nav__link.is-parent-current .lucide {
  color: var(--text-2);
}

.nav__tag {
  margin-left: auto;
}

.account-trigger__short {
  display: none;
}

#s4r-news .news {
  max-height: min(55vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.news__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  margin: 6px -6px -6px;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface-inset);
}

.news__maj {
  color: var(--text-3);
  font-size: var(--text-sm);
}

.list-steps {
  padding-left: var(--space-5);
  list-style: decimal;
}

.list-steps li + li {
  margin-top: var(--space-1);
}

/* Tablette (768–1023 px) : le rail d'icônes sans texte est remplacé par le menu complet, qui s'ouvre avec le bouton ☰
   (comme le bouton de l'espace actuel, includes/header.php:23-25). Ces règles annulent celles du rail (section 5). */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    z-index: var(--z-drawer);
    width: min(300px, 86vw);
    box-shadow: var(--shadow-modal);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
  }

  .sidebar.is-open {
    transform: none;
    visibility: visible;
    transition: transform var(--dur-slow) var(--ease-out), visibility 0s;
  }

  .sidebar .sidebar__close,
  .topbar .topbar__menu {
    display: inline-flex;
  }

  .sidebar__head {
    justify-content: space-between;
    padding: var(--space-3) var(--space-3) var(--space-2) var(--space-5);
  }

  .sidebar__logo {
    display: block;
  }

  .sidebar__mark {
    display: none;
  }

  .station__body,
  .sidebar__foot {
    display: flex;
  }

  .station__chevron,
  .sidebar__tag {
    display: block;
  }

  .station {
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-content: normal;
    margin: var(--space-1) var(--space-3) var(--space-2);
    padding: var(--space-3);
  }

  .nav__label {
    height: auto;
    margin: 0;
    padding: var(--space-5) var(--space-5) var(--space-2);
    overflow: visible;
    background: none;
    color: var(--text-3);
  }

  .nav__link {
    justify-content: flex-start;
    width: auto;
    min-height: 44px;
    margin: 0 var(--space-3);
    padding: var(--space-1) var(--space-3);
  }

  .nav__link--sub {
    min-height: 40px;
    padding-left: calc(2 * var(--space-3) + 17px);
  }

  .nav__link[aria-current="page"]::before {
    left: calc(-1 * var(--space-3));
  }

  .nav__text {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .nav__link .count,
  .nav__meta {
    position: static;
    margin: 0 0 0 auto;
  }

  .nav__link .count {
    min-width: 20px;
    width: auto;
    height: 20px;
    padding: 0 6px;
    overflow: visible;
    color: var(--text-2);
    box-shadow: none;
  }

  .nav__link .count--fail,
  .nav__link .count--warn {
    color: var(--text-inverse);
  }

  .account-trigger__short {
    display: inline;
  }
}

/* ==========================================================================
   Lot X (28/09/2026) — Journal de production : bouton texte « Voir le détail » sous le message d'une ligne en échec
   (remplace le menu ⋯ de chaque ligne). Aligné à gauche, à la taille de la précision de ligne.
   ========================================================================== */
.row-title__action {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

/* ==========================================================================
   Correcteur unique (28/09/2026) — menu : liste repliable des chroniques et sous-entrées d'Émissions (P03) ;
   menu « Mon compte » défilant, jamais sous le lecteur ni la barre d'onglets (NAV-01) ; libellés des chiffres
   sur deux lignes au besoin (NAV-04) ; BO ciné en colonnes plus larges (NAV-05) ; chemins longs coupés (NAV-06) ;
   piste sans onde : bouton aligné à droite (NAV-07).
   ========================================================================== */
.nav__fold > .nav__fold-summary {
  list-style: none;
  cursor: pointer;
}

.nav__fold > .nav__fold-summary::-webkit-details-marker {
  display: none;
}

.nav__fold-summary .nav__fold-icon {
  width: 15px;
  height: 15px;
  margin-left: auto;
  transition: transform var(--dur-fast) var(--ease);
}

.nav__fold[open] > .nav__fold-summary .nav__fold-icon {
  transform: rotate(180deg);
}

.nav__fold > .nav__sub .nav__link--sub {
  padding-left: calc(2 * var(--space-3) + 29px);
}

.topbar .popover {
  max-height: calc(100dvh - var(--topbar-h) - var(--space-5));
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.has-player .topbar .popover {
  max-height: calc(100dvh - var(--topbar-h) - var(--player-h) - var(--space-5));
}

@media (max-width: 767px) {
  .topbar .popover {
    max-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - var(--space-5));
  }

  body.has-player .topbar .popover {
    max-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - var(--player-h) - var(--space-5));
  }
}

.stats--cards .stat__label {
  white-space: normal;
  line-height: 1.25;
}

body[data-page="bo-cine"] .grid--posters {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.row-title__meta {
  overflow-wrap: anywhere;
}

@container tracks (min-width: 560px) {
  .track:not(:has(> .track__wave)) {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}

/* ==========================================================================
   Correcteur 10/10/2026
   ========================================================================== */
/* PN2-03 : Agenda de production en 7 colonnes sur une grille de moins de 1200 px (bureau 1300 px) : l'heure passe
   au-dessus du nom, qui prend toute la largeur du créneau (105 px au lieu de 62) ; un mot trop long passe à la ligne
   entier, avec la césure française au besoin, au lieu d'être coupé n'importe où (« Horoscop / e ») */
.slot__name {
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

@container week (min-width: 960px) and (max-width: 1199px) {
  .slot {
    grid-template-columns: minmax(0, 1fr);
  }

  .slot__meta {
    grid-column: 1;
  }
}

/* PN2-04 : grille empilée (téléphone, tablette) : lien « Aller à aujourd'hui » au-dessus des 7 jours */
.week__aller {
  margin: 0 0 var(--space-3);
}

@container week (min-width: 960px) {
  .week__aller {
    display: none;
  }
}

@media print {
  .week__aller {
    display: none;
  }
}
