/*
 * Styles de base et composants partagés, d'après le design system « Ready Player Web Projets »
 * (direction contrastée) : page sur fond gris (canvas), contenus dans des panneaux blancs
 * détachés, kanban sur une bande marine.
 * Toutes les valeurs de couleur, de taille, de rayon et d'ombre viennent de variables.css.
 */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font: var(--text-body);
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    margin: 0 0 var(--space-4);
}

h1 {
    font: var(--text-title-1);
    color: var(--navy);
}

h2 {
    font: var(--text-title-2);
}

h3 {
    font: var(--text-title-3);
}

p {
    margin: 0 0 var(--space-4);
}

a {
    color: var(--navy);
    text-decoration: none;
}

a:hover {
    color: var(--navy-hover);
    text-decoration: underline;
    text-underline-offset: var(--underline-offset);
}

/* Texte courant : les liens restent repérables sans la couleur. */
p a:not([class]),
dd a:not([class]),
li a:not([class]) {
    text-decoration: underline;
    text-underline-offset: var(--underline-offset);
}

code,
kbd,
samp,
pre {
    font-family: var(--font-mono);
}

code {
    font: var(--text-mono);
}

hr {
    height: 0;
    margin: var(--space-6) 0;
    border: 0;
    border-top: var(--line-width) solid var(--line);
}

/* Focus clavier : 2 px plein, décalé de 2 px, marine sur tous les fonds clairs. */
:focus-visible {
    outline: var(--focus-width) solid var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-radius: var(--radius-sm);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Lien d'évitement : visible au focus clavier */
.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-4);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    min-height: var(--control-size);
    padding: 0 var(--space-4);
    background: var(--navy);
    color: var(--on-navy);
    border-radius: var(--radius-md);
    font: var(--text-button);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
    color: var(--on-navy);
}

.text-muted {
    color: var(--ink-muted);
}

/* Mise en page */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--space-5);
}

/*
 * En-tête commun (SiteHeader) : 52 px, blanc (surface) sur le fond gris de la page, trait fin en bas. Les onglets occupent toute
 * la hauteur : le soulignement de l'onglet actif se pose sur le trait de l'en-tête.
 */
.site-header {
    background: var(--surface);
    border-bottom: var(--line-width) solid var(--line);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0 var(--space-6);
    min-height: var(--header-height);
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    color: var(--navy);
    font: var(--text-title-3);
}

.site-header__brand:hover {
    color: var(--navy-hover);
}

.site-header__user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-5);
    margin-left: auto;
}

.site-header__name {
    color: var(--ink-muted);
}

.site-header__user form {
    margin: 0;
}

.site-main {
    padding-top: var(--space-5);
    padding-bottom: var(--space-7);
}

/*
 * Bande pleine largeur (kanban de la fiche projet), posée par le bloc « band » du gabarit de base
 * hors du conteneur : elle prend toute la largeur de la page sans 100vw. Fond marine (board) ;
 * son contenu est dans un conteneur intérieur, qui lui donne les marges de page (space-8 à partir
 * de 1024 px, space-5 en dessous), et l'anneau de focus passe en blanc (11,9:1 sur board).
 */
.band {
    padding-block: var(--space-5) var(--space-7);
    background: var(--board);
    color: var(--on-board);
}

.band :focus-visible {
    outline-color: var(--on-board);
}

/* Au-dessus de la bande, seule la marge basse de l'en-tête de page (space-6) la sépare du titre. */
.site-main:has(+ .band) {
    padding-bottom: 0;
}

.site-main--after-band {
    padding-top: var(--space-7);
}

.flash-region:empty {
    display: none;
}

.flash-region {
    margin-bottom: var(--space-4);
}

/*
 * Écrans d'accès (connexion, double authentification, enrôlement) : panneau blanc (panel) centré
 * sur le fond gris, à toutes les largeurs ; sa largeur de contenu est narrow-max, la marge
 * intérieure s'y ajoute et le panneau rétrécit sur un petit écran. Pas de bande marine.
 * Pas de navigation, donc pas de point d'orange.
 */
.auth {
    display: flex;
    justify-content: center;
    padding: var(--space-7) var(--space-5);
}

.auth__card {
    flex: 0 1 var(--narrow-max);
    min-width: 0;
    box-sizing: content-box;
}

.auth__card h1 {
    margin-bottom: var(--space-2);
}

.auth__intro {
    margin-bottom: var(--space-6);
    color: var(--ink-muted);
}

.auth__brand {
    margin-bottom: var(--space-6);
    color: var(--navy);
    font: var(--text-title-3);
}

.auth__card .form-field {
    margin-bottom: var(--space-5);
}

.auth__secondary {
    margin-top: var(--space-4);
}

.auth__help {
    margin: var(--space-6) 0 0;
    color: var(--ink-muted);
    font: var(--text-small);
}

@media (min-width: 641px) {
    .auth {
        padding-top: var(--space-8);
    }

    /* Plus spécifique que .panel : un panneau seul à l'écran respire davantage. */
    .auth .auth__card {
        padding: var(--space-7);
    }
}

/*
 * Étapes numérotées (enrôlement) : numéro en marine dans sa colonne, contenu aligné à côté.
 * Les numéros restent ceux de la liste ordonnée pour les lecteurs d'écran.
 */
.steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps__item {
    display: grid;
    grid-template-columns: var(--space-6) minmax(0, 1fr);
    column-gap: var(--space-2);
    margin-bottom: var(--space-6);
    counter-increment: step;
}

