/* Système fonctionnel — composants. À charger après jetons.css et base.css.

   Nommage BEM : .ds-bloc, .ds-bloc__element, .ds-bloc--variante. Les états
   passent par les attributs d'accessibilité (aria-pressed, aria-selected,
   aria-checked, aria-current, aria-invalid, :disabled) : le style suit l'état
   réel, pas une classe qu'on oublierait de retirer. `.is-active` reste
   accepté là où l'ARIA ne convient pas.

   Trois règles que chaque composant respecte :
   · aucune couleur en dur, seulement des jetons (exceptions commentées : la
     bande, toujours sombre, et le papier, toujours blanc) ;
   · pas d'ombre, sauf ce qui flotte (.ds-floating) ;
   · au survol, la bordure ou le fond change ; rien ne se soulève. */

/* ═══ Boutons ═════════════════════════════════════════════════════════════
   Pilule, sans ombre. UN SEUL bouton principal par écran : c'est lui qui
   donne la hiérarchie. Le reste en secondaire ou discret. 44 px par défaut
   (cible tactile Apple), 40 px en compact au bureau. */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-space-2);
  height: var(--ds-size-target); padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--ds-radius-pill);
  font-family: var(--ds-font-sans); font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-semibold); line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color var(--ds-motion-fast), border-color var(--ds-motion-fast), color var(--ds-motion-fast);
}
.ds-btn svg { width: var(--ds-size-icon); height: var(--ds-size-icon); flex-shrink: 0; }
/* Principal : l'encre pleine. Le texte prend `on-color`, qui passe au noir en
   sombre (le bouton devient clair). */
.ds-btn--primary { background: var(--ds-accent); color: var(--ds-on-color); }
.ds-btn--primary:hover { background: var(--ds-accent-hover); }
/* Secondaire : la surface et une bordure. */
.ds-btn--secondary { background: var(--ds-surface); color: var(--ds-text); border-color: var(--ds-border); }
.ds-btn--secondary:hover { background: var(--ds-bg-subtle); border-color: var(--ds-border-strong); }
/* Discret : sans fond ni bordure (action de troisième rang, barre d'outils). */
.ds-btn--quiet { background: transparent; color: var(--ds-text); padding: 0 12px; }
.ds-btn--quiet:hover { background: var(--ds-fill); }
/* Danger en contour : « Supprimer » dans une liste ou des réglages. */
.ds-btn--danger { background: var(--ds-surface); color: var(--ds-danger); border-color: var(--ds-border); }
.ds-btn--danger:hover { background: var(--ds-danger-soft); border-color: var(--ds-danger-border); }
/* Danger plein : la confirmation d'une action irréversible, dans sa fenêtre. */
.ds-btn--danger-solid { background: var(--ds-danger); color: var(--ds-on-color); }
.ds-btn--danger-solid:hover { background: var(--ds-danger-hover); }
/* Sur la bande sombre (toujours sombre) : blanc, couleurs fixes. */
.ds-btn--on-band { background: var(--ds-band-text); color: var(--ds-band); }
.ds-btn--on-band:hover { background: #f4f4f4; }
.ds-btn--sm { height: var(--ds-size-target-sm); padding: 0 16px; }
.ds-btn--block { width: 100%; }
/* Bouton d'icône rond (menu, fermer). Toujours un aria-label. */
.ds-btn--icon { width: var(--ds-size-target-sm); height: var(--ds-size-target-sm); padding: 0; }
.ds-btn:disabled, .ds-btn[aria-disabled='true'] { background: var(--ds-fill); color: var(--ds-text-3); border-color: transparent; cursor: not-allowed; }

/* ═══ Champs ══════════════════════════════════════════════════════════════
   La bordure identifie le contrôle : `border-field`, 3:1 (WCAG 1.4.11). Le
   focus est l'anneau bleu de base.css. */
.ds-input, .ds-select, .ds-textarea {
  width: 100%; height: var(--ds-size-target); padding: 0 14px;
  border: 1px solid var(--ds-border-field); border-radius: var(--ds-radius-md);
  background: var(--ds-surface); color: var(--ds-text);
  font-family: var(--ds-font-sans); font-size: var(--ds-font-size-sm);
}
.ds-textarea { height: auto; min-height: 150px; padding: 14px; line-height: var(--ds-line-height-prose); resize: vertical; }
.ds-input::placeholder, .ds-textarea::placeholder { color: var(--ds-text-3); }
/* Chevron gris moyen (#868686) : lisible sur blanc comme sur noir. */
.ds-select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23868686' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.ds-input[aria-invalid='true'], .ds-select[aria-invalid='true'], .ds-textarea[aria-invalid='true'] { border-color: var(--ds-danger); }
.ds-input:disabled, .ds-select:disabled, .ds-textarea:disabled { background: var(--ds-fill); color: var(--ds-text-3); cursor: not-allowed; }

/* Un champ complet : libellé, contrôle, aide ou erreur. */
.ds-field { display: flex; flex-direction: column; gap: 6px; }
.ds-field__label { font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-semibold); color: var(--ds-text); }
.ds-field__hint { font-size: var(--ds-font-size-xs); line-height: var(--ds-line-height-body); color: var(--ds-text-3); }
.ds-field__error { display: flex; align-items: flex-start; gap: 6px; font-size: var(--ds-font-size-xs); line-height: var(--ds-line-height-body); color: var(--ds-danger); }
.ds-field__error svg { width: var(--ds-size-icon-sm); height: var(--ds-size-icon-sm); margin-top: 1px; flex-shrink: 0; }

