/*
  SynapSIM : feuille de style de l'application.
  Mobile d'abord : les règles de base visent le téléphone, les media queries élargissent.
  Charte tirée du logo SynapSIM : bleu pétrole et gris (typographie à confirmer, docs/HYPOTHESES.md).
  Paliers : < 768 px barre en bas · 768 à 1199 px barre latérale · ≥ 1200 px barre en haut.
*/

:root {
    --petrole: #0a6488;
    --petrole-fonce: #074a66;
    --petrole-clair: #e6f0f4;
    --gris: #979696;
    --gris-fonce: #5f6366;
    --gris-clair: #f3f4f5;
    --bordure: #dfe2e4;
    --texte: #1f2a30;
    --fond: #ffffff;
    --danger: #b3261e;
    --danger-fond: #fbeaea;
    --texte-desactive: #c3c9cc;

    /* Couleurs de surface : redéfinies pour le thème sombre plus bas. */
    --sur-petrole: #ffffff;
    --page-haut: #f8fafb;
    --page-bas: #eef3f5;
    --entete-fond: rgba(255, 255, 255, 0.92);
    --carte-bordure: rgba(15, 45, 60, 0.06);
    --carte-ombre: 0 12px 32px rgba(15, 45, 60, 0.06), 0 1px 3px rgba(15, 45, 60, 0.04);
    --lien-ombre: 0 8px 24px rgba(15, 45, 60, 0.05);
    --lien-ombre-survol: 0 12px 28px rgba(15, 45, 60, 0.08);
    --flottant-ombre: 0 12px 32px rgba(31, 42, 48, 0.16);
    --public-ombre: 0 24px 60px rgba(15, 45, 60, 0.09), 0 2px 6px rgba(15, 45, 60, 0.05);
    --ok-fond: #e3f4ea;
    --ok-texte: #1e6b41;
    /* Voyage en cours (revue de Pascal, point 30) : fond vert foncé, texte blanc. */
    --vert-fonce: #1e6b41;
    --attente-fond: #fff4d6;
    --attente-texte: #6b4e00;
    --alerte-bordure: #f1d9a8;
    --alerte-fond: #fffaf0;
    --alerte-texte: #7a4b00;
    --motif: rgba(10, 100, 136, 0.09);
    --halo-petrole: rgba(10, 100, 136, 0.16);
    --halo-gris: rgba(151, 150, 150, 0.2);

    color-scheme: light dark;

    --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rayon: 12px;
    --ombre: 0 1px 3px rgba(31, 42, 48, 0.12);

    --entete-hauteur: 56px;
    --barre-bas-hauteur: 64px;
    --barre-laterale-largeur: 220px;
    --barre-laterale-reduite: 72px;
    --zone-tactile: 44px;
}

/* ------------------------------------------------------------------------------------------------
   Thème sombre : suit le réglage du système ou du navigateur (prefers-color-scheme). Mêmes repères
   qu'en clair ; le bleu pétrole s'éclaircit pour rester lisible sur fond sombre.
------------------------------------------------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
    :root {
        --petrole: #4db3dc;
        --petrole-fonce: #9ad7f0;
        --petrole-clair: #173a4b;
        --gris: #7d8a91;
        --gris-fonce: #a9b5bc;
        --gris-clair: #0e161b;
        --bordure: #2b3b45;
        --texte: #e6edf1;
        --fond: #16222a;
        --danger: #f28b82;
        --danger-fond: #3a1d1c;
        --texte-desactive: #5e6d76;
        --ombre: 0 1px 3px rgba(0, 0, 0, 0.4);

        --sur-petrole: #04202c;
        --page-haut: #111c22;
        --page-bas: #0b1317;
        --entete-fond: rgba(22, 34, 42, 0.92);
        --carte-bordure: rgba(255, 255, 255, 0.06);
        --carte-ombre: 0 12px 32px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
        --lien-ombre: 0 8px 24px rgba(0, 0, 0, 0.3);
        --lien-ombre-survol: 0 12px 28px rgba(0, 0, 0, 0.45);
        --flottant-ombre: 0 12px 32px rgba(0, 0, 0, 0.55);
        --public-ombre: 0 24px 60px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
        --ok-fond: #15382a;
        --ok-texte: #8fdcae;
        --vert-fonce: #1f7a4a;
        --attente-fond: #3a2f12;
        --attente-texte: #f1cf7a;
        --alerte-bordure: #6b5320;
        --alerte-fond: #2a2414;
        --alerte-texte: #f1cf7a;
        --motif: rgba(77, 179, 220, 0.08);
        --halo-petrole: rgba(77, 179, 220, 0.12);
        --halo-gris: rgba(169, 181, 188, 0.08);
    }

    /* Coche de la liste des pays : trait sombre sur le pétrole clair. */
    .country-options input:checked + label::after {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%2304202c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }

    /* :root pour passer devant la règle de base, écrite plus bas dans le fichier. */
    :root .public-card .button-primary {
        background: var(--petrole);
        box-shadow: none;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--police);
    font-size: 16px;
    line-height: 1.5;
    color: var(--texte);
    background: var(--gris-clair);
}

/* Les champs à 16 px minimum : sinon iOS zoome à la saisie. */
input,
select,
textarea,
button {
    font: inherit;
    font-size: max(16px, 1em);
}

/* Un élément masqué le reste, même si sa classe lui donne un display (bouton caché par un script). */
[hidden] {
    display: none !important;
}

a {
    color: var(--petrole);
}

h1 {
    font-size: 1.5rem;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    color: var(--petrole-fonce);
}

h2 {
    font-size: 1.125rem;
    margin: 0 0 0.5rem;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    flex: none;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--petrole);
    color: var(--sur-petrole);
}

.skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

:focus-visible {
    outline: 3px solid var(--petrole);
    outline-offset: 2px;
}

/* ---------- En-tête ---------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: calc(var(--entete-hauteur) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
    background: var(--fond);
    border-bottom: 1px solid var(--bordure);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--zone-tactile);
    text-decoration: none;
}

.app-logo {
    height: 28px;
    width: auto;
}

.app-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-width: var(--zone-tactile);
    min-height: var(--zone-tactile);
    padding: 0 0.5rem;
    border-radius: 999px;
    color: var(--gris-fonce);
    text-decoration: none;
}

.app-profile:hover {
    background: var(--gris-clair);
}

/* Le petit bonhomme du Profil, en bleu SynapSIM (revue de Pascal, point 25). */
.app-profile-user {
    color: var(--petrole);
}

/* « Profil » en icône seule, sur tous les écrans (28/09/2026) : le nom reste dans aria-label. */
.app-profile-label {
    display: none;
}

/* ---------- Contenu ---------- */

.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
}

.app-main:focus {
    outline: none;
}

/* Connecté, application et Console, sur tous les écrans : seul le contenu défile, dans son cadre (.app-scroll) ;
   la barre du haut et la barre de navigation (en bas au téléphone, à gauche sur PC) ne bougent jamais
   (retours de Lucas du 01/10/2026 pour la Console, du 03/10/2026 pour l'application : elles partaient avec la page). */
body.app-connected {
    overflow: hidden;
    overscroll-behavior: none;
}

/* Écran d'accueil de l'iPhone (retour de Lucas du 02/10/2026) : sur une page plus courte que l'écran,
   le cadre n'avait rien à faire défiler et le geste emportait toute la page, barres comprises ; seule
   une page longue (Administration) restait en place. Le contenu dépasse donc toujours le cadre d'un
   pixel : le geste reste dans le cadre, sur toutes les pages. */
:root:has(> body.app-connected) {
    overscroll-behavior: none;
}

.app-connected .app-main {
    min-height: calc(100% + 1px);
}

.app-connected .app-scroll {
    position: fixed;
    top: calc(var(--entete-hauteur) + env(safe-area-inset-top));
    right: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--bordure) transparent;
}

/* Barre de défilement du cadre : discrète, comme celles des listes (sur PC surtout). */
.app-connected .app-scroll::-webkit-scrollbar {
    width: 8px;
}

.app-connected .app-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.app-connected .app-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--bordure) padding-box;
}

.app-connected .app-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--gris) padding-box;
}

/* Au téléphone, le cadre s'arrête au-dessus de la barre du bas : la barre de défilement va d'une barre
   à l'autre, comme sur PC, au lieu de passer derrière la barre du bas. */
@media (max-width: 767.98px) {
    .app-connected .app-scroll {
        bottom: calc(var(--barre-bas-hauteur) + env(safe-area-inset-bottom) + 1px);
    }

    .app-connected .app-main {
        padding-bottom: 1.5rem;
    }
}

@media (min-width: 768px) {
    /* Dans le cadre, 100 % est la largeur utile (sans la barre de défilement), pas 100vw. */
    .app-connected .app-main {
        margin-left: calc(var(--barre-laterale-largeur) + max(0px, (100% - var(--barre-laterale-largeur) - 1200px) / 2));
    }

    body.nav-collapsed.app-connected .app-main {
        margin-left: calc(var(--barre-laterale-reduite) + max(0px, (100% - var(--barre-laterale-reduite) - 1200px) / 2));
    }
}

.card-list {
    display: grid;
    gap: 0.75rem;
}

.card {
    padding: 1rem;
    background: var(--fond);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
}

.card-title {
    color: var(--petrole-fonce);
}

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.5rem;
    border: 0;
    border-radius: var(--rayon);
    background: var(--petrole);
    color: var(--sur-petrole);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button-primary:hover {
    background: var(--petrole-fonce);
}

/* Téléphone : le bouton principal d'un formulaire est fixé en bas du cadre, au-dessus de la barre du bas. */
.form-actions {
    margin-top: 1.5rem;
}

.app-connected .form-actions {
    position: sticky;
    bottom: 0.75rem;
}

.form-actions .button-primary {
    width: 100%;
}

/* Deux boutons opposés : l'action secondaire à gauche, la principale à droite. Même largeur sur
   téléphone ; largeur du texte dès la tablette. */