.steps__item::before {
    content: counter(step) ".";
    color: var(--navy);
    font: var(--text-title-3);
}

.steps__item > * {
    grid-column: 2;
}

.steps__title {
    grid-row: 1;
    margin-bottom: var(--space-1);
    font: var(--text-title-3);
}

.steps__item > p {
    margin-bottom: var(--space-4);
}

.steps__item > :last-child {
    margin-bottom: 0;
}

.qr-code {
    display: block;
    width: 100%;
    max-width: var(--qr-code-max);
    height: auto;
    margin-bottom: var(--space-4);
    border: var(--line-width) solid var(--line);
    border-radius: var(--radius-md);
}

/* Clé secrète lisible et facile à recopier : Space Mono, groupes de 4 caractères, retour à la ligne permis */
.secret-key {
    display: block;
    padding: var(--space-3) var(--space-4);
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    color: var(--ink);
    font: var(--text-body);
    font-family: var(--font-mono);
    letter-spacing: var(--tracking-code);
    overflow-wrap: anywhere;
    user-select: all;
}

/* Composant Button : 32 px (28 px en --sm) sur ordinateur, 44 px sur mobile et écran tactile */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-height: var(--control-size);
    padding: 0 var(--space-4);
    border: var(--line-width) solid transparent;
    border-radius: var(--radius-md);
    font: var(--text-button);
    text-align: center;
    text-decoration: none;
    /* Un libellé passe à la ligne entre deux mots, jamais au milieu d'un mot. */
    overflow-wrap: normal;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.button:hover {
    text-decoration: none;
}

.button--sm {
    min-height: var(--control-size-sm);
    padding: 0 var(--space-3);
}

.button--primary {
    background: var(--navy);
    color: var(--on-navy);
}

.button--primary:hover {
    background: var(--navy-hover);
    color: var(--on-navy);
}

.button--secondary {
    background: var(--surface);
    color: var(--navy);
    border-color: var(--line-strong);
}

.button--secondary:hover {
    background: var(--surface-hover);
    color: var(--navy);
}

.button--ghost {
    background: transparent;
    color: var(--navy);
}

.button--ghost:hover {
    background: var(--surface-hover);
    color: var(--navy);
}

.button--danger {
    background: var(--danger);
    color: var(--on-danger);
}

.button--danger:hover {
    background: var(--danger-hover);
    color: var(--on-danger);
}

.button--block {
    display: flex;
    width: 100%;
}

/* Pendant l'envoi d'un formulaire (Turbo désactive le bouton et marque le formulaire occupé) */
.button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

[aria-busy="true"] .button,
.button[aria-busy="true"] {
    cursor: progress;
}

.button[aria-busy="true"]::after {
    content: "";
    width: var(--spinner-size);
    height: var(--spinner-size);
    border: var(--indicator-width) solid currentColor;
    border-right-color: transparent;
    border-radius: var(--radius-full);
    animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Composants FormField, SelectField, TextareaField */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: var(--form-max);
    margin-bottom: var(--space-5);
}

/* Valeur non modifiable présentée comme un champ (rôle d'un contact) : libellé et texte sans marge de paragraphe. */
.form-field > p {
    margin: 0;
}

.form-field__label {
    font: var(--text-label);
    font-weight: var(--font-weight-semibold);
    color: var(--ink);
}

.form-field__input {
    /* Une liste déroulante aux options longues ne dépasse pas de son conteneur. */
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: var(--control-size);
    padding: var(--space-1) var(--space-3);
    border: var(--line-width) solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink);
    font: var(--text-body);
}

.form-field__input:focus-visible {
    outline-offset: var(--focus-offset-inset);
    border-color: var(--navy);
}

/* Erreur : bordure de 2 px sans décaler le contenu. */
.form-field__input[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: inset 0 0 0 var(--line-width) var(--danger);
}

/* Valeur technique à recopier (référence d'un projet) : Space Mono, à la taille du texte du champ. */
.form-field__input--mono {
    font-family: var(--font-mono);
}

.form-field__select {
    appearance: auto;
}

.form-field__textarea {
    min-height: var(--textarea-min-height);
    padding-block: var(--space-2);
    resize: vertical;
}

.form-field__help {
    margin: 0;
    color: var(--ink-muted);
    font: var(--text-caption);
}

.form-field__error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
    margin: 0;
    color: var(--danger);
    font: var(--text-caption);
    font-weight: var(--font-weight-semibold);
}

/* La croix se centre sur la première ligne du message. */
.form-field__error .state-shape {
    flex: none;
    width: var(--shape-size-sm);
    height: var(--shape-size-sm);
    margin-top: calc((1lh - var(--shape-size-sm)) / 2);
}

/* Composant ChoiceField (boutons radio) */
.choice-field {
    min-width: 0;
    max-width: var(--form-max);
    margin: 0 0 var(--space-5);
    padding: 0;
    border: 0;
}

.choice-field legend {
    margin-bottom: var(--space-1);
    padding: 0;
}

.choice-field__option {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: var(--space-2);
    min-height: var(--choice-size);
}

.choice-field__input {
    width: var(--choice-input-size);
    height: var(--choice-input-size);
    margin: 0;
    accent-color: var(--navy);
}

/*
 * Le libellé, cliquable, couvre toute la hauteur d'une option (28 px, 44 px au doigt) ; ses marges
 * négatives lui gardent la place d'une ligne de texte pour ne pas écarter l'aide de l'option.
 */
