/* Portail général : feuille de style unique (aucun style en ligne : CSP stricte). Voir UX.md. */
:root {
    --marine: #223A5D;
    --bleu-roi: #1962A1;
    --rouge: #DD281F;
    --ink: #1B2430;
    --muted: #5B6676;
    --bg: #F2F2F2;
    --surface: #FFFFFF;
    --line: #D0D0D0;
    --link: #1962A1;
    --heading: #223A5D;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .12);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #E4EAF2; --muted: #95A3B7; --bg: #0E1726; --surface: #131D2E; --line: #263650;
        --link: #8EC1F7; --heading: #9CC8F5; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--link); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .25rem 0 1rem; color: var(--heading); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }
.muted { color: var(--muted); }

/* Barre du haut */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__brand { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; font-weight: 700; color: var(--ink); text-decoration: none; }
.topbar__brand img { width: 40px; height: 40px; border-radius: 6px; flex: none; }
.dropdown { position: relative; }
.dropdown summary { list-style: none; cursor: pointer; }
.dropdown summary::-webkit-details-marker { display: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #2E7BC4, var(--bleu-roi)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.dropdown__panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30; min-width: 220px; display: flex; flex-direction: column; padding: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.dropdown__panel a, .dropdown__panel .linklike { padding: .5rem .75rem; border-radius: 6px; text-decoration: none; color: var(--ink); text-align: left; font: inherit; }
.dropdown__panel a:hover, .dropdown__panel .linklike:hover { background: var(--bg); }
.dropdown__panel form { margin: 0; }
.linklike { background: none; border: 0; cursor: pointer; width: 100%; }
.dropdown__name { margin: .25rem .75rem .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); font-weight: 600; overflow-wrap: anywhere; }

.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

/* Boutons */
.btn { display: inline-block; padding: .55rem 1.1rem; border: 1px solid var(--bleu-roi); border-radius: 6px; background: var(--bleu-roi); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--marine); border-color: var(--marine); }
.btn--ghost { background: transparent; color: var(--link); border-color: var(--line); font-weight: 400; padding: .35rem .8rem; }
.btn--ghost:hover { background: var(--bg); color: var(--link); border-color: var(--link); }