.form-actions-split {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.form-actions-split > * {
    flex: 1;
}

.form-actions-split .button-primary {
    width: auto;
}

@media (min-width: 768px) {
    .form-actions-split > * {
        flex: none;
        min-width: 10rem;
    }
}

/* ---------- Formulaires ---------- */

.stack {
    display: grid;
    /* Une colonne qui ne s'élargit jamais au-delà de l'écran (ligne de tuiles qui défile de côté). */
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin: 1.25rem 0;
}

.stack-tight {
    margin: 0.75rem 0;
}

.field {
    display: grid;
    gap: 0.375rem;
    text-align: left;
}

.field-label {
    font-weight: 600;
}

.field-input {
    width: 100%;
    min-height: 48px;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--texte);
}

.field-input:focus {
    border-color: var(--petrole);
    outline: 3px solid var(--petrole-clair);
    outline-offset: 0;
}

/* Liste déroulante : même champ que les autres, flèche dessinée (couleur du thème) au lieu du rendu
   du système ; « Choisissez... » en gris tant que rien n'est choisi. */
select.field-input,
.select-button {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.75rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--gris-fonce) 50%),
        linear-gradient(135deg, var(--gris-fonce) 50%, transparent 50%);
    background-position:
        right 1.25rem center,
        right 0.875rem center;
    background-size: 0.375rem 0.375rem;
    background-repeat: no-repeat;
    cursor: pointer;
    text-overflow: ellipsis;
}

select.field-input:required:invalid {
    color: var(--gris-fonce);
}

select.field-input option {
    background: var(--fond);
    color: var(--texte);
}

/* Liste déroulante dessinée (select[data-select], site.js) : bouton au look du champ, liste ouverte
   comme le calendrier (carte flottante), choix aux couleurs du thème. */
.select-wrap {
    position: relative;
}

.select-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.select-button {
    display: flex;
    align-items: center;
    text-align: left;
}

.select-button span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.select-button.is-empty {
    color: var(--gris-fonce);
}

.select-wrap.is-open .select-button {
    border-color: var(--petrole);
}

.select-list {
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.375rem);
    right: 0;
    left: 0;
    max-height: min(20rem, 60vh);
    margin: 0;
    padding: 0.375rem;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--bordure);
    border-radius: 16px;
    background: var(--fond);
    box-shadow: var(--flottant-ombre);
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--bordure) transparent;
}

.select-list[hidden] {
    display: none;
}

.select-list:focus {
    outline: none;
}

.select-list [role="option"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--zone-tactile);
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--rayon) - 2px);
    color: var(--texte);
    cursor: pointer;
}

.select-list [role="option"].is-active {
    background: var(--gris-clair);
}

.select-list [role="option"][aria-selected="true"] {
    color: var(--petrole);
    font-weight: 600;
}

/* Coche du choix en cours. */
.select-list [role="option"][aria-selected="true"]::after {
    content: "";
    flex: none;
    width: 0.375rem;
    height: 0.75rem;
    margin-right: 0.25rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-2px);
}

.field-help {
    font-size: 0.875rem;
    color: var(--gris-fonce);
}

/* Façons de trouver l'EID, sous le champ de la demande d'eSIM. */
.eid-ways p,
.eid-ways ul {
    margin: 0 0 0.25rem;
}

.eid-ways ul {
    padding-left: 1.25rem;
}

.eid-ways p:last-child {
    margin-bottom: 0;
}

.field-error {
    font-size: 0.875rem;
    color: var(--danger);
}

.field-error:empty {
    display: none;
}

.button-block {
    width: 100%;
}

.button-secondary,
.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.5rem;
    border: 1px solid var(--petrole);
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--petrole);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button-secondary:hover {
    background: var(--petrole-clair);
}

.button-secondary:disabled {
    border-color: var(--bordure);
    color: var(--gris);
    cursor: default;
    background: var(--fond);
}

.button-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.link-quiet {
    color: var(--gris-fonce);
}

.text-quiet {
    color: var(--gris-fonce);
}

.notice {
    padding: 0.875rem 1rem;
    border-radius: var(--rayon);
    background: var(--petrole-clair);
    color: var(--petrole-fonce);
    text-align: left;
}

.notice p {
    margin: 0 0 0.5rem;
}

.notice p:last-child {
    margin-bottom: 0;
}

.notice-error {
    background: var(--danger-fond);
    color: var(--danger);
}

.choice-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 56px;
    padding: 0 1rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    cursor: pointer;
    text-align: left;
}

.choice input {
    width: 20px;
    height: 20px;
    accent-color: var(--petrole);
}

.choice:has(input:checked) {
    border-color: var(--petrole);
    background: var(--petrole-clair);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Code à 6 chiffres : 6 cases (js/connexion.js), clavier numérique, collage accepté. */
.code-boxes {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.code-box {
    width: 100%;
    max-width: 52px;
    height: 60px;
    padding: 0;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--texte);
    font-size: 1.625rem;
    font-weight: 700;
    text-align: center;
}

.code-box:focus {
    border-color: var(--petrole);
    outline: 3px solid var(--petrole-clair);
    outline-offset: 0;
}

.code-single {
    font-size: 1.5rem;
    letter-spacing: 0.4em;
    text-align: center;
}

.page-narrow {
    max-width: 560px;
}

/* Dans l'application, une page étroite (Profil, Signaler un incident) est centrée, comme les guides ; la
   Console garde ses pages calées à gauche (retour de Lucas du 03/10/2026). */
body:not(.console) .page-narrow {
    margin-inline: auto;
}

.definition-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

/* Carte du profil : bouton « Modifier » en haut à droite. */
.profile-card {
    position: relative;
}

.card-action {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: var(--zone-tactile);
    padding: 0 0.875rem 0 0.625rem;
    border: 1px solid var(--bordure);
    border-radius: 999px;
    background: var(--fond);
    color: var(--petrole);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.card-action .icon {
    width: 18px;
    height: 18px;
}

.card-action:hover {
    border-color: var(--petrole);
    background: var(--petrole-clair);
}

.definition-list div {
    display: grid;
    gap: 0.125rem;
}

.definition-list dt {
    font-size: 0.875rem;
    color: var(--gris-fonce);
}

.definition-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* ---------- Pages publiques : connexion, code ---------- */

.app-public {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(180deg, var(--page-haut) 0%, var(--page-bas) 100%);
    background-attachment: fixed;
}

/* La carte porte le logo SynapSIM : pas d'en-tête en double. */
.app-public .app-header {
    display: none;
}

.public-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    /* Trame de points presque invisible, qui s'efface vers le bas. */
    background-image: radial-gradient(var(--motif) 1px, transparent 1.2px);
    background-size: 24px 24px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.25) 50%, transparent 90%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.25) 50%, transparent 90%);
}

/* Deux halos très doux, bleu pétrole et gris, qui respirent lentement. */
.public-backdrop::before,
.public-backdrop::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
}

.public-backdrop::before {
    width: 70vmax;
    height: 70vmax;
    top: -34vmax;
    right: -26vmax;
    background: radial-gradient(circle, var(--halo-petrole) 0%, transparent 65%);
    animation: public-glow 16s ease-in-out infinite alternate;
}

.public-backdrop::after {
    width: 60vmax;
    height: 60vmax;
    bottom: -30vmax;
    left: -26vmax;
    background: radial-gradient(circle, var(--halo-gris) 0%, transparent 65%);
    animation: public-glow 20s ease-in-out infinite alternate-reverse;
}

@keyframes public-glow {
    from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
    to { transform: translate3d(-3vmax, 2vmax, 0) scale(1.06); opacity: 1; }
}

@keyframes public-rise {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.app-public .app-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(1.5rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.public-card {
    width: 100%;
    max-width: 420px;
    padding: 2.25rem 1.5rem 1.75rem;
    text-align: center;
    background: var(--fond);
    border: 1px solid var(--carte-bordure);
    border-radius: 24px;
    box-shadow: var(--public-ombre);
    animation: public-rise 0.45s ease-out both;
}

.public-card h1 {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
}

.public-logo {
    display: block;
    width: 100%;
    max-width: 250px;
    height: auto;
    margin: 0 auto 0.75rem;
}

.public-tagline {
    margin: 0 0 1.5rem;
    color: var(--gris-fonce);
    font-size: 0.9375rem;
}

.public-card .stack {
    margin: 1rem 0;
}

.public-card .field-input {
    min-height: 52px;
    background: var(--gris-clair);
    border-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.public-card .field-input:focus {
    background: var(--fond);
    border-color: var(--petrole);
}

.public-card .button-primary {
    min-height: 52px;
    background: linear-gradient(135deg, #0b6e95 0%, var(--petrole) 60%, #085a7b 100%);
    box-shadow: 0 6px 16px rgba(10, 100, 136, 0.2);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.public-card .button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(10, 100, 136, 0.26);
}

.public-card .button-primary:active {
    transform: translateY(0);
}

.public-links {
    display: grid;
    gap: 0.875rem;
    justify-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bordure);
}

.public-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--gris-fonce);
}

.public-footer a {
    color: var(--petrole);
}

/* Langue des pages publiques (connexion, code, À propos, décision du manager). */
.language-switch {
    display: flex;
    flex-basis: 100%;
    justify-content: center;
    gap: 0.25rem 1rem;
}

.language-switch a {
    display: inline-flex;
    align-items: center;
    min-height: var(--zone-tactile);
    padding: 0 0.25rem;
    text-decoration: none;
}

.language-switch a.is-current {
    font-weight: 700;
    color: var(--texte);
    text-decoration: underline;
    text-underline-offset: 4px;
}


@media (min-width: 768px) {
    .public-card {
        padding: 2.75rem 2.5rem 2.25rem;
    }
}

/* ---------- Partie connectée : accueil, historique, voyages ---------- */

.app-connected {
    background: linear-gradient(180deg, var(--page-haut) 0%, var(--page-bas) 100%);
    background-attachment: fixed;
}

.app-connected .app-header {
    background: var(--entete-fond);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    backdrop-filter: saturate(160%) blur(10px);
}

.app-connected .card {
    border: 1px solid var(--carte-bordure);
    border-radius: 20px;
    box-shadow: var(--carte-ombre);
}

.page-head {
    margin: 0.25rem 0 1rem;
}

.page-head h1 {
    margin-bottom: 0.125rem;
}

.page-head p {
    margin: 0;
}

.small {
    font-size: 0.875rem;
}

.notice-row {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.notice-row .button-secondary {
    justify-self: start;
    min-height: 44px;
}

.eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gris-fonce);
}