.choice-field__label {
    display: flex;
    align-items: center;
    min-height: var(--choice-size);
    margin-block: calc((1lh - var(--choice-size)) / 2);
    cursor: pointer;
}

.choice-field__help {
    grid-column: 2;
    margin-bottom: var(--space-1);
}

/* Composant ErrorSummary : fond pâle sans cadre, liens soulignés */
.error-summary {
    max-width: var(--form-max);
    margin-bottom: var(--space-5);
    padding: var(--space-4) var(--space-5);
    background: var(--danger-soft);
    border-radius: var(--radius-md);
}

.error-summary:focus {
    outline: var(--focus-width) solid var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.error-summary__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-1);
    color: var(--danger);
    font: var(--text-title-3);
}

.error-summary__title .state-shape {
    flex: none;
}

.error-summary__list {
    margin: 0;
    padding-left: var(--space-6);
    font: var(--text-small);
}

.error-summary__list a {
    display: inline-flex;
    align-items: center;
    min-height: var(--target-min);
    color: var(--danger);
    text-decoration: underline;
}

/* Composant Flash : fond pâle, forme et type écrit en tête */
.flash {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font: var(--text-small);
}

.flash .state-shape {
    flex: none;
}

.flash__label {
    font-weight: var(--font-weight-semibold);
}

.flash__message {
    color: var(--ink);
}

.flash--success {
    background: var(--success-soft);
    color: var(--success);
}

.flash--error {
    background: var(--danger-soft);
    color: var(--danger);
}

.flash--info {
    background: var(--neutral-soft);
    color: var(--ink);
}

/* Message collé en haut d'une zone (messages du kanban) : seul cas d'ombre d'un Flash. */
.flash--floating {
    box-shadow: var(--shadow-float);
}

/*
 * Navigation principale : liens en ink-muted 14/500 ; onglet actif en marine 14/600, souligné de
 * 2 px d'orange (seul orange de l'écran). La graisse et la couleur du texte portent l'information,
 * l'orange ne fait que souligner.
 */
.site-nav {
    display: flex;
    flex-grow: 1;
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__list > li {
    display: flex;
}

.site-nav__link {
    display: flex;
    align-items: center;
    min-height: var(--header-height);
    padding: 0 var(--space-1);
    border-bottom: var(--indicator-width) solid transparent;
    color: var(--ink-muted);
    font: var(--text-body);
    font-weight: var(--font-weight-medium);
}

.site-nav__link:hover {
    color: var(--navy);
    text-decoration: none;
}

.site-nav__link[aria-current="page"] {
    color: var(--navy);
    font-weight: var(--font-weight-semibold);
    border-bottom-color: var(--orange);
}

/*
 * En-tête de page (PageHeader) : posé directement sur le fond gris, au-dessus des panneaux ;
 * titre en navy, métadonnées en ink-muted (5:1 sur canvas), actions toujours visibles.
 */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin: var(--space-3) 0 var(--space-6);
}

.page-header h1 {
    margin: 0;
}

/* Introduction : ce que la page permet, en une phrase. */
.page-header__intro {
    max-width: var(--measure-max);
    margin: var(--space-2) 0 0;
    color: var(--ink-muted);
}

/* Métadonnées sous le titre (organisation, référence…), séparées par « · » masqué aux lecteurs d'écran. */
.page-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    margin: var(--space-2) 0 0;
    color: var(--ink-muted);
    font: var(--text-small);
}

/* Étiquette neutre posée sur le fond gris (état d'un projet, contact principal) : fond blanc, pour rester visible. */
.page-header .badge--neutral {
    background: var(--surface);
}

.narrow {
    max-width: var(--form-max);
}

/* État vide : une phrase sobre et, pour l'équipe, l'action qui le remplit ; du blanc, pas de cadre */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-6) 0;
    color: var(--ink-muted);
}

.empty-state p {
    max-width: var(--form-max);
    margin: 0;
}

/*
 * En-tête de section affirmé : titre title-2 en ink, compteur en pastille (CountPill) à côté,
 * actions de la section à droite. Posé sur le fond gris au-dessus d'un panneau, ou en tête de panneau.
 */
.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}

.section-header h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    color: var(--ink);
}

/* Lien de retour vers la page parente */
.back-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-size-sm);
    font: var(--text-small);
}

/*
 * Panneau : bloc blanc détaché du fond gris par l'ombre de carte, sans cadre. Tout contenu s'y
 * range (liste, tableau, formulaire, fiche). --flush pour un tableau qui va jusqu'aux bords.
 */
.panel {
    padding: var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* Panneaux successifs : un panneau posé sous un en-tête de section ne reçoit pas cette marge. */
.panel + .panel {
    margin-top: var(--space-6);
}

.panel > :last-child {
    margin-bottom: 0;
}

.panel--flush {
    padding: 0;
    overflow: hidden;
}

.panel__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-4);
    color: var(--ink);
    font: var(--text-title-2);
}

/* Compteur en pastille (CountPill) : nombre en gras, libellé complet pour les lecteurs d'écran. */
.count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--count-pill-min-width);
    height: var(--count-pill-height);
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    background: var(--neutral-soft);
    color: var(--ink);
    font: var(--text-caption);
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
}

/*
 * Pastille d'initiales (Avatar), toujours suivie du nom écrit : même teinte pour tout le monde,
 * initiales navy (9,5:1 sur avatar). « Non assignée » : pastille vide à contour en pointillés
 * (line-strong, 3,6:1 sur surface), texte ink-muted.
 */
.avatar {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    color: var(--ink);
    font: var(--text-caption);
}

