/* Administration des courses : la liste, la fiche (road-book) et l'atelier (parcours, partants, arrivée, règles).
   Les jetons --lgb-* viennent de lgb-tiles.css, les couleurs --race-* de race-style-card.css.
   .ac est le conteneur : les écrans s'adaptent à la place qu'on leur donne, pas à la taille de l'écran. */

:root {
    --lgb-gold: #F5C542;
    --lgb-gold-ink: #6B4A00;
}

.ac {
    container-type: inline-size;
    container-name: ac;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    color: var(--lgb-ink);
    font-family: 'LGB-Equip', sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.ac *, .ac *::before, .ac *::after { box-sizing: border-box; }
.ac svg { flex-shrink: 0; }
:where(.ac) button { font: inherit; color: inherit; cursor: pointer; }
:where(.ac) a { color: inherit; text-decoration: none; }

.ac-page { display: flex; flex-direction: column; gap: 14px; max-width: 1240px; margin: 0 auto; padding: 12px 12px 28px 12px; }
.ac-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Une même donnée, deux présentations : liste au mobile, table au bureau */
.ac-wide { display: none !important; }

/* Titres */
.ac-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px; }
.ac-h-title { margin: 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 21px; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.ac-h-sub { font-size: 12px; color: var(--lgb-ink-2); }
.ac-note { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--lgb-ink-2); }
.ac-note b { color: var(--lgb-ink); font-weight: 600; }
.ac-empty { padding: 18px 14px; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); color: var(--lgb-ink-2); font-size: 13.5px; text-align: center; }

