/* =====================================================================
   TrailPrep — charte graphique
   Tokens --tp-* + surcharge des variables Bootstrap 5.3.
   Changer une couleur = changer la variable ici, nulle part ailleurs.
   ===================================================================== */

:root {
    /* Palette */
    --tp-forest: #1F4D3A;          /* principale : boutons, liens, J-x */
    --tp-forest-dark: #163828;     /* sidebar, survol */
    --tp-forest-soft: #EAF2EC;
    --tp-accent: #E8701A;          /* orange balisage : prochaine action, jour courant */
    --tp-accent-hover: #D2600F;
    --tp-accent-text: #9A420A;     /* orange lisible sur fond clair */
    --tp-accent-soft: #FDEBDC;
    --tp-ground: #F5F3EE;          /* fond de page */
    --tp-surface: #FFFFFF;         /* cartes, tables */
    --tp-surface-alt: #FAF9F6;     /* en-têtes de table */
    --tp-ink: #1C211E;
    --tp-muted: #5B635E;
    --tp-line: #E2DED5;
    --tp-line-strong: #CFCAC0;
    --tp-success: #2E7D4F;
    --tp-success-text: #1F5E3A;
    --tp-success-soft: #E3F1E8;
    --tp-danger: #B42318;
    --tp-danger-soft: #FDECEA;
    --tp-strength: #5B4BB7;        /* renforcement musculaire (séances dédiées et blocs) */
    --tp-strength-text: #47398F;
    --tp-strength-soft: #EFEDFF;

    /* Formes et typo */
    --tp-radius: 12px;
    --tp-radius-sm: 8px;
    --tp-font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --tp-font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Bootstrap 5.3 */
    --bs-body-font-family: var(--tp-font-body);
    --bs-body-color: var(--tp-ink);
    --bs-body-bg: var(--tp-ground);
    --bs-secondary-color: var(--tp-muted);
    --bs-border-color: var(--tp-line);
    --bs-border-radius: var(--tp-radius-sm);
    --bs-primary: #1F4D3A;
    --bs-primary-rgb: 31, 77, 58;
    --bs-link-color: var(--tp-forest);
    --bs-link-color-rgb: 31, 77, 58;
    --bs-link-hover-color: var(--tp-forest-dark);
    --bs-link-hover-color-rgb: 22, 56, 40;
    --bs-focus-ring-color: rgba(232, 112, 26, 0.35);
}

/* ---------- Typographie ---------- */

h1, h2, h3, .h1, .h2, .h3 {
    font-family: var(--tp-font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

h1, .h1 { font-size: clamp(2rem, 1.6rem + 1.4vw, 2.5rem); }
h2, .h2 { font-size: 1.75rem; }
h3, .h3 { font-size: 1.5rem; font-weight: 600; }

h4, h5, h6, .h4, .h5, .h6 {
    font-family: var(--tp-font-body);
    font-weight: 700;
}

h1:focus { outline: none; }

a, .btn-link { color: var(--tp-forest); }

/* Chiffres : J-x, allures, durées, distances */
.tp-num {
    font-family: var(--tp-font-display);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.tp-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tp-accent-text);
}

/* ---------- Boutons ---------- */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: var(--tp-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn:not(.btn-sm):not(.btn-link) { min-height: 44px; }
.btn-sm { min-height: 34px; }

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--tp-forest);
    --bs-btn-border-color: var(--tp-forest);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--tp-forest-dark);
    --bs-btn-hover-border-color: var(--tp-forest-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--tp-forest-dark);
    --bs-btn-active-border-color: var(--tp-forest-dark);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--tp-forest);
    --bs-btn-disabled-border-color: var(--tp-forest);
}

.btn-outline-primary {
    --bs-btn-color: var(--tp-forest);
    --bs-btn-border-color: var(--tp-forest);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--tp-forest);
    --bs-btn-hover-border-color: var(--tp-forest);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--tp-forest);
    --bs-btn-active-border-color: var(--tp-forest);
    --bs-btn-disabled-color: var(--tp-forest);
    --bs-btn-disabled-border-color: var(--tp-forest);
}

/* Prochaine action (« Générer la nutrition »…) : une seule par écran */
.btn-accent {
    --bs-btn-color: var(--tp-ink);
    --bs-btn-bg: var(--tp-accent);
    --bs-btn-border-color: var(--tp-accent);
    --bs-btn-hover-color: var(--tp-ink);
    --bs-btn-hover-bg: var(--tp-accent-hover);
    --bs-btn-hover-border-color: var(--tp-accent-hover);
    --bs-btn-active-color: var(--tp-ink);
    --bs-btn-active-bg: var(--tp-accent-hover);
    --bs-btn-active-border-color: var(--tp-accent-hover);
    --bs-btn-disabled-color: var(--tp-ink);
    --bs-btn-disabled-bg: var(--tp-accent);
    --bs-btn-disabled-border-color: var(--tp-accent);
    font-weight: 700;
}