.avatar__initials {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: var(--radius-full);
    background: var(--avatar);
    color: var(--navy);
    font: var(--text-initials);
    letter-spacing: var(--tracking-initials);
}

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

.avatar--none {
    color: var(--ink-muted);
}

.avatar--none .avatar__initials {
    width: var(--avatar-size-empty);
    height: var(--avatar-size-empty);
    background: transparent;
    border: var(--dash-width) dashed var(--line-strong);
}

.panel form {
    margin: 0;
}

/* Formulaires */
.form__hint {
    margin: 0 0 var(--space-5);
    color: var(--ink-muted);
    font: var(--text-small);
}

/* Actions d'un formulaire, en bas après un trait. */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: var(--line-width) solid var(--line);
}

.form-actions__link {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-size);
}

/* Composant Badge : étiquette discrète, toujours avec un mot, doublé d'une forme */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-tag) var(--space-2);
    border-radius: var(--radius-sm);
    font: var(--text-caption);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    /* Même alignement avec ou sans forme en tête (la forme décalerait la ligne de base). */
    vertical-align: middle;
}

.badge .state-shape {
    flex: none;
    width: var(--shape-size-sm);
    height: var(--shape-size-sm);
}

.badge--neutral {
    background: var(--neutral-soft);
    color: var(--neutral);
}

.badge--success {
    background: var(--success-soft);
    color: var(--success);
}

.badge--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

/* Erreur en aplat foncé : se distingue des autres états par la clarté, pas par la teinte. */
.badge--danger {
    background: var(--danger);
    color: var(--on-danger);
}

/* Statut de tâche : forme dessinée et libellé, sans fond */
.task-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--ink);
    font: var(--text-label);
    white-space: nowrap;
}

.status-shape {
    flex: none;
    width: var(--shape-size);
    height: var(--shape-size);
}

.status-shape--todo {
    color: var(--status-todo);
}

.status-shape--active {
    color: var(--status-active);
}

.status-shape__check {
    stroke: var(--surface);
}

/*
 * Priorité : écrite en toutes lettres avec sa forme. Haute en étiquette ambre (6,1:1) avec son
 * triangle ; normale et basse en texte ink-muted (basse avec son chevron).
 */
.task-priority {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--ink-muted);
    font: var(--text-caption);
    white-space: nowrap;
}

.task-priority--high {
    padding: var(--space-tag) var(--space-priority-inline);
    border-radius: var(--radius-sm);
    background: var(--warning-soft);
    color: var(--priority-high);
    font-weight: var(--font-weight-semibold);
}

.priority-shape {
    flex: none;
    width: var(--shape-size-xs);
    height: var(--shape-size-xs);
}

/* Actions groupées de l'en-tête de page (ex. Modifier, Archiver) */
.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.page-header__actions form {
    margin: 0;
}

/* Filtre d'une liste, à droite de l'en-tête de section (ex. afficher les projets archivés). */
.list-filter {
    margin: 0;
    font: var(--text-small);
}

.list-filter a {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-size);
}

/*
 * Liste des projets, dans un panneau blanc sans marge intérieure (panel--flush) : lignes aérées
 * séparées par un trait. Le nom du projet est le lien ; il couvre toute la ligne (cible large au
 * doigt), sans autre élément interactif. L'équipe voit l'organisation et la référence à droite
 * (dessous sur mobile) ; « Archivé » en étiquette neutre.
 */
.project-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-card {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1) var(--space-4);
    min-width: 0;
    padding: var(--space-3) var(--space-5);
    border-bottom: var(--line-width) solid var(--line);
}

.project-card:last-child {
    border-bottom: 0;
}

.project-card:hover {
    background: var(--surface-hover);
}

.project-card__title {
    min-width: 0;
    margin: 0;
    font: var(--text-title-3);
    overflow-wrap: anywhere;
}

.project-card__link {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-size);
}

.project-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.project-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-4);
    margin: 0;
    color: var(--ink-muted);
    font: var(--text-small);
    overflow-wrap: anywhere;
}

.project-card--archived .project-card__link {
    color: var(--ink-muted);
}

/* Propriétés d'un projet sur la ligne de métadonnées : « Atelier Lumière · Référence site-vitrine · Actif » */
.project-properties {
    margin-bottom: 0;
}

.project-properties__item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    min-width: 0;
}

.project-properties__item + .project-properties__item::before {
    content: "·";
    content: "·" / "";
    margin-right: var(--space-1);
}

.project-properties dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Sur mobile, la ligne revient à la ligne : pas de « · » en début de ligne, un blanc plus large suffit. */
@media (max-width: 640px) {
    .project-properties {
        column-gap: var(--space-4);
    }

    .project-properties__item + .project-properties__item::before {
        content: none;
    }
}

/* Lecture côté client : texte courant en 15/22 (jamais plus grand), mêmes composants. */
.client-view {
    font: var(--text-body-client);
}

/*
 * Tableau de données (DataTable), dans un panneau sans marge intérieure (panel--flush) : lignes
 * aérées séparées par un trait ; cartes empilées sur mobile (paires libellé / valeur), tableau à
 * partir de 768 px avec les en-têtes sur un bandeau surface-sunken. Une personne s'affiche avec
 * sa pastille d'initiales (Avatar), un état avec son étiquette (Badge : forme + mot).
 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table tr {
    display: block;
    padding: var(--space-3) var(--space-5);
    border-bottom: var(--line-width) solid var(--line);
}

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

.data-table th,
.data-table td {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    padding: var(--space-1) 0;
    text-align: left;
    font-weight: var(--font-weight-regular);
    /* Une adresse email longue passe à la ligne au lieu d'élargir la page. */
    overflow-wrap: anywhere;
}