.country-card {
    padding: 1.5rem 1.25rem;
    margin-bottom: 1rem;
}

.country-line {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.country-name {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--texte);
}

.country-operator {
    margin: 0.125rem 0 0;
    font-size: 0.9375rem;
    color: var(--gris-fonce);
}

.flag {
    display: inline-block;
    flex: none;
    border-radius: 4px;
    object-fit: cover;
    vertical-align: middle;
}

.flag-sm { width: 24px; height: 18px; }
.flag-md { width: 32px; height: 24px; }
.flag-lg { width: 56px; height: 42px; border-radius: 6px; }

.flag-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--petrole-clair);
    color: var(--petrole);
    font-size: 0.625rem;
    font-weight: 700;
}

.flag-lg.flag-fallback {
    font-size: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 0.625rem;
    border-radius: 999px;
    background: var(--gris-clair);
    color: var(--gris-fonce);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ok {
    background: var(--ok-fond);
    color: var(--ok-texte);
}

.country-card .badge {
    margin: 1rem 0 0;
}

/* Conso centrée dans la carte (revue de Pascal, 29/09/2026). */
.usage-figure {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.375rem;
    margin: 1.25rem 0 0;
    color: var(--petrole);
}

.usage-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.usage-unit {
    font-size: 1.25rem;
    font-weight: 700;
}

.usage-caption {
    text-align: center;
    margin: 0.375rem 0 0;
    color: var(--gris-fonce);
}

.updated {
    text-align: center;
    margin: 1rem 0 0;
    font-size: 0.8125rem;
    color: var(--gris-fonce);
}

.app-connected .country-blocked {
    border-color: var(--alerte-bordure);
    background: linear-gradient(180deg, var(--alerte-fond) 0%, var(--fond) 60%);
}

.blocked-message {
    margin: 1rem 0 0.25rem;
    font-weight: 600;
    color: var(--alerte-texte);
}

.date-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
}

.date-pair .field {
    min-width: 0;
    /* Le champ du retour à la même hauteur que celui du départ, même quand le départ a une aide dessous. */
    align-content: start;
}

/* Sélecteur de date natif du téléphone, sans largeur imposée par le navigateur. */
input[type="date"].field-input {
    min-width: 0;
    max-width: 100%;
    -webkit-appearance: none;
    appearance: none;
}







.empty-state {
    display: grid;
    gap: 1rem;
    justify-items: start;
    color: var(--gris-fonce);
}

.empty-state p {
    margin: 0;
}

.country-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
}

/* Historique : cartes comme « Mes voyages » (retours du client du 02/10/2026), le volume à droite. */
.usage-amount {
    margin: 0;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--petrole);
}

.usage-amount span {
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Lignes de l'Historique : une seule carte par liste, une ligne par pays ou par voyage (retour de Lucas
   du 03/10/2026). Sur tous les écrans : dates et volume sur la première ligne, pays dessous (retour de
   Lucas du 05/10/2026, plus de pays à droite des dates sur PC). Un trait sous chaque ligne ; la carte coupe celui de la dernière,
   même pendant une recherche. */
.usage-rows {
    padding-block: 0;
    overflow: hidden;
}

.usage-rows:not(:has(> .usage-row:not([hidden]))) {
    display: none;
}

.usage-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "dates amount"
        "countries countries";
    align-items: center;
    gap: 0.375rem 0.75rem;
    margin-bottom: -1px;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--bordure);
}

.usage-row-dates {
    grid-area: dates;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    margin: 0;
    font-weight: 700;
}

.usage-row-countries {
    grid-area: countries;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.usage-row-countries li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.usage-row .usage-amount {
    grid-area: amount;
    justify-self: end;
}

.usage-row-total {
    grid-template-areas: "dates amount";
}

/* « Consommation totale du mois » à droite, juste avant le total (retour de Lucas du 06/10/2026). */
.usage-row-total .usage-row-dates {
    justify-content: flex-end;
    text-align: right;
}

.usage-country-go {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--gris-fonce);
}

.history-trips {
    margin-top: 2rem;
}

/* Recherche de l'historique : un pays et deux dates ; côte à côte sur PC, les dates sous le pays au
   téléphone et en tablette (champs date trop étroits sinon). */
.history-filters {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.history-filters[hidden],
.history-reset[hidden] {
    display: none;
}

.history-reset {
    justify-self: start;
}

@media (min-width: 1200px) {
    .history-filters {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: end;
    }
}

.trip-card {
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

.trip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Voyage que l'on peut effacer : l'étiquette et la poubelle l'une sous l'autre, à droite des dates et des
   pays ; les dates tiennent sur une ligne (retour de Lucas du 06/10/2026). */
.trip-card:has(.trip-hide) {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
}

.trip-card:has(.trip-hide) > .trip-head {
    display: contents;
}

.trip-card:has(.trip-hide) .trip-dates {
    grid-column: 1;
    grid-row: 1;
}

.trip-card:has(.trip-hide) > .trip-countries {
    grid-column: 1;
    grid-row: 2;
}

.trip-card:has(.trip-hide) > :not(.trip-head, .trip-countries) {
    grid-column: 1 / -1;
}

.trip-head-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.trip-card:has(.trip-hide) .trip-head-side {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.trip-dates {
    flex: 1;
    margin: 0;
    font-weight: 700;
    color: var(--texte);
}

/* Voyage en cours : toute la carte en vert foncé, texte blanc (revue de Pascal, point 30). */
.trip-card.is-current {
    background: var(--vert-fonce);
    color: #ffffff;
}

.trip-card.is-current .trip-dates,
.trip-card.is-current .text-quiet {
    color: #ffffff;
}

.trip-extend {
    justify-self: start;
}

.trip-card.is-current .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Poubelle d'un voyage terminé : 44 px au doigt, icône discrète. */
.trip-hide {
    margin: -0.5rem -0.5rem -0.5rem 0;
}

/* Sous l'étiquette : la zone tactile de 44 px ne remonte pas sur l'étiquette. */
.trip-head-side .trip-hide {
    margin-top: 0;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--zone-tactile);
    min-height: var(--zone-tactile);
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--gris-fonce);
    cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
    background: var(--gris-clair);
    color: var(--danger);
}

/* Voyages terminés : le bouton « Effacer » en face du titre, sous « Nouveau voyage ». */
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1.5rem 0 0.75rem;
}

.section-head .section-title {
    margin: 0;
}

.trips-hide-all {
    margin: 0;
}

/* Fenêtre de confirmation (effacer des voyages) : construite par site.js. */
.confirm-dialog {
    width: min(26rem, calc(100vw - 2rem));
    padding: 1.25rem;
    border: 0;
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--texte);
    box-shadow: var(--ombre);
}

.confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.confirm-dialog p {
    margin: 0 0 1.25rem;
    font-size: 1rem;
}

.confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Fenêtre d'information ouverte par un bouton « i » (data-dialog-open, site.js) : pays toujours autorisés. */
.info-dialog {
    width: min(30rem, calc(100vw - 2rem));
    max-height: min(36rem, calc(100vh - 2rem));
    padding: 1.25rem;
    border: 0;
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--texte);
    box-shadow: var(--flottant-ombre);
    overflow: auto;
}

.info-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.info-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: -0.5rem -0.5rem 0.5rem 0;
}

.info-dialog-head .card-title {
    margin: 0;
}

.info-dialog .icon-button:hover,
.info-dialog .icon-button:focus-visible {
    color: var(--texte);
}

.always-allowed-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.5rem 1rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.always-allowed-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-with-info {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--zone-tactile);
    min-height: var(--zone-tactile);
    margin: -0.75rem 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--petrole);
    cursor: pointer;
}

.info-button:hover,
.info-button:focus-visible {
    background: var(--petrole-clair);
}

/* Accueil : le voyage en cours, ses dates et sa durée. */
.home-trip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    font-weight: 600;
}

.home-trip .icon {
    flex: none;
    color: var(--petrole);
}

/* « Prolonger » en haut à droite de la carte du pays, comme « Modifier » du profil (H-172). */
.country-card {
    position: relative;
}

/* « Prolonger le séjour » est plus large : le titre garde sa place à gauche de la pastille ; au téléphone,
   la pastille est plus petite et le titre reste sur une ligne (retours de Lucas du 06/10/2026). */
.country-card:has(> .card-action) .eyebrow {
    padding-right: 11rem;
}

@media (max-width: 767.98px) {
    .country-card > .card-action {
        gap: 0.25rem;
        padding: 0 0.625rem 0 0.5rem;
        font-size: 0.8125rem;
    }

    .country-card > .card-action .icon {
        width: 16px;
        height: 16px;
    }

    .country-card:has(> .card-action) .eyebrow {
        padding-right: 9.25rem;
    }
}

/* Téléphones étroits (360 à 384 px) : plus petite encore, toujours 44 px de haut pour le doigt. */
@media (max-width: 384.98px) {
    .country-card > .card-action {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0;
        padding: 0 0.4375rem 0 0.25rem;
        font-size: 0.75rem;
    }

    .country-card > .card-action .icon {
        width: 14px;
        height: 14px;
    }

    .country-card:has(> .card-action) .eyebrow {
        padding-right: 7.5rem;
    }
}

/* Voyage en cours que la carte du pays ne montre pas : la pastille sous la carte (H-172). */
.home-extend {
    display: flex;
    justify-content: center;
    margin: 0 0 1rem;
}

.home-extend .card-action {
    position: static;
}

/* Champ obligatoire : astérisque rouge après le libellé (le champ porte aussi « required »). */
.field-required {
    margin-left: 0.25rem;
    color: var(--danger);
    font-weight: 700;
}

/* Détail d'un voyage (motif du manager), replié par défaut. */
.trip-details {
    margin-top: 0.75rem;
    border-top: 1px solid var(--bordure);
    padding-top: 0.5rem;
}

