/* ==========================================================================
   Créneau — système de design
   Polices système, aucune ressource tierce. La couleur d'accent vient de
   /theme.css (réglage de l'établissement).
   ========================================================================== */

:root {
    /* Deux hauteurs communes aux champs, listes et boutons : alignés quand ils sont côte à côte. */
    --control-h: 42px;
    --control-h-sm: 34px;
    --accent: #4f46e5;
    --accent-ink: color-mix(in oklab, var(--accent) 82%, black);
    --accent-soft: color-mix(in oklab, var(--accent) 11%, transparent);
    --accent-softer: color-mix(in oklab, var(--accent) 6%, transparent);
    --on-accent: #fff;

    --bg: #f5f6f8;
    --bg-grad: radial-gradient(1200px 600px at 10% -10%, color-mix(in oklab, var(--accent) 9%, transparent), transparent 60%),
               radial-gradient(900px 500px at 110% 10%, color-mix(in oklab, var(--accent) 6%, transparent), transparent 55%);
    --surface: #ffffff;
    --surface-2: #f2f4f7;
    --surface-3: #e9edf2;
    --border: #e3e7ed;
    --border-strong: #cfd6df;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;

    --success: #16a34a;
    --success-soft: color-mix(in oklab, #16a34a 12%, transparent);
    --warning: #d97706;
    --warning-soft: color-mix(in oklab, #d97706 13%, transparent);
    --danger: #dc2626;
    --danger-soft: color-mix(in oklab, #dc2626 11%, transparent);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 1px 2px rgb(15 23 42 / .05);
    --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 16px -4px rgb(15 23 42 / .08);
    --shadow-lg: 0 2px 4px rgb(15 23 42 / .04), 0 18px 48px -12px rgb(15 23 42 / .18);
    --ring: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent);

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent-ink: color-mix(in oklab, var(--accent) 70%, white);
        --accent-soft: color-mix(in oklab, var(--accent) 22%, transparent);
        --accent-softer: color-mix(in oklab, var(--accent) 12%, transparent);
        --bg: #0b0f17;
        --surface: #121826;
        --surface-2: #182032;
        --surface-3: #1f293d;
        --border: #232d42;
        --border-strong: #31405c;
        --text: #e8edf5;
        --text-2: #c3cddd;
        --muted: #8b98ad;
        --faint: #5f6d84;
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px -6px rgb(0 0 0 / .5);
        --shadow-lg: 0 20px 50px -12px rgb(0 0 0 / .6);
        color-scheme: dark;
    }
}

/* --- Base --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-grad), var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
::selection { background: var(--accent-soft); }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }

/* --- Boutons ------------------------------------------------------------ */

.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--text);
    --btn-bd: var(--border-strong);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--control-h); padding: 0 16px;
    font: inherit; font-weight: 600; font-size: .92rem; line-height: 1;
    color: var(--btn-fg); background: var(--btn-bg);
    border: 1px solid var(--btn-bd); border-radius: 12px;
    cursor: pointer; text-decoration: none !important; white-space: nowrap;
    transition: transform .15s var(--ease), background .15s, box-shadow .15s, border-color .15s;
    box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bd: transparent; box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--accent) 60%, transparent); }