.data-table__primary a {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-size);
    font-weight: var(--font-weight-semibold);
}

/* Personne d'une ligne : pastille et nom à la taille du texte du tableau. */
.data-table .avatar {
    font: inherit;
}

.data-table__primary .avatar {
    font-weight: var(--font-weight-medium);
}

.data-table caption {
    text-align: left;
}

/*
 * Sur mobile, libellé dans une colonne fixe et valeur à côté : une valeur longue (adresse email)
 * passe à la ligne dans sa colonne au lieu de glisser sous son libellé.
 */
.data-table td {
    flex-wrap: nowrap;
    align-items: baseline;
}

.data-table__label {
    flex: none;
    width: var(--table-label-width);
    color: var(--ink-muted);
    font: var(--text-caption);
}

.data-table__actions {
    padding-top: var(--space-2);
}

/* Bouton discret de ligne : son libellé s'aligne sur le texte des autres valeurs. */
.data-table__actions .button--ghost {
    margin-left: calc(-1 * var(--space-3));
}

.data-table__row--muted .data-table__primary,
.data-table__row--muted .data-table__primary a,
.data-table__row--muted .data-table__primary .avatar {
    color: var(--ink-muted);
}

.data-table__actions form {
    margin: 0;
}

/*
 * Section d'une page sous l'en-tête (projets actifs, collaborateurs affectés d'un projet) : titre
 * de section posé sur le fond gris, contenu dans ses panneaux.
 */
.page-section {
    margin-top: var(--space-7);
}

/* Juste sous l'en-tête de page ou en tête de la zone sous la bande : la marge de ce qui précède suffit. */
.page-header + .page-section,
.site-main--after-band > .page-section:first-child {
    margin-top: 0;
}

.page-section__intro {
    max-width: var(--measure-max);
    color: var(--ink-muted);
}

/*
 * Kanban d'un projet, sur la bande marine : listes arrondies grises (list, radius-xl, shadow-list),
 * cartes blanches détachées (surface, radius-lg, shadow-card). Listes empilées sur mobile (ou en
 * onglets avec JavaScript, sous 768 px), deux à partir de 768 px, quatre à partir de 1024 px ;
 * jamais de défilement horizontal de la page.
 * Focus : anneau blanc sur le marine (règle de .band), navy dans les listes et le menu.
 */
.kanban {
    position: relative;
}

.kanban__column :focus-visible,
.kanban__menu :focus-visible {
    outline-color: var(--focus-ring);
}

/* Titre « Tâches · 4 » en blanc (11,9:1 sur board), total et aide en on-board-muted (8:1). */
.kanban__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-4);
}

.kanban__header h2 {
    margin: 0;
    color: var(--on-board);
    font: var(--text-board-title);
}

.kanban__total,
.kanban__help {
    color: var(--on-board-muted);
    font-weight: var(--font-weight-regular);
    font-variant-numeric: tabular-nums;
}

.kanban__help {
    margin: 0;
    font: var(--text-caption);
}

/* Messages du glisser-déposer et du menu : restent visibles pendant le défilement du kanban. */
.kanban__feedback {
    position: sticky;
    top: var(--space-2);
    z-index: 4;
}

/* Régions annoncées : toujours rendues (jamais display: none), sans hauteur quand elles sont vides. */
.kanban__message .flash {
    margin-bottom: var(--space-2);
}

.kanban__close[hidden] {
    display: none;
}

.kanban__close {
    display: block;
    min-height: var(--control-size-sm);
    margin: 0 0 var(--space-4) auto;
    padding: 0 var(--space-3);
    border: var(--line-width) solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--navy);
    font: var(--text-button);
    cursor: pointer;
}

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

.kanban__columns {
    display: grid;
    gap: var(--space-4);
    align-items: start;
}

.kanban__column {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    padding: var(--space-2) var(--space-2) var(--space-3);
    border-radius: var(--radius-xl);
    background: var(--list);
    box-shadow: var(--shadow-list);
}

/* « En cours » : bandeau list-active, texte navy (9,5:1), compteur navy plein. */
.kanban__column--active .kanban__title {
    background: var(--list-active);
    color: var(--navy);
}

.kanban__column--active .kanban__title .task-status {
    color: var(--navy);
}

.kanban__column--active .kanban__count {
    background: var(--navy);
    color: var(--on-navy);
}

/* « Terminé » : liste un cran plus foncée, titre ink-done (5,4:1 sur list-done). */
.kanban__column--done {
    background: var(--list-done);
}

.kanban__column--done .kanban__title,
.kanban__column--done .kanban__title .task-status {
    color: var(--ink-done);
}

/* Liste survolée pendant le glisser-déposer : contour blanc en pointillés, visible sur le marine. */
.kanban__column--over {
    outline: var(--focus-width) dashed var(--on-board);
    outline-offset: var(--focus-offset);
}

.kanban__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    color: var(--ink);
    font: var(--text-column-title);
}

.kanban__title .task-status {
    font: var(--text-column-title);
}

.kanban__counter {
    display: inline-flex;
    margin-left: auto;
}

/* Compteur d'une liste : pastille blanche (ink gras 12,3:1). */
.kanban__count {
    background: var(--count-pill);
}

.kanban__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Zone de dépôt d'une liste vide, pour le glisser-déposer. */
.kanban__list[data-kanban-target] {
    min-height: var(--control-height-sm);
}