/* Recherche : un champ en pilule, icône à gauche. */
.ds-search { position: relative; display: flex; align-items: center; }
.ds-search svg { position: absolute; left: 14px; width: var(--ds-size-icon); height: var(--ds-size-icon); color: var(--ds-text-3); pointer-events: none; }
.ds-search .ds-input { padding-left: 40px; border-radius: var(--ds-radius-pill); }

/* ═══ Surfaces ════════════════════════════════════════════════════════════
   Une carte = une bordure, jamais une ombre. Elle est une ZONE, pas un objet :
   rembourrage modéré, arrondi 12 px. */
.ds-card { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); }
.ds-card--pad { padding: var(--ds-space-5); }
.ds-card--pad-lg { padding: var(--ds-space-7); }
/* Carte cliquable : la bordure fonce au survol, rien ne bouge. */
a.ds-card, .ds-card--link { color: inherit; text-decoration: none; transition: border-color var(--ds-motion-fast); }
a.ds-card:hover, .ds-card--link:hover { border-color: var(--ds-border-strong); }
/* Zone en retrait : un bloc posé sans bordure (encadré, solde, note). */
.ds-subtle { background: var(--ds-bg-subtle); border-radius: var(--ds-radius-lg); padding: var(--ds-space-5); }

/* ═══ Listes en lignes ════════════════════════════════════════════════════
   Des lignes séparées par des filets, dans une carte (GitHub, Shopify), plutôt
   qu'une grille de cartes. */
.ds-list { list-style: none; margin: 0; padding: 0; background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); overflow: hidden; }
.ds-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--ds-border-subtle); color: inherit; text-decoration: none; }
.ds-row:first-child { border-top: 0; }
a.ds-row, button.ds-row { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; transition: background-color var(--ds-motion-fast); }
button.ds-row:first-child { border-top: 0; }
a.ds-row:hover, button.ds-row:hover { background: var(--ds-bg-subtle); }
.ds-row__icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--ds-radius-sm); background: var(--ds-fill); color: var(--ds-text-2); }
.ds-row__icon svg { width: var(--ds-size-icon); height: var(--ds-size-icon); }
.ds-row__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ds-row__title { font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-semibold); color: var(--ds-text); }
.ds-row__meta { font-size: var(--ds-font-size-sm); color: var(--ds-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-row__end { display: inline-flex; align-items: center; gap: var(--ds-space-2); flex-shrink: 0; color: var(--ds-text-3); }
.ds-row__end svg { width: var(--ds-size-icon); height: var(--ds-size-icon); }

/* ═══ Pastilles ═══════════════════════════════════════════════════════════
   Neutres par défaut. La couleur seulement pour un SENS, et toujours avec un
   mot ou une icône (WCAG 1.4.1 : la couleur seule ne dit rien à qui la voit
   mal). */
.ds-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--ds-radius-pill); background: var(--ds-fill); color: var(--ds-text-2); font-size: var(--ds-font-size-xs); font-weight: var(--ds-font-weight-medium); line-height: 1; white-space: nowrap; }
.ds-badge svg { width: var(--ds-size-icon-sm); height: var(--ds-size-icon-sm); }
.ds-badge--success { background: var(--ds-success-soft); color: var(--ds-success); }
.ds-badge--warning { background: var(--ds-warning-soft); color: var(--ds-warning); }
.ds-badge--danger { background: var(--ds-danger-soft); color: var(--ds-danger); }
.ds-badge--info { background: var(--ds-info-soft); color: var(--ds-info); }
/* Point d'alerte sur une icône (nombre de choses à voir). */
.ds-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--ds-radius-pill); background: var(--ds-warning); color: var(--ds-on-color); font-size: var(--ds-font-size-xs); font-weight: var(--ds-font-weight-semibold); line-height: 1; box-shadow: 0 0 0 2px var(--ds-surface); }