.btn-outline-accent {
    --bs-btn-color: var(--tp-accent-text);
    --bs-btn-border-color: var(--tp-accent-text);
    --bs-btn-hover-color: var(--tp-ink);
    --bs-btn-hover-bg: var(--tp-accent);
    --bs-btn-hover-border-color: var(--tp-accent);
    --bs-btn-active-color: var(--tp-ink);
    --bs-btn-active-bg: var(--tp-accent);
    --bs-btn-active-border-color: var(--tp-accent);
}

/* Annuler, actions secondaires */
.btn-secondary {
    --bs-btn-color: var(--tp-ink);
    --bs-btn-bg: #ECE9E2;
    --bs-btn-border-color: #ECE9E2;
    --bs-btn-hover-color: var(--tp-ink);
    --bs-btn-hover-bg: #E2DED5;
    --bs-btn-hover-border-color: #E2DED5;
    --bs-btn-active-color: var(--tp-ink);
    --bs-btn-active-bg: #D8D3C8;
    --bs-btn-active-border-color: #D8D3C8;
}

.btn-outline-secondary {
    --bs-btn-color: var(--tp-ink);
    --bs-btn-border-color: var(--tp-line-strong);
    --bs-btn-hover-color: var(--tp-ink);
    --bs-btn-hover-bg: #ECE9E2;
    --bs-btn-hover-border-color: var(--tp-line-strong);
    --bs-btn-active-color: var(--tp-ink);
    --bs-btn-active-bg: #E2DED5;
    --bs-btn-active-border-color: var(--tp-line-strong);
    background-color: var(--tp-surface);
}

.btn-outline-danger {
    --bs-btn-color: var(--tp-danger);
    --bs-btn-border-color: var(--tp-danger);
    --bs-btn-hover-bg: var(--tp-danger);
    --bs-btn-hover-border-color: var(--tp-danger);
    --bs-btn-active-bg: var(--tp-danger);
    --bs-btn-active-border-color: var(--tp-danger);
}

/* ---------- Focus (visible, couleur balisage) ---------- */

.btn:focus-visible,
.btn-link.nav-link:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn-check:focus-visible + .btn {
    border-color: var(--tp-accent);
    box-shadow: 0 0 0 0.25rem rgba(232, 112, 26, 0.35);
    outline: none;
}

/* ---------- Formulaires ---------- */

label, .form-label {
    font-weight: 600;
    font-size: 0.925rem;
    margin-bottom: 0.25rem;
}

.form-check-label, .col-form-label { font-weight: 400; }

.form-control, .form-select {
    border-color: var(--tp-line-strong);
    background-color: var(--tp-surface);
}

.form-control:not(.form-control-sm), .form-select:not(.form-select-sm) { min-height: 44px; }

.form-check-input:checked {
    background-color: var(--tp-forest);
    border-color: var(--tp-forest);
}

.input-group-text {
    background-color: var(--tp-surface-alt);
    border-color: var(--tp-line-strong);
    color: var(--tp-muted);
}

.form-text { color: var(--tp-muted); }