.trip-details summary {
    display: flex;
    align-items: center;
    min-height: var(--zone-tactile);
    color: var(--petrole);
    font-weight: 600;
    cursor: pointer;
}

.trip-card.is-current .trip-details {
    border-top-color: rgba(255, 255, 255, 0.3);
}

.trip-card.is-current .trip-details summary {
    color: inherit;
}

.trip-details-list {
    margin: 0.25rem 0 0;
}

.trip-details-list dt {
    font-size: 0.875rem;
    color: var(--gris-fonce);
}

.trip-card.is-current .trip-details-list dt {
    color: inherit;
    opacity: 0.85;
}

.trip-details-list dd {
    margin: 0.125rem 0 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.trip-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trip-countries li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.trip-card .small {
    margin: 0;
}

@media (min-width: 768px) {

    .country-card {
        padding: 2rem;
    }
}

/* ---------- Page d'erreur ---------- */

.error-page {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem 1.25rem;
    text-align: center;
    background: var(--fond);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
}

.error-text {
    color: var(--gris-fonce);
}

.error-correlation {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.875rem;
    color: var(--gris-fonce);
    user-select: all;
}

/* ---------- Navigation : téléphone (< 768 px), barre fixe en bas ---------- */

.app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: var(--fond);
    border-top: 1px solid var(--bordure);
    padding-bottom: env(safe-area-inset-bottom);
}

.app-nav-toggle {
    display: none;
}

.app-nav-list {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-nav-list > li {
    flex: 1 1 0;
    min-width: 0;
}

.app-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--barre-bas-hauteur);
    min-width: var(--zone-tactile);
    padding: 0 0.25rem;
    color: var(--gris-fonce);
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.app-nav-label {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* iPhone SE (375 px) : « Nouveau voyage » passe sur deux lignes plutôt que d'être tronqué. */
@media (max-width: 767.98px) {
    .app-nav-label {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.app-nav-item.is-active {
    color: var(--petrole);
    font-weight: 600;
}

/* ---------- Tablette et PC (≥ 768 px) : barre latérale à gauche, repliable en icônes ---------- */
/* Plus de barre en haut sur PC (28/09/2026) : la même barre latérale que la tablette. */

@media (min-width: 768px) {
    .app-nav {
        top: var(--entete-hauteur);
        right: auto;
        bottom: 0;
        width: var(--barre-laterale-largeur);
        border-top: 0;
        border-right: 1px solid var(--bordure);
        padding: 0.5rem 0 env(safe-area-inset-bottom);
    }

    /* Animation au clic seulement : l'état replié est rendu par le serveur, rien ne bouge au chargement. */
    body.nav-animate .app-nav {
        transition: width 0.15s ease;
    }

    .app-nav {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .app-nav-item,
    .app-nav-toggle {
        white-space: nowrap;
    }

    /* À l'ouverture, les libellés apparaissent en fondu une fois la barre presque dépliée. */
    body.nav-animate:not(.nav-collapsed) .app-nav-label {
        animation: nav-label-in 0.2s ease 0.08s both;
    }

    @keyframes nav-label-in {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Même forme qu'un lien du menu, en plus discret ; icône dans la même colonne que les autres. */
    .app-nav-toggle {
        display: flex;
        flex: none;
        align-items: center;
        gap: 0.75rem;
        height: 44px;
        margin: 0.25rem 0.5rem 0.25rem;
        padding: 0 0.875rem;
        border: 0;
        border-radius: var(--rayon);
        background: transparent;
        color: var(--gris-fonce);
        font-size: 0.875rem;
        text-align: left;
        cursor: pointer;
    }

    .app-nav-toggle:hover {
        background: var(--gris-clair);
        color: var(--petrole);
    }

    .app-nav-toggle .icon {
        transition: transform 0.15s ease;
    }

    body.nav-collapsed .app-nav-toggle .icon {
        transform: rotate(180deg);
    }

    .app-nav-list {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0 0.5rem;
    }

    .app-nav-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
        height: 48px;
        padding: 0 0.875rem;
        border-radius: var(--rayon);
        font-size: 0.9375rem;
    }

    .app-nav-item:hover {
        background: var(--gris-clair);
    }

    .app-nav-item.is-active {
        background: var(--petrole-clair);
    }

    .app-connected .app-main {
        padding-bottom: 1.5rem;
    }

    .app-connected .form-actions {
        position: static;
    }

    .form-actions .button-primary {
        width: auto;
    }

    .card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.nav-collapsed .app-nav {
        width: var(--barre-laterale-reduite);
    }

    body.nav-collapsed .app-nav-label {
        display: none;
    }
}

/* ---------- PC (≥ 1200 px) : mêmes repères que la tablette, logos plus grands, trois colonnes ---------- */

@media (min-width: 1200px) {
    .app-logo {
        height: 32px;
    }

    .app-connected .app-main {
        padding-bottom: 2rem;
    }

    .card-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* D'une page à l'autre (retour de Lucas du 02/10/2026) : la page affichée reste jusqu'à ce que la
   suivante soit prête, puis le contenu passe en fondu court, sans écran blanc ni saut ; la barre du
   haut et la navigation ne bougent pas. Navigateurs sans View Transitions : changement direct. */
@view-transition {
    navigation: auto;
}

.app-header {
    view-transition-name: app-header;
}

.app-nav {
    view-transition-name: app-nav;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.18s;
}

::view-transition-old(app-header),
::view-transition-new(app-header),
::view-transition-old(app-nav),
::view-transition-new(app-nav) {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }
}

/* ---------- Voyages (lot L4) : demande, récapitulatif, décision du manager ---------- */

.page-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.section-title {
    margin: 1.5rem 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gris-fonce);
}

.notice-success {
    margin-bottom: 1rem;
    background: var(--ok-fond);
    color: var(--ok-texte);
}

.notice-card {
    display: grid;
    gap: 1rem;
    justify-items: start;
}

.notice-card p {
    margin: 0;
}

.trip-form,
.trip-recap {
    padding: 1.25rem;
}

.trip-recap .card-title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
}

.recap-list {
    display: grid;
    gap: 0;
    margin: 0 0 1.25rem;
}

.recap-list > div {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--bordure);
}

.recap-list > div:last-child {
    border-bottom: 0;
}

.recap-list dt {
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gris-fonce);
}

.recap-list dd {
    margin: 0;
    color: var(--texte);
    overflow-wrap: anywhere;
}

.recap-list .badge {
    margin-left: 0.5rem;
}

/* Liste des pays : cases à cocher avec drapeau ; recherche ajoutée par js/voyages.js. */
.country-picker {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.country-picker .field-help,
.country-count {
    margin: 0;
}

.country-options {
    display: grid;
    /* Peu de pays trouvés : collés en haut, sans étirer les lignes sur la hauteur minimale. */
    align-content: start;
    gap: 0.375rem;
    /* Hauteur ajustée à l'écran par js/voyages.js (toute la place libre, sans faire défiler la page). */
    max-height: 22rem;
    min-height: 10rem;
    margin: 0;
    padding: 0.25rem;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--gris-clair);
    overscroll-behavior: contain;
}

.country-options li[hidden] {
    display: none;
}

.country-options label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--zone-tactile);
    padding: 0.375rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--fond);
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s, border-color 0.15s;
}

.country-options label > span {
    flex: 1;
    min-width: 0;
}

.country-options label:hover {
    border-color: var(--bordure);
}

/* Case native masquée (toujours au clavier et au lecteur d'écran) ; pastille à droite à la place. */
.country-options input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.country-options label::after {
    content: "";
    flex: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--bordure);
    border-radius: 50%;
    background: var(--fond) center / 14px no-repeat;
    transition: background-color 0.15s, border-color 0.15s;
}

.country-options input:checked + label::after {
    border-color: var(--petrole);
    background-color: var(--petrole);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Pays choisis, en pastilles au-dessus de la liste (js/voyages.js) : un clic en retire un. */
.country-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.country-chips:empty {
    display: none;
}

.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: var(--zone-tactile);
    padding: 0 0.5rem 0 0.75rem;
    border: 0;
    border-radius: 999px;
    background: var(--petrole);
    color: var(--sur-petrole);
    font-size: 0.9375rem;
    cursor: pointer;
}

.country-chip::after {
    content: "\00d7";
    font-size: 1.125rem;
    line-height: 1;
    opacity: 0.8;
}

.country-chip:hover {
    background: var(--petrole-fonce);
}

.country-options li {
    position: relative;
}

.country-options input:checked + label {
    border-color: var(--petrole);
    background: var(--petrole-clair);
    font-weight: 600;
}

.country-options input:focus-visible + label {
    outline: 3px solid var(--petrole);
    outline-offset: 1px;
}

.badge-wait {
    background: var(--attente-fond);
    color: var(--attente-texte);
}

.badge-no {
    background: var(--danger-fond);
    color: var(--danger);
}

.badge-quiet {
    background: var(--gris-clair);
    color: var(--gris-fonce);
}

.trip-card.is-closed {
    opacity: 0.8;
}

/* Page de décision du manager : demande résumée, choix présélectionné, confirmation animée. */
.decision-card .recap-list {
    margin-top: 1rem;
}

.decision-done {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    text-align: center;
}

.decision-done p {
    margin: 0;
}

.decision-mark {
    width: 72px;
    height: 72px;
    margin-bottom: 0.25rem;
}

.decision-circle {
    fill: none;
    stroke: var(--petrole);
    stroke-width: 3;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: decision-draw 0.6s ease-out forwards;
}

.decision-check {
    fill: none;
    stroke: var(--petrole);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: decision-draw 0.4s 0.5s ease-out forwards;
}

.decision-done.is-refused .decision-circle,
.decision-done.is-refused .decision-check {
    stroke: var(--gris-fonce);
}

@keyframes decision-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .decision-circle,
    .decision-check {
        animation: none;
        stroke-dashoffset: 0;
    }
}

/* ---------- Envoi en cours : le bouton appuyé le montre tout de suite (js/site.js) ---------- */

button.is-loading {
    cursor: progress;
    opacity: 0.9;
}

button.is-loading::before {
    content: "";
    flex: none;
    width: 1.05em;
    height: 1.05em;
    margin-right: 0.6em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: bouton-attente 0.7s linear infinite;
}