/* ═══ Segment ═════════════════════════════════════════════════════════════
   Choix exclusif entre 2 à 4 options courtes. L'option active : la surface et
   un trait, pas une couleur. */
.ds-segment { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--ds-radius-pill); background: var(--ds-fill); max-width: 100%; }
.ds-segment > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--ds-radius-pill); background: transparent; color: var(--ds-text-2); font-family: var(--ds-font-sans); font-size: var(--ds-font-size-xs); font-weight: var(--ds-font-weight-semibold); white-space: nowrap; cursor: pointer; transition: background-color var(--ds-motion-fast), color var(--ds-motion-fast); }
.ds-segment > button svg { width: var(--ds-size-icon-sm); height: var(--ds-size-icon-sm); }
.ds-segment > button:hover { color: var(--ds-text); }
.ds-segment > button[aria-pressed='true'], .ds-segment > button[aria-selected='true'], .ds-segment > button[aria-checked='true'], .ds-segment > button.is-active { background: var(--ds-surface); color: var(--ds-text); box-shadow: 0 0 0 1px var(--ds-border); }
/* Pleine largeur (dans une carte) et grande taille (choix d'une quantité). */
.ds-segment--block { display: flex; }
.ds-segment--block > button { flex: 1; }
.ds-segment--lg > button { min-height: 34px; font-size: var(--ds-font-size-sm); }

/* ═══ Interrupteur ════════════════════════════════════════════════════════
   <button role="switch" aria-checked="…">. Activé : la piste à l'encre, le
   bouton prend `on-color` (blanc en clair, noir en sombre : un bouton blanc
   sur une piste claire disparaîtrait). */
.ds-switch { position: relative; flex-shrink: 0; width: 44px; height: 26px; padding: 0; border: 0; border-radius: var(--ds-radius-pill); background: color-mix(in srgb, var(--ds-text) 15%, transparent); cursor: pointer; transition: background-color var(--ds-motion-base); }
.ds-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: var(--ds-radius-pill); background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform var(--ds-motion-base) var(--ds-motion-ease), background-color var(--ds-motion-base); }
.ds-switch[aria-checked='true'] { background: var(--ds-accent); }
.ds-switch[aria-checked='true']::after { transform: translateX(18px); background: var(--ds-on-color); }
.ds-switch:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══ Onglets ═════════════════════════════════════════════════════════════
   Du texte ; l'actif en encre, demi-gras, souligné de 2 px (comme Google).
   Jamais une pilule. */
.ds-tabs { display: flex; gap: 4px; }
.ds-tab { display: inline-flex; align-items: center; min-height: var(--ds-size-target); margin-bottom: -1px; padding: 0 12px; border-bottom: 2px solid transparent; color: var(--ds-text-2); font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-medium); text-decoration: none; white-space: nowrap; transition: color var(--ds-motion-fast); }
.ds-tab:hover { color: var(--ds-text); }
.ds-tab[aria-current='page'], .ds-tab[aria-selected='true'], .ds-tab.is-active { color: var(--ds-text); font-weight: var(--ds-font-weight-semibold); border-bottom-color: var(--ds-text); }

/* ═══ Barre de navigation ═════════════════════════════════════════════════
   Une seule barre, pleine largeur, fond plein (pas de flou, pas d'îlots
   flottants). Le filet n'apparaît qu'une fois la page défilée : ajouter
   `.is-scrolled` quand window.scrollY > 0. */