/* Pages sans barre (connexion, erreurs) */
.minimal { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.box { width: 100%; max-width: 420px; padding: 2rem; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.box__logo { width: 64px; height: 64px; margin-bottom: .5rem; }

/* Page d'accueil : cartes image + titre + lien */
.landing__title { margin: .5rem 0 1.25rem; }
.landing-grid { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.landing-card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.landing-card:hover, .landing-card:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 24, 40, .14); border-color: var(--bleu-roi); }
/* Zone d'image de taille fixe (16/10) pour TOUTES les cartes : les titres restent alignés, l'image entière est visible. */
.landing-card__img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); }
.landing-card__img img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.landing-card__img--default { background: #fff; }
.landing-card__img--default img { padding: 1.5rem; }
.landing-card__title { padding: .85rem 1rem 1rem; font-weight: 700; font-size: 1.05rem; line-height: 1.3; }

@media (max-width: 480px) {
    .landing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
}

/* Texte d'accueil, messages, formulaires du back-office */
.landing__text { max-width: 70ch; margin: 0 0 1.5rem; font-size: 1.05rem; }
.flash { margin: 0 0 1.25rem; padding: .7rem 1rem; border-radius: 6px; border: 1px solid; }
.flash--ok { background: #E6F4EA; border-color: #8CC9A0; color: #14532D; }
.flash--err { background: #FDECEA; border-color: #F1A9A5; color: #8A1C14; }
@media (prefers-color-scheme: dark) {
    .flash--ok { background: #10331F; border-color: #2C6B47; color: #9BE3BB; }
    .flash--err { background: #3A1517; border-color: #7A2A2A; color: #F6B1AC; }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin: 0 0 1.5rem; }
.panel h2 { margin: 0 0 .75rem; font-size: 1.15rem; color: var(--heading); }
.stack { display: grid; gap: .75rem; max-width: 640px; }
label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }
input[type="text"], textarea, input[type="file"] { width: 100%; padding: .5rem .6rem; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.check { display: flex; align-items: center; gap: .4rem; font-weight: 400; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em; }
.btn--danger { color: #C42A1F; border-color: #C42A1F; }
.btn.btn--danger:not(.btn--ghost) { background: #C42A1F; color: #fff; }
.btn--ghost.btn--danger:hover { background: #C42A1F; color: #fff; border-color: #C42A1F; }
.inline-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; }
.brand-row { display: flex; gap: 1rem; align-items: flex-start; }
.brand-row__logo { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; flex: none; }
.card-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 1rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--line); }
.card-row--off .card-row__thumb { opacity: .45; }
.card-row__thumb { width: 120px; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.card-row__thumb--default { padding: .4rem; }
.card-row__form { display: grid; gap: .6rem; min-width: 0; }
.card-row__opts { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.card-row__actions { display: flex; flex-direction: column; gap: .35rem; }
.card-row__actions form { margin: 0; }
@media (max-width: 720px) { .card-row { grid-template-columns: 1fr; } .card-row__actions { flex-direction: row; flex-wrap: wrap; } }

/* Page des droits : tableau groupes x droits */
.table-wrap { overflow-x: auto; }
.rights { border-collapse: collapse; width: 100%; }
.rights th, .rights td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rights thead th { font-weight: 600; color: var(--heading); }
.rights td { text-align: center; }
.rights tbody th { font-weight: 400; }
.icon-btn { display: inline-flex; padding: .35rem; border-radius: 6px; color: #C42A1F; border: 1px solid transparent; }
.icon-btn:hover, .icon-btn:focus-visible { border-color: #C42A1F; }
.badge { display: inline-block; margin-top: .25rem; padding: .1rem .55rem; border-radius: 999px; border: 1px solid; font-size: .8rem; line-height: 1.4; white-space: nowrap; }
.badge--err { background: #FDECEA; border-color: #F1A9A5; color: #8A1C14; }
@media (prefers-color-scheme: dark) {
    .badge--err { background: #3A1517; border-color: #7A2A2A; color: #F6B1AC; }
}

/* Gestion des sources du calendrier */
input[type="url"], input[type="number"] { width: 100%; padding: .5rem .6rem; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
input[disabled], input[readonly] { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.panel__head h2 { margin: 0; }
.perm { font-size: .8rem; color: var(--muted); }
.panel h3 { margin: 1.25rem 0 .5rem; font-size: 1rem; color: var(--heading); }
.table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.table th, .table td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.table thead th { font-weight: 600; color: var(--heading); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.strong { font-weight: 600; }
.dot { vertical-align: -2px; margin-right: .5rem; }
.badge--ok { background: #E6F4EA; border-color: #8CC9A0; color: #14532D; }
.badge--off { background: var(--bg); border-color: var(--line); color: var(--muted); }
.table .badge, .rows .badge { margin-top: 0; }
.field { display: grid; gap: .25rem; }
.field > label { font-weight: 600; font-size: .9rem; }
.color-row { display: flex; align-items: center; gap: .6rem; }
.color-picker { flex: none; width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.color-hex { max-width: 140px; }
.narrow { max-width: 220px; }
.split-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.rows { margin: 0; border-top: 1px solid var(--line); }
.rows > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; font-weight: 600; text-align: right; }
.counts { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0; }
.counts .badge { margin-top: 0; }
.reject { margin: .6rem 0 0; padding: .6rem .75rem .6rem 1.6rem; background: #FDECEA; border: 1px solid #F1A9A5; border-radius: 6px; color: #8A1C14; font-size: .9rem; }
.copy-row { display: flex; gap: .5rem; max-width: 640px; }
.info { margin: 0 0 1.5rem; padding: .85rem 1rem; background: #EAF2FA; border: 1px solid #A9C8E6; border-radius: var(--radius); color: #173F66; font-size: .95rem; }

/* Fenêtre modale de confirmation (élément <dialog>, ouverte par app.js) */
.modal { width: calc(100% - 2rem); max-width: 440px; padding: 1.5rem; margin: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(16, 24, 40, .3); }
.modal::backdrop { background: rgba(27, 36, 48, .55); }
.modal__close { position: absolute; top: .6rem; right: .6rem; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; background: transparent; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; }
.modal__close:hover { background: var(--bg); color: var(--ink); }
.modal__icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: .9rem; border-radius: 50%; background: #FDECEA; border: 1px solid #F1A9A5; color: #C42A1F; }
.modal__title { margin: 0 0 .5rem; font-size: 1.25rem; line-height: 1.3; color: var(--heading); }
.modal__text { margin: 0; }
.modal__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.modal__actions .btn--ghost { padding: .55rem 1.1rem; }
@media (prefers-color-scheme: dark) {
    .badge--ok { background: #10331F; border-color: #2C6B47; color: #9BE3BB; }
    .reject { background: #3A1517; border-color: #7A2A2A; color: #F6B1AC; }
    .info { background: #11263D; border-color: #2B5380; color: #A9CDF2; }
    .modal__icon { background: #3A1517; border-color: #7A2A2A; color: #F6B1AC; }
    .modal::backdrop { background: rgba(0, 0, 0, .65); }
}

/* Barre du haut : lien Calendrier */
.topbar__link { color: var(--ink); text-decoration: none; font-weight: 600; padding: .4rem .7rem; border-radius: 6px; }
.topbar__link:hover { background: var(--bg); }

/* Accueil : cartes à gauche, panneau Calendrier à droite (sous les cartes sur mobile) */
.landing-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.landing-split .landing-grid { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.landing-split .panel { margin: 0; padding: 1.25rem; }
@media (max-width: 559px) { .landing-split { grid-template-columns: 1fr; } }

/* Calendrier : couleurs des sources par classes .src-<id> (feuille /calendrier/couleurs.css) ; repli = bleu du portail */
.ag { --soft: #F7F8FA; --line2: #E3E6EA; --warn-bg: #FFF6D6; --warn-bd: #E8D48A; --warn-tx: #5A4600; --cancel-bg: #EDEEF0; --cancel-tx: #5B6676; --cancel-bd: #9AA3AF; --danger: #C42A1F; --hover: #F7F8FA; }
@media (prefers-color-scheme: dark) {
    .ag { --soft: #172338; --line2: #22314A; --warn-bg: #3A3112; --warn-bd: #7A6A2A; --warn-tx: #F0DFA0; --cancel-bg: #1D2A40; --cancel-tx: #95A3B7; --cancel-bd: #5B6676; --danger: #F6B1AC; --hover: #172338; }
}
.ag button { font-family: inherit; }
.cal-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #1962A1); }
.ag svg { flex: none; }
.cal-lay { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1rem; align-items: start; }
.cal-fl { margin: 0; padding: 1rem; }
.cal-fl h2 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .75rem; font-size: 15px; }
.cal-fl fieldset { margin: 0 0 .9rem; padding: 0; border: 0; min-width: 0; }
.cal-fl legend { padding: 0; margin-bottom: .3rem; font-size: 13px; font-weight: 700; color: var(--muted); }
.cal-fl label { display: flex; align-items: center; gap: .45rem; font-size: 14px; font-weight: 400; padding: .2rem 0; cursor: pointer; }
.cal-fl input { accent-color: var(--bleu-roi); margin: 0; width: 16px; height: 16px; flex: none; }
.cal-none { margin: 0; font-size: 14px; }
.cal-warn { display: flex; gap: .5rem; align-items: center; background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-tx); border-radius: 6px; padding: .45rem .7rem; font-size: 13px; margin-bottom: .75rem; }
.cal-tb { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.cal-tb strong { color: var(--heading); font-size: 1.1rem; margin: 0 .25rem; }
.cal-b { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--link); border: 1px solid var(--line); border-radius: 6px; padding: .35rem .8rem; font-size: 14px; cursor: pointer; }
.cal-b:hover { background: var(--surface); border-color: var(--link); }
.cal-seg { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.cal-seg button { border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--link); padding: .35rem .7rem; font-size: 14px; cursor: pointer; }
.cal-seg button:last-child { border-right: 0; }
.cal-seg button[aria-pressed="true"] { background: var(--bleu-roi); color: #fff; font-weight: 700; }
.cal-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-v { min-height: 330px; }
.cal-loading { opacity: .55; transition: opacity .15s; }
.cal-mh { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--soft); border-bottom: 1px solid var(--line); }
.cal-mh div { padding: .4rem 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-wk { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: 28px 20px 20px 18px; row-gap: 2px; border-bottom: 1px solid var(--line2); margin-right: -1px; }
.cal-wk:last-child { border-bottom: 0; }
.cal-bg { grid-row: 1 / 5; border-right: 1px solid var(--line2); }
.cal-bg.cal-o { background: var(--soft); }
.cal-dn { grid-row: 1; padding: 3px 0 0 5px; font-size: 13px; }
.cal-dn.cal-o { color: var(--muted); }
.cal-dn span, .cal-gh span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border: 2px solid transparent; border-radius: 50%; }
.ag .cal-td { border-color: var(--link); color: var(--link); font-weight: 700; }
.cal-ev { display: block; border: 0; border-left: 3px solid var(--c, #1962A1); border-radius: 4px; background: var(--t, #E4EEF8); color: var(--ink); font-size: 12px; text-align: left; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 5px; height: 20px; line-height: 18px; }
.cal-ev:hover { filter: brightness(.94); }
.cal-wk .cal-ev { margin: 0 3px; }
.cal-bar { background: var(--d, #1962A1); border-left-color: var(--d, #1962A1); color: var(--on, #fff); font-weight: 600; }
.cal-ev.cal-x { background: var(--cancel-bg); color: var(--cancel-tx); border-left-color: var(--cancel-bd); text-decoration: line-through; font-weight: 400; }
.cal-more { border: 0; background: none; color: var(--link); font-size: 12px; font-weight: 700; text-align: left; padding: 0 8px; cursor: pointer; }
.cal-more:hover { text-decoration: underline; }
.cal-g { display: grid; grid-template-columns: 44px repeat(var(--n), minmax(0, 1fr)); }
.cal-g0 { background: var(--soft); border-bottom: 1px solid var(--line); }
.cal-gh { display: flex; flex-direction: column; align-items: center; padding: .3rem 0; border-left: 1px solid var(--line2); }
.cal-gh small { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-gh span { font-size: 15px; }
.cal-ad { grid-auto-rows: 24px; border-bottom: 1px solid var(--line); }
.cal-ad .cal-ev { margin: 1px 3px; height: 22px; line-height: 20px; }
.cal-adl { font-size: 11px; color: var(--muted); padding: 4px 5px 0 0; text-align: right; }
.cal-cb { border-left: 1px solid var(--line2); }
.cal-hr { height: 40px; font-size: 11px; line-height: 16px; text-align: right; padding: 0 6px; color: var(--muted); }
.cal-dc { position: relative; border-left: 1px solid var(--line2); }
.cal-hl { display: block; height: 40px; border-top: 1px solid var(--line2); }
.cal-now { background: var(--soft); }
.cal-ev.cal-blk { position: absolute; white-space: normal; text-overflow: clip; line-height: 1.3; padding: 3px 5px; }
.cal-blk small { font-size: 12px; color: var(--muted); }
.cal-blk small svg, .cal-lb small svg, .cal-card svg { width: 14px; height: 14px; vertical-align: -2px; }
.cal-gt { background: var(--soft); border-bottom: 1px solid var(--line2); padding: .4rem .9rem; font-size: 13px; font-weight: 700; color: var(--heading); }
.cal-li { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .6rem .9rem; border: 0; border-bottom: 1px solid var(--line2); background: var(--surface); text-align: left; cursor: pointer; color: inherit; font-size: 1rem; }
.cal-li:hover { background: var(--hover); }
.cal-lt { width: 104px; flex: none; white-space: nowrap; font-size: 13px; color: var(--muted); }
.cal-lt small { display: block; white-space: normal; font-size: 11px; line-height: 1.25; }
.cal-lb { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-lb b { font-size: 15px; }
.cal-lb small { font-size: 13px; color: var(--muted); }
.cal-x2 .cal-lb b { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.cal-an { border: 1px solid var(--danger); color: var(--danger); border-radius: 4px; padding: 0 .4rem; font-size: 11px; font-weight: 700; margin-left: .5rem; white-space: nowrap; }
.cal-em { padding: 2.5rem 1rem; text-align: center; color: var(--muted); margin: 0; }
.cal-card { position: absolute; top: 44px; left: 12px; right: 12px; max-width: 400px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, #1962A1); border-radius: var(--radius); padding: .9rem 1rem; z-index: 3; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.cal-card[hidden] { display: none; }
.cal-fr { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: 13px; color: var(--muted); }
.cal-fr span { display: flex; align-items: center; gap: .4rem; }
.cal-cl { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; }
.cal-card h3 { margin: .4rem 0; font-size: 1.2rem; line-height: 1.3; color: var(--heading); }
.cal-card h3 .cal-an { vertical-align: middle; }
.cal-card p { margin: 0 0 .5rem; font-size: 14px; display: flex; gap: .4rem; align-items: center; }
.cal-card p.cal-last { margin-bottom: .8rem; }
.cal-pri { display: inline-flex; align-items: center; gap: .5rem; background: var(--bleu-roi); color: #fff; font-weight: 700; border: 1px solid var(--bleu-roi); border-radius: 6px; padding: .55rem 1.1rem; text-decoration: none; font-size: 14px; }
.cal-pri:hover { background: var(--marine); border-color: var(--marine); color: #fff; }
/* Calendrier : vue par défaut (enregistrée par personne) */
.cal-pf { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line2); }
.cal-pfb { display: grid; gap: .4rem; margin-top: .5rem; }
.cal-pfb .cal-b { width: 100%; text-align: center; line-height: 1.3; }
.cal-b.cal-b--quiet { border-color: transparent; color: var(--muted); }
.cal-b.cal-b--quiet:hover { color: var(--link); }
.cal-pmsg { min-height: 1.3em; margin: .5rem 0 0; font-size: 13px; color: var(--muted); }
.cal-pmsg.cal-perr { color: var(--danger); }
@media (max-width: 559px) {
    .cal-lay { grid-template-columns: 1fr; }
    .cal-fl { display: flex; flex-wrap: wrap; gap: 0 2rem; }
    .cal-fl h2 { flex-basis: 100%; margin-bottom: .4rem; }
    .cal-fl fieldset { margin-bottom: .4rem; }
    .cal-pf { flex-basis: 100%; margin-top: .4rem; }
    .cal-seg { margin-left: 0; }
}

/* Calendrier : mode réduit (panneau de l'accueil) */
.calendar-mini h2 { margin-bottom: .75rem; }
.cal--mini h3 { margin: 1rem 0 .5rem; padding-top: .9rem; border-top: 1px solid var(--line2); font-size: 14px; color: var(--muted); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; font-weight: 700; font-size: 15px; }
.cal-mb { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--link); cursor: pointer; }
.cal-mb:hover { border-color: var(--link); }
.cal-m { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-m em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.cal-d { position: relative; display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto; padding-bottom: 5px; border: 2px solid transparent; border-radius: 50%; font-size: 13px; }
.cal-dots { position: absolute; bottom: 3px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.cal-pt { width: 5px; height: 5px; border-radius: 50%; background: var(--c, #1962A1); }
.cal-pt.cal-ptx { background: var(--cancel-bd); }
.cal-lg { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .5rem; font-size: 12px; color: var(--muted); }
.cal-lg .cal-dot { width: 8px; height: 8px; margin-right: .35rem; }
.cal-ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.cal-ul li { display: flex; gap: .7rem; align-items: center; }
.cal-chip { flex: none; width: 60px; padding: .2rem 0; background: var(--bg); border-radius: 6px; text-align: center; font-weight: 700; font-size: 16px; line-height: 1.2; color: var(--heading); }
.cal-chip small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.cal-chip small { white-space: nowrap; }
.cal-chip small:last-child { font-size: 10px; }
.cal-ul b { display: block; font-size: 14px; }
.cal-ul small { font-size: 13px; color: var(--muted); }
.cal-ul small .cal-dot { width: 8px; height: 8px; margin-right: .35rem; }
.cal-up { border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; }
.cal-up .cal-none { padding: 1rem; }
.cal-ui { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-bottom: 1px solid var(--line2); background: var(--surface); }
.cal-ui { width: 100%; border: 0; border-bottom: 1px solid var(--line2); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cal-ui:last-child { border-bottom: 0; }
.cal-ui:hover, .cal-ub:hover { background: var(--hover); }
.cal-ui .cal-lt { width: 100px; }
.cal--mini .cal-card { position: static; max-width: none; margin: 0 0 .9rem; box-shadow: none; }
.cal-ub { display: flex; gap: .7rem; align-items: center; width: 100%; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cal-ui .cal-lb b { font-size: 14px; }
.cal-ui .cal-lb small { font-size: 12px; }
.cal-all { display: inline-flex; align-items: center; gap: .25rem; margin-top: 1rem; color: var(--link); font-weight: 700; font-size: 14px; text-decoration: none; }
.cal-all:hover { text-decoration: underline; }