.button-primary.is-loading,
.button-primary.is-loading:disabled {
    background: var(--petrole-fonce);
    color: var(--sur-petrole);
}

@keyframes bouton-attente {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    button.is-loading::before {
        animation-duration: 2s;
    }
}

/* Champ imposé (Compte sans approbateur) : visible, grisé, non modifiable. */
.field-input:disabled {
    background: var(--gris-clair);
    color: var(--gris-fonce);
    border-color: var(--bordure);
    cursor: not-allowed;
    opacity: 1;
}

.field-input:disabled::placeholder {
    color: var(--gris-fonce);
}

.field .notice {
    margin-top: 0.5rem;
}

/* ------------------------------------------------------------------------------------------------
   Calendrier des dates de départ et de retour (js/calendrier.js), sur tous les écrans : sur
   téléphone, un mois sur toute la largeur, avec des jours de 44 px pour le doigt.
------------------------------------------------------------------------------------------------ */
.date-pair.has-calendar {
    position: relative;
}

.date-button {
    display: flex;
    min-width: 0;
    white-space: nowrap;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 48px;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--texte);
    text-align: left;
    cursor: pointer;
}

.date-button::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    background: var(--petrole);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.date-button:hover {
    border-color: var(--gris);
}

.date-button.is-active,
.date-button:focus-visible {
    border-color: var(--petrole);
    outline: 3px solid var(--petrole-clair);
    outline-offset: 0;
}

.date-button .is-empty {
    color: var(--gris-fonce);
}

.date-button span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Taille naturelle, calé sur le bord gauche du champ cliqué (départ ou retour). */
.calendar {
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.5rem);
    left: 0;
    padding: 1rem;
    border: 1px solid var(--bordure);
    border-radius: 16px;
    background: var(--fond);
    box-shadow: var(--flottant-ombre);
}

.calendar[hidden] {
    display: none;
}

/* Retour : début du second champ (moitié du bloc plus la moitié de l'espace entre les champs),
   sans dépasser à droite quand le champ est étroit. */
.calendar.is-end {
    left: min(calc(50% + 0.375rem), calc(100% - var(--calendrier-largeur, 0px)));
}

.calendar-months {
    display: flex;
    gap: 1.5rem;
}

.calendar-months > div {
    flex: 1;
    min-width: 0;
}

.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.calendar-title {
    flex: 1;
    font-weight: 600;
    text-align: center;
}

/* Mois et année cliquables : vue des mois, puis des années (H-170). */
button.calendar-title {
    flex: 0 1 auto;
    min-height: 36px;
    margin: 0 auto;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--texte);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button.calendar-title::after {
    content: "";
    display: inline-block;
    width: 0.4em;
    height: 0.4em;
    margin: 0 0 0.2em 0.5em;
    border-right: 2px solid var(--petrole);
    border-bottom: 2px solid var(--petrole);
    transform: rotate(45deg);
}

button.calendar-title:hover {
    background: var(--petrole-clair);
}

button.calendar-title:focus-visible {
    outline: 3px solid var(--petrole);
    outline-offset: 1px;
}

.calendar-picks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.calendar-pick {
    min-height: 48px;
    padding: 0 0.25rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--texte);
    font: inherit;
    font-size: 0.9375rem;
    cursor: pointer;
}

.calendar-pick:hover:not(:disabled) {
    background: var(--petrole-clair);
}

.calendar-pick.is-today {
    box-shadow: inset 0 0 0 1px var(--petrole);
}

.calendar-pick.is-current {
    background: var(--petrole);
    color: var(--sur-petrole);
    font-weight: 600;
}

.calendar-pick:disabled {
    color: var(--texte-desactive);
    cursor: default;
}

.calendar-pick:focus-visible {
    outline: 3px solid var(--petrole);
    outline-offset: 1px;
}

.calendar-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--petrole);
    font-size: 1.25rem;
    cursor: pointer;
}

.calendar-nav:hover:not(:disabled) {
    background: var(--petrole-clair);
}

.calendar-nav:disabled {
    color: var(--texte-desactive);
    cursor: default;
}

.calendar-nav.is-placeholder {
    visibility: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 40px);
    row-gap: 2px;
}

.calendar-weekday {
    padding: 0.25rem 0;
    color: var(--gris-fonce);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--texte);
    font-size: 0.9375rem;
    cursor: pointer;
}

.calendar-day span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.calendar-day:hover:not(:disabled) span {
    background: var(--petrole-clair);
}

.calendar-day.is-today span {
    box-shadow: inset 0 0 0 1px var(--petrole);
}

.calendar-day:disabled {
    color: var(--texte-desactive);
    cursor: default;
}

.calendar-day.in-range {
    background: var(--petrole-clair);
}

.calendar-day.is-start {
    background: linear-gradient(90deg, transparent 50%, var(--petrole-clair) 50%);
}

.calendar-day.is-end {
    background: linear-gradient(90deg, var(--petrole-clair) 50%, transparent 50%);
}

.calendar-day.is-start.is-end {
    background: transparent;
}

.calendar-day.is-start span,
.calendar-day.is-end span {
    background: var(--petrole);
    color: var(--sur-petrole);
    font-weight: 600;
}

.calendar-day:focus-visible {
    outline: none;
}

.calendar-day:focus-visible span {
    outline: 3px solid var(--petrole);
    outline-offset: 1px;
}

.calendar-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bordure);
    color: var(--gris-fonce);
    font-size: 0.875rem;
}

.calendar-foot button {
    min-height: 36px;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--petrole);
    color: var(--sur-petrole);
    font-weight: 600;
    cursor: pointer;
}

/* Tablette et téléphone : jours, flèches et bouton du calendrier de 44 px (01, zones tactiles, B24). */
@media (max-width: 1199.98px) {
    button.calendar-title {
        min-height: var(--zone-tactile);
    }

    .calendar-grid {
        grid-template-columns: repeat(7, var(--zone-tactile));
    }

    .calendar-day {
        height: var(--zone-tactile);
    }

    .calendar-nav {
        width: var(--zone-tactile);
        height: var(--zone-tactile);
    }

    .calendar-foot button {
        min-height: var(--zone-tactile);
    }
}

@media (max-width: 599.98px) {
    /* Deux boutons côte à côte sur 390 px : sans l'icône, « Choisir une date » tient sur une ligne. */
    .date-button {
        padding: 0.625rem 0.75rem;
    }

    .date-button::before {
        display: none;
    }

    .calendar,
    .calendar.is-end {
        left: 0;
        right: 0;
        padding: 0.75rem;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .calendar-day {
        height: var(--zone-tactile);
    }

    .calendar-day span {
        width: 40px;
        height: 40px;
    }

    .calendar-nav {
        width: var(--zone-tactile);
        height: var(--zone-tactile);
    }

    .calendar-foot button {
        min-height: var(--zone-tactile);
    }
}

/* ------------------------------------------------------------------------------------------------
   Choix de la langue : tuiles dans le profil, pastilles en pied des pages publiques.
------------------------------------------------------------------------------------------------ */
.language-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.language-options legend {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
    padding: 0;
}

.language-option {
    position: relative;
}

.language-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.language-option label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 52px;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.language-option label:hover {
    border-color: var(--gris);
}

.language-option .language-code {
    color: var(--gris-fonce);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.language-option input:checked + label {
    border-color: var(--petrole);
    background: var(--petrole-clair);
    font-weight: 600;
}

.language-option input:checked + label .language-code {
    color: var(--petrole);
}

.language-option input:focus-visible + label {
    outline: 3px solid var(--petrole);
    outline-offset: 1px;
}

.language-switch {
    flex-wrap: wrap;
    gap: 0.375rem;
}

.language-switch a {
    min-height: var(--zone-tactile);
    padding: 0 0.875rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.875rem;
}

.language-switch a:hover {
    border-color: var(--bordure);
    background: var(--fond);
}

.language-switch a.is-current {
    border-color: var(--petrole);
    background: var(--petrole);
    color: var(--sur-petrole);
    font-weight: 600;
    text-decoration: none;
}

/* ------------------------------------------------------------------------------------------------
   Nouvelle eSIM (/nouvelle-esim/{lien}) : EID ou photo.
------------------------------------------------------------------------------------------------ */
.eid-input {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    letter-spacing: 0.04em;
}

.or-separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    color: var(--gris-fonce);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.or-separator::before,
.or-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--bordure);
}

.file-input {
    padding: 0.5rem;
    cursor: pointer;
}

.file-input::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--petrole);
    border-radius: 999px;
    background: var(--fond);
    color: var(--petrole);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.file-input::file-selector-button:hover {
    background: var(--petrole-clair);
}

/* ------------------------------------------------------------------------------------------------
   Guides (/guides) : liste et pas à pas, connecté ou non.
------------------------------------------------------------------------------------------------ */
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Dans l'application, les guides sont centrés dans la page. */
.guide-page {
    margin-inline: auto;
}

.public-card.guide-card {
    max-width: 640px;
    text-align: left;
}

/* La liste défile seule ; sa hauteur est ajustée à l'écran par site.js ([data-fit-height]). */
.guide-list {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    margin: 1.25rem 0;
    padding: 0.25rem;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Console : liste qui défile seule (pays, comptes, voyages, demandes, journaux...), hauteur ajustée à l'écran par
   site.js ([data-fit-height]). Un peu de marge intérieure : bordures et contours de focus visibles. */
.scroll-panel {
    overflow-y: auto;
    padding: 0.25rem;
    margin: -0.25rem;
}

/* Arrivé en bas de la liste, la molette ne passe pas à la page ; seulement quand la liste défile
   vraiment (site.js) : sinon, la molette posée dessus ne ferait plus rien. */
.scroll-panel.is-overflowing {
    overscroll-behavior: contain;
}

/* Tableau dans une liste qui défile : l'en-tête reste visible en haut. « clip » (et non « hidden »)
   garde les coins arrondis sans faire du tableau un cadre de défilement, ce qui bloquerait « sticky ». */
.scroll-panel > .data-table {
    overflow: clip;
}

.scroll-panel > .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--fond);
}