.kanban__empty {
    margin: 0;
    padding: var(--space-2);
    color: var(--ink-muted);
    font: var(--text-caption);
}

/* « + Ajouter une tâche » en bas d'« À faire » : lien discret, pleine largeur de la liste. */
.kanban__add {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-size);
    padding: 0 var(--space-2);
    border-radius: var(--radius-md);
    color: var(--ink);
    font: var(--text-button);
}

.kanban__add:hover {
    background: var(--list-hover);
    color: var(--ink);
    text-decoration: none;
}

.plus-shape {
    flex: none;
    width: var(--shape-size-sm);
    height: var(--shape-size-sm);
}

.task-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* Priorité haute : filet gauche ambre de 3 px (seule bordure gauche colorée admise). */
.task-card--priority-high {
    border-left: var(--priority-rule-width) solid var(--priority-high);
    padding-left: calc(var(--space-4) - var(--priority-rule-width));
}

/* Tâche terminée : fond surface-hover, titre ink-done barré (6,1:1). */
.task-card--done {
    background: var(--surface-hover);
}

.task-card--done .task-card__title {
    color: var(--ink-done);
    font-weight: var(--font-weight-medium);
    text-decoration: line-through;
    text-decoration-color: var(--line-strong);
}

.task-card[aria-busy="true"] {
    opacity: 0.7;
    cursor: progress;
}

/* Emplacement de la carte pendant le glisser-déposer. */
.task-card--ghost {
    background: var(--navy-soft);
    box-shadow: none;
    outline: var(--focus-width) dashed var(--navy);
    outline-offset: calc(-1 * var(--focus-width));
}

/* Carte prise et glissée : elle flotte. */
.task-card--chosen {
    box-shadow: var(--shadow-float);
}

.task-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
}

.task-card__title {
    display: inline-flex;
    align-items: center;
    min-height: var(--target-min);
    color: var(--navy);
    font: var(--text-card-title);
    overflow-wrap: anywhere;
}

/*
 * Poignée de glisser-déposer (équipe seulement) : six points, 24 px sur ordinateur, 44 px au doigt.
 * Le rembourrage centre la zone des points dans la cible, quelle que soit sa taille.
 */
.task-card__handle {
    --handle-size: var(--target-min);
    flex: none;
    width: var(--handle-size);
    height: var(--handle-size);
    padding: calc((var(--handle-size) - var(--handle-dots-height)) / 2) calc((var(--handle-size) - var(--handle-dots-width)) / 2);
    border-radius: var(--radius-sm);
    color: var(--line-strong);
    background-image: radial-gradient(circle, currentColor var(--handle-dot-radius), transparent var(--handle-dot-fade));
    background-size: var(--handle-dot-step) var(--handle-dot-step);
    background-origin: content-box;
    background-clip: content-box;
    cursor: grab;
    touch-action: none;
}

.task-card__handle:hover {
    background-color: var(--list);
}

.task-card__handle:active {
    cursor: grabbing;
}

/* Priorité (haute ou basse ; la normale n'est pas écrite sur la carte), sur sa propre ligne. */
.task-card > .task-priority {
    align-self: flex-start;
}

/* Personne assignée (pastille + nom) et « Déplacer… » sur une ligne. */
.task-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-width: 0;
}

.task-card__assignee {
    display: flex;
    min-width: 0;
    margin: 0;
}

/*
 * Menu « Déplacer… » : bouton discret toujours visible (details natif, sans JavaScript), qui
 * ouvre la liste des colonnes, flottante (shadow-float). La colonne actuelle est désactivée.
 */
.kanban__menu {
    position: relative;
    flex: none;
}

.kanban__menu[open] {
    z-index: 3;
}

.kanban__menu > summary {
    list-style: none;
}

.kanban__menu > summary::-webkit-details-marker {
    display: none;
}

.kanban__menu-toggle {
    display: inline-flex;
    align-items: center;
    min-height: var(--target-min);
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--navy);
    font: var(--text-caption);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.kanban__menu-toggle:hover,
.kanban__menu[open] > .kanban__menu-toggle {
    background: var(--list);
}

.kanban__menu-list {
    position: absolute;
    top: calc(100% + var(--space-1));
    right: 0;
    width: var(--menu-width);
    margin: 0;
    padding: var(--space-1);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-float);
}

.kanban__menu-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.kanban__menu-caption {
    margin: var(--space-1) var(--space-2) var(--space-2);
    padding: 0;
    color: var(--ink-muted);
    font: var(--text-tag);
    font-weight: var(--font-weight-semibold);
}

.kanban__menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: var(--menu-item-height);
    padding: 0 var(--space-2);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink);
    font: var(--text-small);
    text-align: left;
    cursor: pointer;
}

.kanban__menu-item:hover:not(:disabled) {
    background: var(--list);
}

/* Colonne actuelle : désactivée, en ink-muted (5,5:1), signalée par « (actuel) ». */
.kanban__menu-item:disabled {
    color: var(--ink-muted);
    cursor: default;
}

.kanban__menu-item .status-shape {
    flex: none;
    width: var(--shape-size);
    height: var(--shape-size);
}

.kanban__menu-current[hidden] {
    display: none;
}

/* Onglets de colonnes : masqués sans JavaScript et à partir de 768 px (voir la requête plus bas). */
.kanban__tabs {
    display: none;
}