.valid.modified:not([type=checkbox]) { outline: 1px solid var(--tp-success); }
.invalid { outline: 1px solid var(--tp-danger); }
.validation-message { color: var(--tp-danger); font-size: 0.875rem; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.darker-border-checkbox.form-check-input { border-color: #929292; }

/* ---------- Cartes ---------- */

.card {
    --bs-card-bg: var(--tp-surface);
    --bs-card-border-color: var(--tp-line);
    --bs-card-border-radius: var(--tp-radius);
    --bs-card-inner-border-radius: calc(var(--tp-radius) - 1px);
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
}

.card-title {
    font-family: var(--tp-font-display);
    font-weight: 700;
    font-size: 1.5rem;
}

/* ---------- Tables ---------- */

/* Enveloppe : bordure arrondie + défilement horizontal sur mobile */
.tp-table-wrap {
    background: var(--tp-surface);
    border: 1px solid var(--tp-line);
    border-radius: var(--tp-radius);
    overflow-x: auto;
    position: relative;   /* contient les .visually-hidden en absolu : sinon ils élargissent la page en mobile */
    margin-bottom: 1rem;
}

.tp-table-wrap > .table { margin-bottom: 0; }

.table {
    --bs-table-bg: var(--tp-surface);
    --bs-table-border-color: var(--tp-line);
    vertical-align: middle;
}

.table > thead > tr > th {
    background: var(--tp-surface-alt);
    color: var(--tp-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* ---------- Alertes, badges, progression ---------- */

.alert { border-radius: var(--tp-radius-sm); }
.alert-success { --bs-alert-bg: var(--tp-success-soft); --bs-alert-color: var(--tp-success-text); --bs-alert-border-color: #C6E3D1; }
.alert-warning { --bs-alert-bg: var(--tp-accent-soft); --bs-alert-color: #7A3508; --bs-alert-border-color: #F6CFAE; }
.alert-danger  { --bs-alert-bg: var(--tp-danger-soft); --bs-alert-color: #8A1B12; --bs-alert-border-color: #F5C2BC; }
.alert-info    { --bs-alert-bg: var(--tp-forest-soft); --bs-alert-color: var(--tp-forest-dark); --bs-alert-border-color: #CFE0D5; }

.progress { --bs-progress-bar-bg: var(--tp-forest); --bs-progress-bg: #E7E3DB; }

/* ---------- Composants TrailPrep ---------- */

/* En-tête de page : titre + sous-titre à gauche, actions à droite */
.tp-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tp-page-header h1 { margin: 0; }
.tp-page-header__sub { margin: 0.25rem 0 0; color: var(--tp-muted); }

.tp-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Pastilles d'état : fait / à faire / attention */
.tp-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.tp-pill--done { background: var(--tp-success-soft); color: var(--tp-success-text); }
.tp-pill--todo { background: var(--tp-ground); color: var(--tp-muted); border: 1px dashed #B8B2A6; }
.tp-pill--warn { background: var(--tp-accent-soft); color: var(--tp-accent-text); }

/* Compte à rebours J-x */
.tp-countdown {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 1rem;
    border-radius: var(--tp-radius);
    background: var(--tp-forest);
    color: #fff;
    line-height: 1;
}

.tp-countdown__value { font-family: var(--tp-font-display); font-weight: 700; font-size: 2.75rem; }
.tp-countdown__label { font-size: 0.8rem; color: #CFE0D5; margin-top: 0.25rem; }

/* État vide */
.tp-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    background: var(--tp-surface);
    border: 1px dashed var(--tp-line-strong);
    border-radius: var(--tp-radius);
    color: var(--tp-muted);
}

.tp-empty .bi { font-size: 2rem; display: block; margin-bottom: 0.5rem; color: var(--tp-line-strong); }

/* Pastille cliquable (lien vers l'élément prêt) */
a.tp-pill { text-decoration: none; }
a.tp-pill:hover { filter: brightness(0.95); }
.tp-pill--locked { opacity: 0.6; }

/* Chargement */
.tp-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 2rem 0;
    color: var(--tp-muted);
}

.tp-loading .spinner-border { color: var(--tp-forest); }

/* Titre de section + action à droite */
.tp-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.tp-section-head h2 { margin: 0; }

/* Fil d'Ariane */
.tp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: var(--tp-muted);
    margin-bottom: 0.75rem;
}

.tp-breadcrumb a { text-decoration: none; font-weight: 600; }
.tp-breadcrumb a:hover { text-decoration: underline; }
.tp-breadcrumb .bi { font-size: 0.7rem; }

/* Compte à rebours compact (listes) */
.tp-badge-j {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: 6px;
    background: var(--tp-forest-soft);
    color: var(--tp-forest);
    font-family: var(--tp-font-display);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Tuiles de chiffres clés */
.tp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}

.tp-stat {
    padding: 0.85rem 1rem;
    background: var(--tp-surface);
    border: 1px solid var(--tp-line);
    border-radius: var(--tp-radius);
}

.tp-stat__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tp-muted);
}

.tp-stat__value {
    margin: 0.2rem 0 0;
    font-family: var(--tp-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.tp-stat__value--text { font-size: 1.35rem; }

/* Grille de formulaire responsive */
.tp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem 1.25rem;
}

.tp-form-grid__full { grid-column: 1 / -1; }

/* Boîte de confirmation */
.tp-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(28, 33, 30, 0.45);
}

.tp-modal {
    position: fixed;
    z-index: 1055;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(440px, calc(100vw - 2rem));
    padding: 1.5rem;
    background: var(--tp-surface);
    border-radius: var(--tp-radius);
    box-shadow: 0 12px 40px rgba(28, 33, 30, 0.25);
    outline: none;
}

.btn-danger {
    --bs-btn-bg: var(--tp-danger);
    --bs-btn-border-color: var(--tp-danger);
    --bs-btn-hover-bg: #93190F;
    --bs-btn-hover-border-color: #93190F;
    --bs-btn-active-bg: #93190F;
    --bs-btn-active-border-color: #93190F;
}

/* Lien principal d'une ligne de table */
.tp-strong-link { font-weight: 700; text-decoration: none; }
.tp-strong-link:hover { text-decoration: underline; }

/* Action discrète dans une tuile (« Modifier ») */
.tp-stat__action {
    margin-top: 0.35rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--tp-forest);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Étapes d'un parcours (génération de plan) */
.tp-stepper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.tp-stepper__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tp-muted);
    font-size: 0.925rem;
    font-weight: 600;
}

.tp-stepper__item:not(:last-child)::after {
    content: "";
    width: 2rem;
    height: 2px;
    margin-left: 0.5rem;
    background: var(--tp-line-strong);
}

.tp-stepper__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--tp-line-strong);
    border-radius: 50%;
    background: var(--tp-surface);
    font-size: 0.85rem;
}

.tp-stepper__item--current { color: var(--tp-ink); }
.tp-stepper__item--current .tp-stepper__num { border-color: var(--tp-accent); background: var(--tp-accent); color: var(--tp-ink); }
.tp-stepper__item--done { color: var(--tp-success-text); }
.tp-stepper__item--done .tp-stepper__num { border-color: var(--tp-success); background: var(--tp-success); color: #fff; }

/* Pastille de phase (couleur portée par un point, texte toujours lisible) */
.tp-phase {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.tp-phase__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Pastille d'initiales (coureur) */
.tp-avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tp-forest);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* Sélecteur de coureur (dans la sidebar, fond sombre) */
.runner-selector { display: flex; flex-direction: column; gap: 0.35rem; }

.runner-selector__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #B9C7BE;
    margin: 0;
}

.runner-selector__select.form-select {
    min-height: 40px;
    background-color: var(--tp-forest-dark);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.runner-selector__select.form-select option { color: var(--tp-ink); background: #fff; }

/* ---------- Divers ---------- */

.content { padding-top: 1.1rem; }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Une erreur est survenue.";
    }

/* Indicateur d'enregistrement automatique */
.tp-save-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 7rem;
    font-size: 0.8rem;
    color: var(--tp-success-text);
}

.tp-save-status .spinner-border { width: 0.8rem; height: 0.8rem; color: var(--tp-muted); }

/* Éléments déplaçables : l'appui long (glisser-déposer au doigt) ne doit ni sélectionner le texte
   ni ouvrir le menu contextuel */
[data-tp-drag] {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Copie de l'élément suivie par le doigt pendant le glisser (polyfill mobile) */
.dnd-poly-drag-image {
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.2);
}

/* Règles du nouveau mot de passe, cochées au fil de la saisie */
.password-rules {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .75rem;
    list-style: none;
    margin: .35rem 0 0;
    padding: 0;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}
.password-rules li::before { content: "○ "; }
.password-rules li.ok { color: var(--bs-success-text-emphasis); }
.password-rules li.ok::before { content: "✓ "; }

/* Lien vers le site officiel d'une course (lot M3) */
.official-site { white-space: nowrap; }

/* Fonctions premium en aperçu (lot O2) : élément visible, verrouillé, badge doré */
.tp-pill--premium { background: #fff4d6; color: #8a5a00; border: 1px solid #f0c75e; font-weight: 600; }
.premium-teaser { border-style: dashed; background: #fbfaf7; }
.premium-teaser--compact { cursor: not-allowed; }

/* Titres : un mot très long (nom de course sans espace) passe à la ligne au lieu de déborder sur mobile */
h1, h2, h3, h4, .card-title {
    overflow-wrap: anywhere;
}

/* Sélecteur de coureur (administrateur) : carte du coureur actif + bouton « Changer » */
.runner-card-mini {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.5rem 0.6rem; border-radius: 8px; background: rgba(255, 255, 255, 0.08);
}
.runner-card-mini__text { display: flex; flex-direction: column; min-width: 0; }
.runner-card-mini__name { color: #fff; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner-card-mini__meta { color: rgba(255, 255, 255, 0.65); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Choix d'un coureur (administrateur) : liste recherchable ; plein écran sur mobile (le clavier virtuel masque le reste) */
.tp-modal--picker { width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; }
.tp-picker__list { overflow-y: auto; min-height: 8rem; max-height: 50vh; display: flex; flex-direction: column; gap: 2px; }
.tp-picker__item {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
    width: 100%; padding: 0.5rem 0.75rem; text-align: left;
    border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--tp-ink);
}
.tp-picker__item.is-active, .tp-picker__item:hover { background: var(--tp-surface-alt); border-color: var(--tp-line); }
.tp-picker__item.is-current { border-color: var(--tp-accent-text); }
.tp-picker__name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.tp-focus-sentinel { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.tp-picker__meta { font-size: 0.8rem; color: var(--tp-muted); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
    .tp-modal--picker { inset: 0; top: 0; left: 0; transform: none; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
    .tp-picker__list { flex: 1; max-height: none; }
}