/* Barres de défilement discrètes des listes qui défilent seules (guides, fenêtres d'information, listes de la Console). */
.guide-list,
.info-dialog,
.country-options,
.scroll-panel {
    scrollbar-width: thin;
    scrollbar-color: var(--bordure) transparent;
}

.guide-list::-webkit-scrollbar,
.info-dialog::-webkit-scrollbar,
.country-options::-webkit-scrollbar,
.scroll-panel::-webkit-scrollbar {
    width: 8px;
}

.guide-list::-webkit-scrollbar-track,
.info-dialog::-webkit-scrollbar-track,
.country-options::-webkit-scrollbar-track,
.scroll-panel::-webkit-scrollbar-track {
    background: transparent;
}

.guide-list::-webkit-scrollbar-thumb,
.info-dialog::-webkit-scrollbar-thumb,
.country-options::-webkit-scrollbar-thumb,
.scroll-panel::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--bordure) padding-box;
}

.guide-list::-webkit-scrollbar-thumb:hover,
.info-dialog::-webkit-scrollbar-thumb:hover,
.country-options::-webkit-scrollbar-thumb:hover,
.scroll-panel::-webkit-scrollbar-thumb:hover {
    background: var(--gris) padding-box;
}

.guide-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--carte-bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--texte);
    text-decoration: none;
    box-shadow: var(--lien-ombre);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.guide-link:hover {
    border-color: var(--petrole);
    box-shadow: var(--lien-ombre-survol);
}

.guide-link .icon {
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 12px;
    background: var(--petrole-clair);
    color: var(--petrole);
}

.guide-link > span {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}

.guide-back {
    margin: 0 0 1rem;
}

.guide-back a::before {
    content: "\2039";
    margin-right: 0.5rem;
}

.guide-summary {
    color: var(--gris-fonce);
}

.guide-steps {
    display: grid;
    gap: 0.875rem;
    margin: 1.25rem 0;
    padding: 0;
    list-style: none;
    counter-reset: etape;
}

.guide-steps li {
    position: relative;
    min-height: 32px;
    padding-left: 2.75rem;
    counter-increment: etape;
}

.guide-steps li::before {
    content: counter(etape);
    position: absolute;
    top: -2px;
    left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--petrole);
    color: var(--sur-petrole);
    font-size: 0.875rem;
    font-weight: 700;
}

.guide-tip {
    display: grid;
    gap: 0.25rem;
    margin: 0 0 1.25rem;
    text-align: left;
}

/* ------------------------------------------------------------------------------------------------
   Accueil : logo de l'entreprise à gauche du prénom et du nom (revue de Pascal, point 17).
------------------------------------------------------------------------------------------------ */

.home-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-head h1 {
    margin: 0;
}

.home-head p {
    margin: 0.125rem 0 0;
}

.home-logo img {
    display: block;
    width: auto;
    height: 44px;
    max-width: 200px;
    object-fit: contain;
    object-position: left center;
}

@media (prefers-color-scheme: dark) {
    .home-logo img:not(.has-dark) {
        padding: 4px 8px;
        border-radius: 8px;
        background: #dfe6ea;
    }
}

/* Sans logo : le nom de l'entreprise, à la hauteur du logo (H-105). */
.home-company-name {
    max-width: 200px;
    margin: 0;
    color: var(--petrole);
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 44px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-email {
    overflow-wrap: anywhere;
}

/* ---------- SynapSIM Console (back office, H-119) ----------
   Classes propres à la Console : l'application n'en utilise aucune, son rendu ne change pas. Mêmes
   variables, donc même thème clair et sombre. */

.console-tag {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gris-fonce);
}

/* PREPROD ou poste de développement : rappel permanent dans l'en-tête et en tête de page (H-123). */
.env-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: var(--attente-fond);
    color: var(--attente-texte);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.env-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0 0 1rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--alerte-bordure);
    border-radius: var(--rayon);
    background: var(--alerte-fond);
    color: var(--alerte-texte);
    font-size: 0.875rem;
}

.app-public .env-line {
    max-width: 420px;
}

/* Recherche au-dessus d'un tableau : champ puis bouton, sur une ligne dès que la place le permet. */
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.table-toolbar .field {
    flex: 1 1 240px;
    margin: 0;
}

/* Console : filtres et recherche d'une liste sur une seule ligne quand l'écran est assez large, pour
   laisser la hauteur à la liste. Le titre du champ reste lu par les lecteurs d'écran. */
.list-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.list-tools > .tile-options {
    flex: 1 1 auto;
}

.list-tools > .table-toolbar {
    flex: 1 1 22rem;
    align-items: center;
}

.list-tools .table-toolbar .field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 0;
}

/* Choix parmi quelques options (rôle d'un utilisateur, policy d'une zone) : des tuiles comme celles
   de la langue dans l'application, jamais une liste déroulante. Enregistrées dès le choix (data-auto-submit). */
.tile-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.tile-options legend {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0;
}

.tile-option {
    position: relative;
}

.tile-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.tile-option label {
    display: inline-flex;
    align-items: center;
    min-height: var(--zone-tactile);
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.tile-option label:hover {
    border-color: var(--gris);
}

.tile-option input:checked + label {
    border-color: var(--petrole);
    background: var(--petrole-clair);
    color: var(--petrole-fonce);
    font-weight: 600;
}

.tile-option input:focus-visible + label {
    outline: 3px solid var(--petrole);
    outline-offset: 1px;
}

/* Onglets en tuiles (vues d'une Company dans la Console) : lien actif comme une tuile choisie. */
.tile-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--zone-tactile);
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--texte);
    text-decoration: none;
}

.tile-link:hover {
    border-color: var(--gris);
}

.tile-link.is-current {
    border-color: var(--petrole);
    background: var(--petrole-clair);
    color: var(--petrole-fonce);
    font-weight: 600;
}

/* Sans script, le bouton enregistre le choix ; avec, il disparaît (site.js enregistre dès le choix). */
.tile-options + .tile-submit {
    margin-top: 0.5rem;
}

/* Tableaux de la Console : complets dès 768 px ; en dessous, une carte par ligne (01, « listes en
   cartes » sur téléphone), chaque valeur précédée du nom de sa colonne (data-label). */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--fond);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--bordure);
}

.data-table thead th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gris-fonce);
    white-space: nowrap;
    vertical-align: middle;
}

.data-table thead a {
    display: inline-flex;
    align-items: center;
    min-height: var(--zone-tactile);
    color: inherit;
    text-decoration: none;
}

.data-table thead a:hover {
    color: var(--petrole);
}

.data-table tbody tr:last-child > * {
    border-bottom: 0;
}

.data-table tbody th {
    font-weight: 600;
}

.data-table-wrap {
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table th,
    .data-table td {
        display: block;
    }

    .data-table {
        background: none;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .data-table tbody {
        display: grid;
        gap: 0.75rem;
    }

    .data-table tr {
        padding: 0.5rem 1rem;
        background: var(--fond);
        border-radius: var(--rayon);
        box-shadow: var(--ombre);
    }

    .data-table th,
    .data-table td,
    .data-table tbody tr:last-child > * {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--bordure);
    }

    .data-table tr > :last-child,
    .data-table tbody tr:last-child > :last-child {
        border-bottom: 0;
    }

    .data-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.125rem;
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--gris-fonce);
    }

    .data-table tbody th {
        font-size: 1.0625rem;
    }
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* Au téléphone : les tuiles de navigation (vues d'une entreprise, filtres d'une liste) sur une seule
   ligne qui défile de côté, au lieu de trois ou quatre rangées qui repoussent la liste sous l'écran. */
@media (max-width: 767.98px) {
    nav.tile-options {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -1rem;
        padding: 0.125rem 1rem;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
    }

    nav.tile-options::-webkit-scrollbar {
        display: none;
    }

    nav.tile-options .tile-option {
        flex: none;
    }

    .list-tools > nav.tile-options {
        flex: 1 1 100%;
        min-width: 0;
    }

    nav.tile-options .tile-link {
        white-space: nowrap;
    }

    /* Onglets d'une rubrique (Administration, Demandes de la Console) : en haut de la page, au même
       endroit sur chaque onglet, quel que soit le titre (sur une ou deux lignes) ou l'intro. */
    .stack > nav.section-tabs {
        order: -1;
    }

    /* Liste et page défilent ensemble : plus de cadre de défilement dans la liste. */
    .scroll-panel {
        overflow: visible;
        margin: 0;
        padding: 0;
    }
}

/* Pastille de pays sans action (lecture seule, rôle Support) : même forme que celle du voyage. */
.country-chip.chip-static {
    padding-right: 0.75rem;
    cursor: default;
}

.country-chip.chip-static::after {
    content: none;
}

.country-chip.chip-static:hover {
    background: var(--petrole);
}

.chip-form {
    display: inline;
    margin: 0;
}

/* Aperçu de l'accueil de l'application avec le logo d'une Company, en clair et en sombre côte à côte,
   quel que soit le thème de l'écran (H-105, H-114). Couleurs de l'application, fixées ici. */
.logo-previews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
}

/* Un logo (clair ou sombre) : son aperçu, puis ses boutons juste dessous. */
.logo-slot {
    display: grid;
    align-content: start;
    gap: 0.625rem;
    min-width: 0;
}

.logo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo-actions form {
    margin: 0;
}

