:root {
  --jaune: #fece5e; --jaune-txt: #b3860a; --jaune-bg: #fff6df;
  --bleu: #3c8cff; --bleu-bg: #eaf2ff;
  --orange: #f06437; --orange-txt: #c4471d; --vert: #2cb79d; --vert: #2cb79d; --rouge: #ef5f5f; --rouge-bg: #fdecec;
  --noir: #2a2a22; --ink: #2a2a22; --bg: #f4f1ee; --card: #ffffff; --muted: #7a7068; --border: #e6e0d8; --hover: #faf7f3;
  --banner: #fff3cd; --sel: #fdf0e9; --disabled: #b9b1a8;
  --shadow: 0 2px 8px rgba(42,42,34,.07);
  --radius: 12px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #f1ece4; --bg: #1c1c17; --card: #26261f; --muted: #a99f94; --border: #3a3a31; --hover: #2f2f27;
    --banner: #3a3220; --sel: #3a2a22; --rouge-bg: #3a2222; --disabled: #6a635b; --orange-txt: #f58a66; --shadow: 0 2px 8px rgba(0,0,0,.3); color-scheme: dark; }
}
:root[data-theme="dark"] { --ink: #f1ece4; --bg: #1c1c17; --card: #26261f; --muted: #a99f94; --border: #3a3a31; --hover: #2f2f27;
  --banner: #3a3220; --sel: #3a2a22; --rouge-bg: #3a2222; --disabled: #6a635b; --orange-txt: #f58a66; --shadow: 0 2px 8px rgba(0,0,0,.3); color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.4; }
body::before { content: ''; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--noir); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* Marque */
.logo-tile { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #fff; flex: none; }
.logo-tile img { height: 30px; width: auto; display: block; }
.login-logo { width: 150px; height: auto; margin: 0 auto 4px; display: block; }
.login-card h1 { text-align: center; }
.brand-mark { display: inline-flex; gap: 4px; padding: 8px; background: var(--noir); border-radius: 10px; }
.brand-mark span { width: 12px; height: 22px; border-radius: 3px; }
.brand-mark .b { background: var(--jaune); } .brand-mark .c { background: var(--bleu); }
.brand-mark.sm { padding: 6px; } .brand-mark.sm span { width: 8px; height: 16px; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 32px 28px; width: min(360px, 100%); display: grid; gap: 10px; }
.login-card h1 { margin: 8px 0 0; font-size: 1.6rem; font-weight: 800; }
.login-card p { margin: 0 0 8px; }
.login-card label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.login-card input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.error { color: var(--rouge); min-height: 1.2em; }

/* En-tête */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--noir); color: #fff; border-bottom: 3px solid var(--orange);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 10px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 1.15rem; font-weight: 800; }
.brand span { font-size: 12px; color: #cfc8bf; }
.period { display: flex; align-items: end; gap: 8px; margin-left: auto; }
.field { display: grid; gap: 2px; }
.field span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: #cfc8bf; }
.field input, .field select { background: #3a3a31; border: 1px solid #4a4a40; color: #fff; border-radius: 8px; padding: 6px 8px; color-scheme: dark; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: #fff; color: var(--noir); }
.top .btn.ghost { background: transparent; border-color: #5a5a50; color: #fff; }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.icon-btn { background: #3a3a31; border: 1px solid #4a4a40; color: #fff; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 18px; line-height: 1; }
.icon-btn.light { background: transparent; }
.banner { background: var(--banner); border-bottom: 1px solid var(--border); padding-block: 8px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); font-size: 13px; }

/* Mise en page */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding-block: 20px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); align-items: start; }
.side { position: sticky; top: 84px; display: grid; gap: 16px; max-height: calc(100vh - 100px); overflow: auto; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px; }
.card h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head input { width: 110px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--card); color: var(--ink); }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.loading, .empty { padding: 40px; text-align: center; color: var(--muted); }