.ds-navbar { position: sticky; top: 0; z-index: var(--ds-z-sticky); background: var(--ds-bg); border-bottom: 1px solid transparent; transition: border-color var(--ds-motion-fast); }
.ds-navbar.is-scrolled { border-bottom-color: var(--ds-border-subtle); }
.ds-navbar__inner { display: flex; align-items: center; gap: var(--ds-space-6); max-width: calc(var(--ds-layout-frame) + 2 * var(--ds-layout-gutter)); height: var(--ds-size-nav); margin: 0 auto; padding: 0 var(--ds-layout-gutter); }
.ds-navbar__brand { display: inline-flex; align-items: center; gap: var(--ds-space-2); white-space: nowrap; color: var(--ds-text); font-size: var(--ds-font-size-md); font-weight: var(--ds-font-weight-semibold); text-decoration: none; }
.ds-navbar .ds-tabs { align-self: stretch; }
.ds-navbar .ds-tab { min-height: 100%; }
.ds-navbar__end { display: flex; align-items: center; gap: var(--ds-space-3); margin-left: auto; }

/* ═══ État vide ═══════════════════════════════════════════════════════════
   Une phrase et un lien, pas un bloc : le titre ouvre la phrase en
   demi-gras. Jamais de tuile d'icône ni de bouton noir. */
.ds-empty { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: var(--ds-space-4) var(--ds-space-5); }
.ds-empty--card { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); }
.ds-empty__text { flex: 1 1 320px; margin: 0; font-size: var(--ds-font-size-sm); line-height: var(--ds-line-height-body); color: var(--ds-text-2); }
.ds-empty__text strong, .ds-empty__text b { font-weight: var(--ds-font-weight-semibold); color: var(--ds-text); }
/* Zone cliquable agrandie sans bouger la mise en page (marge négative) :
   33 px au pointeur fin, 45 px au doigt. */
.ds-empty__link { display: inline-flex; align-items: center; gap: 4px; padding-block: 6px; margin-block: -6px; color: var(--ds-info); font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-medium); text-decoration: none; white-space: nowrap; }
.ds-empty__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ds-empty__link svg { width: var(--ds-size-icon-sm); height: var(--ds-size-icon-sm); }
@media (pointer: coarse) { .ds-empty__link { padding-block: 12px; margin-block: -12px; } }

/* ═══ Message ═════════════════════════════════════════════════════════════
   Neutre par défaut (zone en retrait). La couleur seulement si le message EST
   une information, un succès, un avertissement ou une erreur. */
.ds-alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--ds-radius-md); background: var(--ds-bg-subtle); color: var(--ds-text-2); font-size: var(--ds-font-size-sm); line-height: var(--ds-line-height-body); }
.ds-alert svg { width: var(--ds-size-icon); height: var(--ds-size-icon); margin-top: 2px; flex-shrink: 0; color: var(--ds-text-3); }
.ds-alert strong, .ds-alert b { font-weight: var(--ds-font-weight-semibold); color: var(--ds-text); }
.ds-alert--info { background: var(--ds-info-soft); color: var(--ds-text); }
.ds-alert--info svg { color: var(--ds-info); }
.ds-alert--success { background: var(--ds-success-soft); color: var(--ds-text); }
.ds-alert--success svg { color: var(--ds-success); }
.ds-alert--warning { background: var(--ds-warning-soft); color: var(--ds-text); }
.ds-alert--warning svg { color: var(--ds-warning); }
.ds-alert--danger { background: var(--ds-danger-soft); color: var(--ds-text); }
.ds-alert--danger svg { color: var(--ds-danger); }

/* ═══ Flottants ═══════════════════════════════════════════════════════════
   Les SEULS éléments à porter une ombre. En sombre, la surface s'éclaircit
   d'un cran (l'ombre ne se voit pas sur du noir), et les « papiers » à
   l'intérieur (champs, boutons secondaires, segments) prennent la même
   surface, sinon ils feraient des trous sombres. */
.ds-floating { --ds-surface: var(--ds-surface-float); background: var(--ds-surface-float); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-xl); box-shadow: var(--ds-shadow-float); }