/* position: relative : le libellé masqué du nombre reste dans la rangée qui défile (pas de débordement de la page). */
.kanban__tab {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--touch-target);
    padding: 0 var(--space-4);
    border: 0;
    border-bottom: var(--indicator-width) solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: transparent;
    color: var(--on-board-muted);
    font: var(--text-title-3);
    white-space: nowrap;
    scroll-snap-align: start;
    cursor: pointer;
}

.kanban__tab:hover {
    color: var(--on-board);
}

/* Onglet actif : fond clair et texte navy (la clarté), trait navy dessous ; jamais d'orange. */
.kanban__tab[aria-selected="true"] {
    background: var(--list);
    color: var(--navy);
    border-bottom-color: var(--navy);
}

.kanban__tab .status-shape {
    flex: none;
    width: var(--shape-size);
    height: var(--shape-size);
    color: currentColor;
}

.kanban__tab-count {
    background: var(--count-pill);
}

/*
 * Fiche tâche : panneaux empilés, statut et détails en tête ; à partir de 1024 px, deux colonnes
 * (description et historique à gauche, statut et détails à droite, en premier dans le document).
 */
.task-layout {
    display: grid;
    gap: var(--space-6);
}

.task-layout__aside,
.task-layout__main {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    min-width: 0;
}

/* Les panneaux d'une colonne sont espacés par la grille, pas par leur marge. */
.task-layout .panel {
    margin-top: 0;
}

.task-status-current {
    margin: 0;
}

.status-change {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: var(--line-width) solid var(--line);
}

/* Formulaire de statut de la fiche tâche : liste et bouton alignés, empilés quand la place manque. */
.status-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3);
}

.status-form .form-field {
    flex: 1 1 var(--status-select-min);
    max-width: var(--status-select-max);
    margin-bottom: 0;
}

/* Propriétés de la fiche tâche : libellé au-dessus de la valeur, séparées par un trait. */
.details {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.details__item {
    min-width: 0;
    padding: var(--space-3) 0;
    border-bottom: var(--line-width) solid var(--line);
}

.details__item:first-child {
    padding-top: 0;
}

.details__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.details dt {
    margin-bottom: var(--space-1);
    color: var(--ink-muted);
    font: var(--text-caption);
}

.details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Personne assignée : nom à la taille du texte courant, pas en méta. */
.details .avatar {
    font: inherit;
}

/* Tokens API : consigne en gras avant le secret, résumé du token avant les actions. */
.api-token-warning {
    font-weight: var(--font-weight-semibold);
}

.api-token-details {
    margin-bottom: var(--space-5);
}

/*
 * Secret d'un token, montré une fois : Space Mono, en lecture seule, passe à la ligne n'importe
 * où (jamais de défilement horizontal) ; hauteur de trois lignes, sans poignée de redimensionnement.
 */
.api-token-secret {
    min-height: 0;
    padding-block: var(--space-2);
    font-family: var(--font-mono);
    overflow-wrap: anywhere;
    word-break: break-all;
    resize: none;
}

/*
 * Historique des statuts d'une tâche, du plus récent au plus ancien : pastille d'initiales à
 * gauche, changement et méta à côté ; lignes séparées par un trait.
 */
.status-history {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.status-history__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: var(--space-3);
    padding: var(--space-4) 0;
    border-bottom: var(--line-width) solid var(--line);
}

.status-history__item:first-child {
    padding-top: 0;
}

.status-history__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.status-history__change,
.status-history__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    margin: 0;
}

.status-history__arrow {
    color: var(--ink-muted);
}

.status-history__meta {
    margin-top: var(--space-1);
    color: var(--ink-muted);
    font: var(--text-caption);
    overflow-wrap: anywhere;
}

/*
 * Fil de commentaires d'une tâche, du plus ancien au plus récent : pastille d'initiales à gauche,
 * méta (auteur, date, étiquettes) puis contenu Markdown ; lignes séparées par un trait. Le
 * contenu ne déborde jamais du panneau (longue URL coupée, bloc de code défilant dans son cadre).
 */
.comment-thread {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment-thread__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: var(--space-3);
    padding: var(--space-4) 0;
    border-bottom: var(--line-width) solid var(--line);
}

.comment-thread__item:first-child {
    padding-top: 0;
}

.comment-thread__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.comment-thread__content {
    min-width: 0;
}

.comment-thread__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    margin: 0 0 var(--space-2);
    color: var(--ink-muted);
    font: var(--text-caption);
    overflow-wrap: anywhere;
}

.comment-thread__author {
    color: var(--ink);
    font-weight: var(--font-weight-semibold);
}

/*
 * Formulaire de commentaire de l'équipe, sous le fil dans le même panneau, séparé par un trait :
 * messages annoncés, zone de texte, case « Interne », bouton « Commenter ».
 */
.comment-compose {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: var(--line-width) solid var(--line);
}

.comment-form__internal {
    margin-bottom: var(--space-4);
}

.comment-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* Étiquettes libres d'une tâche, posées sur un panneau blanc ou une carte (list : 1,2:1 sur surface, texte ink-done 6,1:1). */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.tag {
    padding: var(--space-tag-sm) var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--list);
    color: var(--ink-done);
    font: var(--text-tag);
    overflow-wrap: anywhere;
}

/* Contenu Markdown rendu (description d'une tâche) */
.markdown {
    overflow-wrap: anywhere;
}

.markdown > :last-child {
    margin-bottom: 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
    color: var(--ink);
    font: var(--text-title-3);
}

.markdown ul,
.markdown ol {
    margin: 0 0 var(--space-4);
    padding-left: var(--space-6);
}