/* Planning */
.week { margin-bottom: 22px; }
.week-head { display: grid; grid-template-columns: 170px 1fr 1fr; gap: 10px; padding: 0 4px 6px; align-items: end; }
.week-head h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.lieu-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.b { background: var(--jaune); } .dot.c { background: var(--bleu); }
.row { display: grid; grid-template-columns: 170px 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.row.closed { opacity: .55; }
.day { position: relative; background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; cursor: pointer; }
.day .d { font-weight: 800; font-size: 15px; text-transform: capitalize; }
.day .meta { font-size: 12px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: 11px; border-radius: 20px; padding: 1px 8px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.tag.strong { background: var(--ink); color: var(--card); border-color: var(--ink); }
.remark { font-size: 12px; margin-top: 6px; color: var(--ink); }
.cell { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; cursor: pointer; border-left: 4px solid var(--border); position: relative; min-height: 64px; }
.cell:hover, .day:hover { background: var(--hover); }
.cell.b { border-left-color: var(--jaune); } .cell.c { border-left-color: var(--bleu); }
.cell.closed { background: transparent; box-shadow: none; border-left-color: transparent; cursor: default; color: var(--muted); font-size: 12px; min-height: 0; }
.cell.changed::after, .day.changed::after { content: ''; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.cell-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; padding-right: 12px; }
.need { font-weight: 700; color: var(--ink); }
.need.short { color: var(--rouge); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; border-radius: 20px; padding: 2px 10px; background: var(--bg); border: 1px solid var(--border); }
.chip .r { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.chip.ref { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip.ref .r { color: inherit; opacity: .65; }
.chip.warn { border-color: var(--rouge); background: var(--rouge-bg); }
.chip.hl { background: var(--card); border-style: dashed; color: var(--muted); }
.chip.hi { outline: 2px solid var(--ink); outline-offset: 1px; font-weight: 700; }
/* Surlignage d'une personne : on estompe tout le reste, sans couleur (l'orange/rouge reste réservé aux alertes) */
.planning.focus .chip:not(.hi) { opacity: .28; }
.planning.focus .alerts, .planning.focus .remark { opacity: .35; }
.focus-bar { position: sticky; top: calc(76px + env(safe-area-inset-top, 0px)); z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--ink); color: var(--card); border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; font-size: 13px; }
.focus-bar button { border: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.alerts { margin-top: 6px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.alerts .err { color: var(--rouge); }
.alerts .warn { color: var(--orange-txt); }
.chip.soft { border-color: var(--orange); border-style: dashed; }
.pick.soft { border-style: dashed; border-color: var(--orange); }
.pick.soft small { color: var(--orange-txt); }
.flag { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; margin-left: 5px; vertical-align: 1px; }
.small { font-size: 12.5px; }
.lieu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.need-line { font-size: 12.5px; font-weight: 600; }
.team { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.chip.big { font-size: 13.5px; padding: 4px 6px 4px 12px; }
.add { display: flex; align-items: center; gap: 8px; }
.add-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.role-select { border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; background: var(--card); color: var(--ink); font-size: 13px; }
ul.ko { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 12px; font-size: 12.5px; color: var(--ink); }
ul.ko span { color: var(--muted); }
details.rem-box { margin-top: 12px; }
details.rem-box summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details.rem-box textarea { margin-top: 6px; }
.drawer-head .sub { font-size: 12.5px; color: #cfc8bf; margin-top: 2px; }
.head-btns { display: flex; gap: 8px; }
.remark.lieu { color: var(--muted); }

/* Compteurs */
.counts { width: 100%; border-collapse: collapse; font-size: 13px; }
.counts th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); text-align: right; font-weight: 600; padding: 4px 4px; background: var(--bg); position: sticky; top: 0; }
.counts th:first-child { text-align: left; }
.counts td { padding: 5px 4px; border-bottom: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.counts td:first-child { text-align: left; }
.counts tr { cursor: pointer; }
.counts tr:hover td { background: var(--hover); }
.counts tr.sel td { background: var(--hover); font-weight: 700; }
.counts tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
.counts .perm td:first-child::after { content: ' · perm.'; color: var(--muted); font-size: 11px; }
.split { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--bg); width: 54px; margin-left: auto; }
.split i { display: block; height: 100%; }
.split .b { background: var(--jaune); } .split .c { background: var(--bleu); }
.summary-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.summary-list li { display: flex; justify-content: space-between; }
.summary-list b { font-variant-numeric: tabular-nums; }

/* Tiroir jour */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(42,42,34,.35); z-index: 40; }
.drawer { position: fixed; top: env(safe-area-inset-top, 0px); right: 0; bottom: 0; padding-right: env(safe-area-inset-right, 0px); width: min(760px, 100%); background: var(--bg); z-index: 41; overflow: auto; box-shadow: -8px 0 24px rgba(42,42,34,.15); }
.drawer-head { position: sticky; top: 0; background: var(--noir); color: #fff; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 2; }
.drawer-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; text-transform: capitalize; }
.drawer-body { padding: 16px 20px 40px; display: grid; gap: 16px; }
.drawer .card h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.drawer .card.b { border-top: 4px solid var(--jaune); } .drawer .card.c { border-top: 4px solid var(--bleu); }
.activity { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.role { border-top: 1px solid var(--border); padding: 10px 0; }
.role-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.role-head span { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.role-head em { font-style: normal; font-size: 12px; }
.chip button { border: 0; background: none; cursor: pointer; padding: 0 0 0 2px; color: inherit; opacity: .6; font-size: 14px; line-height: 1; }
.chip button:hover { opacity: 1; }
.picker { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.pick { font-size: 12.5px; border-radius: 20px; padding: 2px 10px; border: 1px solid var(--border); background: var(--card); color: var(--ink); cursor: pointer; }
.pick:hover { background: var(--hover); border-color: var(--muted); }
.pick small { color: var(--muted); margin-left: 4px; }
.pick:disabled { cursor: not-allowed; background: transparent; color: var(--disabled); border-style: dashed; }
.pick:disabled small { color: var(--disabled); }
details.others { margin-top: 6px; font-size: 12px; color: var(--muted); }
details.others summary { cursor: pointer; }
textarea.rem { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px; font: inherit; font-size: 13px; resize: vertical; min-height: 38px; background: var(--card); color: var(--ink); }
.rem-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; display: block; margin: 8px 0 4px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--noir); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 60; max-width: min(560px, calc(100% - 32px)); }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .period { margin-left: 0; flex-wrap: wrap; }
  .actions .btn { flex: 1 1 auto; }
  .layout { padding-block: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .row, .week-head { grid-template-columns: 1fr; }
  .week-head .lieu-title { display: none; }
}

/* Onglets */
.tabs { display: flex; gap: 4px; background: #3a3a31; border-radius: 10px; padding: 3px; }
.tab { border: 0; background: transparent; color: #cfc8bf; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.tab[aria-selected="true"] { background: #fff; color: var(--noir); }
.tab:focus-visible, .dcell:focus-visible, .pick:focus-visible, .btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.linkbtn { border: 0; background: none; color: var(--orange-txt); cursor: pointer; padding: 0; font-size: 12px; text-decoration: underline; }

/* Grille des dispos */
.dispos { min-width: 0; }
.dgrid-wrap { overflow-x: auto; margin-top: 8px; }
.dgrid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.dgrid th, .dgrid td { padding: 2px; text-align: center; }
.dgrid thead th { font-weight: 600; color: var(--muted); vertical-align: bottom; padding-bottom: 6px; }
.dgrid thead th span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.dgrid thead th b { display: block; color: var(--ink); font-size: 13px; }
.dgrid thead th small { display: block; font-variant-numeric: tabular-nums; }
.dgrid thead th.chg b { color: var(--orange-txt); }
.dgrid th[scope="row"], .dgrid .corner { position: sticky; left: 0; background: var(--card); text-align: left; padding-right: 12px; white-space: nowrap; z-index: 1; font-weight: 600; }
.dgrid th[scope="row"] small { color: var(--muted); font-weight: 400; margin-left: 6px; font-variant-numeric: tabular-nums; }
.dgrid tbody tr:hover th, .dgrid tbody tr:hover td { background: var(--hover); }
.dcell { width: 30px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--noir); cursor: pointer; font-size: 13px; font-weight: 800; padding: 0; display: inline-grid; place-items: center; }
/* Dispo : contour + fond, sans coche */
.dcell.on { background: var(--bg); border-color: var(--muted); }
/* Déjà placé·e : coche + couleur du lieu (Bastille jaune, Chantelivre bleu, hors les murs vert) */
.dcell.placed.b { background: var(--jaune); border-color: var(--jaune); color: var(--noir); }
.dcell.placed.c { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.dcell.placed.h { background: var(--vert); border-color: var(--vert); color: #fff; }
.dcell.chg { outline: 2px dashed var(--orange); outline-offset: 1px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.dcell.sample { width: 20px; height: 18px; font-size: 11px; cursor: default; }
@media (max-width: 720px) { .tabs { order: 3; } }
.login-card .btn.primary { background: var(--noir); color: #fff; margin-top: 4px; padding: 10px 14px; }

/* En-tête clair (identique en thème sombre) : le personnage du logo s'y pose sans pastille */
body::before { background: #fff; }
.top { background: #fff; color: var(--noir); border-bottom: 3px solid var(--orange); box-shadow: 0 1px 0 #e6e0d8; color-scheme: light; }
.top .brand strong { color: var(--noir); }
.logo-tile { background: transparent; width: auto; height: 44px; border-radius: 0; }
.logo-tile img { height: 42px; }
.top .field span { color: #7a7068; }
.top .field input, .top .field select { background: #f4f1ee; border-color: #e6e0d8; color: var(--noir); color-scheme: light; }
.top .icon-btn { background: #f4f1ee; border-color: #e6e0d8; color: var(--noir); }
.top .icon-btn.light { background: transparent; }
.top .btn.ghost { border-color: #d6cfc6; color: var(--noir); }
.top .btn.primary { background: var(--noir); color: #fff; }
.tabs { background: #f4f1ee; }
.tab { color: #7a7068; }
.tab[aria-selected="true"] { background: var(--noir); color: #fff; }

/* Confirmation */
.confirm-backdrop { position: fixed; inset: 0; background: rgba(42,42,34,.35); z-index: 70; }
.confirm { position: fixed; z-index: 71; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px));
  background: var(--card); color: var(--ink); border-radius: 14px; box-shadow: 0 12px 40px rgba(42,42,34,.25); padding: 22px 22px 18px; }
.confirm h2 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 800; }
.confirm p { margin: 0 0 18px; line-height: 1.45; }
.confirm-btns { display: flex; justify-content: flex-end; gap: 8px; }
.btn.dark { background: var(--noir); color: #fff; }
.confirm .btn.ghost { color: var(--ink); }
/* Case qui vient de changer */
.dcell.just { animation: just 1.2s ease-out; }
@keyframes just { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .dcell.just { animation: none; } }

/* Icônes compétences : drapeau UK (English) et note (lecture musicale) */
.ico-uk { width: 16px; height: 8px; margin-left: 5px; vertical-align: 0; border-radius: 1px; flex: none; }
.ico-note { margin-left: 4px; font-size: 12px; line-height: 1; }
.cell-top .ico-uk, .need-line .ico-uk { width: 18px; height: 9px; }

/* Période */
.period { align-items: center; }
.top .field select#periode { min-width: 210px; font-weight: 600; }
.period-meta { display: grid; gap: 1px; font-size: 12px; color: #7a7068; }
.period-meta .linkbtn { color: #c4471d; text-align: left; }
.top .btn.ghost#new-period { padding: 7px 12px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.np-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.np-field { display: grid; gap: 4px; }
.np-field span { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.np-field input { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--card); color: var(--ink); }
.np-resume { font-size: 13px; margin: 12px 0 0; min-height: 1.2em; }
.confirm .error { margin: 4px 0 10px; font-size: 13px; }

/* Colonnes Dispos / Médiateur */
.dispos-col, .mediateur-col, .resa-col { display: grid; gap: 16px; min-width: 0; align-content: start; }
.req-card { display: grid; gap: 10px; }
.req-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.req-head h2 { margin-bottom: 4px; }
.req-steps { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.req-steps span { border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; color: var(--muted); }
.req-steps span.done { background: var(--ink); color: var(--card); border-color: var(--ink); }
.req-stats { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; }
.req-stats b { font-variant-numeric: tabular-nums; }
.resp-list { display: flex; flex-wrap: wrap; gap: 6px; }
.resp { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; border: 1px solid var(--border); border-radius: 20px; padding: 3px 4px 3px 10px; background: var(--card); color: var(--ink); }
.resp.ok { border-color: var(--ink); }
.resp .st { font-size: 11px; color: var(--muted); }
.resp button { border: 0; background: var(--bg); color: var(--ink); border-radius: 14px; padding: 2px 8px; cursor: pointer; font-size: 11.5px; }
.sim-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; background: var(--banner); color: var(--ink); border-radius: 4px; padding: 2px 6px; font-weight: 700; }

/* Fenêtres larges (demande, formulaire médiateur) */
.sheet { position: fixed; z-index: 71; left: 50%; top: calc(24px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(820px, calc(100% - 32px));
  max-height: calc(100vh - 48px - env(safe-area-inset-top, 0px)); overflow: auto; background: var(--bg); color: var(--ink); border-radius: 14px; box-shadow: 0 12px 40px rgba(42,42,34,.25); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--noir); color: #fff; padding: 14px 20px; }
.sheet-head h2 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.sheet-body { padding: 16px 20px 20px; display: grid; gap: 14px; }
.sheet-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border-top: 1px solid var(--border); padding: 12px 20px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-row label, .stack label { display: grid; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.form-row input, .stack textarea, .stack input { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.stack { display: grid; gap: 12px; }
.recips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; max-height: 260px; overflow: auto; padding: 4px 2px; }
.recips label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 400; cursor: pointer; }
.recips small { color: var(--muted); font-size: 11.5px; margin-left: auto; font-variant-numeric: tabular-nums; }
.recip-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.mail-preview { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; line-height: 1.5; }
.mail-preview .subj { font-weight: 700; margin-bottom: 8px; }
.mail-preview .fake-btn { display: inline-block; background: var(--noir); color: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 600; margin-top: 8px; }
.coverage { font-size: 13px; }
.coverage .warn { color: var(--orange-txt); }

/* Formulaire médiateur */
.mf { width: min(560px, calc(100% - 32px)); }
.mf .sheet-head { background: #fff; color: var(--noir); border-bottom: 3px solid var(--orange); }
.mf .sheet-head img { height: 34px; }
.mf-hello { font-size: 15px; }
.mf-rules { display: grid; gap: 8px; }
.rule { display: grid; gap: 4px; }
.rule-top { display: flex; justify-content: space-between; font-size: 13px; }
.rule-top b { font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--muted); }
.rule.ok .bar i { background: var(--vert); }
.mf-week { display: grid; gap: 6px; }
.mf-week h3 { margin: 6px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.mf-days { display: flex; flex-wrap: wrap; gap: 6px; }
.dchip { border: 1px solid var(--border); background: var(--card); color: var(--ink); border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 13px; min-width: 64px; text-align: center; }
.dchip small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.dchip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.dchip[aria-pressed="true"] small { color: inherit; opacity: .7; }
.dchip.we { border-style: solid; border-width: 1.5px; }
.mf-why { font-size: 12.5px; color: var(--orange-txt); }

/* Onglet Médiateur */
.med-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.med-bar select { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; background: var(--card); color: var(--ink); font: inherit; font-weight: 600; min-width: 220px; }
.med-bar .icon-btn { background: var(--card); border-color: var(--border); color: var(--ink); }
.med-id h2.name { font-size: 1.4rem; font-weight: 800; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 0; display: flex; align-items: center; gap: 6px; }
.tags.big .tag { font-size: 12px; padding: 2px 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; }
.kpi b { display: block; font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mcal .h { font-size: 10.5px; text-transform: uppercase; color: var(--muted); text-align: center; letter-spacing: .4px; }
.mcal .c { aspect-ratio: 1.6; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; display: grid; place-items: center; color: var(--muted); max-width: 100%; }
.mcal .c.closed { border-style: dashed; opacity: .4; }
.mcal .c.on { background: var(--bg); border-color: var(--muted); color: var(--ink); }
.mcal .c.b { background: var(--jaune); border-color: var(--jaune); color: var(--noir); font-weight: 700; }
.mcal .c.cc { background: var(--bleu); border-color: var(--bleu); color: #fff; font-weight: 700; }
.mcal .c.out { visibility: hidden; }
.htable { width: 100%; border-collapse: collapse; font-size: 13px; }
.htable th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 6px 6px; background: var(--bg); }
.htable td { padding: 7px 6px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.htable tr.cur td { font-weight: 700; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

/* Cohorte */
.coh { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 10px; font-size: 13px; }
.coh .resp-list { flex-basis: 100%; }
.depannage { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.depannage .picker { margin-top: 4px; }
.dgrid tr.horsc th[scope="row"] { color: var(--muted); font-weight: 400; }
.dgrid tr.horsc th[scope="row"]::after { content: ' · dépannage'; font-size: 10.5px; }

/* Barre d'action du planning */
.planning-col { display: grid; gap: 14px; min-width: 0; align-content: start; }
.plan-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.btn.fill { background: var(--orange); color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); }
.btn.fill:hover { filter: brightness(.95); }
.top .linkbtn.new-period { color: #7a7068; font-size: 12.5px; text-decoration: none; border: 1px dashed #d6cfc6; border-radius: 8px; padding: 6px 10px; }
.top .linkbtn.new-period:hover { color: var(--noir); border-color: #7a7068; }
/* Alignement du sélecteur de période : flèches et lien alignés sur le champ, pas sur son libellé */
.period { align-items: flex-end; }
.period .icon-btn, .top .field select#periode { height: 38px; box-sizing: border-box; }
.period .icon-btn { width: 38px; display: inline-grid; place-items: center; padding: 0; }
.top .field select#periode { padding: 0 10px; }
.top .linkbtn.new-period { height: 38px; display: inline-flex; align-items: center; }
/* Champs du formulaire de demande : même hauteur, alignés en haut */
.form-row { align-items: start; }
.form-row label { align-content: start; }
.form-row input { height: 42px; box-sizing: border-box; padding-block: 0; }

/* Calendrier du formulaire médiateur */
.cal-card { padding: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-month { grid-column: 1 / -1; font-weight: 800; font-size: 1rem; text-transform: capitalize; margin-top: 10px; }
.cal-month:first-child { margin-top: 0; }
.cal-h { text-align: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.cal-h.we { color: var(--ink); }
.cal-d { height: 44px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--ink); font-size: 15px; font-weight: 600;
  display: grid; place-items: center; padding: 0; font-variant-numeric: tabular-nums; }
button.cal-d { cursor: pointer; }
button.cal-d:hover { border-color: var(--muted); }
.cal-d.out { visibility: hidden; }
.cal-d.closed { background: transparent; border-style: dashed; color: var(--disabled); font-weight: 400; }
.cal-d.vac { background: var(--vac-bg); border-color: var(--vac-bd); }
.cal-d.vac.closed { background: transparent; }
.cal-d[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.cal-d.vac[aria-pressed="true"] { box-shadow: inset 0 -4px 0 var(--vert); }
.cal-d:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.cal-d.sample { width: 22px; height: 18px; display: inline-block; }
.cal-d.sample.on { background: var(--ink); border-color: var(--ink); }
.cal-legend { margin: 0 0 10px; }
.vac-note { margin: 0 0 12px; font-size: 13px; background: var(--vac-bg); border: 1px solid var(--vac-bd); border-radius: 8px; padding: 8px 12px; color: var(--ink); font-weight: 600; }
:root { --vac-bg: #e2f4ef; --vac-bd: #9fd9ca; --vac-trait: #9b7fd4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --vac-bg: #1f3a33; --vac-bd: #2f6b5c; } }
:root[data-theme="dark"] { --vac-bg: #1f3a33; --vac-bd: #2f6b5c; }
/* Vacances : petit trait violet (vert = jauge semaine, jaune/bleu = maisons) sous le chiffre (lisible même sur mobile), sans fond qui ferait croire à une sélection */
.cal-d.vac { background: var(--card); border-color: var(--border); position: relative; }
.cal-d.vac::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 16px; height: 3px; margin-left: -8px; border-radius: 2px; background: var(--vac-trait); }
.cal-d.vac[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); box-shadow: none; }
.cal-d.vac.closed::after { opacity: .35; }
.cal-d.sample.vac { background: var(--card); border-color: var(--border); }
.cal-d.sample.vac::after { bottom: 3px; width: 10px; margin-left: -5px; height: 2px; }
.vac-note { background: var(--bg); border-color: var(--border); font-weight: 500; }
/* En-tête : libellé « Période » masqué visuellement (lu par les lecteurs d'écran) pour aligner
   flèches, sélecteur, onglets et boutons sur une même ligne */
.period .field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.period { align-items: center; }
.top { align-items: center; }
.tabs, .actions .btn, .actions .icon-btn { height: 38px; box-sizing: border-box; }
.tabs { align-items: center; }
.tab { height: 32px; display: inline-flex; align-items: center; }
.actions .btn { display: inline-flex; align-items: center; }

/* Remarques visibles dans le formulaire médiateur */
.cal-d.note { position: relative; }
.cal-d.note::before { content: ''; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.mf-notes { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.mf-notes h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.mf-notes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }

.note-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); vertical-align: 1px; }
.mf-notes h3 { display: flex; align-items: center; gap: 6px; }

/* Hors les murs : 3e colonne, vert (couleur du lieu) */
.row, .week-head { grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .55fr); }
.dot.h { background: var(--vert); }
.cell.h { border-left-color: var(--vert); }
.card.h { border-top: 4px solid var(--vert); }
.drawer .card.h { border-top: 4px solid var(--vert); }
.hlm-add { border: 1px dashed var(--border) !important; border-left: 1px dashed var(--border) !important; background: transparent !important; box-shadow: none !important; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; min-height: 64px; }
.hlm-add:hover { color: var(--ink); border-color: var(--vert) !important; }
.row.closed .hlm-add { opacity: 1; }
.row.closed .cell.h { opacity: 1; }
.hlm-title { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.hlm-fields { margin: 8px 0 4px; }
.mcal .c.hh { background: var(--vert); border-color: var(--vert); color: #fff; font-weight: 700; }
/* Remarques partagée / interne */
.remark.prive { color: var(--muted); font-style: italic; }
.rem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.rem-grid .rem-label, .card.h > .rem-label { display: grid; gap: 4px; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink); font-weight: 600; }
.rem-grid .rem-label .muted, .card.h > .rem-label .muted { font-weight: 400; }
@media (max-width: 720px) { .rem-grid { grid-template-columns: 1fr; } .row, .week-head { grid-template-columns: 1fr; } }

.hlm-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, .7fr); }
.hlm-fields label { min-width: 0; }
.hlm-fields input { width: 100%; min-width: 0; }

/* Envoi du planning */
.mail-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.mail-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--border); }
.mail-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.warn-box { border-left: 4px solid var(--orange); display: grid; gap: 4px; font-size: 13.5px; }
.check-line { display: flex !important; align-items: center; gap: 8px; text-transform: none !important; letter-spacing: 0 !important; font-size: 13.5px !important; color: var(--ink) !important; font-weight: 400 !important; }
.inline-select { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.inline-select select { border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; background: var(--card); color: var(--ink); font: inherit; }
.mail-table td.nw { white-space: nowrap; text-transform: capitalize; }

/* Option direction mise en avant */
.dir-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border: 2px solid var(--border); }
.dir-card.on { border-color: var(--ink); }
.dir-toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 14px; }
.dir-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: none; width: 40px; height: 22px; border-radius: 11px; background: var(--border); position: relative; transition: background .15s; margin-top: 2px; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.dir-toggle input:checked + .switch { background: var(--ink); }
.dir-toggle input:checked + .switch::after { transform: translateX(18px); }
.dir-toggle input:focus-visible + .switch { outline: 2px solid var(--orange); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
.mail-scroll { overflow-x: auto; }
.mail-table.dir td { font-size: 12.5px; min-width: 120px; }
.mail-table .miss { color: var(--rouge); }

/* Ouverture exceptionnelle d'un jour fermé */
.cell.closed.reopen { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.reopen-line { display: flex; align-items: center; gap: 10px; }
.cell.closed.reopen .remark { opacity: .8; }
.cell.closed.reopen .linkbtn { opacity: 0; font-size: 12px; }
.row:hover .cell.closed.reopen .linkbtn, .cell.closed.reopen .linkbtn:focus-visible { opacity: 1; }
@media (hover: none) { .cell.closed.reopen .linkbtn { opacity: 1; } }
.row.closed .cell.exc, .row.exc-row .cell.exc { opacity: 1; }
.cell.exc { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(0,0,0,.025) 8px 16px); }
.exc-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 2px 0 6px; }
.exc-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: 8px 0; }
.closed-card { display: flex; flex-direction: column; gap: 8px; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; gap: 2px; margin: 4px 0 8px; }
.seg-btn { border: 0; background: transparent; font: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.seg-btn.on { background: var(--ink); color: var(--bg, #fff); }
.seg-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.reopen-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Billets du jour (discret) */
.day-billets { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
/* Réservations du jour dans le panneau */
.resa-day { list-style: none; margin: 0 0 10px; padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 12.5px; display: grid; gap: 4px; }
/* Onglets Anniversaires / Scolaires */
.resa-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; }
.resa-tools input[type=search] { flex: 1 1 180px; max-width: 280px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 13.5px; }
.resa-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.resa { display: grid; grid-template-columns: 112px 1fr auto; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); align-items: start; }
.resa.off { opacity: .5; }
.resa-time b { display: block; font-size: 14px; white-space: nowrap; }
.resa-time small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.resa-title { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.resa-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.resa-note { font-size: 12.5px; margin-top: 6px; padding: 6px 8px; background: var(--bg); border-radius: 6px; white-space: pre-line; }
.resa-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; text-align: right; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--ink); }
.badge.ok { background: color-mix(in srgb, var(--vert) 18%, transparent); border-color: transparent; }
.badge.off { color: var(--muted); }
.warn-txt { color: var(--rouge); font-size: 12px; }
@media (max-width: 640px) { .resa { grid-template-columns: 70px 1fr; } .resa-side { grid-column: 2; align-items: flex-start; text-align: left; } }

.layout.full { grid-template-columns: minmax(0, 1fr); }
.side[hidden] { display: none; }

/* Rôle (simulation) */
.role-pick { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.role-pick select { width: 118px; height: 38px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; background: var(--card); color: var(--ink); font-size: 13px; }

/* Lectures */
.lect-col { min-width: 0; }
.lect { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.lect-main { padding: 28px 32px; }
.lect-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.lect-admin { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lect-kicker { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.lect-title { font-size: 30px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.01em; }
.lect-dates { color: var(--muted); font-size: 14px; }
.lect-sous { margin-top: 6px; font-weight: 600; }
.lect-msg { white-space: pre-line; font-size: 15px; line-height: 1.55; margin: 18px 0 0; max-width: 72ch; }
.lect-liens { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lect-sec { margin-top: 28px; }
.lect-sec > h2, .lect-bar h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.lect-rem { white-space: pre-line; font-size: 14px; line-height: 1.6; background: var(--bg); border-radius: 10px; padding: 16px 18px; max-width: 80ch; }
.prog { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.prog-col { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.prog-col h3 { font-size: 14px; margin: 0 0 8px; }
.prog-col ol { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.55; }
.lect-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.lect-bar h2 { margin: 0; }
.pub-h { font-size: 14px; margin: 18px 0 10px; }
.livres { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.livre { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; background: var(--card); }
.cover { aspect-ratio: 4 / 3; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.ph { aspect-ratio: auto; height: 56px; }
.cover.ph span { font-size: 22px; opacity: .55; }
.livre-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.livre-body h3 { font-size: 14.5px; margin: 0; }
.livre-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.lect-archive { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.lect-archive h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; }
.lect-archive h3 { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.lect-archive ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lect-archive li button { width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; display: grid; gap: 2px; font: inherit; color: inherit; }
.lect-archive li button:hover { background: var(--hover); }
.lect-archive li button.on { background: var(--bg); box-shadow: inset 3px 0 0 var(--orange); }
.lect-empty { display: flex; gap: 12px; align-items: center; justify-content: center; }
.lect-edit { padding: 24px 28px; display: grid; gap: 12px; }
.lect-sub { font-size: 14px; margin: 14px 0 0; }
.lect-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lect-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lect-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lect-edit label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.lect-edit input, .lect-edit select, .lect-edit textarea { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 400; }
.lect-link { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: end; }
.prog-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.prog-e { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.livre-edit { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.livre-edit legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.livre-tools { display: flex; gap: 14px; }
.linkbtn.danger { color: var(--rouge); }
@media (max-width: 980px) { .lect { grid-template-columns: 1fr; } .lect-archive { position: static; max-height: none; } .lect-grid4, .lect-grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .lect-main, .lect-edit { padding: 18px 16px; } .lect-grid2, .lect-grid3, .lect-grid4, .lect-link { grid-template-columns: 1fr; } .role-pick span { display: none; } }

@media (max-width: 1600px) { .role-pick > span { display: none; } }
/* En-tête : tenir sur une ligne avec 6 onglets */
.tab { padding: 6px 11px; }
.period { gap: 6px; }
.vue-lectures .period { display: none; }
.vue-contenu #undo, .vue-contenu #save, .vue-contenu #banner { display: none; }

/* En-tête sur deux lignes : navigation et actions en haut, période en dessous (vues liées à une période) */
@media (min-width: 721px) {
  .top .brand { order: 0; }
  .top .tabs { order: 1; }
  .top .actions { order: 2; margin-left: auto; }
  .top .period { order: 3; flex-basis: 100%; margin-left: 0; justify-content: flex-start; padding-top: 2px; }
}
/* Catalogue et sélection de livres */
.cat-btn { width: 100%; text-align: left; border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; cursor: pointer; font: inherit; font-weight: 600; display: flex; justify-content: space-between; color: inherit; }
.cat-btn.on, .cat-btn:hover { background: var(--bg); }
.cat-list { display: grid; }
.cat-row { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.cat-row.editing { grid-template-columns: 1fr; }
.cat-row .cover { width: 56px; aspect-ratio: 3 / 4; border-radius: 4px; }
.cat-row .cover.ph { height: auto; }
.cat-main { display: grid; gap: 2px; min-width: 0; }
.cat-themes { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.cat-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.theme-livres { display: grid; gap: 8px; }
.tl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.tl-main { display: flex; gap: 10px; align-items: center; min-width: 0; }
.tl-main .cover { width: 40px; flex: none; aspect-ratio: 3 / 4; border-radius: 4px; }
.tl-main .cover.ph { height: auto; } .tl-main .cover.ph span { font-size: 16px; }
.tl-edit { grid-column: 1 / -1; display: grid; gap: 10px; padding-top: 6px; }
.pick { display: grid; gap: 8px; margin-top: 6px; }
.pick-label { max-width: 480px; }
.pick-res { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: 10px; max-width: 480px; display: grid; }
.pick-res button { width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.pick-res button:hover { background: var(--hover); }
.pick > .btn { justify-self: start; }
@media (max-width: 640px) { .cat-row { grid-template-columns: 48px 1fr; } .cat-links, .cat-row > .btn { grid-column: 2; justify-content: flex-start; } .tl-row { grid-template-columns: 1fr; } }
/* Couvertures entières (formats variés : à l'italienne, carrés, à la française) */
.livre .cover:not(.ph) { aspect-ratio: 1 / 1; padding: 12px; }
.livre .cover img { object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.cat-row .cover img, .tl-main .cover img { object-fit: contain; }
.cover-edit { display: flex; align-items: center; gap: 12px; }
.cover-edit .cover { width: 64px; flex: none; aspect-ratio: 3 / 4; border-radius: 4px; padding: 0; }
.cover-edit .cover.ph { height: auto; }
.cover-up { cursor: pointer; }

/* Accueil */
.acc { display: grid; gap: 16px; }
.acc-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.acc-nav { display: flex; gap: 8px; align-items: center; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.acc-lieu { padding: 18px 20px; border-top: 4px solid var(--border); display: grid; gap: 10px; }
.acc-lieu.b { border-top-color: var(--jaune, #f5c542); } .acc-lieu.c { border-top-color: var(--bleu, #3b82f6); } .acc-lieu.h { border-top-color: var(--vert, #3bb48a); }
.acc-lieu-head { display: grid; gap: 2px; }
.acc-lieu h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 8px; }
.acc-lieu h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 0; }
.acc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.acc-alert { color: var(--rouge); font-size: 13px; }
.acc-rem { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; white-space: pre-line; }
.acc-theme { text-align: left; display: grid; gap: 2px; padding: 16px 20px; cursor: pointer; border: 1px solid var(--border); font: inherit; color: inherit; }
.acc-theme:hover { background: var(--bg); }
.acc-theme b { font-size: 16px; }
.acc-slots { display: grid; gap: 12px; max-width: 760px; }
.acc-slot { padding: 16px 20px; display: grid; gap: 8px; border-left: 4px solid var(--border); }
.acc-slot.b { border-left-color: var(--jaune, #f5c542); } .acc-slot.c { border-left-color: var(--bleu, #3b82f6); } .acc-slot.h { border-left-color: var(--vert, #3bb48a); }
.acc-slot-date b { font-size: 15px; }
.acc-slot-lieu { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acc-avec { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.role-mediateur #undo, .role-mediateur #save, .role-mediateur #banner { display: none !important; }
.acc-lieu h2 { text-transform: none; letter-spacing: 0; color: var(--ink); }
.acc-passes { justify-self: start; }
.acc-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 0; }
.acc-slots.passes { opacity: .75; }

/* ---------- Onglets : icônes (téléphone) ---------- */
.tab-ico { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab-plus { display: none; }
.plus-menu { position: fixed; z-index: 30; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); background: #fff; border: 1px solid #e6e0d8; border-radius: 14px; box-shadow: 0 10px 30px rgba(42,42,34,.18); padding: 6px; display: grid; min-width: 210px; }
.plus-menu[hidden] { display: none; }
.plus-menu button { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 12px 14px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--noir); text-align: left; cursor: pointer; }
.plus-menu button.on, .plus-menu button:hover { background: #f4f1ee; }
.plus-menu .tab-ico { display: block; }

/* ---------- Téléphone ---------- */
@media (max-width: 720px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .top { gap: 8px 10px; padding-block: 8px; }
  .top .brand strong { font-size: 1rem; }
  .logo-tile, .logo-tile img { height: 34px; }
  .top .actions { margin-left: auto; gap: 6px; flex-wrap: nowrap; }
  .top .actions #undo, .top .actions #save { padding: 6px 10px; font-size: 13px; }
  .role-pick select { width: auto; max-width: 112px; height: 34px; font-size: 12.5px; }
  .top .period { order: 4; flex-basis: 100%; display: flex; gap: 6px; flex-wrap: nowrap; }
  .top .period .field { flex: 1; min-width: 0; }
  .top .period select { width: 100%; }
  .new-period { white-space: nowrap; font-size: 12px; padding: 6px 8px; }
  /* barre d'onglets en bas de l'écran */
  .top .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; order: 9; border-radius: 0; margin: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    background: #fff; border-top: 1px solid #e6e0d8; box-shadow: 0 -4px 16px rgba(42,42,34,.06); display: flex; gap: 0; }
  .top .tabs .tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11px; border-radius: 10px; background: transparent; color: #7a7068; }
  .top .tabs .tab[hidden] { display: none; }
  .top .tabs .tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .top .tabs .tab[aria-selected="true"] { background: transparent; color: var(--noir); }
  .top .tabs .tab[aria-selected="true"] .tab-ico { stroke-width: 2.2; }
  .tab-ico { display: block; }
  .tab-plus:not([hidden]) { display: flex; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
  .acc-top { align-items: flex-start; }
  .acc-grid { grid-template-columns: 1fr; }
  .lect-title { font-size: 24px; }
  .drawer { width: 100%; }
}

/* Lectures : en-tête visuel, consignes en cartes */
.lect-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; margin: -28px -32px 0; padding: 28px 32px; border-radius: 14px 14px 0 0;
  background: linear-gradient(120deg, var(--jaune-bg, #fff6df), #fff 70%); border-bottom: 1px solid var(--border); }
.lect-hero.evt { background: linear-gradient(120deg, #e6f6f2, #fff 70%); }
.lect-hero-txt { display: grid; gap: 6px; }
.lect-hero .lect-admin { margin-top: 8px; }
.lect-hero .lect-msg { margin-top: 8px; }
.lect-emoji { font-size: 1.15em; margin-right: 10px; }
.lect-title { font-size: 34px; }
.lect-fan { position: relative; width: 300px; height: 190px; flex: none; margin-right: 8px; }
.lect-fan img { position: absolute; bottom: 0; left: calc(var(--i) * 38px); height: calc(170px - var(--i) * 6px); max-width: 130px; object-fit: contain; border-radius: 4px;
  box-shadow: 0 6px 18px rgba(42,42,34,.22); transform: rotate(calc((var(--i) - 2) * 4deg)); transform-origin: bottom center; background: #fff; }
.rem-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rem-date { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.rem-card { white-space: pre-line; font-size: 14px; line-height: 1.55; background: var(--bg); border-radius: 12px; padding: 14px 16px; border-left: 3px solid var(--orange); }
.prog-col { background: #fff; }
@media (max-width: 980px) { .lect-fan { display: none; } .lect-hero { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .lect-hero { margin: -18px -16px 0; padding: 18px 16px; } .lect-title { font-size: 24px; } }
@media (max-width: 720px) {
  .top .period .field, .top .period .field select, #periode { min-width: 0 !important; width: 100%; }
  .new-period { font-size: 0 !important; width: 38px; height: 38px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
  .new-period::before { content: '+'; font-size: 20px; line-height: 1; }
}

.row, .resa-group { scroll-margin-top: 130px; }
@media (max-width: 720px) { .row, .resa-group { scroll-margin-top: 150px; } }
/* Accueil : chiffres clés */
.acc-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.acc-kpis .kpi { background: var(--bg); border: 1px solid transparent; border-radius: 12px; padding: 12px 16px; display: grid; gap: 2px; }
.acc-kpis .kpi b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.acc-kpis .kpi span { color: var(--muted); font-size: 13px; }
.acc-kpis .kpi.main { background: var(--noir); border-color: var(--noir); color: #fff; }
.acc-kpis .kpi.main span { color: #cfc8bf; }
.acc-lieu-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.acc-billets { text-align: right; display: grid; line-height: 1.1; }
.acc-billets b { font-size: 24px; font-variant-numeric: tabular-nums; }
.acc-billets span { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) { .acc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .acc-kpis .kpi { padding: 10px 12px; } .acc-kpis .kpi b { font-size: 22px; } }
.acc-kpis .kpi span { text-transform: none; letter-spacing: 0; font-weight: 500; }
@media (max-width: 720px) {
  .top .tabs { min-height: 60px; align-items: stretch; }
  .top .tabs .tab { justify-content: center; height: auto; line-height: 1.2; }
  .top .tabs .tab .tab-ico { width: 22px; height: 22px; flex: none; }
  .top .actions #undo:disabled, .top .actions #save:disabled { display: none; }
}
.vue-lectures .top .period { display: none !important; }
/* Accueil : l'équipe d'abord, chiffres en discret */
.acc-team .chip { font-size: 14.5px; padding: 6px 12px; }
.acc-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.acc-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Éléments collants : sous l'en-tête, quelle que soit sa hauteur (mesurée en JS dans --top-h) */
.side { top: calc(var(--top-h, 84px) + 12px); max-height: calc(100vh - var(--top-h, 84px) - 24px); }
.focus-bar { top: var(--top-h, 76px); }
.lect-archive { top: calc(var(--top-h, 84px) + 12px); max-height: calc(100vh - var(--top-h, 84px) - 24px); }
.row, .resa-group { scroll-margin-top: calc(var(--top-h, 120px) + 12px) !important; }

.top .brand strong { white-space: nowrap; letter-spacing: -.01em; }
@media (max-width: 720px) { .top .brand strong { font-size: .95rem; } }
@media (max-width: 380px) { .top .brand strong { display: none; } }

/* Movinmotion */
.mm { padding: 24px 28px; display: grid; gap: 14px; }
.mm-note { font-size: 13px; background: var(--jaune-bg, #fff6df); border-radius: 10px; padding: 10px 14px; }
.mm-sum { font-size: 13px; color: var(--muted); }
.mm-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: 10px; }
.mm-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.mm-table th { position: sticky; top: 0; background: var(--bg); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; white-space: nowrap; }
.mm-table td { padding: 7px 10px; border-top: 1px solid var(--border); white-space: nowrap; }
@media (max-width: 640px) { .mm { padding: 18px 16px; } }

/* Coordonnées médiateur */
.coord { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.coord a { color: inherit; }
.coord-edit { margin-left: auto; }
.coord-form { display: grid; grid-template-columns: 1fr 1.4fr 160px; gap: 10px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); align-items: end; }
.coord-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.coord-form input, .coord-form select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; background: var(--card); color: var(--ink); }
.coord-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 640px) { .coord-form { grid-template-columns: 1fr; } }
.coord-edit.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--ink); }
.acc-hello { font-size: 20px; font-weight: 700; margin-bottom: 6px; }

/* Connexion : choix du mode */
.login-mode { justify-self: center; margin-bottom: 4px; }
.login-pw { display: grid; gap: 6px; }
.login-pw[hidden] { display: none; }
.ok-msg { color: #2d7a5b; font-size: 14px; margin: 0; }
.ok-msg:empty { display: none; }
/* Accès à l'app */
.acces { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.acces-lien { display: flex; gap: 8px; width: 100%; }
.acces-lien input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12.5px; background: var(--bg); color: var(--ink); }
.acces p { width: 100%; margin: 0; }
.add-med { margin-bottom: 16px; }
.add-med h2 { margin: 0; }
.add-med .coord-form { grid-template-columns: 1fr 1fr; border-top: 0; padding-top: 0; }
.med-add { margin-left: auto; }
@media (max-width: 640px) { .add-med .coord-form { grid-template-columns: 1fr; } }

.lect-new { width: 100%; margin: 10px 0 16px; }
.tl-pubs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tl-row .tl-pub { display: inline-flex; flex-direction: row; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; align-items: center; gap: 4px; font-size: 13px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; cursor: pointer; user-select: none; }
.tl-row .tl-pub input { width: auto; padding: 0; margin: 0; accent-color: var(--orange); }
.tl-row .tl-pub.on { border-color: var(--orange); background: #fff4ee; font-weight: 600; }
.livre-pubs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.livre-pubs span { font-size: 11px; background: var(--bg); border-radius: 999px; padding: 1px 8px; }
@media (max-width: 640px) { .tl-pubs { justify-content: flex-start; } }
/* Liens-boutons (livres, thèmes, catalogue) : pastilles sobres, pas de bleu/violet ni de soulignement */
a.btn, a.btn:visited { text-decoration: none; color: var(--ink); }
.livre-links a.btn, .cat-links a.btn, .lect-liens a.btn { background: var(--bg); border-color: transparent; font-weight: 600; font-size: 12.5px; padding: 5px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; transition: background .15s, color .15s; }
.livre-links a.btn::before, .cat-links a.btn::before, .lect-liens a.btn::before { content: '↗'; font-size: 11px; color: var(--orange); }
.livre-links a.btn:hover, .cat-links a.btn:hover, .lect-liens a.btn:hover { background: var(--sel); color: var(--orange-txt); }
.lect-liens a.btn { background: rgba(255,255,255,.75); border-color: var(--border); }

.lect-pick, .lect-sheet, .lect-sheet-bg { display: none; }
@media (max-width: 980px) {
  .lect-pick { display: block; margin-bottom: 12px; position: sticky; top: calc(var(--top-h, 84px) + 4px); z-index: 5; }
  .lect-pick-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); cursor: pointer; }
  .lect-pick-btn span:first-child { display: grid; gap: 2px; min-width: 0; }
  .lect-pick-btn b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lect-pick-btn small { color: var(--muted); font-size: 12px; }
  .lect-pick-ico { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--bg); display: grid; place-items: center; color: var(--orange-txt); }
  .lect-sheet-bg { display: block; position: fixed; inset: 0; background: rgba(42,42,34,.35); z-index: 60; }
  .lect-sheet { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; max-height: 82vh; background: var(--card); border-radius: 18px 18px 0 0; z-index: 61; box-shadow: 0 -8px 30px rgba(0,0,0,.15); animation: sheetUp .2s ease-out; }
  .lect-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; border-bottom: 1px solid var(--border); }
  .lect-sheet-list { overflow: auto; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
  .lect-sheet-list h2 { display: none; }
  .lect-sheet-list h3 { font-size: 12px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
  .lect-sheet-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .lect-sheet-list li button { width: 100%; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 10px; cursor: pointer; display: grid; gap: 2px; font: inherit; color: inherit; }
  .lect-sheet-list li button.on { background: var(--bg); box-shadow: inset 3px 0 0 var(--orange); }
  .lect-sheet-list .cat-btn { width: 100%; }
  .lect-archive { display: none; }
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.lect-msg.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.lect-more { justify-self: start; font-weight: 600; color: var(--orange-txt); text-decoration: none; margin-top: 2px; }

/* Accueil : trouloulou + « Bonjour Prénom » */
.acc-hi { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.acc-troul { width: 56px; height: auto; flex: none; animation: troulHi .6s ease-out; transform-origin: bottom center; }
.acc-hi h1 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; }
.acc-hi h1 span { color: var(--orange-txt); }
@keyframes troulHi { 0% { transform: rotate(-8deg) scale(.9); opacity: 0; } 60% { transform: rotate(4deg); opacity: 1; } 100% { transform: none; } }
/* Mobile, accueil : pas de bandeau d'en-tête, seuls les petits boutons restent en haut à droite */
@media (max-width: 720px) {
  .vue-accueil .top { position: absolute; left: 0; right: 0; background: transparent; border-bottom: 0; box-shadow: none; }
  .vue-accueil .top .brand, .vue-accueil .top .period { display: none !important; }
  .vue-accueil .acc { padding-top: 44px; }
  .acc-troul { width: 50px; }
  .acc-hi h1 { font-size: 34px; }
}

/* Mobile : pas de bandeau d'en-tête sur aucune page. Les réglages (rôle, actualiser, période) restent en haut, dans le flux, sans fond */
@media (max-width: 720px) {
  html { --top-h: 0px !important; }
  .top { position: static; background: transparent; border-bottom: 0; box-shadow: none; }
  .top .brand { display: none !important; }
  .vue-accueil .top { position: absolute; }
}
/* Anniversaires / scolaires sur mobile : heure + maison sur une ligne, puis le détail en pleine largeur */
.resa-time .dot { flex: none; }
@media (max-width: 640px) {
  .resa { grid-template-columns: 1fr; gap: 6px; }
  .resa-time { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .resa-time small { margin-top: 0; font-size: 12.5px; }
  .resa-side { grid-column: 1; flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; gap: 8px; }
}

/* ---------- En-tête ordinateur : trouloulou au centre, onglets à gauche et à droite ---------- */
.tabs-split { display: none; }
@media (min-width: 721px) {
  .top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 18px; row-gap: 8px; padding-block: 8px; }
  .top > .tabs { display: none; }
  .tabs-split { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
  .tabs-l { grid-column: 1; grid-row: 1; justify-self: end; justify-content: flex-end; }
  .brand { grid-column: 2; grid-row: 1; }
  .top-r { grid-column: 3; grid-row: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
  .top-r .tabs-r { margin-right: auto; }
  .top > .period { grid-column: 1 / -1; grid-row: 2; justify-self: center; margin: 0; }
  .tabs-split .tab { color: var(--muted); padding: 8px 14px; border-radius: 999px; font-size: 14.5px; transition: background .15s, color .15s; }
  .tabs-split .tab:hover { background: #f4f1ee; color: var(--noir); }
  .tabs-split .tab[aria-selected="true"] { background: var(--noir); color: #fff; }
  .tabs-split .tab-ico { display: none; }
  .logo-tile { height: 56px; }
  .logo-tile img { height: 54px; transition: transform .25s; }
  .brand:hover .logo-tile img { transform: rotate(-6deg); }
  /* L'accueil n'a plus son propre trouloulou : celui de l'en-tête suffit */
  .acc-troul { display: none; }
}
@media (max-width: 720px) { .top-r { display: flex; justify-content: flex-end; width: 100%; } }
/* Accueil ordinateur : colonne centrée, grand « Bonjour », cartes maisons en grille */
@media (min-width: 721px) {
  #accueil .acc { max-width: 1120px; margin: 12px auto 0; gap: 22px; }
  .acc-hi h1 { font-size: 44px; }
  .acc-hi { margin-bottom: 40px; }
  #accueil .lect-title { font-size: 26px; }
  .acc-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .acc-lieu { border-radius: 16px; }
}
/* « Bonjour Prénom, » posé sur la ligne de base du trouloulou, avec de l'air en dessous */
.acc-hi { align-items: flex-end; margin-bottom: 36px; }
.acc-hi h1 { padding-bottom: 2px; }

/* Commentaire laissé avec les dispos */
.bulle { cursor: pointer; font-size: 12px; margin-left: 4px; filter: saturate(.8); display: inline-block; line-height: 1; }
.bulle:hover, .bulle:focus-visible { transform: scale(1.2); outline: none; }
.mf-com { display: grid; gap: 6px; margin-top: 16px; font-weight: 600; font-size: 14px; }
.mf-com textarea { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; resize: vertical; background: var(--card); }
.fiche-com { background: #fff8e6; border-radius: 10px; padding: 10px 14px; margin-top: 12px; }
.fiche-com-h { font-size: 12px; font-weight: 700; color: #8a6d1a; }
.fiche-com p { margin: 4px 0 0; white-space: pre-line; }
.bulle.old { opacity: .35; filter: grayscale(1); }

/* Commentaire de dispos : bulle qui reste ouverte jusqu'au clic sur la croix (ou Échap) */
#bulle-pop { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(520px, calc(100% - 32px)); background: var(--noir); color: #fff; border-radius: 14px; padding: 14px 44px 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 70; animation: sheetUp .18s ease-out; }
#bulle-pop .bulle-h { font-size: 12.5px; font-weight: 700; opacity: .75; margin-bottom: 4px; }
#bulle-pop p { margin: 0; white-space: pre-line; line-height: 1.45; }
#bulle-pop .bulle-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
#bulle-pop .bulle-x:hover { background: rgba(255,255,255,.28); }
@media (max-width: 720px) { #bulle-pop { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
/* Chargement : anneau orange qui tourne + barre de progression indéterminée */
.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 64px 20px; }
.loading::before { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #eadfd6; border-top-color: var(--orange); animation: spin .8s linear infinite; }
.loading::after { content: ''; width: min(220px, 60%); height: 4px; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--orange), transparent) #eee6df; background-size: 40% 100%; background-repeat: no-repeat; animation: barre 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes barre { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { .loading::before, .loading::after { animation-duration: 3s; } }

/* Accueil : billets vendus par créneau, en jauges horizontales */
.jauges { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 5px; }
.jauges li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.j-h { color: var(--muted); font-variant-numeric: tabular-nums; }
.j-bar { height: 8px; border-radius: 6px; background: #efe9e3; overflow: hidden; }
.j-bar i { display: block; height: 100%; border-radius: 6px; background: #c9bdb1; transition: width .4s ease; }
.acc-lieu.b .j-bar i { background: #f2c94c; } .acc-lieu.c .j-bar i { background: #5b8def; }
.jauges li.haut .j-bar i { filter: saturate(1.2) brightness(.95); }
/* complet : même couleur que la maison (pas d’alerte rouge) */
.j-n { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 44px; text-align: right; }
.j-n b { color: var(--ink); }
.badge.interne { background: repeating-linear-gradient(135deg, #f1ece6 0 6px, #e6dfd7 6px 12px); color: var(--ink); }

/* Accueil médiateur : créneaux passés, compacts et groupés par mois */
.acc-passes { margin-top: 18px; }
.acc-passes-list { padding: 14px 18px; margin-top: 8px; }
.acc-passes-list h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 6px; }
.acc-passes-list h3:first-child { margin-top: 0; }
.acc-passes-list ul { list-style: none; margin: 0; padding: 0; }
.acc-passes-list li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.acc-passes-list li:last-child { border-bottom: 0; }
.loading::after { content: none; display: none; }
.acc-stats .live { color: #2f9e6e; font-size: 11px; font-weight: 600; margin-left: 4px; }

/* Bouton « Remplir automatiquement » : plus visible, explication en infobulle */
.btn.fill { position: relative; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; padding: 12px 22px; border-radius: 12px; box-shadow: 0 6px 18px rgba(194, 85, 45, .28); }
.btn.fill svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn.fill:hover { filter: none; background: #b04a25; transform: translateY(-1px); }
.btn.fill[data-tip]::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 8px); width: 280px; padding: 9px 12px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .15s, transform .15s; z-index: 30; }
.btn.fill[data-tip]:hover::after, .btn.fill[data-tip]:focus-visible::after { opacity: 1; transform: none; }
@media (hover: none) { .btn.fill[data-tip]::after { display: none; } }

/* Accueil : remarques du jour (toute la maison / lieux fermés) */
.acc-notes { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 14px 18px; margin-bottom: 16px; }
.acc-note { min-width: 200px; flex: 1 1 240px; font-size: 14px; line-height: 1.45; }
.acc-note > div + div { margin-top: 3px; }
.acc .prive { color: #7a5c2e; background: #fbf3e4; border-radius: 6px; padding: 3px 8px; display: inline-block; margin-top: 4px; font-size: 13.5px; }
.plan-toolbar { position: relative; z-index: 40; }

/* Renforts : deuxième ligne de la case, pictos anniv / café / librairie */
.chips-renforts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: inherit; }
.chip .r.ico { display: inline-flex; align-items: center; padding: 0; background: none; margin-right: 1px; }
.chip .r.ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.chip.big .r.ico svg { width: 16px; height: 16px; }

/* Menus déroulants maison (js/fselect.js) */
select.fsel-src { position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 1px !important; height: 1px !important; min-width: 0 !important; overflow: hidden; }
.fsel { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; line-height: 1.25; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--ink); max-width: 100%; }
.fsel:hover { border-color: #cfc6ba !important; }
.fsel:focus-visible { outline: 2px solid var(--vert); outline-offset: 1px; }
.fsel[aria-expanded="true"] { border-color: var(--ink) !important; }
.fsel-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fsel-chev { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .55; transition: transform .15s; }
.fsel[aria-expanded="true"] .fsel-chev { transform: rotate(180deg); }
.top .period .fsel, .top .period .field .fsel { width: 100%; }
.fsel-pop { position: fixed; z-index: 1000; background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(40, 30, 20, .18); padding: 6px; max-height: min(60vh, 420px); overflow: auto; animation: fsel-in .12s ease-out; }
.fsel-list { display: flex; flex-direction: column; gap: 1px; }
.fsel-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 12px 9px 32px; font-size: 14px; color: var(--ink); cursor: pointer; position: relative; white-space: nowrap; }
.fsel-opt:hover, .fsel-opt:focus-visible { background: #f4efe8; outline: none; }
.fsel-opt.on { font-weight: 700; background: #f7f1e9; }
.fsel-opt.on::before { content: ''; position: absolute; left: 12px; top: 50%; width: 10px; height: 6px; border-left: 2px solid var(--orange); border-bottom: 2px solid var(--orange); transform: translateY(-70%) rotate(-45deg); }
.fsel-opt[disabled] { opacity: .4; cursor: default; }
.fsel-grp { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
@keyframes fsel-in { from { opacity: 0; transform: translateY(-4px); } }
.fsel-voile { position: fixed; inset: 0; background: rgba(30, 25, 20, .35); z-index: 999; animation: fsel-fade .15s; }
.fsel-pop.fsel-sheet { left: 0; right: 0; bottom: 0; top: auto; border-radius: 18px 18px 0 0; max-height: 72vh; padding: 8px 10px calc(14px + env(safe-area-inset-bottom, 0px)); animation: fsel-up .18s ease-out; }
.fsel-pop.fsel-sheet .fsel-opt { font-size: 16px; padding: 14px 14px 14px 38px; white-space: normal; }
.fsel-pop.fsel-sheet .fsel-opt.on::before { left: 15px; }
.fsel-head { font-weight: 700; font-size: 15px; padding: 10px 14px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; position: sticky; top: -8px; background: #fff; }
.fsel-head::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 4px; background: #ddd5cb; margin: -2px auto 10px; }
@keyframes fsel-up { from { transform: translateY(100%); } }
@keyframes fsel-fade { from { opacity: 0; } }
.fsel { text-transform: none !important; letter-spacing: normal !important; }
.fsel .fsel-txt { display: block !important; }
.top .field .fsel { color: var(--noir) !important; font-weight: 600; }
.fsel .fsel-txt { font-size: inherit !important; color: inherit !important; text-transform: none !important; letter-spacing: normal !important; }
.mm-mois { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; } .mm-mois .lect-title { margin: 0; }
/* Barre d'actions du planning : reste visible au défilement (Enregistrer / Annuler y vivent désormais) */
.plan-toolbar { position: sticky; top: var(--top-h, 0px); background: var(--bg, #f4f1ee); padding: 10px 0; margin-top: -10px; margin-bottom: 4px; }
.plan-toolbar #save { box-shadow: var(--shadow); }

/* Planning : titre de semaine sur une ligne (mois en avant) + case date carrée */
.row, .week-head { grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .55fr) !important; }
.week-head { row-gap: 8px; padding: 14px 4px 8px; }
.week-head .week-title { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.wt-mois { font-size: 20px; font-weight: 800; color: var(--ink); }
.wt-sem { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; padding: 10px 6px; min-height: 84px; }
.day .d { display: flex; flex-direction: column; align-items: center; line-height: 1.05; font-weight: 400; text-transform: none; }
.day .dj { font-size: 13px; color: var(--muted); text-transform: capitalize; }
.day .dn { font-size: 26px; font-weight: 800; color: var(--ink); margin-top: 2px; }
.day .dm { font-size: 11px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.day .tags { justify-content: center; }
.day .tag { font-size: 10px; padding: 1px 6px; white-space: normal; line-height: 1.2; }
@media (max-width: 720px) {
  .row, .week-head { grid-template-columns: 1fr !important; }
  .week-head .lieu-sp { display: none; }
  .day { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 0; text-align: left; padding: 10px 14px; }
  .day .d { flex-direction: row; align-items: baseline; gap: 6px; }
  .day .tags { justify-content: flex-start; margin: 0; }
}
@media (max-width: 720px) { .plan-toolbar { position: static; margin-top: 0; } }

/* Accueil : invités / surbooking */
.inv-bloc { margin-top: 4px; }
.inv-list .inv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.inv-reg { font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 8px; }
.inv-reg.offert { background: #e6f2ea; color: #2c6b45; }
.inv-reg.a_regler { background: #fdebdc; color: #a24a1c; }
.inv-act { margin-left: auto; display: inline-flex; gap: 10px; }
.inv-act .linkbtn { font-size: 12px; }
.inv-form { display: grid; gap: 8px; background: var(--bg); border-radius: 10px; padding: 10px; margin-top: 6px; }
.inv-form input:not([type=radio]) { border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13.5px; background: var(--card); min-width: 0; }
.inv-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inv-seg { justify-self: start; }
.inv-seg input { position: absolute; opacity: 0; pointer-events: none; }
.inv-seg .seg-btn { cursor: pointer; }
.r.ico { display: inline-flex; align-items: center; vertical-align: -2px; } .r.ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; } .acc-team .chip .r.ico svg { width: 16px; height: 16px; }

/* Panneau du jour : laisse la colonne compteurs + commentaires visible à droite (grand écran) */
body.drawer-side .drawer { right: var(--side-garde); width: min(760px, calc(100% - var(--side-garde) - 20px)); border-radius: 0 0 0 0; }
body.drawer-side .side { z-index: 42; }
#banner:not([hidden]) { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .banner-act { display: inline-flex; gap: 8px; margin-left: auto; }
/* Panneau du jour ouvert : la colonne « Jours sur la période » s'aligne sur le haut du panneau */
body.drawer-side .side { position: fixed; top: env(safe-area-inset-top, 0px); right: var(--side-r); width: var(--side-w); max-height: 100vh; bottom: 0; }
.autosave { position: fixed; left: 16px; bottom: 16px; z-index: 90; background: var(--noir, #2a2a22); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 20px; box-shadow: var(--shadow); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; } .autosave.attente, .autosave.enCours, .autosave.ok { opacity: 1; transform: none; } .autosave.ok { background: #2c6b45; } @media (max-width: 720px) { .autosave { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
/* Pictos des renforts : emojis en couleur */
.r.ico { font-size: 14px; line-height: 1; opacity: 1 !important; filter: none; margin-right: 2px; }
.chip.big .r.ico, .acc-team .chip .r.ico { font-size: 16px; }
/* Surbooking aéré, liens neutres, seule la croix en rouge */
.inv-list { display: grid; gap: 0; }
.inv-list .inv { display: block; padding: 9px 0; border-top: 1px solid var(--border); }
.inv-list .inv:first-child { border-top: 0; padding-top: 4px; }
.inv-l1 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.inv-h { min-width: 44px; }
.inv-nom { font-weight: 600; }
.inv-note { color: var(--muted); font-size: 13px; margin: 3px 0 0 54px; }
.linkbtn.neutre { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.linkbtn.neutre:hover { text-decoration-color: currentColor; }
.inv-del { background: none; border: 0; color: var(--rouge, #c0392b); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.inv-bloc > .linkbtn.neutre { margin-top: 8px; display: inline-block; }
.inv-form .fsel { min-width: 96px; }
.chip.renfort { border-style: dashed; border-color: #b9ae9f; background: transparent; }
.focus-jours { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.focus-j { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 20px; padding: 3px 10px; font: inherit; font-size: 12.5px; cursor: pointer; text-transform: capitalize; }
.focus-j:hover { background: rgba(255,255,255,.26); }
.row.flash > * { animation: flash-row 1.6s ease-out; }
@keyframes flash-row { 0%, 40% { box-shadow: 0 0 0 3px var(--orange); } 100% { box-shadow: var(--shadow); } }
@media (min-width: 721px) { .focus-bar { top: calc(var(--top-h, 76px) + 66px); } }

/* Fiche médiateur : profil éditable (référent·e, English, renforts) */
.profil { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 0 4px; border-top: 1px solid var(--border); margin-top: 14px; }
.prof-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.prof-t { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 13px; cursor: pointer; background: var(--card); user-select: none; }
.prof-t input { position: absolute; opacity: 0; pointer-events: none; }
.prof-t.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.prof-t:focus-within { outline: 2px solid var(--vert); outline-offset: 1px; }
.prof-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

/* Lecture musicale (Chantelivre) : case à cocher dans le panneau du jour + grosse note */
.note-grosse { font-size: 22px; line-height: 1; vertical-align: -3px; }
.cell .need .note-grosse { font-size: 24px; }
.lecture-lbl { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.lecture-tg { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 8px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 20px; cursor: pointer; font-size: 13.5px; font-weight: 600; user-select: none; }
.lecture-tg input { position: absolute; opacity: 0; pointer-events: none; }
.lecture-tg .lt-ico { font-size: 18px; filter: grayscale(1); opacity: .5; }
.lecture-tg.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.lecture-tg.on .lt-ico { filter: none; opacity: 1; }
.lecture-tg:focus-within { outline: 2px solid var(--vert); outline-offset: 1px; }
.badge-lecture { display: inline-flex; align-items: center; gap: 4px; background: #efe7fb; color: #5b3d99; border-radius: 20px; padding: 2px 10px 2px 6px; font-size: 12px; font-weight: 700; } .badge-lecture { font-size: 12.5px; }
button.pick { display: inline-flex; align-items: center; gap: 4px; margin-top: 0; white-space: nowrap; } button.pick .ico-uk, button.pick .ico-note { margin: 0; }
/* Lecture musicale : badge bleu Chantelivre, même style dans le planning et dans le panneau du jour */
.badge-lecture { background: #e3edfd; color: #2a5cb8; }
.lecture-tg { background: var(--card); color: var(--muted); border-color: var(--border); font-weight: 600; }
.lecture-tg.on { background: #e3edfd; color: #2a5cb8; border-color: #b9d0f7; }
.mdp-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; margin-bottom: 10px; } .mdp-form input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 15px; } #mdp-dlg .confirm, #mdp-dlg .confirm-backdrop { display: block; } #mdp-dlg .confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* Onglet Dispos : ligne des dates figée en haut (le tableau défile dans son cadre) */
.dgrid-wrap { overflow: auto; max-height: calc(100vh - var(--top-h, 84px) - 32px); overscroll-behavior: contain; }
.dgrid thead th { position: sticky; top: 0; background: var(--card); z-index: 2; box-shadow: 0 1px 0 var(--border); }
.dgrid thead th.corner { left: 0; z-index: 3; }

/* Onglet Infos */
.inf-wrap { max-width: 860px; margin: 0 auto; display: grid; gap: 16px; }
.inf-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.inf-sommaire { display: flex; flex-wrap: wrap; gap: 6px; }
.inf-sommaire a { font-size: 13px; color: var(--ink); text-decoration: none; border: 1px solid var(--border); background: var(--card); border-radius: 20px; padding: 4px 12px; }
.inf-sommaire a:hover { border-color: var(--ink); }
.card.inf { padding: 22px 26px; scroll-margin-top: calc(var(--top-h, 84px) + 16px); }
.inf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.inf-head h2 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; }
.inf-tools { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.inf-tools .icon-btn { width: 30px; height: 30px; font-size: 14px; }
.inf-del { background: none; border: 0; color: var(--rouge); font-size: 20px; cursor: pointer; line-height: 1; }
.inf-body { font-size: 15px; line-height: 1.6; }
.inf-body p { margin: 0 0 10px; } .inf-body ul { margin: 0 0 10px; padding-left: 22px; } .inf-body li { margin: 2px 0; }
.inf-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; }
.inf-body a { color: var(--ink); text-decoration-color: var(--border); text-underline-offset: 3px; }
.inf-maj { margin-top: 8px; }
.inf-form { display: grid; gap: 12px; padding: 22px 26px; }
.inf-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.inf-form input, .inf-form textarea { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 15px; font-weight: 400; background: var(--card); color: var(--ink); }
.inf-form textarea { resize: vertical; line-height: 1.5; }
.inf-actions { display: flex; justify-content: flex-end; gap: 8px; }
.inf-head h2 { text-transform: none !important; letter-spacing: 0 !important; color: var(--ink) !important; font-size: 1.25rem !important; }

/* Infos : mosaïque de tuiles (hauteurs variables), détail en fenêtre */
.inf-wrap { max-width: 1100px; }
.inf-mosaique { columns: 3 280px; column-gap: 16px; }
.inf-tuile { display: block; width: 100%; break-inside: avoid; margin: 0 0 16px; padding: 0; border: 0; text-align: left; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; font: inherit; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.inf-tuile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(42,42,34,.12); }
.inf-tuile:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.inf-tuile img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: cover; }
.inf-ph { display: flex; align-items: center; justify-content: center; height: 110px; }
.inf-tuile:nth-child(3n+2) .inf-ph { height: 150px; } .inf-tuile:nth-child(4n) .inf-ph { height: 90px; }
.inf-ph span { font-size: 42px; font-weight: 800; color: rgba(42,42,34,.25); }
.inf-ph.mini { width: 72px; height: 54px; border-radius: 8px; background: var(--bg); }
.inf-t-body { padding: 14px 18px 18px; }
.inf-t-body h2 { margin: 0 0 6px; font-size: 1.08rem; font-weight: 800; line-height: 1.25; }
.inf-t-body p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.inf-voile { position: fixed; inset: 0; background: rgba(30,25,20,.45); z-index: 80; }
.inf-detail { position: fixed; z-index: 81; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--card); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.inf-x { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; z-index: 2; background: var(--card); }
.inf-d-img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.inf-d-body { padding: 22px 28px 24px; }
.inf-d-body h2 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; }
.inf-d-res { color: var(--muted); font-size: 15.5px; margin: 0 0 14px; }
.inf-d-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px; }
.inf-detail .inf-form { padding: 22px 28px; box-shadow: none; }
.inf-detail .inf-form h2 { margin: 0; font-size: 1.2rem; }
.inf-img-row { display: flex; align-items: center; gap: 12px; }
.inf-img-row img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }
.inf-img-row label.btn { display: inline-flex; font-weight: 600; }
.inf-del-txt { background: none; border: 0; color: var(--rouge); font: inherit; font-size: 13.5px; cursor: pointer; }
body.inf-modal { overflow: hidden; }
@media (max-width: 720px) {
  .inf-mosaique { columns: 1; }
  .inf-detail { left: 0; right: 0; bottom: 0; top: auto; transform: none; width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
}
.inf-x { color: var(--ink) !important; font-size: 22px; line-height: 1; border: 1px solid var(--border); }
.inf-ph span.emo { font-size: 54px; color: inherit; } .inf-body .inf-img { display: block; max-width: 100%; border-radius: 10px; margin: 8px 0 14px; border: 1px solid var(--border); }

/* Lectures : introduction en tuiles, mises à jour éditables */
.intro-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.intro-tuile { background: var(--bg); border-radius: 12px; padding: 14px 16px; border-top: 3px solid var(--border); }
.intro-tuile.it-infos { grid-column: 1 / -1; background: #fbf8f4; }
.intro-tuile.it-intro { border-top-color: var(--orange); }
.intro-tuile.it-bebe { border-top-color: #f2a7c3; } .intro-tuile.it-famille { border-top-color: var(--vert); } .intro-tuile.it-scolaire { border-top-color: #9b7fd4; }
.intro-tuile h3 { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.it-txt { white-space: pre-line; font-size: 14.5px; line-height: 1.55; }
.intro-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.intro-edit label:first-child { grid-column: 1 / -1; }
.maj-tools { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.maj-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14.5px; box-sizing: border-box; }
.maj-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.btn.lv-del { color: var(--rouge); border-color: #f3c9c9; }
.regles h2 { font-size: 1.35rem; margin: 0 0 8px; } .regles h3 { margin: 18px 0 6px !important; } .regles ol, .regles ul { margin: 0 0 6px; padding-left: 22px; } .regles li { margin: 3px 0; }

/* Mises à jour : liste compacte pleine largeur, texte replié à 3 lignes */
.maj-list { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.maj-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--border); border-left: 3px solid var(--orange); }
.maj-row:first-child { border-top: 0; }
.maj-date { font-size: 12.5px; font-weight: 600; color: var(--muted); display: grid; gap: 4px; justify-items: start; padding-top: 2px; text-transform: capitalize; }
.maj-txt { white-space: pre-line; font-size: 14px; line-height: 1.5; }
.maj-txt.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.maj-more { font-size: 12.5px; margin-top: 4px; }
.maj-row .maj-tools { margin: 0; gap: 10px; }
.maj-list .maj-form { margin: 0; border-radius: 0; padding: 12px 16px; background: var(--bg); border-left: 3px solid var(--orange); }
@media (max-width: 720px) { .maj-row { grid-template-columns: 1fr; gap: 6px; } .maj-date { grid-auto-flow: column; justify-content: start; } }

/* Onglet Librairie */
.lib { max-width: 1100px; margin: 0 auto; display: grid; gap: 16px; }
.lib-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.lib-kpi { background: var(--card); border-radius: 12px; border-top: 4px solid var(--c); box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 6px; }
.lib-kpi span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lib-kpi b { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lib h2 { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.lib-barres { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.lib-b { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.lib-b i { display: block; width: 100%; max-width: 26px; background: var(--ink); border-radius: 4px 4px 0 0; opacity: .85; }
.lib-b:hover i { background: var(--orange); opacity: 1; }
.lib-b small { font-size: 10px; color: var(--muted); }
.lib-top-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.lib-top-head h2 { margin: 0; }
.lib-top-head input { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; min-width: 260px; }
.lib-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.lib-cols ol { list-style: none; margin: 0; padding: 0; }
.lib-cols li { display: grid; grid-template-columns: 28px minmax(0, 1fr) 40px 76px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.lib-rang { width: 24px; height: 24px; border-radius: 50%; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.lib-rang.podium { background: var(--orange); color: #fff; }
.lib-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-q { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-ca { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lib-note { font-size: 12px; color: var(--muted); font-style: italic; margin: 0; }
@media (max-width: 900px) { .lib-kpis { grid-template-columns: repeat(2, 1fr); } .lib-cols { grid-template-columns: 1fr; } }
/* Librairie v2 : TTC/HT, deux groupes d'indicateurs, tri CA / exemplaires */
.lib-grp { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: -6px; }
.lib-kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lib-kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lib-kpi b small { font-size: 12px; font-weight: 600; color: var(--muted); }
.lib-kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.lib-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lib-seg .seg-btn.on { background: var(--orange); color: #fff; border-color: var(--orange); }
.lib-cols li { grid-template-columns: 28px minmax(0, 1fr) 40px 84px; }
.lib-cols li.lib-head { font-size: 11px; color: var(--muted); padding: 4px 0; }
.lib-cols li.lib-head span:nth-child(3), .lib-cols li.lib-head span:nth-child(4) { text-align: right; }
.lib-nom { display: grid; white-space: normal; }
.lib-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-nom small { font-size: 11px; color: var(--muted); }
.lib-ca { display: grid; } .lib-ca small { font-size: 11px; font-weight: 400; color: var(--muted); }
.lib-rec { font-size: 10px; background: #fbe4b0; color: #b8860b; border-radius: 10px; padding: 1px 6px; margin-left: 6px; font-weight: 700; vertical-align: 1px; }
@media (max-width: 900px) { .lib-kpis.k3, .lib-kpis.k4 { grid-template-columns: repeat(2, 1fr); } }
.lib-header { background: #2a2a22; color: #fff; border-bottom: 3px solid #f06437; border-radius: 14px; padding: 20px 26px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lib-header h1 { margin: 0; font-size: 1.45rem; font-weight: 800; color: #fff; }
.lib-sub { color: rgba(255,255,255,.7); font-size: 14px; margin-top: 4px; text-transform: none; }
.lib-nav { display: flex; gap: 8px; align-items: center; }
.lib-nav .icon-btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.lib-nav .icon-btn:disabled { opacity: .35; }
.lib-today { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); }
.lib-foot { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 0 12px; }
.lib-header { background: #2a2a22; color: #fff; border-bottom: 3px solid #f06437; border-radius: 14px; padding: 20px 26px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lib-header h1 { margin: 0; font-size: 1.45rem; font-weight: 800; color: #fff; }
.lib-sub { color: rgba(255,255,255,.7); font-size: 14px; margin-top: 4px; }
.lib-nav { display: flex; gap: 8px; align-items: center; }
.lib-nav .icon-btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.lib-nav .icon-btn:disabled { opacity: .35; }
.lib-today { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); }
.lib-foot { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 0 12px; }

/* Mobile : passe responsive */
.cell-lieu { display: none; }
@media (max-width: 720px) {
  /* Planning : nom de la maison dans chaque case (la colonne d'en-tête disparaît sur mobile) */
  .cell-lieu { display: inline; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
  /* Mois (Movinmotion) : flèches et titre sur une ligne */
  .mm-mois { flex-wrap: nowrap; } .mm-mois .lect-title { font-size: 1.3rem; flex: 1; min-width: 0; }
  /* Librairie : chiffres plus compacts, TTC collé au montant */
  .lib-kpis.k3 { grid-template-columns: 1fr; }
  .lib-kpi { padding: 12px 14px; } .lib-kpi b { font-size: 1.45rem; white-space: nowrap; } .lib-kpi b small { font-size: 11px; }
  .lib-header { padding: 16px 18px; } .lib-header h1 { font-size: 1.15rem; }
  .lib-cols li { grid-template-columns: 24px minmax(0, 1fr) 30px 70px; gap: 8px; font-size: 13px; }
  .lib-top-head { flex-direction: column; align-items: flex-start; }
  /* Dispos : légende compacte */
  .dispos .card-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .dispos .card-head > div { min-width: 0; }
  .dispos #dfilter { width: 100%; }
  .dgrid th[scope="row"], .dgrid .corner { padding-right: 6px; font-size: 13px; }
  .dgrid th[scope="row"] small { margin-left: 3px; }
  .dgrid .corner { font-size: 0; }
  .dispos .legend { gap: 6px 12px; font-size: 11.5px; }
  .dispos .legend .dcell.sample { width: 16px; height: 16px; font-size: 10px; }
}

/* Catalogue : thème déjà passé / en cours / à venir (direction) */
.th-item { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.th-etat { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.th-etat.passe { background: #ece7e1; color: var(--muted); }
.th-etat.encours { background: #e3f4ef; color: #1f7f6c; }
.th-etat.avenir { background: #e6efff; color: #2a64c4; }
.pick-res .th-etat { margin-left: 6px; }
.cat-filtre { margin-top: 10px; }