/* Menu : une liste d'actions, dans un flottant. */
.ds-menu { width: 268px; max-width: calc(100vw - 32px); padding: 6px; }
.ds-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--ds-radius-sm); background: transparent; color: var(--ds-text); font-family: var(--ds-font-sans); font-size: var(--ds-font-size-sm); text-align: left; text-decoration: none; cursor: pointer; }
.ds-menu__item:hover { background: var(--ds-fill); }
.ds-menu__item svg { width: var(--ds-size-icon); height: var(--ds-size-icon); flex-shrink: 0; color: var(--ds-text-3); }
.ds-menu__item--danger, .ds-menu__item--danger svg { color: var(--ds-danger); }
.ds-menu__sep { height: 1px; margin: 6px 4px; background: var(--ds-border-subtle); }

/* Fenêtre : voile + boîte. Au téléphone, elle devient une feuille ancrée en
   bas, arrondie en haut. */
.ds-dialog-wrap { position: fixed; inset: 0; z-index: var(--ds-z-modal); display: flex; align-items: center; justify-content: center; padding: var(--ds-space-4); background: var(--ds-overlay); }
.ds-dialog { width: 100%; max-width: 400px; padding: var(--ds-space-6); }
.ds-dialog__title { margin: 0; font-size: var(--ds-font-size-lg); font-weight: var(--ds-font-weight-semibold); letter-spacing: var(--ds-letter-spacing-heading); line-height: var(--ds-line-height-heading); }
.ds-dialog__text { margin: var(--ds-space-2) 0 0; font-size: var(--ds-font-size-sm); line-height: var(--ds-line-height-prose); color: var(--ds-text-2); }
.ds-dialog__actions { display: flex; gap: var(--ds-space-2); margin-top: var(--ds-space-5); }
.ds-dialog__actions .ds-btn { flex: 1; }

/* Toast : sur la bande sombre, dans les deux modes. Ses teintes d'icône sont
   fixes, choisies pour ce fond toujours sombre. */
.ds-toaster { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: var(--ds-z-toast); display: flex; flex-direction: column; align-items: center; gap: var(--ds-space-2); transform: translateX(-50%); pointer-events: none; }
.ds-toast { display: inline-flex; align-items: center; gap: 10px; max-width: min(440px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid var(--ds-band-border); border-radius: var(--ds-radius-lg); background: var(--ds-band); color: var(--ds-band-text); font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-medium); box-shadow: var(--ds-shadow-float); pointer-events: auto; }
.ds-toast svg { width: var(--ds-size-icon); height: var(--ds-size-icon); flex-shrink: 0; }
.ds-toast--success svg { color: #67dc84; }
.ds-toast--info svg { color: #a1c9fe; }
.ds-toast--warning svg { color: #f4c753; }
.ds-toast--danger svg { color: #ffb2aa; }
.ds-toast__action { margin-left: 4px; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: var(--ds-radius-md); background: transparent; color: inherit; font: inherit; font-size: var(--ds-font-size-xs); font-weight: var(--ds-font-weight-semibold); cursor: pointer; }
.ds-toast__action:hover { background: rgba(255, 255, 255, 0.1); }

/* ═══ Bande sombre ════════════════════════════════════════════════════════
   L'appel final d'une page, un encart marketing. Sombre dans les deux modes,
   bordée en sombre. Son bouton : .ds-btn--on-band. */
.ds-band { position: relative; overflow: hidden; padding: var(--ds-space-14) var(--ds-space-12); border: 1px solid var(--ds-band-border); border-radius: var(--ds-radius-lg); background: var(--ds-band); color: var(--ds-band-text); }
.ds-band .ds-title { max-width: 18ch; letter-spacing: var(--ds-letter-spacing-hero); line-height: 1.05; }
.ds-band p { margin: 14px 0 0; max-width: 40ch; font-size: var(--ds-font-size-md); color: var(--ds-band-text-2); }
/* Le seul décor toléré, repris d'Aceve : une grille à peine visible. */
.ds-band--grid::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.ds-band > * { position: relative; }

/* ═══ Questions repliées ══════════════════════════════════════════════════
   <details> natif : lu par qui veut, invisible pour qui est décidé. */
.ds-faq { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); overflow: hidden; }
.ds-faq__item { border-bottom: 1px solid var(--ds-border-subtle); }
.ds-faq__item:last-child { border-bottom: 0; }
.ds-faq__item > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; list-style: none; color: var(--ds-text); font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-semibold); cursor: pointer; }
.ds-faq__item > summary::-webkit-details-marker { display: none; }
.ds-faq__item > summary svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ds-text-3); transition: transform var(--ds-motion-glide) var(--ds-motion-ease); }
.ds-faq__item[open] > summary svg { transform: rotate(180deg); }
.ds-faq__answer { padding: 0 22px 20px; font-size: var(--ds-font-size-sm); line-height: var(--ds-line-height-relaxed); color: var(--ds-text-2); }