/* Le champ fichier est caché : on clique sur « Changer le logo », le logo part aussitôt (site.js). */
.logo-upload {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.logo-upload label {
    cursor: pointer;
}

.logo-upload input[type="file"]:focus-visible + label {
    outline: 3px solid var(--petrole);
    outline-offset: 2px;
}

.logo-preview {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    overflow: hidden;
}

.logo-preview .home-head {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    min-width: 0;
    margin: 0;
}

.logo-preview .home-logo {
    min-width: 0;
    max-width: 100%;
}

.logo-preview .home-logo img {
    max-width: min(200px, 100%);
}

.logo-preview h3 {
    margin: 0;
    font-size: 1.125rem;
    overflow-wrap: anywhere;
}

.logo-preview-light {
    background: #f8fafb;
    color: #1f2a30;
}

.logo-preview-light h3 {
    color: #074a66;
}

.logo-preview-light .home-logo img {
    padding: 0;
    background: none;
}

.logo-preview-dark {
    background: #111c22;
    color: #e6edf1;
}

.logo-preview-dark h3 {
    color: #9ad7f0;
}

.logo-preview-dark .home-logo img:not(.has-dark) {
    padding: 4px 8px;
    border-radius: 8px;
    background: #dfe6ea;
}

.logo-preview-caption {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.75;
}

.logo-placeholder {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Console seulement (body.console) : un titre de section en tête de carte n'a pas de marge haute. */
.console .card > .section-title:first-child {
    margin-top: 0;
}

/* Zones d'une Company (Console) : une tuile par zone, aérée, qui ouvre la zone. */
.zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.zone-tile {
    display: grid;
    gap: 0.875rem;
    height: 100%;
    padding: 1.25rem;
    border: 1px solid var(--carte-bordure);
    border-radius: 16px;
    background: var(--fond);
    box-shadow: var(--lien-ombre);
    color: var(--texte);
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s;
}

.zone-tile:hover {
    box-shadow: var(--lien-ombre-survol);
    transform: translateY(-1px);
}

.zone-grid > li {
    min-width: 0;
}

.zone-tile .badge {
    white-space: normal;
    text-align: left;
}

.zone-tile-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--petrole-fonce);
}

.zone-tile-count {
    color: var(--gris-fonce);
    font-size: 0.875rem;
}

/* Deux lignes de drapeaux au plus : le nombre de pays, dessous, dit le reste. */
.zone-flags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    max-height: calc(48px + 0.375rem);
    overflow: hidden;
}

.zone-tile-new {
    align-content: center;
    justify-items: center;
    min-height: 160px;
    border: 2px dashed var(--bordure);
    background: transparent;
    box-shadow: none;
    color: var(--petrole);
    font-weight: 600;
}

.zone-tile-new .icon {
    display: block;
    width: 32px;
    height: 32px;
}

.zone-tile-new:hover {
    border-color: var(--petrole);
    background: var(--petrole-clair);
    box-shadow: none;
}

/* Retour à la page précédente (Console) : un bouton arrondi avec sa flèche, comme les tuiles. */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    justify-self: start;
    min-height: var(--zone-tactile);
    padding: 0 1rem 0 0.625rem;
    border: 1px solid var(--bordure);
    border-radius: 999px;
    background: var(--fond);
    color: var(--petrole-fonce);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.back-link:hover,
.back-link:focus-visible {
    border-color: var(--petrole);
    background: var(--petrole-clair);
}

.page-head .back-link {
    margin-bottom: 0.75rem;
}

.back-link .icon {
    width: 20px;
    height: 20px;
}

/* En-tête d'une zone : retour, nom et policy, puis ce qu'elle fait. */
.zone-head {
    display: grid;
    gap: 0.5rem;
}

.zone-head p {
    margin: 0;
}

.zone-head-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.875rem;
}

.zone-head-title h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--petrole-fonce);
}

.zone-head-title .badge {
    white-space: normal;
}

/* Pays déjà dans une autre zone : drapeau, message et « Déplacer vers… » sur la même ligne. */
.zone-move {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.zone-move form {
    margin: 0;
}

.zone-subtitle {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--petrole-fonce);
}

/* Zone sans policy (Console, H-142) : l'eSIM y marche sans contrôle, rappelé en orange. */
.badge-risk {
    background: var(--alerte-fond);
    color: var(--alerte-texte);
    box-shadow: inset 0 0 0 1px var(--alerte-bordure);
}

.notice-risk {
    border: 1px solid var(--alerte-bordure);
    background: var(--alerte-fond);
    color: var(--alerte-texte);
}

.zone-tile.is-risk {
    border-color: var(--alerte-bordure);
}

/* Case « J'ai compris le risque » : grande zone au doigt, texte à côté. */
.risk-accept {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-weight: 600;
    cursor: pointer;
}

.risk-accept input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0.125rem 0 0;
    accent-color: var(--alerte-texte);
}

/* Pays d'une zone : une carte par pays, drapeau et nom, croix pour le retirer. */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.country-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 52px;
    padding: 0.25rem 0.25rem 0.25rem 0.875rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
}

.country-tile-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.country-tile form {
    margin: 0;
}

.country-tile-remove {
    font-size: 1.25rem;
    line-height: 1;
}

.zone-hint {
    color: var(--gris-fonce);
    font-size: 0.8125rem;
}

/* Ajout de pays à une zone : même liste que « Nouveau voyage » dans l'application, bouton collé en bas. */
.zone-picker .country-options {
    max-height: 26rem;
}

.zone-picker-actions {
    position: sticky;
    bottom: 0;
    padding: 0.75rem 0 0;
    background: var(--fond);
}

/* Aucun pays coché : le bouton dit quoi faire, sans pouvoir être envoyé. */
.zone-picker-actions .button-primary:disabled {
    border-color: var(--bordure);
    background: var(--gris-clair);
    color: var(--gris-fonce);
    box-shadow: none;
    cursor: default;
}

/* ------------------------------------------------------------------------------------------------
   Console : cartes repliables (titre cliquable, flèche qui tourne), comme « Réglages de la zone ».
   ------------------------------------------------------------------------------------------------ */
.card-fold {
    padding: 0;
}

.card-fold > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--zone-tactile);
    padding: 1rem;
    cursor: pointer;
    list-style: none;
    color: var(--petrole-fonce);
    font-weight: 700;
}

.card-fold > summary::-webkit-details-marker {
    display: none;
}

.card-fold > summary::after {
    content: "";
    flex: none;
    width: 0.625rem;
    height: 0.625rem;
    margin-right: 0.25rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s;
}

.card-fold[open] > summary::after {
    transform: rotate(-135deg);
}

.card-fold > summary:focus-visible {
    outline: 3px solid var(--petrole);
    outline-offset: -3px;
    border-radius: var(--rayon);
}

.card-fold-count {
    margin-left: auto;
    color: var(--gris-fonce);
    font-weight: 600;
    font-size: 0.875rem;
}

.card-fold-body {
    padding: 0 1rem 1rem;
}

/* ------------------------------------------------------------------------------------------------
   Console : liste des pays. Une ligne par pays : drapeau, nom, une seule pastille, un bouton.
   ------------------------------------------------------------------------------------------------ */
.country-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.country-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.875rem;
    min-height: 56px;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
}

.country-row-name {
    flex: 1 1 10rem;
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.country-row-state {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.country-row-state a {
    font-size: 0.875rem;
}

.country-row form {
    margin: 0 0 0 auto;
}

/* « Désactiver » / « Réactiver » d'un pays : un petit bouton, pas un bouton de formulaire (retour de
   Lucas du 01/10/2026). Au téléphone, un peu plus haut pour le doigt. */
.country-row .button-secondary {
    min-height: 34px;
    padding: 0 0.75rem;
    font-size: 0.875rem;
}

@media (max-width: 767.98px) {
    .country-row .button-secondary {
        min-height: 40px;
    }
}

/* ------------------------------------------------------------------------------------------------
   Console : tutoriel d'une page (tutorial.js). La lumière assombrit tout sauf l'élément montré.
   ------------------------------------------------------------------------------------------------ */
.tuto-light {
    position: fixed;
    z-index: 200;
    border-radius: var(--rayon);
    box-shadow: 0 0 0 9999px rgba(8, 20, 28, 0.55);
    pointer-events: none;
    transition: width 0.15s, height 0.15s;
}

.tuto-bubble {
    position: fixed;
    z-index: 201;
    width: min(26rem, calc(100vw - 24px));
    padding: 1rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    color: var(--texte);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.tuto-title {
    margin: 0 0 0.375rem;
    font-size: 1.0625rem;
    color: var(--petrole-fonce);
}

.tuto-bubble p {
    margin: 0 0 0.875rem;
    line-height: 1.45;
}

.tuto-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tuto-count {
    color: var(--gris-fonce);
    font-size: 0.875rem;
}

.tuto-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tuto-buttons button {
    width: auto;
    min-height: 40px;
    padding: 0.5rem 0.875rem;
}

.tutorial-replay {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.tutorial-replay .icon {
    width: 20px;
    height: 20px;
}

/* En-tête d'une page de la Console : titre à gauche, « Revoir le tutoriel » à droite. */
.page-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* De l'air entre la ligne du titre et ce qui suit (intro, pastille du rôle, cartes du Profil). */
.page-head > .page-tools + * {
    margin-top: 0.5rem;
}

.page-narrow > .page-tools {
    margin-bottom: 1rem;
}

/* Au téléphone (retour de Lucas du 02/10/2026) : le titre et « Revoir le tutoriel » toujours sur la
   même ligne, le bouton plus petit et calé à droite ; un titre long passe sur deux lignes. */
@media (max-width: 767.98px) {
    .page-tools {
        flex-wrap: nowrap;
    }

    .page-tools h1 {
        flex: 1 1 auto;
        min-width: 0;
        margin-bottom: 0;
        overflow-wrap: anywhere;
    }

    .page-tools .tutorial-replay {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 0 0.75rem 0 0.5rem;
        gap: 0.25rem;
        border-radius: 999px;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .page-tools .tutorial-replay .icon {
        width: 16px;
        height: 16px;
    }
}

/* ------------------------------------------------------------------------------------------------
   Console : comptes d'une Company. Une carte par Compte : nom et état, puis ses informations.
   ------------------------------------------------------------------------------------------------ */
.account-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 0.75rem;
    /* Une carte ouverte (« Modifier », H-154) n'étire pas ses voisines. */
    align-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
}

.account-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
}

.account-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem 0.75rem;
}

.account-card-name {
    font-size: 1.0625rem;
    color: var(--petrole-fonce);
    overflow-wrap: anywhere;
}

.account-card-details {
    display: grid;
    gap: 0.5rem;
    margin: 0;
}

/* Cartes d'une même ligne à la même hauteur (site.js, [data-equal-height]) : les actions repliées
   restent en bas, alignées d'une carte à l'autre. */
.account-card > .card-fold {
    margin-top: auto;
}

.account-card > .account-card-details:not(:last-child) {
    margin-bottom: 0.75rem;
}

.account-card-details div {
    display: grid;
    grid-template-columns: minmax(7.5rem, auto) 1fr;
    gap: 0.75rem;
}

.account-card-details dt {
    color: var(--gris-fonce);
    font-size: 0.875rem;
}

.account-card-details dd {
    margin: 0;
    min-width: 0;
}

/* Téléphone : l'intitulé au-dessus de la valeur, l'email garde toute la largeur. */
@media (max-width: 30rem) {
    .account-card-details div {
        grid-template-columns: 1fr;
        gap: 0.125rem;
    }
}

/* ------------------------------------------------------------------------------------------------
   Console : ouverture d'une Company. Une ligne par condition : marque verte ou orange, texte, lien.
   ------------------------------------------------------------------------------------------------ */
.opening-conditions {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.opening-condition {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.875rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    background: var(--fond);
}

.opening-condition.is-missing {
    border-color: var(--alerte-bordure);
    background: var(--alerte-fond);
}

.opening-condition-mark {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-weight: 700;
}

.opening-condition.is-met .opening-condition-mark {
    background: var(--petrole-clair);
    color: var(--petrole-fonce);
}

.opening-condition.is-missing .opening-condition-mark {
    background: var(--alerte-bordure);
    color: var(--alerte-texte);
}

.opening-condition-text {
    display: grid;
    flex: 1 1 14rem;
    gap: 0.125rem;
    min-width: 0;
}

.opening-condition .button-secondary {
    margin-left: auto;
}

/* ------------------------------------------------------------------------------------------------
   Console : défilement. À partir de 768 px, la page défile dans son propre cadre, sous la barre du
   haut : la barre de défilement commence sous l'en-tête, pas en haut de l'écran. Au téléphone, le
   défilement reste celui du navigateur (barre d'adresse qui se replie, barres superposées).
   Toutes les barres de la Console sont fines et suivent le thème clair ou sombre.
   ------------------------------------------------------------------------------------------------ */
.console,
.console * {
    scrollbar-width: thin;
    scrollbar-color: var(--bordure) transparent;
}

.console ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.console ::-webkit-scrollbar-track {
    background: transparent;
}

.console ::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: var(--bordure) padding-box;
}

.console ::-webkit-scrollbar-thumb:hover {
    background: var(--gris) padding-box;
}

.console ::-webkit-scrollbar-corner {
    background: transparent;
}

/* ------------------------------------------------------------------------------------------------
   Console : tableau de bord de l'accueil. Des chiffres (ce qui attend une action) puis des
   graphiques rendus par le serveur, sans script : barres en HTML (le texte garde sa taille sur
   tous les écrans), anneau en SVG.
   ------------------------------------------------------------------------------------------------ */
.dash-context {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-context li {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--bordure);
    border-radius: 999px;
    background: var(--fond);
    color: var(--gris-fonce);
    font-size: 0.875rem;
}

.dash-context strong {
    color: var(--texte);
    font-weight: 600;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.dash-stat {
    display: grid;
    align-content: start;
    gap: 0.25rem;
    min-height: 7.5rem;
    padding: 1rem;
    border: 1px solid var(--carte-bordure);
    border-radius: var(--rayon);
    background: var(--fond);
    box-shadow: var(--lien-ombre);
    color: var(--texte);
    text-decoration: none;
}

a.dash-stat:hover {
    box-shadow: var(--lien-ombre-survol);
}

.dash-stat-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gris-fonce);
    font-size: 0.875rem;
    font-weight: 600;
}

.dash-stat-head .icon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--petrole);
}