.btn--primary:hover { --btn-bg: var(--accent-ink); border-color: transparent; }
.btn--soft { --btn-bg: var(--accent-soft); --btn-fg: var(--accent-ink); --btn-bd: transparent; box-shadow: none; }
.btn--soft:hover { --btn-bg: color-mix(in oklab, var(--accent) 18%, transparent); border-color: transparent; }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; color: var(--text-2); }
.btn--ghost:hover { --btn-bg: var(--surface-2); border-color: transparent; }
.btn--danger { --btn-fg: var(--danger); }
.btn--danger:hover { --btn-bg: var(--danger-soft); border-color: transparent; }
.btn--sm { min-height: var(--control-h-sm); padding: 0 11px; font-size: .84rem; border-radius: 10px; gap: 6px; }
.btn--lg { min-height: 50px; padding: 0 22px; font-size: 1rem; border-radius: 14px; }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--control-h); }
.btn--icon.btn--sm { width: var(--control-h-sm); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.inline-form { display: inline; margin: 0; }

/* --- Cartes ------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.card__body { padding: 22px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card__foot { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card--flat { box-shadow: none; }
.card--danger { border-color: color-mix(in oklab, var(--danger) 35%, var(--border)); }
.card--accent { background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 65%, black)); color: #fff; border: 0; }
.card--accent .muted { color: rgb(255 255 255 / .8); }
a.card { color: inherit; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
/* L'étape en cours d'une session, sur sa carte de l'accueil : la carte y mène. */
.session-card__next { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: .875rem; }

/* --- Pastilles, étiquettes ---------------------------------------------- */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: .76rem; font-weight: 600; line-height: 1.3;
    background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--outline { background: transparent; border: 1px solid var(--border-strong); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot--live { background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--success) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.avatar {
    --h: 230;
    width: 42px; height: 42px; border-radius: 14px; flex: none;
    display: grid; place-items: center;
    font-weight: 700; font-size: .9rem; letter-spacing: .02em;
    color: hsl(var(--h) 55% 32%);
    background: hsl(var(--h) 70% 92%);
}
@media (prefers-color-scheme: dark) { .avatar { color: hsl(var(--h) 80% 82%); background: hsl(var(--h) 35% 22%); } }
.avatar--lg { width: 56px; height: 56px; border-radius: 18px; font-size: 1.1rem; }
.avatar--sm { width: 32px; height: 32px; border-radius: 10px; font-size: .75rem; }

/* --- Formulaires -------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: .88rem; color: var(--text-2); }
.field small, .hint { color: var(--muted); font-size: .8rem; }
.input, .select, .textarea {
    width: 100%; min-height: var(--control-h); padding: 10px 14px;
    font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
/* Une ligne : hauteur fixe, sinon un champ texte et une liste ne font pas la même taille. */
.input, .select { height: var(--control-h); padding-block: 0; }
/* Champ fichier : le bouton du navigateur prend l'allure d'un petit bouton, centré dans le cadre. */
.input[type="file"] { height: auto; padding: 5px 6px; width: auto; flex: 1 1 240px; min-width: 0; font-size: .88rem; color: var(--muted); cursor: pointer; }
.input[type="file"]::file-selector-button {
    height: calc(var(--control-h) - 12px); margin-right: 12px; padding: 0 12px;
    font: inherit; font-weight: 600; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.input[type="file"]:hover::file-selector-button { background: var(--surface-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input--lg { height: 56px; min-height: 56px; font-size: 1.1rem; padding: 0 18px; border-radius: 16px; }
.input--code { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.input--sm, .select--sm { height: var(--control-h-sm); min-height: var(--control-h-sm); padding: 0 10px; font-size: .88rem; border-radius: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.choice-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__box {
    display: flex; gap: 14px; align-items: flex-start; height: 100%;
    padding: 16px; border: 1.5px solid var(--border-strong); border-radius: var(--radius);
    background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice__box .icon { width: 26px; height: 26px; color: var(--accent); margin-top: 2px; }
.choice input:checked + .choice__box { border-color: var(--accent); background: var(--accent-softer); box-shadow: var(--ring); }
.choice input:focus-visible + .choice__box { box-shadow: var(--ring); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 38px; height: 38px; border-radius: 12px; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); transition: transform .15s var(--ease), box-shadow .15s; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--text); transform: scale(1.08); }
.swatch:hover span { transform: scale(1.06); }

.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; border-radius: var(--radius);
    background: var(--surface-2); color: var(--text-2); font-size: .92rem;
}
.alert .icon { margin-top: 2px; }
.alert[hidden] { display: none; }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--warning { background: var(--warning-soft); color: color-mix(in oklab, var(--warning) 80%, var(--text)); }
.alert--info { background: var(--accent-softer); color: var(--accent-ink); }
.alert--success { background: var(--success-soft); color: var(--success); }
/* Sur téléphone, le bouton d'une alerte passe sous le texte au lieu de l'écraser. */
@media (max-width: 640px) {
    .alert:has(> .btn) { flex-wrap: wrap; }
    .alert:has(> .btn) > .grow { flex-basis: calc(100% - 30px); }
    .alert > .btn { margin-left: 30px; }
}

/* --- Toasts ------------------------------------------------------------- */

.toasts { position: fixed; z-index: 100; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.toast {
    pointer-events: auto;
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px 13px 16px; border-radius: 16px;
    background: #0f172a; color: #f8fafc; font-weight: 500; font-size: .93rem;
    box-shadow: var(--shadow-lg);
    animation: toast-in .45s var(--ease) both;
}
@media (prefers-color-scheme: dark) { .toast { background: #f8fafc; color: #0f172a; } }
.toast > .icon { width: 22px; height: 22px; padding: 3px; border-radius: 8px; }
.toast--success > .icon { background: var(--success); color: #fff; }
.toast--error > .icon { background: var(--danger); color: #fff; }
.toast--info > .icon { background: var(--accent); color: #fff; }
.toast span { flex: 1; }
.toast__close { all: unset; cursor: pointer; opacity: .6; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.toast__close:hover { opacity: 1; background: rgb(127 127 127 / .2); }
.toast.is-leaving { animation: toast-out .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* --- Écrans centrés (installation, connexion, accueil) ------------------ */

.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.center-card { width: min(100%, 520px); }
.center-card--wide { width: min(100%, 680px); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none !important; }
.brand__mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.brand__mark .icon { width: 22px; height: 22px; }
/* Le logo de l'établissement à la place du pictogramme : sur fond clair, sans déformer l'image. */
.brand__mark--logo { background: var(--surface); box-shadow: 0 0 0 1px var(--border); overflow: hidden; padding: 3px; }
.brand__mark--logo img { width: 100%; height: 100%; object-fit: contain; }
.print-brand { display: inline-flex; align-items: center; gap: 10px; }
.print-brand img { height: 36px; width: auto; max-width: 140px; object-fit: contain; }
.hero-title { font-size: clamp(1.9rem, 4.5vw, 2.6rem); letter-spacing: -.035em; line-height: 1.08; }
.hero-title em { font-style: normal; background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #6366f1)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.stepper { display: flex; gap: 8px; }
.stepper__item { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.stepper__item.is-done { background: var(--accent); }
.stepper__item.is-current { background: linear-gradient(90deg, var(--accent) 50%, var(--surface-3) 50%); }

/* --- Application admin : colonne + contenu ------------------------------ */

.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100dvh; }
/* Sans min-width: 0, un tableau large élargirait toute la page au lieu de défiler dans son cadre. */
.app__content { min-width: 0; }
.sidebar {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column; gap: 6px;
    padding: 20px 14px; border-right: 1px solid var(--border);
    background: color-mix(in oklab, var(--surface) 72%, transparent);
    backdrop-filter: blur(16px);
}
.sidebar .brand { padding: 4px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { padding: 14px 12px 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.nav__link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    color: var(--text-2); font-weight: 550; text-decoration: none !important;
    transition: background .15s, color .15s;
}
.nav__link:hover { background: var(--surface-2); color: var(--text); }
.nav__link.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.nav__link .icon { width: 19px; height: 19px; }
.sidebar__foot { margin-top: auto; padding: 12px; border-radius: 16px; background: var(--surface-2); display: flex; align-items: center; gap: 10px; }

.main { min-width: 0; padding: 32px clamp(16px, 4vw, 48px) 80px; }
.main__inner { max-width: 1240px; margin: 0 auto; }
.topbar { display: none; }
.scrim { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.page-head__eyebrow a { color: var(--muted); }
.page-head__meta { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: .9rem; }
.page-head__meta > span { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 960px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .3s var(--ease); background: var(--surface); box-shadow: var(--shadow-lg); }
    .app.is-nav-open .sidebar { transform: none; }
    .app.is-nav-open .scrim { opacity: 1; pointer-events: auto; }
    .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(15 23 42 / .4); opacity: 0; pointer-events: none; transition: opacity .3s; }
    .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40; padding: 10px 16px; background: color-mix(in oklab, var(--surface) 82%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
    .main { padding-top: 22px; }
    .import-nav { top: 57px; } /* sous la barre du haut, collée elle aussi */
}

/* --- Statistiques ------------------------------------------------------- */

.stat { padding: 18px 20px; }
.stat__label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; font-weight: 600; }
.stat__label .icon { width: 30px; height: 30px; padding: 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.stat__value { font-size: 2rem; font-weight: 750; letter-spacing: -.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: .95rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
a.stat-link { color: inherit; text-decoration: none !important; display: block; border-radius: var(--radius-lg); transition: transform .2s var(--ease); }
a.stat-link:hover { transform: translateY(-2px); }

.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar__fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 75%, white), var(--accent)); transition: width .8s var(--ease); }
.bar__fill.w-0 { width: 0; }
.meter-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 70px; gap: 14px; align-items: center; padding: 9px 0; }
.meter-row + .meter-row { border-top: 1px dashed var(--border); }

/* --- Onglets ------------------------------------------------------------ */

.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow-x: auto; scrollbar-width: none; margin-bottom: 24px; max-width: 100%; }
.tab { flex: 1 0 auto; justify-content: center; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; color: var(--text); font-weight: 650; font-size: .95rem; white-space: nowrap; text-decoration: none !important; transition: background .15s, color .15s; }
.tab .icon { color: var(--muted); }
.tab:hover { background: var(--accent-softer); color: var(--accent-ink); }
.tab:hover .icon { color: var(--accent-ink); }
.tab.is-active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.tab.is-active .icon { color: #fff; }
.tab .count { font-size: .75rem; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.tab.is-active .count { background: color-mix(in oklab, #fff 25%, transparent); color: #fff; }

/* --- Tableaux / listes -------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--border); }
.list__item:first-child { border-top: 0; }

.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty__icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.empty__icon .icon { width: 28px; height: 28px; }

/* --- Bloc « nouveau lien » ---------------------------------------------- */

.link-box { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--border-strong); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .85rem; color: var(--text-2); }

/* ==========================================================================
   Espace des familles
   ========================================================================== */

.portal-top { position: sticky; top: 0; z-index: 30; background: color-mix(in oklab, var(--bg) 78%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent); }
.portal-top__inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal { max-width: 1180px; margin: 0 auto; padding: 28px 20px 120px; }
.portal-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.portal-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.035em; }
.portal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.portal-aside { position: sticky; top: 84px; }
@media (max-width: 980px) {
    .portal-layout { grid-template-columns: 1fr; }
    .portal-aside { position: static; order: -1; }
}
.wish-submit-end { display: none; }
/* Le bouton « Enregistrer » des demandes reste sous la main pendant qu'on fait défiler la liste. */
.requests-foot { position: sticky; bottom: 0; z-index: 5; }
@media (max-width: 980px) { .wish-submit-end { display: flex; } }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .85rem; font-weight: 550; color: var(--text-2); }
.chip .icon { width: 15px; height: 15px; color: var(--muted); }
.chip--warning { background: var(--warning-soft); border-color: transparent; color: color-mix(in oklab, var(--warning) 85%, var(--text)); }
.chip--warning .icon { color: currentColor; }
/* Référentiel : le {lead} d'un {group}, ou son absence, visible d'un coup d'œil. */
/* Référentiel, vue d'ensemble : les trois chiffres, l'import, puis l'état. */
.directory-tiles { margin-bottom: 18px; }
.directory-import { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 20px; margin-bottom: 28px; border-radius: var(--radius-lg); background: var(--surface-2); }
.directory-import p { flex: 1 1 320px; margin: 0; }
.health .list { margin: 10px 0 0; padding: 0; list-style: none; }
.health__item { align-items: flex-start; }
.health__item .icon.health__icon { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--warning); }
.health__item--ok .icon.health__icon { color: var(--success); }
.health__item--info { color: var(--muted); }
.health__item--info .icon.health__icon { color: var(--muted); }
.health__item .small a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.health__item .small a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.health__item > .btn { flex: none; }
.health__hint { margin-top: 4px; font-style: italic; }
.health__pairs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.health__pairs li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.chip--success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.chip--success .icon { color: currentColor; }

/* Un enfant */
.child { scroll-margin-top: 90px; }
.child__head { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.child__progress { margin-left: auto; text-align: right; min-width: 120px; }
.child__progress .bar { margin-top: 6px; }

/* Une ligne formateur */
.teacher { border-top: 1px solid var(--border); }
.teacher__row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; }
.teacher__name { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.teacher__meta { color: var(--muted); font-size: .85rem; display: flex; gap: 4px 12px; flex-wrap: wrap; }
.teacher__meta span { display: inline-flex; align-items: center; gap: 4px; }
.teacher__meta .icon { width: 14px; height: 14px; }
.teacher--booked { background: linear-gradient(90deg, var(--success-soft), transparent 70%); }
.booked-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 12px; background: var(--surface); border: 1px solid color-mix(in oklab, var(--success) 35%, var(--border)); font-weight: 650; font-variant-numeric: tabular-nums; }
.booked-pill .icon { color: var(--success); }

details.picker > summary { list-style: none; }
details.picker > summary::-webkit-details-marker { display: none; }
details.picker[open] .picker__toggle .icon:last-child { transform: rotate(180deg); }
.picker__toggle .icon:last-child { transition: transform .25s var(--ease); }
.picker__panel { padding: 0 22px 20px; animation: panel-in .35s var(--ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot {
    position: relative;
    display: grid; place-items: center;
    min-height: 44px; padding: 0 6px;
    font: inherit; font-weight: 650; font-size: .92rem; font-variant-numeric: tabular-nums;
    border-radius: 12px; border: 1.5px solid var(--border-strong);
    background: var(--surface); color: var(--text);
    cursor: pointer; width: 100%;
    transition: transform .15s var(--ease), border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.slot:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-softer); transform: translateY(-2px); box-shadow: 0 8px 18px -10px var(--accent); }
.slot:active { transform: scale(.96); }
.slot--taken { background: var(--surface-2); color: var(--faint); border-color: transparent; text-decoration: line-through; cursor: not-allowed; }
.slot--busy { background: var(--warning-soft); color: color-mix(in oklab, var(--warning) 80%, var(--text)); border-color: transparent; cursor: not-allowed; }
.slot--taken:hover, .slot--busy:hover { transform: none; box-shadow: none; border-color: transparent; }
.slot--taken:hover { background: var(--surface-2); color: var(--faint); }
.slot--busy:hover { background: var(--warning-soft); color: color-mix(in oklab, var(--warning) 80%, var(--text)); }
.slot.is-sending { color: transparent; pointer-events: none; }
.slot.is-sending::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; border: 1.5px solid var(--border-strong); }
.legend i.l-taken { background: var(--surface-3); border-color: transparent; }
.legend i.l-busy { background: var(--warning-soft); border-color: transparent; }

/* Agenda de la famille */
.agenda { padding: 6px 0; }
.agenda__item { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; align-items: center; padding: 12px 20px; position: relative; }
.agenda__item + .agenda__item::before { content: ""; position: absolute; left: 50px; top: -10px; height: 20px; border-left: 2px dotted var(--border-strong); }
.agenda__time { font-weight: 750; font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.agenda__time small { display: block; font-size: .72rem; font-weight: 600; color: var(--faint); letter-spacing: 0; }
.agenda__what { min-width: 0; }
.agenda__what strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda__summary { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.ring { --p: 0; width: 54px; height: 54px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 750; font-size: .9rem; }

/* Planning d'un formateur */
.timeline { display: flex; flex-direction: column; }
.timeline__row { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: center; padding: 12px 22px; border-top: 1px solid var(--border); }
.timeline__row:first-child { border-top: 0; }
.timeline__time { font-variant-numeric: tabular-nums; font-weight: 700; }
.timeline__time small { color: var(--faint); font-weight: 600; }
.timeline__row--free .timeline__time { color: var(--faint); font-weight: 600; }
.timeline__row--booked { background: linear-gradient(90deg, var(--accent-softer), transparent 70%); box-shadow: inset 3px 0 0 var(--accent); }

/* Feuille imprimable */
.sheet { max-width: 820px; margin: 0 auto; padding: 40px 24px; }
.sheet-table td, .sheet-table th { padding: 12px 10px; }

@media print {
    body { background: #fff; color: #000; font-size: 12pt; }
    .no-print, .toasts, .portal-top, .sidebar, .topbar { display: none !important; }
    .card { box-shadow: none; border-color: #ccc; }
    .sheet { padding: 0; }
    a { color: #000; }
}

@media (max-width: 640px) {
    body { font-size: 15px; }
    .card__body { padding: 18px; }
    .teacher__row { padding: 14px 16px; flex-wrap: wrap; }
    .teacher__row > .row:last-child { width: 100%; }
    .teacher__row .picker__toggle { width: 100%; }
    .picker__panel { padding: 0 16px 18px; }
    .child__head { padding: 18px 16px; flex-wrap: wrap; }
    .child__progress { margin-left: 0; width: 100%; text-align: left; }
    .timeline__row { grid-template-columns: 70px 1fr; padding: 12px 16px; }
    .timeline__row > :last-child { grid-column: 1 / -1; }
    .meter-row { grid-template-columns: 90px 1fr 56px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

.slots > form { display: contents; }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split > form[style*="sticky"] { position: static !important; } }
.icon--xl { width: 32px; height: 32px; }

.brand--truncate { min-width: 0; }
.brand--truncate > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.child-nav { margin: -8px 0 24px; }
.child-nav .chip { text-decoration: none; }
.child-nav .chip:hover { border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* Proposition automatique */
.pick-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.pick { position: relative; cursor: pointer; display: block; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick__box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--border-strong); background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.pick__check { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; border: 1.5px solid var(--border-strong); color: transparent; transition: background .15s, border-color .15s, color .15s; }
.pick__check .icon { width: 15px; height: 15px; }
.pick input:checked + .pick__box { border-color: var(--accent); background: var(--accent-softer); }
.pick input:checked + .pick__box .pick__check { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick input:focus-visible + .pick__box { box-shadow: var(--ring); }
.pick.is-disabled { cursor: not-allowed; opacity: .55; }
.plan-card { display: flex; flex-direction: column; }
.plan-card .agenda { flex: 1; }
.plan-card__range { font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 2px; }
.plan-card--best { border-color: var(--accent); box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-soft); }
.plan-cta { display: flex; gap: 14px; align-items: center; padding: 18px 20px; margin-bottom: 20px; text-decoration: none !important; color: inherit; }
.plan-cta .empty__icon { width: 46px; height: 46px; border-radius: 14px; flex: none; }
.plan-cta .empty__icon .icon { width: 22px; height: 22px; }
/* L'heure ne sert que si la famille a une contrainte d'horaire. */
.row:has(select[name="contrainte"] option[value=""]:checked) select[name="heure"] { display: none; }

/* Carte d'invitation (haut de la page des familles) */
.invite {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center;
    padding: 30px 32px; margin-bottom: 20px; border-radius: var(--radius-xl);
    color: #fff;
    background:
        radial-gradient(420px 220px at 100% 0%, rgb(255 255 255 / .18), transparent 70%),
        radial-gradient(300px 300px at 0% 120%, rgb(255 255 255 / .12), transparent 70%),
        linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 62%, black));
    box-shadow: 0 24px 50px -24px color-mix(in oklab, var(--accent) 70%, transparent);
}
.invite::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgb(255 255 255 / .07); }
.invite__date {
    width: 112px; padding: 12px 8px 14px; border-radius: 22px; text-align: center;
    background: #fff; color: var(--text); box-shadow: 0 14px 30px -12px rgb(0 0 0 / .35);
    display: flex; flex-direction: column; align-items: center; line-height: 1;
}
.invite__dow { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); }
.invite__date strong { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.invite__month { font-size: .85rem; font-weight: 600; color: var(--muted); text-transform: capitalize; }
.invite__body { position: relative; z-index: 1; min-width: 0; }
.invite__eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; opacity: .85; }
.invite h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); letter-spacing: -.035em; margin: 8px 0 8px; }
.invite__lead { font-size: 1.05rem; opacity: .95; }
.invite__lead strong { font-weight: 700; }
.invite__facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .9rem; font-weight: 550; opacity: .92; }
.invite__facts span { display: inline-flex; align-items: center; gap: 7px; }
.invite__status { position: relative; z-index: 1; align-self: start; }
.invite__pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: rgb(255 255 255 / .18); border: 1px solid rgb(255 255 255 / .3); font-weight: 650; font-size: .88rem; white-space: nowrap; backdrop-filter: blur(6px); }
.invite__pill--closed { background: rgb(0 0 0 / .2); }
@media (max-width: 760px) { .invite__status { min-width: 0; } .invite__pill { white-space: normal; } }

.steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.steps li strong { display: block; font-size: .92rem; }
.steps li small { display: block; color: var(--muted); font-size: .8rem; }
.steps__n { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 750; background: var(--surface-2); color: var(--muted); }
.steps__n .icon { width: 16px; height: 16px; }
.steps li.is-current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.steps li.is-current .steps__n { background: var(--accent); color: #fff; }
.steps li.is-done .steps__n { background: var(--success-soft); color: var(--success); }

@media (max-width: 760px) {
    .invite { grid-template-columns: 1fr; padding: 20px 18px 22px; gap: 14px; border-radius: var(--radius-lg); }
    /* La date devient une ligne compacte au-dessus du titre. */
    .invite__date { width: auto; flex-direction: row; align-self: start; justify-self: start; gap: 8px; padding: 8px 12px; border-radius: 12px; }
    .invite__date strong { font-size: 1.25rem; margin: 0; }
    .invite__dow, .invite__month { font-size: .82rem; }
    .invite h1 { font-size: 1.55rem; }
    .invite__lead { font-size: .98rem; }
    .invite__facts { gap: 6px 14px; font-size: .85rem; }
    .invite__facts span:first-child { display: none; }
    .steps { gap: 6px; }
    .steps li { flex-direction: column; text-align: center; gap: 6px; padding: 10px 6px; }
    .steps li strong { font-size: .76rem; line-height: 1.25; }
    .steps li small { display: none; }
    .steps__n { width: 26px; height: 26px; border-radius: 8px; font-size: .8rem; }
}

/* Remplissage automatique (« magie ») */
.btn--magic { --btn-bg: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #ec4899)); --btn-fg: #fff; --btn-bd: transparent; background: var(--btn-bg); box-shadow: 0 8px 18px -8px color-mix(in oklab, var(--accent) 70%, transparent); }
.btn--magic:hover { filter: brightness(1.08); border-color: transparent; }
.btn--magic .icon { animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(12deg); } }
.child__head .btn--magic { margin-left: auto; }
.child__head .btn--magic + .child__progress { margin-left: 0; }
.teacher--proposed { background: linear-gradient(90deg, var(--accent-softer), transparent 75%); box-shadow: inset 3px 0 0 var(--accent); }
.proposed-pill {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 12px;
    border: 1.5px dashed var(--accent); background: var(--surface); color: var(--accent-ink);
    font-weight: 750; font-variant-numeric: tabular-nums;
    animation: pop-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes pop-in { from { opacity: 0; transform: scale(.6) translateY(6px); } }
.magic-bar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); pointer-events: none; }
.magic-bar__inner {
    pointer-events: auto; max-width: 1180px; margin: 0 auto;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 12px 14px 12px 16px; border-radius: 20px;
    background: color-mix(in oklab, var(--surface) 88%, transparent); backdrop-filter: blur(18px);
    border: 1px solid var(--border); box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-soft);
    animation: toast-in .45s var(--ease) both;
}
.magic-bar__icon { width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #ec4899)); }
.magic-bar__text { flex: 1 1 220px; min-width: 0; }
.magic-bar__text strong { display: block; }
.magic-bar__text small { color: var(--muted); }
.magic-bar__hours, .magic-bar__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.magic-bar__hours .select { width: auto; height: var(--control-h-sm); min-height: var(--control-h-sm); padding: 0 8px; }
.magic-bar__hours:has(select[name="contrainte"] option[value=""]:checked) select[name="heure"] { display: none; }
body:has(.magic-bar) .portal { padding-bottom: 200px; }
body:has(.magic-bar) .toasts { bottom: 150px; }
@media (max-width: 640px) {
    .child__head .btn--magic { order: 3; width: 100%; margin-left: 0; }
    .magic-bar { padding: 8px; }
    .magic-bar__inner { gap: 10px; padding: 12px; }
    .magic-bar__hours, .magic-bar__actions { width: 100%; }
    .magic-bar__actions .btn, .magic-bar__actions form { flex: 1; }
    .magic-bar__actions form .btn { width: 100%; }
}

.magic-bar__label { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.magic-bar__label .icon { width: 14px; height: 14px; }

.child-nav { align-items: center; }
.child-nav__magic { margin-left: auto; }
@media (max-width: 640px) { .child-nav__magic { order: -1; width: 100%; margin-left: 0; } }
.booked-by { max-width: 130px; line-height: 1.3; }

/* Mode vœux */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.seg__opt { position: relative; cursor: pointer; }
.seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg__opt span { display: block; padding: 7px 12px; border-radius: 9px; font-size: .84rem; font-weight: 650; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.seg__opt:hover span { color: var(--text); }
.seg__opt input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg__opt--1 input:checked + span { background: var(--accent); color: #fff; }
.seg__opt--2 input:checked + span { background: var(--accent-soft); color: var(--accent-ink); }
.seg__opt input:focus-visible + span { box-shadow: var(--ring); }
.seg__opt input:disabled + span { cursor: not-allowed; opacity: .7; }
/* La même pastille en liens (bascule de vue d'une liste). */
.seg__link { display: block; padding: 7px 12px; border-radius: 9px; font-size: .84rem; font-weight: 650; color: var(--muted); white-space: nowrap; text-decoration: none; transition: background .15s, color .15s, box-shadow .15s; }
.seg__link:hover { color: var(--text); }
.seg__link.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg__link:focus-visible { box-shadow: var(--ring); outline: none; }
/* Vue par {learner} : les personnes qui le suivent, une par ligne, avec leurs icônes. */
.guardian-list { display: flex; flex-direction: column; gap: 6px; }
.guardian { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.guardian__name { min-width: 0; }
.guardian--out .guardian__name { color: var(--muted); }
.requested { color: var(--accent-ink); font-weight: 600; }
.wish-hours { border: 0; margin: 0; padding: 0; min-width: 0; }
.wish-hours legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: .88rem; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.wish-hours label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wish-hours .select { width: 100%; }
/* Maximum de vœux « Prioritaire » pour un enfant : compteur sous son nom, « Prioritaire » grisé une fois atteint. */
/* Collé sous le bandeau de la page pendant qu'on descend la liste : la raison du gris reste en vue (fond opaque). */
.wish-limit { position: sticky; top: var(--wish-limit-top, 65px); z-index: 2; display: flex; align-items: flex-start; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: linear-gradient(var(--accent-soft), var(--accent-soft)) var(--surface); color: var(--accent-ink); font-size: .9rem; }
.wish-limit > .icon { flex: none; margin-top: 2px; }
.wish-limit p + p { margin-top: 2px; }
.wish-limit + .teacher { border-top: 0; }
/* Côté organisation : pas de bandeau collant sur grand écran, la barre du haut (63 px) sur téléphone. */
.main .wish-limit { --wish-limit-top: 0px; }
@media (max-width: 960px) { .main .wish-limit { --wish-limit-top: 63px; } }
.wish-limit--over { background: linear-gradient(var(--warning-soft), var(--warning-soft)) var(--surface); color: color-mix(in oklab, var(--warning) 80%, var(--text)); }
.seg__opt input[data-limited] + span { opacity: .4; }
@media (max-width: 640px) { .wish-limit { padding: 12px 16px; } }
.wish-short { margin-top: 10px; }
.wish-short__count { display: block; margin-top: 4px; font-size: .85rem; }
.wish-legend { margin: 0; padding-left: 18px; font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 640px) {
    .seg { width: 100%; }
    .seg__opt { flex: 1; }
    .seg__opt span { text-align: center; padding: 8px 4px; }
}

/* Prise en main */
.onboarding__list { list-style: none; margin: 14px 0 0; padding: 0 0 8px; }
.onboarding__list li { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-top: 1px solid var(--border); }
.onboarding__list li strong { display: block; font-size: .93rem; }
.onboarding__list li small { display: block; color: var(--muted); font-size: .82rem; }
.onboarding__n { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 750; font-size: .85rem; background: var(--surface-2); color: var(--muted); }
.onboarding__n .icon { width: 15px; height: 15px; }
.onboarding__list li.is-done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.onboarding__list li.is-done .onboarding__n { background: var(--success-soft); color: var(--success); }
.onboarding__list li.is-current { background: var(--accent-softer); }
.onboarding__list li.is-current .onboarding__n { background: var(--accent); color: #fff; }

/* --- Mode d'emploi : fiches, recherche, aides contextuelles -------------- */

/* Le « ? » discret posé à côté d'un libellé ; sa zone de clic déborde pour le doigt. */
.help-tip { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; border-radius: 50%; color: var(--faint); vertical-align: -.25em; text-decoration: none !important; transition: color .15s, background .15s; }
.help-tip::after { content: ""; position: absolute; inset: -8px; }
.help-tip .icon { width: 17px; height: 17px; }
.help-tip:hover, .help-tip:focus-visible { color: var(--accent-ink); background: var(--accent-soft); }
.invite .help-tip, .card--accent .help-tip { color: rgb(255 255 255 / .75); }

/* Le texte d'une fiche, en page comme dans le panneau. */
.help-doc { color: var(--text-2); line-height: 1.65; }
.help-doc > * + * { margin-top: 12px; }
.help-doc ul, .help-doc ol { margin-bottom: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.help-doc strong { color: var(--text); font-weight: 650; }
.help-doc li::marker { color: var(--faint); }
.help-doc ol > li::marker { color: var(--accent-ink); font-weight: 700; }

/* Les liens actifs : un bouton par écran visé. */
.help-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px !important; }
.help-action { display: flex; align-items: center; gap: 12px; margin: 0; padding: 11px 14px; border-radius: var(--radius); border: 1px solid color-mix(in oklab, var(--accent) 28%, var(--border)); background: var(--accent-softer); color: var(--accent-ink); font-weight: 600; line-height: 1.35; text-decoration: none !important; transition: background .15s, border-color .15s, transform .15s var(--ease); }
a.help-action:hover { background: var(--accent-soft); border-color: var(--accent); }
a.help-action:hover .help-action__go { transform: translateX(3px); }
.help-action small { display: block; margin-top: 2px; font-size: .8rem; font-weight: 500; color: var(--muted); }
.help-action__icon { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface); color: var(--accent-ink); }
.help-action__icon .icon { width: 17px; height: 17px; }
.help-action__go { flex: none; transition: transform .15s var(--ease); }
.help-action--note { background: var(--surface-2); border-color: var(--border); color: var(--text-2); font-weight: 500; }
.help-action--note .help-action__icon { color: var(--muted); }

/* « Voir aussi » et la liste du thème. */
.help-related { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.help-related h3, .help-side h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 0 0 6px; }
.help-related__link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; margin: 0 -10px; border-radius: 10px; color: var(--text); font-weight: 550; font-size: .92rem; text-decoration: none !important; }
.help-related__link:hover { background: var(--surface-2); color: var(--accent-ink); }
.help-related__link .icon { color: var(--faint); flex: none; }
.help-related__link.is-current { background: var(--accent-soft); color: var(--accent-ink); }
.help-side { padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }

/* La liste des fiches et sa recherche. */
.help-center [hidden] { display: none !important; }
.help-search { position: relative; max-width: 720px; }
.help-search > .icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.help-search .input { height: 56px; min-height: 56px; padding: 0 52px 0 50px; font-size: 1.05rem; border-radius: 16px; box-shadow: var(--shadow-sm); }
.help-search .input::-webkit-search-cancel-button { cursor: pointer; }
.help-search__kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); min-width: 24px; padding: 2px 7px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); font: 600 .78rem var(--mono); text-align: center; pointer-events: none; }
.help-search:focus-within .help-search__kbd, .help-search:has(.input:not(:placeholder-shown)) .help-search__kbd { display: none; }
.help-search--sm > .icon { left: 14px; width: 17px; height: 17px; }
.help-search--sm .input { height: var(--control-h); min-height: var(--control-h); padding: 0 14px 0 40px; font-size: .92rem; border-radius: 12px; }
.help-status { margin: 8px 0 14px; min-height: 1.3em; color: var(--muted); font-size: .85rem; }
.help-popular { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.help-chip { text-decoration: none !important; transition: border-color .15s, color .15s; }
.help-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
/* En colonnes (maçonnerie) : les cartes s'empilent sans trou, une seule colonne sur téléphone. */
.help-themes { columns: 3 320px; column-gap: 20px; }
.help-theme { display: block; width: 100%; break-inside: avoid; margin-bottom: 20px; }
.help-theme__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.help-theme__head h2 { font-size: 1.02rem; }
.help-theme__icon { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.help-theme__icon .icon { width: 17px; height: 17px; }
.help-items { list-style: none; margin: 0; padding: 4px 8px 10px; }
.help-item { display: block; padding: 9px 12px; border-radius: 12px; color: inherit; text-decoration: none !important; transition: background .15s; }
.help-item:hover { background: var(--surface-2); }
.help-item strong { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .93rem; font-weight: 650; }
.help-item:hover strong { color: var(--accent-ink); }
.help-item small { display: block; margin-top: 2px; color: var(--muted); font-size: .82rem; line-height: 1.4; }

/* Une fiche en pleine page. */
.help-page__summary { font-size: 1.05rem; color: var(--text); font-weight: 550; line-height: 1.5; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.help-page .help-doc { max-width: 70ch; }

/* Fiche « Comment le planning est calculé » : petites cases (comme celles du planning), échelle des
   critères, exemple avant / après, étapes du calcul. Tient aussi dans le panneau d'aide étroit. */
.help-doc h2 { margin-top: 26px; font-size: 1.15rem; color: var(--text); }
.help-doc h3 { font-size: 1rem; color: var(--text); margin: 0; }
.calc-slots { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.calc-slot { display: grid; place-items: center; width: 24px; height: 18px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.calc-slot .icon { width: 11px; height: 11px; }
.calc-slot--p { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.calc-slot--w { background: var(--warning); border-color: var(--warning); color: #fff; }
.calc-slot--x { background: var(--danger-soft); border: 1px dashed var(--danger); color: var(--danger); }
.calc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); }
.calc-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.calc-legend .calc-slot { width: 16px; height: 13px; }
.calc-hard { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.calc-hard > div { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.calc-hard span { font-size: .9rem; color: var(--muted); }
.help-doc ol.calc-ladder { list-style: none; padding: 0; gap: 0; counter-reset: calc; }
.calc-ladder > li { position: relative; display: grid; gap: 6px; padding: 0 0 22px 50px; }
.calc-ladder > li::before { counter-increment: calc; content: counter(calc); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface); border: 2px solid var(--accent); color: var(--accent-ink); z-index: 1; }
.calc-ladder > li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.calc-ladder p { margin: 0; }
.calc-note { font-size: .9rem; color: var(--muted); }
.calc-example { display: grid; gap: 12px; margin-top: 4px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.calc-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.calc-compare > div { display: grid; gap: 6px; align-content: start; min-width: 0; }
.calc-compare h4 { margin: 0; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.calc-fam { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; align-items: center; font-size: .88rem; }
.calc-fam b { font-weight: 600; color: var(--text); }
.calc-verdict { margin: 4px 0 0; padding: 6px 10px; border-radius: var(--radius-sm); font-size: .88rem; }
.calc-verdict--bad { background: var(--danger-soft); color: var(--danger); }
.calc-verdict--good { background: var(--accent-soft); color: var(--accent-ink); }
.calc-days { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; font-size: .88rem; }
.calc-days__label { color: var(--muted); }
.help-doc ol.calc-flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.calc-flow > li { display: grid; gap: 3px; align-content: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.calc-flow small { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.calc-flow span { font-size: .9rem; color: var(--muted); }
.help-doc ul.calc-impossible { list-style: none; padding: 0; }
.calc-impossible li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; }
.calc-impossible .icon { width: 16px; height: 16px; margin-top: 4px; color: var(--danger); }

/* Le panneau d'aide : à droite sur ordinateur, en bas de l'écran sur téléphone. */
.help-panel { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; width: min(460px, 100vw); height: 100dvh; max-width: 100vw; max-height: 100dvh; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); border-radius: var(--radius-xl) 0 0 var(--radius-xl); overflow: hidden; }
.help-panel[open] { display: flex; flex-direction: column; animation: help-in .28s var(--ease) both; }
.help-panel::backdrop { background: rgb(15 23 42 / .32); backdrop-filter: blur(2px); }
@keyframes help-in { from { transform: translateX(32px); opacity: 0; } }
.help-panel__inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.help-panel__head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 22px; border-bottom: 1px solid var(--border); }
.help-panel__head [data-help-back]:not([hidden]) + .help-panel__eyebrow { margin-left: -4px; }
.help-panel__head:has([data-help-back]:not([hidden])) { padding-left: 12px; }
.help-panel__eyebrow { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: .8rem; font-weight: 650; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.help-panel__eyebrow .icon { color: var(--accent-ink); }
.help-panel__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 28px; }
.help-panel__body h2 { font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 14px; outline: none; }
.help-panel__loading { color: var(--muted); }
.help-panel__foot { padding: 14px 24px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface-2); }
@media (max-width: 640px) {
    .help-panel { inset: auto 0 0 0; width: 100vw; height: auto; max-height: 88dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
    .help-panel[open] { animation-name: help-up; }
    .help-panel__body { padding: 18px 18px 24px; }
    .help-tip { width: 24px; height: 24px; }
}
@keyframes help-up { from { transform: translateY(40px); opacity: 0; } }
/* Côté familles, le « ? » colle au bouton « Remplir automatiquement ». */
.magic-wrap { display: inline-flex; align-items: center; gap: 2px; }
.child__head .magic-wrap { margin-left: auto; }
.child__head .magic-wrap .btn--magic { margin-left: 0; }
.child__head .magic-wrap + .child__progress { margin-left: 0; }
@media (max-width: 640px) {
    .child__head .magic-wrap { order: 3; width: 100%; margin-left: 0; }
    .magic-wrap .btn--magic { flex: 1; width: auto !important; }
}

.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--border); cursor: not-allowed; opacity: 1; }
.mode-fixed { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.mode-fixed .icon { width: 22px; height: 22px; color: var(--accent); }

/* Retours des tests utilisateurs */
.proposed-pill small { font-size: .7rem; font-weight: 600; opacity: .75; }
body:has(.magic-bar) .portal { padding-bottom: 300px; }
@media (max-width: 640px) {
    body:has(.magic-bar) .portal { padding-bottom: 380px; }
    .btn--sm.btn--icon { width: 44px; min-height: 44px; }
    /* L'avatar reste à côté du nom ; l'action passe dessous, sur toute la largeur. */
    .teacher__row { display: grid; grid-template-columns: auto 1fr; align-items: center; }
    .teacher__row > :nth-child(n+3) { grid-column: 1 / -1; justify-content: flex-start; }
}
.confirm-dialog { border: 0; border-radius: var(--radius-lg); padding: 22px; max-width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgb(15 23 42 / .45); backdrop-filter: blur(2px); }
.confirm-dialog__text { font-weight: 600; font-size: 1.02rem; margin-bottom: 18px; }
.link-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; overflow: hidden; }
.link-dialog .confirm-dialog__text { margin-bottom: 10px; }
.link-dialog__url { word-break: break-all; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin: 0 0 10px; font-size: .9rem; }
.link-dialog p { margin: 0 0 10px; }
.link-dialog__deliver { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; margin-bottom: 10px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.link-dialog__deliver p { flex: 1 1 260px; margin: 0; }
/* Les façons de donner le lien : imprimer son courrier, l'envoyer par e-mail. */
.link-dialog__ways { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.link-dialog__ways form { margin: 0; }
/* Tout en bas, à part et en petit : faire un nouveau lien (geste exceptionnel), confirmé sur place. */
.link-dialog__renew { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .84rem; color: var(--muted); }
.link-dialog__renew-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text-2); text-decoration: underline; cursor: pointer; }
.link-dialog__renew.is-confirming { color: var(--text); }
.link-dialog__renew.is-confirming p { margin: 0 0 10px; }
.link-dialog__renew-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.link-dialog__renewed { margin-bottom: 10px; }
.link-dialog__loading { color: var(--muted); animation: link-dialog-wait 1.2s ease-in-out infinite; }
/* Les places encore vides pendant l'attente : des barres grises de la taille du contenu à venir. */
.link-dialog__ghost { display: inline-block; height: 1em; max-width: 100%; vertical-align: middle; border-radius: 6px; background: var(--surface-2); animation: link-dialog-wait 1.2s ease-in-out infinite; }
.link-dialog__ghost--button { width: 11em; height: var(--control-h); border-radius: 12px; }
@keyframes link-dialog-wait { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .link-dialog__loading, .link-dialog__ghost { animation: none; } }
.confirm-dialog__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 640px) { .confirm-dialog__actions .btn { flex: 1 1 100%; min-height: 48px; } .confirm-dialog__actions { flex-direction: column-reverse; } }
.sheet-mobile { display: none; }
.sheet-card { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px 16px; }
.sheet-card__time { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.sheet-card__time small { display: block; font-size: .75rem; color: var(--faint); font-weight: 600; }
.sheet-card__room { margin-top: 6px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { .sheet-desktop { display: none; } .sheet-mobile { display: flex; } }

.pick-group { grid-column: 1 / -1; margin: 8px 0 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.pick-group:first-child { margin-top: 0; }
.print-only { display: none; }
@media print {
    .print-only { display: block; }
    /* Une journée tient sur une page : lignes serrées, jamais coupées, sans fond coloré. */
    body { font-size: 10.5pt; }
    .timeline__row { grid-template-columns: 80px 1fr 1fr; gap: 10px; padding: 5px 8px; break-inside: avoid; background: none; box-shadow: none; }
    .timeline__row--booked { border-left: 3px solid #000; }
    .timeline__notes { border-bottom: 1px dotted #999; min-height: 20px; }
    .timeline__came { display: inline-flex; align-items: center; gap: 4px; font-size: 8pt; color: #555; }
    .timeline__came::before { content: ''; width: 9px; height: 9px; border: 1px solid #555; }
    .timeline__printed { font-size: 8pt; color: #555; padding: 0 8px 4px; }
    .portal { padding: 0; }
    .portal-hero { margin-bottom: 8px; }
    .portal-hero h1 { font-size: 16pt; }
    .chip { padding: 2px 8px; font-size: 9pt; }
    .print-page h1 { font-size: 16pt; }
}

.chip-check { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .88rem; }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-softer); }
.chip-check.is-known { color: var(--muted); background: var(--surface-2); cursor: default; }
.chip--warning { border-color: color-mix(in oklab, var(--warning) 55%, var(--border)); background: var(--warning-soft); }
.chip-check.is-known .icon { width: 14px; height: 14px; color: var(--success); }
@media print { .print-page { break-after: page; } .print-page:last-child { break-after: auto; } }
@page { size: A4; margin: 14mm 16mm; }

/* Affiche de salle : lisible de loin sur une porte. */
.room-poster { display: flex; flex-direction: column; gap: 18px; }
.room-poster__head { text-align: center; border-bottom: 3px solid currentColor; padding-bottom: 12px; }
.room-poster__label { text-transform: uppercase; letter-spacing: .12em; font-size: .9rem; color: var(--muted); }
.room-poster__name { font-size: 3.6rem; line-height: 1.05; margin: 2px 0 6px; word-break: break-word; }
.room-poster__meta { margin: 0; color: var(--muted); }
.room-poster__table { width: 100%; border-collapse: collapse; font-size: 1.05rem; background: var(--surface); }
.room-poster__table th, .room-poster__table td { border: 1px solid var(--border-strong); padding: 6px 10px; text-align: left; }
.room-poster__table thead th { background: var(--surface-2); font-size: 1.1rem; }
.room-poster__table thead th small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.room-poster__table tbody th { white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; }
.room-poster__table tr { break-inside: avoid; }
.room-poster__table .is-free { color: var(--faint); }
.room-poster__table .is-busy { font-weight: 600; }
@media print {
    .room-poster__name { font-size: 48pt; }
    .room-poster__label, .room-poster__meta, .room-poster__table .is-free { color: #555; }
    .room-poster__table { font-size: 12pt; }
    .room-poster__table th, .room-poster__table td { border-color: #555; padding: 4px 8px; }
    .room-poster__table thead th { background: none; }
}

/* La page des courriers : le bouton « remis », sous la barre. */
.letters-delivered { align-items: center; }
.sheet-head { margin-bottom: 0; }
.unavailability__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sheet-head .letter__to { margin-top: 8mm; }

/* Lettre d'invitation : à l'écran une feuille A4, à l'impression une page par personne. */
.letter { background: #fff; color: #111; border: 1px solid var(--border); border-radius: 6px; padding: 16mm 18mm; font-size: 11pt; line-height: 1.5; display: flex; flex-direction: column; gap: 14px; }
.letter p { margin: 0; }
.letter__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 10px; }
.letter__from { display: flex; flex-direction: column; font-size: 10pt; color: #333; }
.letter__from strong { font-size: 12pt; color: #111; }
.letter__logo { max-height: 22mm; max-width: 50mm; object-fit: contain; align-self: flex-start; margin-bottom: 6px; }
.letter__to { display: flex; flex-direction: column; min-width: 70mm; max-width: 85mm; margin-top: 18mm; }
.letter__date { align-self: flex-end; }
.letter__body { display: flex; flex-direction: column; gap: 10px; }
.letter__access { display: flex; gap: 18px; align-items: center; border: 1.5px solid #111; border-radius: 8px; padding: 12px 16px; margin: 4px 0; break-inside: avoid; }
.letter__access .qr { width: 36mm; height: 36mm; flex: none; }
.letter__access-text { display: flex; flex-direction: column; gap: 8px; font-size: 10pt; min-width: 0; }
.letter__url { word-break: break-all; }
.letter__code { font-family: var(--mono); font-size: 14pt; font-weight: 700; letter-spacing: .08em; }
.letter__signature { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-start; min-width: 60mm; margin-top: 10px; }
@media print {
    .letter { border: 0; border-radius: 0; padding: 0; min-height: auto; }
}
@media (max-width: 640px) {
    .letter { padding: 20px; }
    .letter__head { flex-direction: column; }
    .letter__to { margin-top: 0; }
}


/* Import */
.dropzone { position: relative; display: flex; align-items: center; gap: 14px; padding: 22px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--accent); background: var(--accent-softer); }
.dropzone .icon { width: 28px; height: 28px; color: var(--accent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:has(input:valid) { border-style: solid; border-color: var(--success); }
.map-group { margin: 18px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.map-group:first-child { margin-top: 0; }
.map-grid { display: flex; flex-direction: column; }
.map-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(180px, 280px) 1fr; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--border); }
.map-row__label { font-weight: 600; font-size: .9rem; }
/* Parcourir le fichier ligne par ligne pendant l'association des colonnes. */
/* Collée en haut de l'écran : on change de ligne sans remonter, même en bas de la liste des colonnes. */
.import-nav { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 22px; border-bottom: 1px solid var(--border); background: var(--surface-2); box-shadow: 0 6px 12px -10px rgb(0 0 0 / .25); }
.import-nav[hidden] { display: none; }
.import-nav__line .input { width: 84px; text-align: center; }
.map-row__sample { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row.is-missing .select { border-color: var(--warning); }
.map-row.is-doubt .select { border-color: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 18%, transparent); }

/* Dépôt unique du référentiel : un fichier déposé, ce qu'il contient, ses colonnes. */
.import-file { padding: 14px 22px; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.import-file:first-child { border-top: 0; }
.import-file__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.import-file__icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-softer); color: var(--accent); }
.import-file.is-error .import-file__icon { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.import-file.is-doubt .import-file__icon { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.import-file__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-file__kind { display: flex; align-items: center; gap: 8px; }
.import-file__kind .select { min-width: 190px; }
.import-file__note { margin: 10px 0 0; }
.import-file__columns { margin-top: 10px; }
.import-file__columns > summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--accent); padding: 4px 0; }
.map-panel { padding-top: 8px; }
.map-panel__doubts { margin-bottom: 10px; }
.map-panel__foot { padding-top: 12px; margin-top: 8px; border-top: 1px dashed var(--border); gap: 10px; flex-wrap: wrap; }
.dropzone--compact { padding: 12px 16px; }
/* Le bilan : points à regarder, {teachers} en liste (une carte par personne), {leads} par personne. */
.import-watch { padding: 14px 18px; border-radius: var(--radius); background: var(--surface-2); }
.import-watch h3 { font-size: .95rem; margin: 0 0 8px; }
.import-watch__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.import-watch__list li { display: flex; align-items: flex-start; gap: 8px; }
.import-watch__list .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--warning); }
.import-watch__list li.muted .icon { color: var(--muted); }
.import-section { scroll-margin-top: 80px; }
.import-heading { display: flex; align-items: flex-start; gap: 8px; }
.import-heading > .icon { flex: none; margin-top: 3px; }
.import-heading > span { flex: 1; min-width: 0; }
.import-lead__warn { color: var(--warning); font-weight: 600; }
.btn[hidden] { display: none; }
.dropzone:has(input:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.import-person:has(input:disabled) { cursor: default; opacity: .75; }
.import-people { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.import-person { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.import-person:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.import-person.is-flagged { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.import-person input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.import-person__body { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.import-person__star .icon { width: 15px; height: 15px; color: var(--accent); vertical-align: -2px; }
.import-person__warn { color: var(--warning); font-weight: 600; }
.import-person__warn .icon { width: 14px; height: 14px; vertical-align: -2px; }
.import-more > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0; }
.import-more[open] > summary { margin-bottom: 10px; }
.import-leads { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.import-lead { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.import-lead.is-missing { border-style: dashed; }
.import-lead .icon { width: 14px; height: 14px; vertical-align: -2px; }
.import-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.import-facts .is-warning { color: var(--warning); font-weight: 600; }
.import-facts .icon { width: 14px; height: 14px; vertical-align: -2px; }
/* Le bouton d'enregistrement reste en vue tant qu'on parcourt le bilan. */
.import-savebar { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -8px 18px -12px rgba(15, 23, 42, .25); gap: 10px; flex-wrap: wrap; }
form.is-reading .dropzone { opacity: .6; pointer-events: none; }
@media (max-width: 760px) {
    .import-savebar > span { display: none; }
    .import-savebar .btn { width: 100%; justify-content: center; }
    /* Les trois chiffres sur une ligne, sans prendre tout l'écran (import et référentiel). */
    .import-result .grid--3, .directory-tiles.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .import-result .stat, .directory-tiles .stat { padding: 10px; }
    .import-result .stat__label, .directory-tiles .stat__label { font-size: .72rem; }
    .import-result .stat__label .icon, .directory-tiles .stat__label .icon { display: none; }
    .import-result .stat__value, .directory-tiles .stat__value { font-size: 1.5rem; margin-top: 4px; }
}
.dropzone__names { display: block; margin-top: 4px; color: var(--text); font-weight: 600; word-break: break-word; }
@media (max-width: 760px) { .import-file { padding: 14px 16px; } .import-file__kind { order: 5; width: 100%; } .import-file__kind .select { width: 100%; } }
@media (max-width: 760px) { .map-row { grid-template-columns: 1fr; gap: 6px; } }
.room-select { width: 140px; }

form:has(input[name="mode"][value="wishes"]:checked) .priority-field { display: none; }
/* Session en mode vœux, à la modification : le champ porte « hidden », que .field { display: flex } annulait. */
.priority-field[hidden] { display: none; }
/* Réglages du seul mode vœux : cachés quand « Réservation directe » est choisi (assistant de création). */
form:has(input[name="mode"][value="direct"]:checked) .wish-only { display: none; }
/* Maximum de « Prioritaire » : sans objet en vœux par équipe (une seule ligne par élève). */
form:has(input[name="wish_kind"][value="panels"]:checked) .wish-only { display: none; }
/* La variante du mode vœux n'apparaît qu'une fois « Vœux puis planning » choisi. */
.wish-kind { display: none; }
form:has(input[name="mode"][value="wishes"]:checked) .wish-kind { display: flex; }

/* Onglet « Planning » : une ligne par {teacher}, une case par créneau, la première colonne reste visible. */
.pg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: .82rem; color: var(--muted); }
.pg-legend li { display: inline-flex; align-items: center; gap: 6px; }
.pg-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface); }
/* Créneau où il ne reçoit pas (indisponible, ou pris dans une autre session). */
.pg-cell.pg-cell--blocked { display: block; cursor: not-allowed; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--surface-3) 4px, var(--surface-3) 8px); }
.pg-cell { display: grid; place-items: center; width: 34px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font: inherit; font-size: .68rem; font-weight: 700; letter-spacing: .02em; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.pg-swatch--family, .pg-cell--family { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pg-swatch--company, .pg-cell--company { background: color-mix(in oklab, var(--accent) 45%, #f59e0b); border-color: transparent; color: #fff; }
.pg-swatch--staff, .pg-cell--staff { background: color-mix(in oklab, var(--accent) 35%, var(--surface)); border-color: var(--accent); color: var(--accent-ink); }
.pg-search { width: 220px; }
.pg__scroll { overflow-x: auto; border-radius: var(--radius-lg); }
.pg__table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .82rem; }
.pg__table th, .pg__table td { padding: 3px; text-align: center; border-bottom: 1px solid var(--border); }
.pg__table thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: .72rem; white-space: nowrap; padding: 8px 3px; }
.pg__table .pg__time.is-now { color: var(--accent-ink); background: var(--accent-soft); }
.pg__name { position: sticky; left: 0; z-index: 1; min-width: 170px; max-width: 230px; text-align: left !important; padding: 6px 12px !important; background: var(--surface); border-right: 1px solid var(--border); }
.pg__table thead .pg__name { z-index: 2; background: var(--surface-2); }
.pg__name a { display: block; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg__name small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg__name small .icon { width: 12px; height: 12px; }
.pg__total { min-width: 92px; padding: 6px 12px !important; text-align: left !important; }
.pg__total .bar { margin-top: 4px; height: 6px; }
.pg-cell--free:hover { border-color: var(--accent); background: var(--accent-softer); }
.pg-cell:hover { transform: scale(1.08); box-shadow: var(--shadow-sm); }
.pg-cell:focus-visible { box-shadow: var(--ring); }
.pg-over { color: var(--danger); font-weight: 600; }
.pg__total .pg-over { display: inline; margin-left: 6px; font-size: .72rem; }
.pg-over .icon { width: 14px; height: 14px; vertical-align: -2px; }
.bar__fill--over { background: var(--danger); }
.pg-demand__bar-col { width: 40%; }
.pg-dialog { width: min(92vw, 440px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg, 0 20px 50px -12px rgb(0 0 0 / .35)); }
.pg-dialog > .stack { padding: 20px 22px; }
.pg-dialog::backdrop { background: rgb(15 23 42 / .35); }
.pg-dialog [hidden], [data-pg-row][hidden] { display: none !important; }
.pg-pair { display: contents; }
@media (max-width: 640px) { .pg-search { width: 100%; } .pg__name { min-width: 120px; max-width: 150px; } }
.pg-cell__long { display: none; }
.pg-wrap [hidden] { display: none !important; }
/* Plein écran : toute la fenêtre, en-tête des heures et noms toujours visibles, cases plus larges. */
.pg-wrap.is-full { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; gap: 12px; padding: 14px 18px; background: var(--bg); overflow: hidden; }
.pg-wrap.is-full .pg-head { margin-bottom: 0 !important; flex: none; }
.pg-wrap.is-full .pg { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pg-wrap.is-full .pg__scroll { flex: 1; overflow: auto; }
/* Colonnes fixes : noms et total à largeur fixe, les créneaux se partagent le reste à parts égales
   (défilement seulement si chaque créneau descendrait sous 36 px). */
.pg-wrap.is-full .pg__table { table-layout: fixed; width: 100%; min-width: calc(440px + var(--pg-slots, 24) * 36px); }
.pg-wrap.is-full .pg__table .pg__name { width: 230px; max-width: none; }
.pg-wrap.is-full .pg__table .pg__total { width: 210px; }
.pg-wrap.is-full .pg-cell { width: 100%; min-width: 0; padding: 0 4px; overflow: hidden; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.pg-wrap.is-full .pg-cell__short { display: none; }
.pg-wrap.is-full .pg-cell__long { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Les prénoms ne tiennent pas dans les cases : les initiales. */
.pg-wrap.is-full.is-compact .pg-cell { padding: 0; font-weight: 700; letter-spacing: .02em; }
.pg-wrap.is-full.is-compact .pg-cell__short { display: inline; }
.pg-wrap.is-full.is-compact .pg-cell__long { display: none; }
/* Le total ne passe jamais sur deux lignes : toutes les lignes gardent la même hauteur. */
.pg__total { white-space: nowrap; }
html.has-full-grid, html.has-full-grid body { overflow: hidden; }

/* Envoi des liens par e-mail : en-tête du message, aperçu fidèle, suivi de l'envoi. */
[data-controller="mail-send"] [hidden] { display: none !important; }
.mail-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: .88rem; }
.mail-head dt { color: var(--muted); font-weight: 600; }
.mail-head dd { margin: 0; overflow-wrap: anywhere; }
.mail-preview { width: 100%; height: 560px; border: 1px solid var(--border); border-radius: var(--radius); background: #f1f5f9; }

/* Assistant de création d'une session : barre d'étapes numérotées, une étape à la fois. */
.wizard [hidden] { display: none !important; }
.wizard__nav { display: flex; gap: 6px; margin: 0; padding: 16px 22px; list-style: none; border-bottom: 1px solid var(--border); }
.wizard__nav li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wizard__nav li:not(:last-child) { flex: 1; }
.wizard__nav li:not(:last-child)::after { content: ''; flex: 1; min-width: 12px; height: 2px; border-radius: 2px; background: var(--border); transition: background .3s; }
.wizard__nav li:has(.is-done)::after { background: var(--accent); }
.wizard__dot { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.wizard__dot:disabled { color: var(--faint); cursor: default; }
.wizard__dot:not(:disabled):hover { background: var(--surface-2); }
.wizard__dot:focus-visible { outline: none; box-shadow: var(--ring); }
.wizard__num { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); font-size: .8rem; transition: background .2s, border-color .2s, color .2s; }
.wizard__dot.is-current { color: var(--text); }
.wizard__dot.is-current .wizard__num { border-color: var(--accent); color: var(--accent); box-shadow: var(--ring); }
.wizard__dot.is-done { color: var(--text-2); }
.wizard__dot.is-done .wizard__num { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.wizard__head h2 { margin: 0; outline: none; }
/* Le titre reçoit le focus à chaque étape (lecteurs d’écran) : pas de cadre pour autant. */
.wizard__head h2:focus-visible { box-shadow: none; }
.wizard__head p { margin: 4px 0 0; }
.wizard.is-ready .wizard__step.is-current { animation: wizard-in .28s ease both; }
@keyframes wizard-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.wizard__gap { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-softer); font-size: .88rem; color: var(--text-2); }
.wizard__gap p { margin: 0; }
.wizard__gap p:first-child { font-weight: 600; color: var(--text); }
.recap { margin: 0; display: flex; flex-direction: column; }
.recap__row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr auto; gap: 4px 14px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--border); }
.recap__row:first-child { border-top: 0; }
.recap dt { font-weight: 600; font-size: .88rem; color: var(--text-2); }
.recap dd { margin: 0; }
@media (max-width: 640px) {
    .wizard__nav { gap: 4px; padding: 14px 16px; }
    .wizard__nav li { gap: 4px; }
    .wizard__nav li:not(:last-child)::after { min-width: 4px; }
    .wizard__dot { padding: 2px; }
    .wizard__dot.is-current { padding-right: 8px; }
    .wizard__dot:not(.is-current) .wizard__label { display: none; }
    .wizard__nav li:has(.is-current) { min-width: max-content; }
    .recap__row { grid-template-columns: 1fr auto; }
    .recap dd { grid-column: 1; }
    .recap__row .btn { grid-column: 2; grid-row: 1 / span 2; }
}

/* Équipes de classe : une carte par équipe, sa bordure dit si elle est complète. */
.panel-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); scroll-margin-top: 24px; }
.panel-box.is-empty { border-color: color-mix(in oklab, var(--danger) 45%, var(--border)); }
.panel-box.is-incomplete { border-color: color-mix(in oklab, var(--warning) 55%, var(--border)); }
.panel-box.is-idle { opacity: .7; border-style: dashed; }
.panel-box__members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.panel-box__members li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.app-version { display: block; margin: auto 12px 8px; font-size: .72rem; color: var(--faint); text-decoration: none !important; }
.app-version + .sidebar__foot { margin-top: 0; }
.portal-footer { text-align: center; padding: 0 16px 40px; font-size: .82rem; }
.portal-footer a { color: var(--muted); }
.privacy-text { line-height: 1.7; color: var(--text-2); }
/* « ? » d'aide : centré sur la hauteur des lettres, quelle que soit la taille du texte voisin. */
.help-tip { vertical-align: middle; top: -.06em; }
h1 .help-tip, h2 .help-tip { width: 24px; height: 24px; margin-left: 6px; top: -.04em; }
h1 .help-tip .icon, h2 .help-tip .icon { width: 19px; height: 19px; }
.label .help-tip, label .help-tip, .stat__label .help-tip, small .help-tip { width: 18px; height: 18px; margin-left: 2px; top: -.02em; }
.label .help-tip .icon, label .help-tip .icon, .stat__label .help-tip .icon, small .help-tip .icon { width: 15px; height: 15px; }
/* Un titre d'en-tête de carte ne se resserre pas : son « ? » reste sur la même ligne. */
.card__head > h2, .card__head > h3, .card__head > div > h2, .card__head > div > h3 { flex-shrink: 0; }
.card__head > span.small { text-align: right; }

/* --- Calcul du planning (mode vœux) : écran animé et bilan --------------- */
.ring--lg { width: 76px; height: 76px; }
.ring--lg span { width: 60px; height: 60px; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; gap: 1px; }
.ring--lg span small { font-size: .7rem; color: var(--muted); }
.ring--success { background: conic-gradient(var(--success) calc(var(--p) * 1%), var(--surface-3) 0); }

.run-dialog { border: 0; padding: 0; border-radius: var(--radius-xl); width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.run-dialog::backdrop { background: rgb(15 23 42 / .5); backdrop-filter: blur(3px); }
.run-dialog[open] { animation: run-in .35s var(--ease); }
@keyframes run-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.run { position: relative; padding: 26px; display: flex; flex-direction: column; gap: 20px; background: radial-gradient(500px 220px at 0 0, var(--accent-softer), transparent 70%); }
.run__head { display: flex; align-items: center; gap: 14px; }
.run__head h2 { font-size: 1.3rem; letter-spacing: -.02em; }
.run__orb { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 0 var(--accent-soft); animation: run-orb 1.6s ease-in-out infinite; }
.run__orb svg { width: 24px; height: 24px; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes run-orb { 50% { box-shadow: 0 0 0 12px transparent; transform: scale(1.04); } 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 35%, transparent); } }
.run__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.run__step { display: flex; gap: 12px; align-items: flex-start; color: var(--faint); transition: color .3s; }
.run__step small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.run__step:not(.is-active) small, .run__step:not(.is-active) .run__bar { display: none; }
.run__step.is-active small, .run__step.is-active .run__bar { display: block; }
.run__step.is-active, .run__step.is-done { color: var(--text); }
.run__step.is-active { font-weight: 650; }
.run__dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; margin-top: 1px; transition: all .3s var(--ease); }
.run__dot svg { width: 13px; height: 13px; opacity: 0; transform: scale(.4); transition: all .3s var(--ease); }
.run__step.is-active .run__dot { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.run__step.is-done .run__dot { border-color: var(--success); background: var(--success); color: #fff; animation: none; }
.run__step.is-done .run__dot svg { opacity: 1; transform: none; }
.run__bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.run__bar span { display: block; height: 100%; width: 35%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--accent), color-mix(in oklab, var(--accent) 55%, var(--success)), transparent); animation: run-scan 1.4s ease-in-out infinite; }
.run__bar.is-done span { width: 100%; animation: none; background: var(--success); }
@keyframes run-scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
.run__elapsed { margin-top: 6px; font-variant-numeric: tabular-nums; }
.run__stat { border-radius: var(--radius-sm); padding: 4px 6px; margin: -4px -6px; }
.run__stat.is-better { animation: run-better .9s var(--ease); }
@keyframes run-better { 0% { background: var(--success-soft); } 100% { background: transparent; } }
.run__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); animation: pop-in .3s var(--ease); }
.run__stat small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.run__stat strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.run__stat em { font-style: normal; font-size: .8rem; color: var(--muted); font-weight: 600; }
.run__stat s { margin-left: 6px; color: var(--faint); font-size: .85rem; }
.run__floor { display: block; font-size: .7rem; color: var(--faint); margin-top: 2px; }
.run__floor.is-reached { color: var(--success); font-weight: 650; }
.review__optimum { color: var(--success); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.review__optimum svg, .review__time .muted svg { width: 13px; height: 13px; flex: none; }
.run__spark.is-empty { display: none; }
.run__spark { grid-column: 1 / -1; width: 100%; height: 56px; overflow: visible; }
/* Avec des prioritaires : en haut ce qui est placé (et les essais), en bas les temps et leur courbe. */
.run__stats--priority { grid-template-columns: repeat(3, 1fr); }
.run__stats--priority .run__stat--priority { order: 1; }
.run__stats--priority .run__stat--rounds { order: 2; }
.run__stats--priority > :not(.run__stat--priority, .run__stat--rounds, .run__spark, :first-child) { order: 3; }
.run__stats--priority .run__spark { order: 4; grid-column: auto; align-self: center; }
.run__spark path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset .35s linear; }
.run__spark-max { stroke: var(--warning); }
.run__spark-avg { stroke: var(--accent); }
.run__result { display: flex; gap: 16px; align-items: center; animation: pop-in .4s var(--ease); }
.run__result strong { font-size: 1.15rem; }
.run__actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.run [hidden] { display: none !important; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 12px; border-radius: 2px; opacity: 0;
    background: var(--accent);
    background: hsl(from var(--accent) calc(h + var(--hue) * 55) s l);
    animation: confetti var(--d) var(--delay) cubic-bezier(.25, .6, .4, 1) forwards; }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), 420px) rotate(var(--r)); } }
@media (max-width: 640px) { .run { padding: 20px; } .run__stats { grid-template-columns: repeat(2, 1fr); } .run__stat strong { font-size: 1.3rem; } .run__actions .btn { flex: 1; min-height: 48px; } }

.review__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; align-items: start; }
.review__score { display: flex; gap: 16px; align-items: center; }
.review__score > div:last-child { display: flex; flex-direction: column; align-items: flex-start; }
.review__big { font-size: 1.7rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.review__big .muted { font-size: 1.1rem; font-weight: 600; }
.review__label { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 8px; }
.review__label svg { width: 14px; height: 14px; }
.review__time { display: flex; flex-direction: column; gap: 2px; }
.review__time strong { font-size: 1.15rem; }
.review__search { margin-top: 10px; display: flex; gap: 6px; align-items: flex-start; }
.review__search svg { flex: none; width: 15px; height: 15px; color: var(--accent); margin-top: 2px; }
.review__checks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.review__checks li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.review__tick { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.review__tick svg { width: 12px; height: 12px; }
.review__checks .is-ok .review__tick { background: var(--success-soft); color: var(--success); }
.review__checks .is-ko .review__tick { background: var(--danger-soft); color: var(--danger); }
.review__checks .is-ko { color: var(--danger); font-weight: 600; }
.review__checks .review__details { gap: 2px; margin-top: 4px; padding-left: 2px; }
.review__checks .review__details li { display: list-item; font-size: .85rem; font-weight: 400; color: var(--text); }
.review__unplaced { border-top: 1px solid var(--border); }
.impossible { border-color: color-mix(in oklab, var(--danger) 35%, var(--border)); }
.impossible h3 { display: flex; align-items: center; gap: 8px; color: var(--danger); }
.impossible h3 > svg { width: 18px; height: 18px; flex: none; }
.impossible__list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.impossible__list li { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; }
.impossible__count { flex: none; min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 99px; background: var(--danger-soft); color: var(--danger); font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
/* « À prévoir » : ce que la grille permet, pour information (pas de couleur d'alerte). */
.forecast h3 { display: flex; align-items: center; gap: 8px; }
.forecast h3 > svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.forecast__subtitle { margin-top: 14px; font-size: .95rem; }
.forecast__more { margin-top: 10px; }
.forecast__more summary { cursor: pointer; color: var(--accent); }
.forecast__share { flex: none; min-width: 48px; text-align: center; padding: 2px 6px; border-radius: 99px; background: var(--surface-2, var(--border)); font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
/* Le verdict de place (décision du 17/11) : une jauge colorée, le reste en texte. Rien ne bloque. */
.place { margin-bottom: 24px; }
/* Fenêtre « Place par {teacher} » (choix A du 23/11) : une barre par {teacher}, la part de sa classe
   (pleine) puis celle de ses autres classes (hachurée), et un trait pour ses créneaux. */
.confirm-dialog.place-detail { max-width: min(860px, calc(100vw - 32px)); width: 100%; gap: 14px; }
/* Seulement ouverte : un « display » sans [open] la montrerait, fermée, dans la colonne. */
.confirm-dialog.place-detail[open] { display: grid; }
.place-detail__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.place-detail__head h3 { margin: 0; }
.place-detail__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); }
.place-detail__legend span { display: inline-flex; align-items: center; gap: 7px; }
.place-detail__sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.place-detail__sw--lead, .place-detail__bar--lead { background: var(--accent); }
.place-detail__sw--other, .place-detail__bar--other { background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--accent) 45%, transparent) 0 4px, color-mix(in oklab, var(--accent) 22%, transparent) 4px 7px); }
.place-detail__sw--wished-in, .place-detail__bar--wished-in { background: var(--success-soft); }
.place-detail__bar--wished-in { box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--success) 45%, transparent); }
.place-detail__sw--wished-out, .place-detail__bar--wished-out { background: repeating-linear-gradient(90deg, color-mix(in oklab, var(--faint) 30%, transparent) 0 5px, color-mix(in oklab, var(--faint) 12%, transparent) 5px 9px); }
.place-detail__bar { cursor: help; }
/* Bulle d'information maison (tip_controller), dans le style des menus. */
.tip { position: fixed; z-index: 100; max-width: min(320px, calc(100vw - 16px)); padding: 8px 11px; border-radius: var(--radius-sm); background: var(--text); color: var(--surface); font-size: .82rem; line-height: 1.4; box-shadow: var(--shadow-lg); pointer-events: none; }
.tip::after { content: ""; position: absolute; top: 100%; left: var(--tip-arrow, 50%); margin-left: -6px; border: 6px solid transparent; border-top-color: var(--text); }
.tip--below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--text); }
@media (prefers-reduced-motion: no-preference) { .tip { animation: tip-in .12s var(--ease); } }
@keyframes tip-in { from { opacity: 0; transform: translateY(3px); } }
.place-detail__sw--slots { width: 2px; height: 14px; background: var(--text); border-radius: 1px; }
.place-detail__rows { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.place-detail__row { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); }
.place-detail__row:nth-child(odd) { background: var(--surface-2); }
.place-detail__row.is-over { background: var(--danger-soft); }
.place-detail__who { min-width: 0; }
.place-detail__who strong { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-detail__who small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.place-detail__track { position: relative; height: 26px; min-width: 0; }
.place-detail__stack { position: absolute; top: 4px; height: 18px; left: 0; border-radius: 6px; overflow: hidden; }
.place-detail__bar { position: absolute; top: 0; bottom: 0; }
.place-detail__cap { position: absolute; top: -1px; bottom: -1px; width: 2px; margin-left: -1px; z-index: 1; cursor: help; background: var(--text); border-radius: 1px; }
.place-detail__fig { text-align: right; font-variant-numeric: tabular-nums; font-size: .88rem; }
.place-detail__fig small { display: block; color: var(--muted); font-size: .74rem; white-space: nowrap; }
.place-detail__row.is-over .place-detail__fig b { color: var(--danger); }
@media (max-width: 620px) {
    .place-detail__row { grid-template-columns: minmax(0, 1fr) auto; }
    .place-detail__track { grid-column: 1 / -1; grid-row: 2; }
}
.place h3 { display: flex; align-items: center; gap: 8px; }
.place h3 > svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.place__meter { flex: none; width: 120px; height: 8px; border-radius: 99px; background: var(--surface-2, var(--border)); overflow: hidden; }
.place__meter > span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width .3s ease; }
.place--tight .place__meter > span { background: var(--warning); }
.place--crowded .place__meter > span { background: color-mix(in oklab, var(--warning) 50%, var(--danger)); }
.place--full .place__meter > span { background: var(--danger); }
.place__levers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.place__advice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius, 10px); background: var(--accent-soft, var(--surface-2)); }
.place__advice > svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent); }
.place__details summary { cursor: pointer; color: var(--accent); }
[data-controller="place"][aria-busy="true"] .place { opacity: .7; transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { .place__meter > span { transition: none; } }
.place__split { padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius, 10px); }
.place__split-groups { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.place__split-groups legend { margin-bottom: 6px; }
.review__unplaced-head { padding: 18px 22px 6px; }
.review__unplaced-head h4 { display: flex; align-items: center; gap: 8px; color: var(--warning); }
/* Un autre {teacher} de la classe qui a encore de la place, sous « Placer à la main ». */
.review__no-place { display: block; color: var(--muted); font-weight: 600; }
.review__alternatives { margin-top: 6px; text-align: right; line-height: 1.6; }
.review__alternatives a { white-space: nowrap; }
/* Ajouter une personne : les champs du nouvel élève, et l'entreprise, seulement quand ils servent. */
form .contact-new__student, form .contact-new__company { display: none; }
form:has(#c-student option[value="new"]:checked) .contact-new__student { display: flex; }
form:has(#c-type option[value="apprenticeship_master"]:checked) .contact-new__company { display: flex; }
/* « Placer un rendez-vous » : une ligne par heure, la personne puis les {teachers}, côte à côte. */
.placement th, .placement td { white-space: nowrap; vertical-align: middle; }
.placement thead th small { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-weight: 500; color: var(--muted); }
.placement thead th a { color: var(--text); font-weight: 600; }
.placement__time { position: sticky; left: 0; z-index: 1; background: var(--surface); font-variant-numeric: tabular-nums; }
.placement thead .placement__time { background: var(--surface-2); }
.placement__family { border-right: 2px solid var(--border-strong); background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
.placement__asked { background: var(--accent-softer); }
.placement__busy { font-weight: 600; color: var(--text-2); }
.placement__taken { color: var(--faint); font-size: .82rem; }
.placement tr.is-busy td, .placement tr.is-busy th { background: color-mix(in oklab, var(--surface-2) 50%, var(--surface)); }
.placement tr.is-next td { background: color-mix(in oklab, var(--success) 7%, var(--surface)); }
/* Placé à la main chez un autre {teacher} : la demande est traitée, reste à prévenir la personne. */
.review__replaced td { background: color-mix(in oklab, var(--success) 6%, transparent); }
@media (max-width: 1100px) { .review__grid { grid-template-columns: 1fr 1fr; } .review__checks { grid-column: 1 / -1; } }
@media (max-width: 640px) { .review__grid { grid-template-columns: 1fr; gap: 20px; } }

/* --- Pages d'accueil allégées ------------------------------------------------------------- */
/* Page d'une session : la barre de navigation (frise des étapes, puis listes) et le panneau de l'étape. */
.session-status { text-decoration: none !important; }
.session-status .badge { font-size: .85rem; padding: 6px 12px; }
.journey { margin-bottom: 24px; overflow: hidden; }
.frise { list-style: none; margin: 0; padding: 14px 12px 10px; display: flex; overflow-x: auto; scrollbar-width: none; position: relative; }
.frise__item { flex: 1 1 0; min-width: 92px; position: relative; }
/* Le trait qui relie une étape à la précédente : coloré quand on l'a franchi. */
.frise__item + .frise__item::before { content: ""; position: absolute; top: 24px; left: calc(-50% + 24px); right: calc(50% + 24px); height: 2px; border-radius: 2px; background: var(--border-strong); }
.frise__item.is-done + .frise__item::before { background: var(--success); }
.frise__item a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 14px; color: var(--muted); font-weight: 600; font-size: .86rem; line-height: 1.25; text-align: center; text-decoration: none !important; transition: background .15s, color .15s; }
.frise__item a:hover { background: var(--accent-softer); color: var(--accent-ink); }
.frise__dot { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 750; font-size: .85rem; font-variant-numeric: tabular-nums; background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); }
.frise__dot .icon { width: 16px; height: 16px; }
.frise__label { padding: 2px 10px; border-radius: 99px; }
.frise__count { font-size: .74rem; font-weight: 700; color: var(--warning); font-variant-numeric: tabular-nums; }
.frise__item.is-done a { color: var(--text); }
.frise__item.is-done .frise__dot { border-color: transparent; background: color-mix(in oklab, var(--success) 16%, var(--surface)); color: var(--success); }
.frise__item.is-current a { color: var(--accent-ink); font-weight: 750; }
.frise__item.is-current .frise__dot { border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.frise__item.is-skipped .frise__dot { border-color: var(--warning); color: var(--warning); }
.frise__item.is-skipped a { color: var(--text); }
/* L'étape affichée sous la barre : même vert plein que la liste affichée. */
.frise__item.is-selected .frise__label { background: var(--accent); color: #fff; }
.journey__lists { display: flex; gap: 4px; padding: 5px; border-top: 1px solid var(--border); background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.journey__lists .tab { padding: 8px 14px; font-size: .9rem; }
/* Petit écran : les quatre listes sur deux lignes, aucune cachée derrière un défilement. */
@media (max-width: 640px) { .journey__lists { flex-wrap: wrap; overflow-x: visible; } .journey__lists .tab { flex: 1 1 calc(50% - 4px); } }
.step { margin-bottom: 24px; }
.step.is-current { border-color: color-mix(in oklab, var(--accent) 35%, var(--border)); }
.step__head { padding: 22px 24px 0; }
.step__position { display: flex; align-items: center; gap: 10px; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 6px; }
.step__state { text-transform: none; letter-spacing: 0; }
.step.is-done .step__state { background: var(--success-soft); color: var(--success); }
.step.is-current .step__state { background: var(--accent-soft); color: var(--accent-ink); }
.step.is-skipped .step__state { background: var(--warning-soft); color: var(--warning); }
.step__head h2 { font-size: 1.35rem; }
.step__body { padding: 12px 24px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.step__body > * { max-width: 100%; }
.step__body > p { max-width: 72ch; }
.step__body > .alert, .step__body > .checklist { align-self: stretch; }
.step__fact { font-weight: 650; }
.step__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.step__actions .select { width: auto; }
.step__links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 600; }
.step__links a { display: inline-flex; align-items: center; gap: 6px; }
.step__links .icon { width: 15px; height: 15px; }
.wish-edit { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; font-size: .8rem; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.wish-edit .icon { width: 13px; height: 13px; }
.stat-strip__more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.stat-strip__more .icon { width: 14px; height: 14px; }
.links-send { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.step__foot { padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); font-size: .9rem; font-weight: 600; }
.step__foot a { display: inline-flex; align-items: center; gap: 6px; }
.checklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.checklist li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: 0; }
.checklist li strong { display: block; font-size: .95rem; }
.checklist li small { display: block; color: var(--muted); font-size: .84rem; }
.checklist__tick { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.checklist__tick .icon { width: 14px; height: 14px; }
.checklist .is-ok .checklist__tick { background: var(--success-soft); color: var(--success); }
.checklist .is-missing .checklist__tick { background: var(--warning-soft); color: var(--warning); }
.checklist .is-warn { background: var(--warning-soft); }
.checklist .is-warn .checklist__tick { background: var(--warning); color: #fff; }

/* Réglages d'une session : les sections à gauche, l'encadré « Place » à droite, qui reste en vue
   pendant qu'on fait défiler ; une seule colonne sur un écran étroit. */
.settings-layout { display: grid; gap: 20px; align-items: start; max-width: 860px; }
.settings-layout--side { max-width: none; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); }
.settings-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.settings-side .place { margin-bottom: 0; }
.settings-side .place .card__head { flex-wrap: wrap; gap: 8px; }
.settings-side .place h3 { flex: 1 1 100%; flex-wrap: wrap; min-width: 0; }
.settings-side .place__levers .btn { display: block; white-space: normal; text-align: left; height: auto; min-height: var(--control-h-sm); padding-block: 6px; }
.settings-save .card__body { padding-block: 10px; }
.settings-block .card__head h3 { display: flex; align-items: center; gap: 8px; }
.settings-block .card__head h3 > svg { width: 18px; height: 18px; color: var(--accent); }
.settings-save { position: sticky; bottom: 12px; z-index: 2; box-shadow: var(--shadow-md, var(--shadow-sm)); }
.settings-save__notice { color: var(--warning); margin-left: 8px; }
@media (max-width: 1100px) {
    .settings-layout--side { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
    .settings-side { position: static; max-height: none; overflow: visible; }
}

/* Les chiffres d'une session en une bande. */
.stat-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding: 14px 22px; margin-bottom: 24px; }
.stat-strip__item { display: flex; align-items: baseline; gap: 8px; color: inherit; text-decoration: none !important; }
.stat-strip__item strong { font-size: 1.4rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-strip__item span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.stat-strip__item:hover span { color: var(--accent); }
.stat-strip__note { flex: 1 1 260px; }

/* Cartes repliables : la tête sert de bouton, le contenu se déplie. */
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card:not([open]) > summary { padding-bottom: 18px; }
details.card[open] .details-toggle .icon { transform: rotate(180deg); }
.demo-links { margin-top: 32px; }
.demo-links:not([open]) h3 { font-size: .95rem; color: var(--muted); }

/* Prise en main : les étapes faites se déplient sous les autres. */
.onboarding__done { border-top: 1px solid var(--border); }
.onboarding__done > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 10px 22px; }
.onboarding__done > summary::-webkit-details-marker { display: none; }
.onboarding__done > summary .icon { width: 14px; height: 14px; }
.onboarding__done[open] > summary .icon { transform: rotate(180deg); }
.onboarding__done .onboarding__list { margin: 0; }
.onboarding > .onboarding__list:not(:last-child) { padding-bottom: 0; }
.onboarding > .card__head:last-child { padding-bottom: 18px; }
/* Le cercle reste à gauche du titre ; faute de place, ce sont les boutons qui passent dessous. */
.onboarding > .card__head { flex-wrap: wrap; }
.onboarding > .card__head > .row:first-child { flex: 1 1 300px; min-width: 0; }
.onboarding > .card__head > .row:last-child { margin-left: auto; }

/* Menu ⋮ d'une ligne : les gestes rares ou risqués, en toutes lettres. Attribut popover : le
   navigateur l'affiche au-dessus de tout, même hors d'un tableau qui défile ; menu_controller le
   range contre son bouton. Sans cet attribut (vieux navigateur), les gestes restent visibles dans
   la ligne et le bouton ⋮, inutile, disparaît. */
.menu { padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); text-align: left; }
.menu form { display: contents; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 12px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.25; text-align: left; text-decoration: none !important; cursor: pointer; }
.menu__item:hover, .menu__item:focus-visible { background: var(--surface-2); }
.menu__item .icon { width: 16px; height: 16px; flex: none; color: var(--muted); }
.menu__item--danger, .menu__item--danger .icon { color: var(--danger); }
.menu__item--danger:hover, .menu__item--danger:focus-visible { background: var(--danger-soft); }
.menu__sep { height: 1px; margin: 4px 6px; background: var(--border); }
@supports selector(:popover-open) {
    .menu { position: fixed; inset: auto; margin: 0; min-width: 220px; max-width: min(300px, calc(100vw - 16px)); }
    .menu:popover-open { display: flex; flex-direction: column; gap: 2px; }
}
@supports not selector(:popover-open) {
    [popovertarget] { display: none; }
    .menu { display: inline-flex; flex-wrap: wrap; border: 0; box-shadow: none; padding: 0; background: none; }
}
@media (max-width: 640px) { .menu__item { min-height: 46px; } }
/* La page d'un {teacher} (son lien) : à l'écran, ses rendez-vous seuls ; les créneaux libres sont
   repliés dessous et reviennent sur la feuille imprimée. */
@media screen { .timeline--compact .timeline__row--free { display: none; } }
.timeline__row.is-next { background: var(--success-soft); }
.timeline__row.is-past { opacity: .55; }
.free-slots { margin-top: 16px; }
/* Sur la page d'un {teacher}, les indisponibilités viennent après ses rendez-vous. */
.portal #indisponibilites { margin-top: 16px; }
.free-slots > summary { display: flex; align-items: center; gap: 10px; padding: 14px 22px; cursor: pointer; list-style: none; font-weight: 600; }
.free-slots > summary::-webkit-details-marker { display: none; }
.free-slots > summary .icon { width: 17px; height: 17px; color: var(--muted); }
.free-slots[open] > summary .icon:last-child { transform: rotate(180deg); }
.free-slots > .chips { padding: 0 22px 18px; }

/* Fiches d'un {teacher} et d'une famille (secrétariat) : les mêmes gestes sur chaque rendez-vous. */
.timeline__actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.timeline__row a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.timeline__row a:hover { text-decoration-color: currentColor; }
.move-dialog, .book-dialog { width: min(520px, calc(100vw - 32px)); max-width: none; text-align: left; white-space: normal; }
.move-dialog form { display: flex; flex-direction: column; gap: 12px; }
.move-dialog p, .book-dialog p { margin: 0; }
/* La liste des {learners} qui se réduit pendant la frappe (fenêtre « Réserver pour une famille »). */
.pick-list { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pick-list legend { padding: 0; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.pick-list__items { max-height: min(260px, 38vh); overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.pick-list__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pick-list__item[hidden] { display: none; }
.pick-list__item:hover { background: var(--surface-2); }
.pick-list__item:has(input:checked) { background: var(--accent-soft); }
.pick-list__items > p { padding: 8px 10px; margin: 0; }
/* La fiche d'une famille : son adresse, son lien, sa dernière visite ; puis un {teacher} à ouvrir pour choisir une heure. */
.contact-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 14px 22px; margin-bottom: 20px; }
.contact-fact { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: .92rem; overflow-wrap: anywhere; }
.add-teacher { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.add-teacher > summary, div.add-teacher { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.add-teacher > summary { cursor: pointer; list-style: none; }
.add-teacher > summary::-webkit-details-marker { display: none; }
.add-teacher > summary .icon { width: 16px; height: 16px; color: var(--muted); }
.add-teacher[open] > summary .icon { transform: rotate(180deg); }
.add-teacher[open] > summary { border-bottom: 1px solid var(--border); }
.add-teacher > .slots { padding: 12px 14px; }
.add-teacher--done { background: var(--success-soft); border-color: transparent; }
.add-teacher--done > .icon { width: 16px; height: 16px; color: var(--success); }
.add-teacher--none { color: var(--muted); }

/* Un geste impossible, à sa place dans le menu, avec sa raison : rien à cliquer. */
.menu__note { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 12px; min-height: 38px; color: var(--muted); font-size: .85rem; }
.menu__note .icon { width: 16px; height: 16px; flex: none; color: var(--faint); }

/* Listes des familles et des formateurs : les actions restent visibles quand le tableau défile (écran moyen) ; sur
   téléphone, chaque ligne devient une carte, chaque case précédée du titre de sa colonne. */
/* L'adresse e-mail et le lien dans les tableaux : une icône d'état cliquable, une forme par état. */
.link-state, .email-state { position: relative; display: inline-grid; place-items: center; width: var(--control-h-sm); height: var(--control-h-sm); padding: 0; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text-2); cursor: pointer; }
.email-state:hover, .email-state:focus-visible, .link-state:hover, .link-state:focus-visible { background: var(--surface-2); border-color: var(--border); }
.email-state .icon, .link-state .icon { width: 17px; height: 17px; }
.link-state--ok { color: var(--success); background: var(--success-soft); }
.link-state--made { color: var(--text-2); }
.link-state--pending { color: var(--faint); border: 1px dashed var(--border); }
.link-state--blocked { color: var(--danger); background: var(--danger-soft); }
.email-state--none { color: var(--faint); border: 1px dashed var(--border); }
.email-state--warn { color: var(--warning); background: var(--warning-soft); }
.email-state--corrected::after { content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.email-check { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; color: var(--warning); }
.email-check[hidden] { display: none; }
.email-check .icon { width: 15px; height: 15px; flex: none; }
@media (max-width: 640px) { .email-state, .link-state { width: 44px; height: 44px; } }
/* La fenêtre « Modifier l'adresse e-mail » : le champ, une aide, l'avertissement s'il y a lieu. */
.email-dialog { width: min(480px, calc(100vw - 32px)); max-width: none; white-space: normal; text-align: left; }
.email-dialog form { display: flex; flex-direction: column; gap: 12px; }
.email-dialog .confirm-dialog__text, .email-dialog p { margin: 0; }
/* Les liens d'une case (pastille + « Planning », « Voir », « Fiche ») : au survol, seul le mot se
   souligne, pas l'espace entre la pastille et lui. */
.people-table td > a, .people-table td > a:hover { text-decoration: none; }
.people-table td > a:hover .wish-edit, .people-table td > a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.people-table__actions { text-align: right; }
.people-table th:last-child, .people-table__actions { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px color-mix(in oklab, var(--text) 25%, transparent); }
.people-table tbody tr:hover .people-table__actions { background: var(--surface-2); }
@media (max-width: 760px) {
    .people-table thead { display: none; }
    .people-table, .people-table tbody, .people-table tr, .people-table td { display: block; width: 100%; }
    .people-table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .people-table td { padding: 4px 0; border: 0; white-space: normal; }
    .people-table td[data-label] { display: flex; gap: 10px; align-items: baseline; }
    .people-table td[data-label]::before { content: attr(data-label); flex: 0 0 34%; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
    .people-table__actions { position: static; box-shadow: none; text-align: left; padding-top: 8px; background: none; }
}
/* Sur téléphone, les messages s'affichent en haut : en bas, ils recouvraient les boutons sous le pouce. */
@media (max-width: 640px) { .toasts { bottom: auto; top: max(12px, env(safe-area-inset-top)); } }
.import-watch__list [hidden], .import-watch__list[hidden], .import-watch [hidden] { display: none; }