/* ═══ Score ═══════════════════════════════════════════════════════════════
   Une mesure, pas un verdict : anneau à l'encre sur une piste neutre, jamais
   vert « c'est bien » ni rouge « c'est mal ». --p = pourcentage (0–100). */
.ds-score { --p: 70; position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: var(--ds-radius-pill); line-height: 1; }
.ds-score::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: conic-gradient(var(--ds-text) 0 calc(var(--p) * 1%), color-mix(in srgb, var(--ds-text) 12%, transparent) 0 100%); -webkit-mask: radial-gradient(closest-side, transparent 80%, #000 81%); mask: radial-gradient(closest-side, transparent 80%, #000 81%); }
.ds-score b { position: relative; font-size: var(--ds-font-size-xl); font-weight: var(--ds-font-weight-semibold); font-variant-numeric: tabular-nums; }
.ds-score span { position: relative; margin-top: 2px; font-size: var(--ds-font-size-xs); color: var(--ds-text-3); }

/* ═══ Chargement ══════════════════════════════════════════════════════════ */
.ds-skeleton { position: relative; overflow: hidden; border-radius: var(--ds-radius-sm); background: var(--ds-fill); }
.ds-skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: ds-shimmer 1.4s var(--ds-motion-ease) infinite; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .ds-skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); }
}
[data-theme='dark'] .ds-skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); }
@keyframes ds-shimmer { to { transform: translateX(100%); } }

/* ═══ Papier ══════════════════════════════════════════════════════════════
   Un document imprimable (CV, facture, lettre) montré tel qu'il sortira :
   blanc dans les deux modes. À poser avec data-theme="light" : les jetons y
   reprennent leurs valeurs claires. C'est la seule surface hors flottants à
   porter une ombre : elle représente une feuille. */
.ds-paper { background: var(--ds-surface); color: var(--ds-text); box-shadow: 0 6px 24px -8px rgba(20, 23, 28, 0.25); }
/* En sombre, à l'écran seulement : la feuille reste blanche mais s'atténue
   d'un cran (le blanc s'affiche #E6E6E6). Une grande zone blanche sur une page
   noire éblouit, et l'œil qui s'y adapte lit moins bien le texte autour.
   L'impression et l'export n'en héritent pas. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .ds-paper { filter: brightness(0.9); }
}
@media screen {
  [data-theme='dark'] .ds-paper { filter: brightness(0.9); }
}

/* ═══ Téléphone ═══════════════════════════════════════════════════════════
   Cibles de 44 px au doigt (Apple 44 pt, WCAG 2.5.8), champs en 16 px (sous
   16 px, iOS zoome sur le champ au toucher). */
@media (max-width: 720px) {
  .ds-navbar .ds-tabs { display: none; }
  .ds-navbar__inner { gap: var(--ds-space-3); }
}
@media (max-width: 640px) {
  .ds-btn--sm { height: var(--ds-size-target); }
  .ds-btn--icon { width: var(--ds-size-target); height: var(--ds-size-target); }
  .ds-segment > button, .ds-segment--lg > button { min-height: var(--ds-size-target-sm); }
  .ds-input, .ds-select, .ds-textarea { font-size: var(--ds-font-size-md); }
  .ds-card--pad-lg { padding: 22px; }
  .ds-row { padding: 14px; }
  /* Une description coupée à « Score de compat… » ne dit plus rien. */
  .ds-row__meta { white-space: normal; }
  .ds-band { padding: var(--ds-space-10) 26px; }
  .ds-dialog-wrap { align-items: flex-end; padding: 0; }
  .ds-dialog { max-width: none; border-radius: var(--ds-radius-xl) var(--ds-radius-xl) 0 0; padding-bottom: calc(var(--ds-space-6) + env(safe-area-inset-bottom, 0px)); }
}