.dash-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--petrole-fonce);
}

.dash-stat-hint {
    color: var(--gris-fonce);
    font-size: 0.8125rem;
}

/* Quelque chose à regarder (anomalie, échec Webbing) : la tuile passe en alerte. */
.dash-stat.is-alert {
    border-color: var(--alerte-bordure);
    background: var(--alerte-fond);
}

.dash-stat.is-alert .dash-stat-value,
.dash-stat.is-alert .dash-stat-head .icon {
    color: var(--alerte-texte);
}

.dash-charts {
    display: grid;
    gap: 0.75rem;
}

.dash-chart {
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.dash-chart .section-title {
    margin: 0;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.25rem 0.375rem;
}

.bar-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
    height: 10rem;
    border-bottom: 1px solid var(--bordure);
}

.bar-value {
    color: var(--texte);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bar {
    width: 100%;
    max-width: 2.5rem;
    min-height: 3px;
    border-radius: 6px 6px 2px 2px;
    background: var(--petrole);
    opacity: 0.75;
}

.bar-col.is-current .bar {
    opacity: 1;
}

.bar-label {
    color: var(--gris-fonce);
    font-size: 0.6875rem;
    text-align: center;
    white-space: nowrap;
}

/* Téléphone : l'anneau et sa légende centrés dans leur carte ; une date sur deux, sinon elles se chevauchent. */
@media (max-width: 767px) {
    .dash-donut {
        flex-direction: column;
        justify-content: center;
    }

    .bar-label:nth-child(even of .bar-label) {
        visibility: hidden;
    }
}

.chart-track {
    fill: none;
    stroke: var(--gris-clair);
}

.chart-arc {
    fill: none;
    stroke: var(--petrole);
    stroke-linecap: round;
}

.chart-center {
    fill: var(--texte);
    font-size: 22px;
    font-weight: 700;
}

.chart-center-sub {
    fill: var(--gris-fonce);
    font-size: 11px;
}

.dash-donut {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.dash-donut svg {
    display: block;
    width: 9rem;
    height: 9rem;
    flex: none;
}

.dash-legend {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
}

.dash-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-legend .dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--petrole);
}

.dash-legend .dot.is-muted {
    background: var(--bordure);
}

.dash-rank {
    display: grid;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-rank li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 0.75rem;
    font-size: 0.9375rem;
}

.dash-rank .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-rank .count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rank-bar {
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 999px;
    background: var(--gris-clair);
    overflow: hidden;
}

.rank-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--petrole);
}

/* Hauteur des barres et largeur des classements, par pas de 5 % : pas de style en ligne (CSP). */
.bar.pct-0 { height: 0%; }
.rank-bar > .pct-0 { width: 0%; }
.bar.pct-5 { height: 5%; }
.rank-bar > .pct-5 { width: 5%; }
.bar.pct-10 { height: 10%; }
.rank-bar > .pct-10 { width: 10%; }
.bar.pct-15 { height: 15%; }
.rank-bar > .pct-15 { width: 15%; }
.bar.pct-20 { height: 20%; }
.rank-bar > .pct-20 { width: 20%; }
.bar.pct-25 { height: 25%; }
.rank-bar > .pct-25 { width: 25%; }
.bar.pct-30 { height: 30%; }
.rank-bar > .pct-30 { width: 30%; }
.bar.pct-35 { height: 35%; }
.rank-bar > .pct-35 { width: 35%; }
.bar.pct-40 { height: 40%; }
.rank-bar > .pct-40 { width: 40%; }
.bar.pct-45 { height: 45%; }
.rank-bar > .pct-45 { width: 45%; }
.bar.pct-50 { height: 50%; }
.rank-bar > .pct-50 { width: 50%; }
.bar.pct-55 { height: 55%; }
.rank-bar > .pct-55 { width: 55%; }
.bar.pct-60 { height: 60%; }
.rank-bar > .pct-60 { width: 60%; }
.bar.pct-65 { height: 65%; }
.rank-bar > .pct-65 { width: 65%; }
.bar.pct-70 { height: 70%; }
.rank-bar > .pct-70 { width: 70%; }
.bar.pct-75 { height: 75%; }
.rank-bar > .pct-75 { width: 75%; }
.bar.pct-80 { height: 80%; }
.rank-bar > .pct-80 { width: 80%; }
.bar.pct-85 { height: 85%; }
.rank-bar > .pct-85 { width: 85%; }
.bar.pct-90 { height: 90%; }
.rank-bar > .pct-90 { width: 90%; }
.bar.pct-95 { height: 95%; }
.rank-bar > .pct-95 { width: 95%; }
.bar.pct-100 { height: 100%; }
.rank-bar > .pct-100 { width: 100%; }

.dash-empty {
    margin: 0;
    color: var(--gris-fonce);
}

@media (min-width: 768px) {
    .dash-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .dash-charts {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    }

    .dash-charts > .dash-chart-wide {
        grid-row: span 2;
    }
}

/* Console : actions d'un Compte (H-154), repliées sous la carte. */
.account-actions {
    margin-top: 0.75rem;
    box-shadow: none;
    border: 1px solid var(--bordure);
}

/* Console : historique d'un voyage (H-157), une étape par ligne bordée. */
.history-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.history-list > li {
    display: grid;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    overflow-wrap: anywhere;
}

.history-list .badge {
    justify-self: start;
}

/* Console : recherche dans les journaux (H-158), champs en grille. */
.log-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    gap: 0.75rem;
}

.log-search > .button-secondary {
    justify-self: start;
}

/* Détail technique d'une erreur, replié ; défile s'il est long. */
.log-exception pre {
    max-height: 20rem;
    margin: 0.5rem 0 0;
    padding: 0.75rem;
    overflow: auto;
    border-radius: var(--rayon);
    background: var(--gris-clair);
    font-size: 0.8125rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Accueil, plusieurs SIM actives : le détail du total, centré sous lui, une SIM par bloc (H-76). */
.usage-by-sim {
    display: grid;
    gap: 0.5rem;
    max-width: 24rem;
    margin: 1rem auto 0;
    padding: 0;
    list-style: none;
    text-align: center;
}

.usage-by-sim li {
    display: grid;
    gap: 0.125rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: var(--gris-clair);
}

/* ICCID entier (19 à 20 chiffres) : en groupes, à la ligne si l'écran est étroit. */
.sim-number {
    color: var(--gris-fonce);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* Choix des SIM d'un voyage : mêmes cases que la liste des pays, sans cadre, hauteur fixe ni défilement. */
.country-options.sim-options {
    max-height: none;
    min-height: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: none;
}

.country-options.sim-options label {
    border-color: var(--bordure);
}

.sim-label {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}