/* Boutons */
.ac-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--lgb-radius); background: var(--lgb-violet); color: #FFFFFF !important; font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
.ac-btn svg { width: 17px; height: 17px; }
.ac-btn:disabled { opacity: 0.5; cursor: default; }
.ac-btn--big { min-height: 48px; width: 100%; font-size: 15px; }
.ac-btn--ghost { background: var(--lgb-lilac-soft); color: var(--lgb-violet-deep) !important; }
.ac-btn--line { background: #FFFFFF; color: var(--lgb-ink) !important; box-shadow: inset 0 0 0 1px #D9D5E2; }
.ac-btn--danger { background: var(--lgb-red); }
.ac-btn--dark { background: var(--lgb-ink); }
.ac-select { min-width: 0; min-height: 40px; padding: 0 10px 0 12px; border: 0; border-radius: var(--lgb-radius); background: #FFFFFF; color: var(--lgb-ink); font: inherit; font-size: 13.5px; font-weight: 600; box-shadow: var(--lgb-shadow); }
.ac-tools { display: flex; align-items: center; gap: 8px; }
.ac-tools .ac-push { margin-left: auto; }

/* Jeton de course */
.ac-token { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--lgb-radius); background: var(--race-bg, var(--lgb-violet)); color: var(--race-ink, #FFFFFF); font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 14px; line-height: 1; letter-spacing: 0.01em; }
.ac-token--done { background: color-mix(in srgb, var(--race-bg, var(--lgb-violet)) 28%, #FFFFFF); color: #55505F; }

/* Lignes de course */
.ac-list { display: flex; flex-direction: column; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); overflow: hidden; }
.ac-race { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; }
.ac-race + .ac-race { border-top: 1px solid var(--lgb-line); }
.ac-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ac-name { font-size: 14.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-sub { font-size: 12.5px; line-height: 1.3; color: var(--lgb-ink-2); }
.ac-sub b { color: var(--lgb-ink); font-weight: 600; }
.ac-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; min-width: 0; }
.ac-chev { flex-shrink: 0; width: 18px; height: 18px; color: #A8A3B3; }

/* Puces d'état */
.ac-chip { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; height: 21px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; background: var(--c-bg, var(--lgb-lilac-soft)); color: var(--c-ink, var(--lgb-violet-deep)); }
.ac-chip--live { --c-bg: var(--lgb-red); --c-ink: #FFFFFF; }
.ac-chip--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ac-chip--open { --c-bg: var(--lgb-green-soft); --c-ink: var(--lgb-green-ink); }
.ac-chip--prep { --c-bg: var(--lgb-lilac-soft); --c-ink: var(--lgb-violet-deep); }
.ac-chip--done { --c-bg: #ECEAF1; --c-ink: #4A4458; }
.ac-chip--warn { --c-bg: var(--lgb-gold-soft); --c-ink: var(--lgb-gold-ink); }
.ac-chip--bad { --c-bg: var(--lgb-red-soft); --c-ink: #A81420; }
.ac-chip--plain { --c-bg: transparent; --c-ink: var(--lgb-ink-2); padding: 0; font-weight: 600; }

/* Ça urge */
.ac-todo { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 12px; border-radius: var(--lgb-radius); background: var(--lgb-gold-soft); color: var(--lgb-ink); text-decoration: none; }
.ac-todo .ac-sub { color: #5C4A16; }
.ac-todo .ac-chev { color: #8A6E1E; }
.ac-todos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

/* Barre de progression */
.ac-bar { display: block; height: 6px; border-radius: 999px; background: rgba(21, 18, 31, 0.14); overflow: hidden; }
.ac-bar span { display: block; height: 100%; border-radius: inherit; background: var(--bar, var(--lgb-ink)); }

/* Table bureau */
.ac-table { display: flex; flex-direction: column; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); overflow: hidden; }
.ac-tr { display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 14px; min-height: 52px; padding: 6px 14px; color: inherit; text-decoration: none; font-size: 13.5px; }
.ac-tr + .ac-tr { border-top: 1px solid var(--lgb-line); }
.ac-tr--head { min-height: 36px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--lgb-ink-2); background: #FAFAFC; }
.ac-tr--hot { background: #FFFBEA; }
.ac-tr--done { color: var(--lgb-ink-2); }
.ac-cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.ac-cell-name .ac-token { width: 36px; height: 36px; font-size: 12px; }
.ac-cell-name span:last-child { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.2; }
.ac-prog { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ac-prog .ac-bar { flex: 1; --bar: var(--lgb-violet); background: #ECEAF1; }
.ac-prog b { font-weight: 600; white-space: nowrap; font-size: 12.5px; }


/* En-tête de fiche : bandeau aux couleurs de la course + feuille de route */
.ac-head { border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); overflow: hidden; }
.ac-band { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 44px 12px 14px; background: var(--race-bg, var(--lgb-violet)); color: var(--race-ink, #FFFFFF); }
.ac-band-name { margin: 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 27px; line-height: 0.95; text-transform: uppercase; }
.ac-band-sub { font-size: 12.5px; color: var(--race-muted, rgba(255, 255, 255, 0.72)); }
.ac-band-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ac-band-tag { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.72); color: #1F1B29; font-size: 11px; font-weight: 700; }
.ac-band-menu { position: absolute; top: 6px; right: 4px; }
.ac-band-menu .mud-icon-button { color: var(--race-ink, #FFFFFF); }

.ac-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 12px 6px 10px 6px; list-style: none; }
.ac-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; font-size: 11.5px; color: var(--lgb-ink-2); }
.ac-step::before { content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 2px; background: #E4E1EA; }
.ac-step:first-child::before { display: none; }
.ac-step-dot { position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 0 0 2px #D9D5E2; color: #FFFFFF; }
.ac-step-dot svg { width: 13px; height: 13px; }
.ac-step--done::before, .ac-step--now::before { background: var(--lgb-violet); }
.ac-step--done { color: var(--lgb-ink); }
.ac-step--done .ac-step-dot { background: var(--lgb-violet); box-shadow: none; }
.ac-step--now { color: var(--lgb-violet-deep); font-weight: 700; }
.ac-step--now .ac-step-dot { box-shadow: inset 0 0 0 2px var(--lgb-violet), 0 0 0 4px var(--lgb-lilac-soft); }
.ac-step--now .ac-step-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lgb-violet); }

/* La check-list du road-book */
.ac-check { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; color: inherit; text-decoration: none; }
.ac-check + .ac-check { border-top: 1px solid var(--lgb-line); }
.ac-check .ac-name { white-space: normal; }
.ac-state { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #ECEAF1; color: #6E6878; }
.ac-state svg { width: 16px; height: 16px; }
.ac-state--ok { background: var(--lgb-green-soft); color: var(--lgb-green-ink); }
.ac-state--warn { background: var(--lgb-gold-soft); color: var(--lgb-gold-ink); }
.ac-val { flex-shrink: 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 18px; line-height: 1; }
.ac-val small { font-family: 'LGB-Equip', sans-serif; font-weight: 400; font-size: 11.5px; color: var(--lgb-ink-2); }

/* Tuile résultat à saisir */
.ac-hot { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--lgb-radius); background: var(--lgb-gold); color: #2A1F00; }
.ac-hot-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.ac-hot-title { margin: 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 22px; line-height: 1; text-transform: uppercase; }
.ac-hot-sub { font-size: 13px; }

/* Lignes d'étape */
.ac-stage { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 12px; color: inherit; text-decoration: none; }
.ac-stage + .ac-stage { border-top: 1px solid var(--lgb-line); }
.ac-stage .ac-name { white-space: normal; }
.ac-num { flex-shrink: 0; width: 24px; text-align: center; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 18px; line-height: 1; }
.ac-ty { flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; color: #FFFFFF; background: var(--t); }
.ac-ty svg { width: 18px; height: 18px; }
.ac-ty--m { --t: #D42B2B; }
.ac-ty--h { --t: #B8620A; }
.ac-ty--p { --t: #0E8048; }
.ac-ty--c { --t: #6B42FE; }
.ac-stage--done .ac-num, .ac-stage--done .ac-name { color: var(--lgb-ink-2); }
.ac-fold { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 42px; border: 0; background: none; color: var(--lgb-violet); font: inherit; font-size: 13px; font-weight: 600; width: 100%; cursor: pointer; }
.ac-fold svg { width: 16px; height: 16px; }
.ac-stage + .ac-fold, .ac-fold + .ac-stage { border-top: 1px solid var(--lgb-line); }
.ac-link { color: var(--lgb-violet) !important; font-size: 12.5px; font-weight: 600; }

/* La fiche : une colonne, puis le parcours à gauche et le reste à droite */
.ac-cols { display: flex; flex-direction: column; gap: 14px; }
.ac-cols-top { order: -1; }
.ac-cols-top:empty { display: none; }

/* Feuille de confirmation : vit dans un dialogue, hors de .ac */
.ac-sheet, .ac-sheet *, .ac-sheet *::before, .ac-sheet *::after { box-sizing: border-box; }
.ac-sheet { display: flex; flex-direction: column; gap: 12px; padding: 6px 0 8px 0; color: var(--lgb-ink); font-family: 'LGB-Equip', sans-serif; font-size: 14px; }
.ac-sheet-title { margin: 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 27px; line-height: 0.95; text-transform: uppercase; }
.ac-effects { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-radius: var(--lgb-radius); background: #F7F6FA; }
.ac-effects li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.3; }
.ac-effects li + li { border-top: 1px solid #E9E7EF; }
.ac-effects svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--lgb-violet-deep); }
.ac-effects b { font-weight: 700; }


/* Atelier */
.ac-page--narrow { max-width: 720px; }
.ac-badge { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 2px; }
.ac-paste { display: block; width: 100%; margin: 0; padding: 10px 12px; border: 0; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: inset 0 0 0 1px #D9D5E2; color: #3B3747; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.55; resize: vertical; white-space: pre; overflow: auto; }
.ac-mono { font-family: ui-monospace, Consolas, monospace; font-weight: 400; }
.ac-input { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: inset 0 0 0 1px #D9D5E2; color: var(--lgb-ink-2); font-size: 14px; cursor: text; }
.ac-input svg { width: 18px; height: 18px; }
.ac-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--lgb-ink); font: inherit; }
.ac-edit { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 6px 12px; }
.ac-edit + .ac-edit { border-top: 1px solid var(--lgb-line); }
.ac-edit .ac-name { white-space: normal; }
.ac-more { display: grid; place-items: center; width: 32px; height: 32px; border: 0; padding: 0; background: none; color: var(--lgb-ink-2); flex-shrink: 0; cursor: pointer; }
.ac-more svg { width: 20px; height: 20px; }
.ac-ty-btn { flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; margin: -6px; border: 0; padding: 0; background: none; cursor: pointer; }
.ac-btn--small { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
.ac-grow { flex: 1; min-width: 0; }
.ac-select--block { width: 100%; min-height: 44px; }
.ac-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 6px; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); }
.ac-stat { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.ac-stat b { font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 25px; line-height: 1; }
.ac-stat span { font-size: 11.5px; color: var(--lgb-ink-2); }
.ac-tone-warn { color: #8A6200; }
.ac-tone-bad { color: #A81420; }
.ac-jersey { flex-shrink: 0; width: 34px; height: 34px; object-fit: contain; }
.ac-team { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 6px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ac-team + .ac-team, .ac-riders + .ac-team { border-top: 1px solid var(--lgb-line); }
.ac-riders { display: flex; flex-direction: column; padding: 0 12px 6px 56px; background: #FFFFFF; }
.ac-rider { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; border: 0; padding: 0; background: none; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ac-rider + .ac-rider { border-top: 1px solid var(--lgb-line); }
.ac-tick { flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--lgb-violet); color: #FFFFFF; }
.ac-tick svg { width: 14px; height: 14px; }
.ac-tick--off { background: #FFFFFF; box-shadow: inset 0 0 0 2px #D9D5E2; }
.ac-fold--danger { color: #B3261E; border-top: 1px solid var(--lgb-line); }
.ac-decide { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }
.ac-decide + .ac-decide { border-top: 1px solid var(--lgb-line); }
.ac-decide-options { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-decide-options .ac-btn { white-space: normal; text-align: left; padding: 4px 10px; }
.ac-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* L'arrivée : les places et les maillots */
.ac-finish { display: flex; flex-direction: column; gap: 14px; }
.ac-rank { display: flex; align-items: center; gap: 4px; min-height: 46px; padding: 0 6px 0 0; font-size: 14px; }
.ac-rank + .ac-rank { border-top: 1px solid var(--lgb-line); }
.ac-rank-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 5px 0 5px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ac-rank .ac-name { font-size: 14px; }
.ac-rank-n { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lgb-lilac-soft); color: var(--lgb-violet-deep); font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 15px; line-height: 1; }
.ac-rank--next { background: var(--lgb-lilac-soft); }
.ac-rank--next .ac-rank-n { background: var(--lgb-violet); color: #FFFFFF; }
.ac-rank--empty .ac-name { color: #8C8798; font-weight: 400; }
.ac-pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 5px 12px; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ac-pick .ac-name { font-size: 14px; }
.ac-pick + .ac-pick { border-top: 1px solid var(--lgb-line); }
.ac-picklist { max-height: 340px; overflow-y: auto; }

/* Les règles */
.ac-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: var(--lgb-radius); background: #E7E4EE; }
.ac-seg-item { min-height: 38px; border: 0; border-radius: var(--lgb-radius-sm); background: none; color: var(--lgb-ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ac-seg-item--on { background: #FFFFFF; color: var(--lgb-violet-deep); box-shadow: var(--lgb-shadow); }
/* Format choisi dans la fenêtre de création de course (MudDialog, hors de .ac) */
.race-format { display: grid; gap: 8px; margin-top: 20px; font-family: 'LGB-Equip', sans-serif; }
.race-format-label { font-size: 12px; color: var(--lgb-ink-2); }
.ac-rule { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; }
.ac-rule + .ac-rule { border-top: 1px solid var(--lgb-line); }
.ac-rule .ac-name { white-space: normal; }
.ac-switch { flex-shrink: 0; position: relative; width: 38px; height: 22px; border: 0; padding: 0; border-radius: 999px; background: var(--lgb-violet); cursor: pointer; }
.ac-switch::after { content: ""; position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; }
.ac-switch--off { background: #CFCBD8; }
.ac-switch--off::after { right: auto; left: 2px; }
.ac-stepper { flex-shrink: 0; display: grid; grid-template-columns: 34px 34px 34px; align-items: center; border-radius: var(--lgb-radius); box-shadow: inset 0 0 0 1px #D9D5E2; }
.ac-stepper button { height: 36px; border: 0; padding: 0; background: none; color: var(--lgb-violet); font: inherit; font-size: 18px; font-weight: 600; cursor: pointer; }
.ac-stepper b { text-align: center; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 17px; line-height: 1; }
.ac-two { display: flex; flex-direction: column; gap: 14px; }

/* Survol : seulement là où une souris existe */
@media (hover: hover) {
    a.ac-race:hover, button.ac-race:hover, a.ac-tr:hover { background: #FAFAFC; }
    a.ac-tr.ac-tr--hot:hover { background: #FFF6D6; }
    a.ac-todo:hover { background: #FFEFA8; }
    button.ac-team:hover, button.ac-pick:hover, .ac-rider:hover { background: #FAFAFC; }
}

/* Bureau */
@container ac (min-width: 720px) {
    .ac-narrow { display: none !important; }
    .ac-wide { display: flex !important; }
    .ac-page { padding: 16px 16px 32px 16px; }
    .ac-todos { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    .ac-cols { display: grid; grid-template-columns: minmax(0, 1fr) 372px; grid-template-rows: auto 1fr; gap: 14px 18px; align-items: start; }
    .ac-cols-main { grid-column: 1; grid-row: 1 / span 2; }
    .ac-cols-top { grid-column: 2; grid-row: 1; order: 0; }
    .ac-cols-bottom { grid-column: 2; grid-row: 2; }
    .ac-head--wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: stretch; }
    .ac-head--wide .ac-steps { align-self: center; padding: 14px 16px; }
    .ac-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
    .ac-finish { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
    .ac-picklist { max-height: 620px; }
}

/* Administration des coureurs : préfixe ar-* */

/* Recherche et outils */
.ar-top { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.ar-search { flex: 1 1 200px; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); cursor: text; }
.ar-search svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--lgb-violet); }
.ar-search input { flex: 1; min-width: 0; border: 0; padding: 0; background: none; color: var(--lgb-ink); font: inherit; font-size: 15px; font-weight: 600; outline: none; }
.ar-search input::placeholder { color: var(--lgb-ink-2); font-weight: 400; }
.ar-search--on { box-shadow: inset 0 0 0 2px var(--lgb-violet); }
.ar-add { flex-shrink: 0; display: grid; place-items: center; width: 50px; border-radius: var(--lgb-radius); background: var(--lgb-violet); color: #FFFFFF !important; }
.ar-add svg { width: 24px; height: 24px; }
.ar-inline { display: inline-flex; }

/* L'infirmerie */
.ar-care-block { display: flex; flex-direction: column; gap: 14px; }
.ar-care-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ar-care { display: flex; flex-direction: column; gap: 3px; min-height: 92px; padding: 10px 12px; border-radius: var(--lgb-radius); background: var(--lgb-gold-soft); color: var(--lgb-ink); text-decoration: none; }
.ar-care-n { font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 32px; line-height: 1; }
.ar-care-t { font-size: 14px; font-weight: 700; line-height: 1.15; }
.ar-care-s { font-size: 12px; line-height: 1.25; color: #5C4A16; }

/* Filtres */
.ar-chips { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ar-chipbtn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: #FFFFFF; box-shadow: inset 0 0 0 1px #D9D5E2; color: var(--lgb-ink); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.ar-chipbtn--on { background: var(--lgb-violet); box-shadow: none; color: #FFFFFF; }
.ar-chipselect { flex-shrink: 0; max-width: 150px; height: 34px; padding: 0 8px 0 12px; border: 0; border-radius: 999px; background: #FFFFFF; box-shadow: inset 0 0 0 1px #D9D5E2; color: var(--lgb-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ar-chipselect--on { background: var(--lgb-violet); box-shadow: none; color: #FFFFFF; }
.ar-chipselect option { background: #FFFFFF; color: var(--lgb-ink); }

/* Lignes de coureur */
.ar-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 12px; color: inherit; text-decoration: none; }
.ar-row + .ar-row { border-top: 1px solid var(--lgb-line); }
.ar-row--sel { background: var(--lgb-lilac-soft); }
.ar-j { flex-shrink: 0; width: 38px; height: 38px; object-fit: contain; }
.ar-j--none { display: grid; place-items: center; color: #B4AFC0; }
.ar-j--none svg { width: 32px; height: 32px; }
.ar-j--big { width: 92px; height: 92px; }
.ar-j--big.ar-j--none svg { width: 74px; height: 74px; }
.ar-j--small { width: 28px; height: 28px; }
.ar-j--small.ar-j--none svg { width: 24px; height: 24px; }
.ar-pts { flex-shrink: 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 19px; line-height: 1; text-align: right; }
.ar-pts small { display: block; margin-top: 2px; font-family: 'LGB-Equip', sans-serif; font-weight: 400; font-size: 11px; color: var(--lgb-ink-2); }
.ar-flag { width: 18px; height: 12px; margin-right: 6px; object-fit: cover; vertical-align: -1px; }
.ar-country { display: flex; align-items: center; white-space: nowrap; }
.ar-ellipsis { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-tr { min-height: 48px; }
.ar-tr-sel { background: var(--lgb-lilac-soft); }
.ar-num { font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 17px; line-height: 1; }

/* Bandeau d'alerte */
.ar-alert { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--lgb-radius); background: var(--lgb-gold-soft); color: var(--lgb-ink); }
.ar-alert-t { font-size: 14px; font-weight: 700; line-height: 1.2; }
.ar-alert-s { font-size: 12.5px; line-height: 1.35; color: #5C4A16; }
.ar-alert--row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.ar-alert .ac-btn { white-space: normal; text-align: center; }

/* La fiche */
.ar-desk { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ar-pane { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ar-with-sheet .ar-list-part { display: none; }
.ar-hero { position: relative; display: flex; align-items: center; gap: 10px; min-height: 124px; padding: 14px; border-radius: var(--lgb-radius); background: var(--lgb-ink); color: #FFFFFF; overflow: hidden; }
.ar-hero-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ar-hero-name { margin: 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 31px; line-height: 0.95; text-transform: uppercase; }
.ar-hero-sub { font-size: 13px; line-height: 1.25; opacity: 0.86; }
.ar-hero-menu { position: absolute; top: 2px; right: 2px; }
.ar-hero-menu .mud-icon-button { color: #FFFFFF; }
.ar-btns { display: flex; gap: 8px; }
.ar-btns > * { flex: 1; min-height: 44px; }
.ar-tl { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 6px 8px 12px; }
.ar-tl + .ar-tl { border-top: 1px solid var(--lgb-line); }
.ar-tl .ac-name { white-space: normal; }
.ar-kv { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 4px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; }
.ar-kv + .ar-kv, .ar-kv + .ac-fold { border-top: 1px solid var(--lgb-line); }
.ar-kv-k { flex: 0 0 96px; font-size: 12.5px; color: var(--lgb-ink-2); }
.ar-kv-v { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-kv-v small { font-size: 12.5px; font-weight: 400; color: var(--lgb-ink-2); }
.ar-pen { flex-shrink: 0; width: 15px !important; height: 15px !important; color: #A8A3B3; }
.ar-kv--edit { flex-direction: column; align-items: stretch; padding: 10px 12px; background: #FAFAFC; }
.ar-kv-actions { display: flex; gap: 8px; }
.ar-kv-actions .ac-btn { flex: 1; }

/* Le tri, un coureur à la fois */
.ar-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.ar-progress .ac-bar { flex: 1; --bar: var(--lgb-violet); background: #E4E1EA; }
.ar-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px 16px 14px; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); text-align: center; }
.ar-card-name { margin: 2px 0 0 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 31px; line-height: 0.95; text-transform: uppercase; }
.ar-card-sub { font-size: 13.5px; color: var(--lgb-ink-2); }
.ar-card-last { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: #F4F3F8; font-size: 12.5px; text-align: left; }
.ar-q { margin: 0; font-family: 'LGB-Garaje', sans-serif; font-weight: 900; font-size: 21px; line-height: 1; text-transform: uppercase; }
.ar-stack { display: flex; flex-direction: column; gap: 8px; }
.ar-stack .ac-btn { justify-content: flex-start; min-height: 50px; gap: 10px; font-size: 14.5px; white-space: normal; text-align: left; }
.ar-stack .ac-btn img { width: 30px; height: 30px; object-fit: contain; }
.ar-stack .ar-search { flex: none; }
.ar-textbtn { align-self: center; border: 0; padding: 6px 10px; background: none; color: var(--lgb-violet-deep); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ar-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 12px; border-radius: var(--lgb-radius); background: var(--lgb-ink); color: #FFFFFF; font-size: 13px; }
.ar-toast button { flex-shrink: 0; border: 0; padding: 4px; background: none; color: #CDBEFF; font: inherit; font-weight: 700; cursor: pointer; }
.ar-q-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 4px 12px; border: 0; background: none; font: inherit; font-size: 13.5px; color: inherit; text-align: left; cursor: pointer; }
.ar-q-row + .ar-q-row { border-top: 1px solid var(--lgb-line); }
.ar-q-row-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-q-row--now { background: var(--lgb-lilac-soft); font-weight: 700; }
.ar-q-row--done { color: var(--lgb-ink-2); }
.ar-queue { display: none; }
kbd.ar-k { display: none; place-items: center; min-width: 22px; height: 22px; margin-left: auto; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); color: inherit; font: inherit; font-size: 11.5px; font-weight: 700; }
.ac-btn--line kbd.ar-k, .ac-btn--ghost kbd.ar-k { background: rgba(21, 18, 31, 0.08); }

/* Deux maillots */
.ar-duo { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); }
.ar-duo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: inherit; }
.ar-duo-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ar-opt { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 56px; padding: 6px 8px; border: 0; border-radius: var(--lgb-radius); background: #F4F3F8; color: var(--lgb-ink); font: inherit; text-align: left; cursor: pointer; }
.ar-opt .ar-j { width: 32px; height: 32px; }
.ar-opt-t { min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.ar-opt-t small { font-size: 11.5px; font-weight: 400; color: var(--lgb-ink-2); }
.ar-opt--on { background: var(--lgb-lilac-soft); box-shadow: inset 0 0 0 2px var(--lgb-violet); }
.ar-duo-out { font-size: 12px; color: var(--lgb-ink-2); }
.ar-grid { display: flex; flex-direction: column; gap: 10px; }

/* Les sosies */
.ar-cmp { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1fr); column-gap: 8px; font-size: 13px; }
.ar-cmp > * { display: flex; align-items: center; min-width: 0; min-height: 32px; border-top: 1px solid var(--lgb-line); }
.ar-cmp .k { color: var(--lgb-ink-2); font-size: 12px; }
.ar-cmp .h { border-top: 0; font-weight: 700; }
.ar-cmp .diff { color: var(--lgb-gold-ink); font-weight: 700; }

/* Formulaires */
.ar-form { display: flex; flex-direction: column; gap: 10px; }
.ar-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--lgb-ink-2); }
.ar-f input, .ar-f select { width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 12px; border: 0; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: inset 0 0 0 1px #D9D5E2; color: var(--lgb-ink); font: inherit; font-size: 15px; font-weight: 600; outline: none; }
.ar-f input:focus, .ar-f select:focus { box-shadow: inset 0 0 0 2px var(--lgb-violet); }
.ar-f-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ar-from { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--lgb-radius); background: var(--lgb-lilac-soft); color: var(--lgb-violet-deep); font-size: 12.5px; font-weight: 600; }
.ar-from svg { flex-shrink: 0; width: 16px; height: 16px; }
.ar-pasted { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.ar-pasted + .ar-pasted { border-top: 1px solid var(--lgb-line); }
.ar-pasted-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ar-f-row--fill { grid-template-columns: minmax(0, 1fr); }
.ar-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ===== Nationalités ===== */
.an-grid { display: flex; flex-direction: column; border-radius: var(--lgb-radius); background: #FFFFFF; box-shadow: var(--lgb-shadow); overflow: hidden; }
.an-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.an-flag { flex-shrink: 0; display: grid; place-items: center; width: 33px; height: 22px; border-radius: 3px; background: var(--lgb-line); color: var(--lgb-ink-2); overflow: hidden; }
.an-flag > * { grid-area: 1 / 1; }
.an-flag svg { width: 16px; height: 16px; }
.an-flag img { width: 100%; height: 100%; object-fit: cover; }
.an-flag-off { visibility: hidden; }
.an-flag--big { width: 54px; height: 36px; }
.an-flag--big svg { width: 24px; height: 24px; }
.an-sheet-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.an-center { text-align: center; }

@media (hover: hover) {
    a.ar-row:hover, button.ar-kv:hover, a.ar-tr:hover, button.ar-q-row:hover { background: #FAFAFC; }
    a.ar-row--sel:hover, a.ar-tr-sel:hover { background: var(--lgb-lilac-soft); }
    a.ar-care:hover { background: #FFEFA8; }
    button.an-row:hover { background: #FAFAFC; }
}

@container ac (min-width: 720px) {
    .ar-top { flex-wrap: nowrap; align-items: center; }
    .ar-top .ac-btn { min-height: 44px; }
    .ar-search { min-height: 44px; }
    .ar-care-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ar-care { flex-direction: row; align-items: center; gap: 12px; min-height: 68px; }
    .ar-care-n { min-width: 50px; font-size: 34px; }
    .ar-with-sheet .ar-list-part { display: flex; }
    .ar-with-sheet .ar-desk { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
    .ar-sheet-pane { position: sticky; top: 0; }
    .ar-workshop { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
    .ar-queue { display: flex; max-height: 76vh; overflow-y: auto; }
    .ar-workshop-main { width: 100%; max-width: 620px; justify-self: center; }
    kbd.ar-k { display: inline-grid; }
    .ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
    .ar-f-row--fill { grid-template-columns: 150px 150px minmax(0, 1fr); }
    .an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .an-grid .ar-row + .ar-row { border-top: 0; }
    .an-grid .ar-row { box-shadow: inset 0 -1px 0 var(--lgb-line); }
}