.markdown pre {
    max-width: 100%;
    overflow-x: auto;
    padding: var(--space-3) var(--space-4);
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
}

.markdown img {
    max-width: 100%;
    height: auto;
}

.markdown blockquote {
    margin: 0 0 var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    color: var(--ink-muted);
}

.markdown table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.markdown th,
.markdown td {
    padding: var(--space-1) var(--space-3);
    border-bottom: var(--line-width) solid var(--line);
    text-align: left;
}

/*
 * En-tête sous 1024 px : la marque et « Se déconnecter » sur la première ligne, la navigation
 * dessous, sur une ligne qui revient à la ligne si besoin (jamais de défilement de la page).
 * Onglets de 44 px au doigt (--control-size).
 */
@media (max-width: 1023px) {
    .site-header__inner {
        gap: 0 var(--space-4);
    }

    .site-header__brand {
        min-height: var(--header-height);
    }

    .site-nav {
        flex-basis: 100%;
        order: 3;
    }

    .site-nav__link {
        min-height: var(--control-size);
    }
}

@media (max-width: 640px) {
    .site-header__inner {
        padding-top: var(--space-1);
    }

    .band {
        padding-block: var(--space-4) var(--space-6);
    }

    .panel {
        padding: var(--space-5);
    }

    .panel--flush {
        padding: 0;
    }

    /*
     * Deux rangées au lieu de trois : la marque rétrécit et passe sur deux lignes à côté de
     * « Se déconnecter » ; le nom de la personne connectée rejoint la rangée de la navigation,
     * à droite. Aucun texte n'est retiré ni modifié.
     */
    .site-header__brand {
        flex: 1 1 0;
        min-width: 0;
        min-height: var(--touch-target);
        overflow-wrap: normal;
    }

    /* Retour à la ligne forcé entre la première rangée (marque, déconnexion) et la navigation. */
    .site-header__inner::after {
        content: "";
        flex-basis: 100%;
        order: 2;
    }

    .site-header__user {
        display: contents;
    }

    .site-header__user form {
        display: flex;
        align-items: center;
        order: 1;
    }

    .site-nav {
        flex: 1 1 auto;
    }

    .site-header__name {
        display: flex;
        align-items: center;
        order: 4;
        min-height: var(--touch-target);
        margin-left: auto;
    }
}

/* Au doigt : poignée, « Déplacer… », colonnes du menu et « Ajouter une tâche » à 44 px. */
@media (max-width: 640px), (pointer: coarse) {
    .task-card__handle {
        --handle-size: var(--touch-target);
        margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) 0 0;
    }

    .kanban__menu-toggle,
    .kanban__menu-item {
        min-height: var(--touch-target);
    }

    .task-card__title {
        min-height: var(--touch-target);
    }

    .error-summary__list a {
        min-height: var(--touch-target);
    }
}

/*
 * Kanban sous 768 px, avec JavaScript : le contrôleur « column-tabs » pose .kanban--tabs et
 * hidden sur les listes non affichées. Les onglets défilent dans leur propre rangée (accroche par
 * onglet, sans barre visible) ; la page ne défile jamais en largeur. Le titre de la liste
 * affichée est repris par l'onglet actif : il reste lisible par les lecteurs d'écran seulement.
 */
@media (max-width: 767px) {
    .kanban--tabs .kanban__tabs {
        display: flex;
        gap: var(--space-2);
        margin: 0 0 var(--space-4);
        padding: var(--space-tag) var(--space-tag) var(--space-1);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

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

    .kanban--tabs .kanban__column[hidden] {
        display: none;
    }

    /* Une seule liste affichée : on change de colonne par « Déplacer… », visible sur chaque carte. */
    .kanban--tabs .kanban__help {
        display: none;
    }

    .kanban--tabs .kanban__title {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (min-width: 768px) {
    .kanban__columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .data-table thead {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .data-table thead th {
        display: table-cell;
        padding: var(--space-3) var(--space-5);
        background: var(--surface-sunken);
        border-bottom: var(--line-width) solid var(--line);
        color: var(--ink-muted);
        font: var(--text-caption);
        font-weight: var(--font-weight-semibold);
    }

    .data-table tr {
        display: table-row;
        padding: 0;
        border: 0;
    }

    .data-table tbody th,
    .data-table tbody td {
        display: table-cell;
        padding: var(--space-4) var(--space-5);
        vertical-align: middle;
        border-bottom: var(--line-width) solid var(--line);
    }

    .data-table tbody tr:last-child th,
    .data-table tbody tr:last-child td {
        border-bottom: 0;
    }

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

    .data-table__label {
        display: none;
    }

    /* Plus spécifique que « .data-table td » pour aligner les actions de ligne à droite. */
    .data-table td.data-table__actions {
        text-align: right;
        white-space: nowrap;
    }

    .data-table__actions .button--ghost {
        margin-left: 0;
    }

    /* Nom et étiquettes d'une cellule principale restent sur une ligne quand la place le permet. */
    .data-table tbody th > * {
        vertical-align: middle;
    }

    .data-table tbody th > * + * {
        margin-left: var(--space-2);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-inline: var(--space-8);
    }

    .kanban__columns {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .task-layout {
        grid-template-columns: minmax(0, 1fr) var(--task-aside-width);
        align-items: start;
    }

    .task-layout__aside {
        grid-column: 2;
        grid-row: 1;
    }

    .task-layout__main {
        grid-column: 1;
        grid-row: 1;
    }
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none;
        animation: none;
    }
}
