/* =====================================================================
   PBA Connect v2 — feuille de style unique
   Marine PBA + or, couleur de parcours (BTS & Diplômes = bleu, Titres pro = vert d'eau)
   ===================================================================== */

:root {
  --ink: #0E2146;
  --brand: #0E2146;
  --brand-2: #18306A;
  --brand-3: #2A4383;
  --ink-2: #18306A;
  --ink-3: #2A4383;
  --gold: #C9A14A;
  --gold-soft: #F4EBD5;
  --paper: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F9FAFC;
  --line: #E0E5EF;
  --line-strong: #C9D1E1;
  --text: #16213B;
  --muted: #5A6681;
  --faint: #8A94AB;
  --classique: #3152CF;
  --classique-soft: #E9EEFD;
  --tp: #0B7F72;
  --tp-soft: #E2F4F1;
  --ok: #1D7A4C;   --ok-soft: #E4F4EB;
  --warn: #9A6200; --warn-soft: #FBF1DC;
  --bad: #BE3A2B;  --bad-soft: #FBE9E6;
  --info: #3152CF; --info-soft: #E9EEFD;
  --p: var(--classique);
  --p-soft: var(--classique-soft);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-pop: 0 12px 32px -8px rgba(14, 33, 70, .28), 0 2px 6px rgba(14, 33, 70, .08);
  --side: 268px;
  --top: 60px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
body.is-tp { --p: var(--tp); --p-soft: var(--tp-soft); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 15px/1.5 var(--font); font-feature-settings: "tnum" 1, "cv01" 1;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--p); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 15px; height: 15px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------------------
   Structure: en-tête + navigation horizontale (méga-menu) + pied de page
   Toute la largeur de l'écran est rendue au contenu (PC portables).
   Mobile / applications Android et iOS : barre d'onglets + menu plein écran.
   --------------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: 28px; }
body.app { min-height: 100vh; display: flex; flex-direction: column; }

.hd { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); background: var(--brand); }
.hd-bar { position: relative; color: #fff; }
.hd-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--p); }
.hd-in { height: var(--top); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.brand-t { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.brand small { font-size: .7rem; color: var(--gold); font-weight: 600; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }

/* Sélecteur de parcours: l'élément signature */
.switch { padding: 3px; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; background: rgba(255,255,255,.08); border-radius: 9px; flex: none; }
.switch a { display: block; text-align: center; padding: 6px 12px; border-radius: 6px; font-size: .8rem; font-weight: 600; color: #B9C3DB; line-height: 1.2; white-space: nowrap; }
.switch a:hover { color: #fff; text-decoration: none; }
.switch a[aria-current="true"] { color: #fff; background: var(--classique); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.switch a.sw-tp[aria-current="true"] { background: var(--tp); }
.switch-solo { padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,.08); font-size: .8rem; font-weight: 600; color: #fff; display: inline-flex; align-items: center; gap: 8px; flex: none; }
.switch-solo i { width: 8px; height: 8px; border-radius: 50%; background: var(--p); box-shadow: 0 0 0 3px rgba(255,255,255,.12); }

.top-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.top-search input[type=search] { width: 100%; min-height: 38px; padding: 8px 34px 8px 38px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: .9rem; transition: background .15s, border-color .15s; }
.top-search input[type=search]::placeholder { color: #9AA7C6; }
.top-search input[type=search]:focus { background: #fff; color: var(--text); border-color: #fff; box-shadow: 0 0 0 3px rgba(201,161,74,.35); }
.top-search input[type=search]:focus::placeholder { color: var(--faint); }
.top-search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9AA7C6; pointer-events: none; }
.top-search:focus-within > .ic { color: var(--faint); }
.kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 .72rem/1 var(--font); color: #9AA7C6; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.top-search:focus-within .kbd { display: none; }
.top-search-results { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; display: none; max-height: 60vh; overflow: auto; color: var(--text); }
.top-search-results.open { display: block; }
.top-search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 7px; color: var(--text); }
.top-search-results a:hover, .top-search-results a.hl { background: var(--surface-2); text-decoration: none; }
.top-search-results small { color: var(--muted); }

.hd-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.top-search + .hd-right { margin-left: 0; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; border: 0; background: transparent; color: #C9D2E8; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.icon-btn .dot { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--brand); }
.me { position: relative; }
.me > button { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 0; background: transparent; border-radius: 11px; cursor: pointer; font: inherit; color: #fff; text-align: left; }
.me > button:hover { background: rgba(255,255,255,.08); }
.me-chev { color: #9AA7C6; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none; }
.me-txt { display: flex; flex-direction: column; line-height: 1.15; }
.me-name { font-size: .88rem; font-weight: 600; }
.me-role { font-size: .74rem; color: #9AA7C6; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; display: none; color: var(--text); }
.menu-pop.open { display: block; animation: pop-in .14s ease-out; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; border: 0; background: none; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .danger { color: var(--bad); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.me-card b { display: block; font-size: .92rem; color: var(--ink); }
.me-card small { display: block; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }

/* Barre de navigation + méga-menu */
.mnav { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(14,33,70,.03), 0 6px 18px -14px rgba(14,33,70,.35); }
.mnav-in { display: flex; align-items: stretch; gap: 2px; height: 50px; }
.mg { position: static; display: flex; }
.mnav-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 0; background: none; font: 600 .9rem/1 var(--font); color: var(--muted); cursor: pointer; position: relative; white-space: nowrap; }
.mnav-btn .ic { width: 17px; height: 17px; }
.mnav-btn .chev { opacity: .5; transition: transform .15s; }
.mnav-btn:hover, .mg.open .mnav-btn { color: var(--ink); text-decoration: none; background: var(--surface-2); }
.mnav-btn.on { color: var(--ink); }
.mnav-btn.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--p); }
.mg.open .chev { transform: rotate(180deg); }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -20px rgba(14,33,70,.35); display: none; max-height: calc(100vh - 140px); overflow-y: auto; }
.mg.open .mega { display: block; animation: pop-in .14s ease-out; }
.mega-in { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding-top: 22px; padding-bottom: 26px; }
.mega-intro { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 12px; background: linear-gradient(160deg, var(--brand), var(--brand-3)); color: #fff; align-self: start; }
.mega-intro b { font-size: 1.15rem; letter-spacing: -.01em; }
.mega-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--p-soft); color: var(--p); flex: none; }
.mega-intro .mega-ic { background: rgba(255,255,255,.12); color: var(--gold); }
.mega-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 24px; align-content: start; }
.mega-sec { font-size: .72rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px 10px; }
.mega-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: .9rem; }
.mega-link .ic { width: 17px; height: 17px; color: var(--faint); }
.mega-link span { flex: 1; min-width: 0; }
.mega-link em { font-style: normal; font-size: .68rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 2px 7px; border-radius: 99px; }
.mega-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.mega-link:hover .ic { color: var(--p); }
.mega-link.on { background: var(--p-soft); color: var(--ink); font-weight: 600; }
.mega-link.on .ic { color: var(--p); }
.mega-link.soon { color: var(--muted); }

.content { flex: 1; padding-top: 26px; padding-bottom: 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .lead { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs .ic-sm { width: 12px; height: 12px; opacity: .6; }
.parcours-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--p); background: var(--p-soft); padding: 2px 9px; border-radius: 99px; vertical-align: middle; }

/* ---------------------------------------------------------------------
   Blocs
   --------------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 18px; }
.panel + .panel, .stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-aside { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* Chiffres clés: une rangée sobre, pas de cartes multiples */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi b { display: block; font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .84rem; color: var(--muted); }
.kpi a { color: inherit; }
.kpi.alert b { color: var(--bad); }

/* Listes simples */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; }
.list .s { font-size: .84rem; color: var(--muted); }

/* Créneau de cours */
.slot { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: start; }
.slot:first-child { border-top: 0; }
.slot time { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.3; }
.slot time small { display: block; font-weight: 400; color: var(--muted); }
.slot .bar { border-left: 3px solid var(--c, var(--p)); padding-left: 12px; }
.slot.cancelled .bar { opacity: .55; text-decoration: line-through; }

/* ---------------------------------------------------------------------
   Formulaires et boutons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; min-height: 38px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 .9rem/1.2 var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: var(--faint); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-p { background: var(--p); border-color: var(--p); color: #fff; }
.btn-p:hover { filter: brightness(1.08); background: var(--p); }
.btn-danger { color: var(--bad); border-color: #EBC3BD; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date],
input[type=time], input[type=tel], input[type=url], input[type=file], input:not([type]), select, textarea {
  width: 100%; padding: 8px 11px; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .92rem;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--p-soft); }
input[readonly] { background: var(--surface-2); }
.field { margin-bottom: 14px; }
.field.err input, .field.err select, .field.err textarea { border-color: var(--bad); }
.field .error { color: var(--bad); font-size: .8rem; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--p); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 650; color: var(--ink); margin-bottom: 10px; font-size: 1rem; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }

/* Barre de filtres */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.filters .f { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.filters .f label { margin: 0; font-size: .76rem; color: var(--muted); font-weight: 600; }
.filters .f-grow { flex: 1; min-width: 220px; }
.filters select, .filters input { min-height: 36px; font-size: .88rem; }

/* ---------------------------------------------------------------------
   Tableaux
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-size: .78rem; font-weight: 650; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
table.t th a { color: inherit; }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:hover td { background: var(--row-hover, #FAFBFE); }
html[data-mode="sombre"] { --row-hover: #1E2A44; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t .who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
table.t .who .avatar { width: 30px; height: 30px; font-size: .7rem; background: var(--p-soft); color: var(--p); }
table.t .who b { display: block; font-weight: 600; color: var(--ink); }
table.t .who small { color: var(--muted); }
table.t td.actions { text-align: right; white-space: nowrap; }
table.t.compact td, table.t.compact th { padding: 7px 10px; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.pager { display: flex; gap: 4px; }
.pager a, .pager span { min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); background: var(--surface); font-size: .85rem; }
.pager span.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager a:hover { text-decoration: none; border-color: var(--faint); }

/* Badges d'état */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--chip, #EDF0F6); color: var(--chip-ink, var(--muted)); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-p { background: var(--p-soft); color: var(--p); }
.b-tp { background: var(--tp-soft); color: var(--tp); }
.b-classique { background: var(--classique-soft); color: var(--classique); }

/* Onglets */
.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--p); }
.tabs .count { font-weight: 500; color: var(--faint); margin-left: 4px; }

/* Fiche descriptive */
dl.facts { display: grid; grid-template-columns: 190px 1fr; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .86rem; padding: 8px 0; border-top: 1px solid var(--line); }
dl.facts dd { margin: 0; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
dl.facts dt:first-of-type, dl.facts dt:first-of-type + dd { border-top: 0; }

.profile-head { display: flex; gap: 18px; align-items: center; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.2rem; background: var(--p-soft); color: var(--p); }

/* Messages */
.flashes { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--brand); color: #fff; box-shadow: var(--shadow-pop); font-size: .9rem; animation: flash-in .25s ease-out; }
.flash.error { background: var(--bad); }
.flash button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0; }
@keyframes flash-in { from { transform: translateY(8px); opacity: 0; } }
.notice { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--info-soft); color: var(--ink); font-size: .9rem; margin-bottom: 18px; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.notice.ok { background: var(--ok-soft); }
.notice .ic { color: var(--info); margin-top: 1px; }
.notice.warn .ic { color: var(--warn); }
.notice.bad .ic { color: var(--bad); }
.notice.ok .ic { color: var(--ok); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--faint); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); color: var(--text); }
dialog::backdrop { background: rgba(14, 33, 70, .45); }
dialog .panel-head { border-bottom: 1px solid var(--line); }
dialog form[method=dialog] { margin: 0; }

/* Appel: grille de statuts */
.roll td.st { white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: 6px 11px; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; border-left: 1px solid var(--line); background: var(--surface); }
.seg label:first-of-type { border-left: 0; }
.seg input:checked + label.s-present { background: var(--ok); color: #fff; }
.seg input:checked + label.s-absent { background: var(--bad); color: #fff; }
.seg input:checked + label.s-absence_justifiee { background: #2563eb; color: #fff; }
.seg input:checked + label.s-entreprise { background: #7c3aed; color: #fff; }
.seg input:checked + label.s-retard { background: var(--warn); color: #fff; }
.seg input:checked + label.s-depart_anticipe { background: var(--brand-3); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--p); outline-offset: -2px; }

/* Planning semaine */
.week { display: grid; grid-template-columns: repeat(var(--days, 5), minmax(150px, 1fr)); gap: 0; overflow-x: auto; }
.week .day { border-left: 1px solid var(--line); min-height: 220px; }
.week .day:first-child { border-left: 0; }
.week .day-h { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .85rem; font-weight: 650; color: var(--ink); position: sticky; top: 0; background: var(--surface); }
.week .day-h small { display: block; font-weight: 400; color: var(--muted); }
.week .day-h.today { color: var(--p); box-shadow: inset 0 -2px 0 var(--p); }
.week .ev { margin: 8px; padding: 8px 10px; border-radius: 7px; background: color-mix(in srgb, var(--c, var(--p)) 12%, var(--surface)); border-left: 3px solid var(--c, var(--p)); font-size: .82rem; line-height: 1.35; }
.week .ev b { display: block; color: var(--ink); font-size: .84rem; }
.week .ev .h { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.week .ev.cancel { opacity: .6; text-decoration: line-through; background: var(--surface-2, var(--surface)); border-left-color: var(--line-strong, #999); }
.week .ev.cancel .badge { text-decoration: none; }
html[data-mode="sombre"] .week .ev:not(.event):not(.cancel) { background: color-mix(in srgb, var(--c, var(--p)) 22%, var(--surface)); }
html[data-mode="sombre"] .week .ev .muted, html[data-mode="sombre"] .week .ev div { color: #C4CDE0; }
.week .ev.event { background: var(--gold-soft); border-left-color: var(--gold); }
.week .ev a { color: inherit; }

/* Page publique (connexion) */
.public { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); background: var(--surface); }
.public-art {
  position: relative; overflow: hidden; background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.public-art::after {
  content: ""; position: absolute; inset: auto -20% -35% auto; width: 80%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(201,161,74,.35), rgba(201,161,74,0) 62%);
}
.public-art .brand { padding: 0; }
.public-art .brand img { width: 44px; height: 44px; border-radius: 10px; }
.public-art .brand b { font-size: 1.2rem; }
.public-art h1 { margin-bottom: 16px; color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; max-width: 14ch; line-height: 1.1; position: relative; z-index: 1; }
.public-art p { color: #B9C4DE; max-width: 42ch; position: relative; z-index: 1; }
.public-art .tracks { display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
.public-art .tracks span { padding: 6px 12px; border-radius: 99px; font-size: .82rem; font-weight: 600; border: 1px solid rgba(255,255,255,.18); color: #E3E8F4; }
.public-art .tracks span:first-child { border-color: rgba(49,82,207,.9); background: rgba(49,82,207,.25); }
.public-art .tracks span:last-child { border-color: rgba(11,127,114,.9); background: rgba(11,127,114,.25); }
.public-form { display: grid; place-items: center; padding: 40px 24px; }
.public-form .box { width: 100%; max-width: 380px; }
.public-form h2 { font-size: 1.5rem; margin-bottom: 6px; }
.public-form .lead { color: var(--muted); margin-bottom: 26px; }
.pw { position: relative; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px; cursor: pointer; border-radius: 6px; }
.public-form .alt { margin-top: 20px; font-size: .88rem; text-align: center; color: var(--muted); }
.legal { margin-top: 36px; font-size: .76rem; color: var(--faint); text-align: center; }
.legal a { color: var(--faint); }

/* Impression */
@media print {
  .hd, .ft, .tabbar, .sheet, .filters, .actions, .btn, .flashes { display: none !important; }
  .content { padding: 0; max-width: none; }
  .panel { border: 0; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .mnav-btn { padding: 0 10px; font-size: .86rem; }
  .mnav-btn > .ic { display: none; }
  .mega-in { grid-template-columns: 1fr; }
  .mega-intro { display: none; }
  .hd-in { gap: 12px; }
  .me-txt { display: none; }
}
@media (max-width: 1100px) {
  .grid-aside, .grid-3 { grid-template-columns: 1fr; }
  .brand-t { display: none; }
}
@media (max-width: 920px) {
  .wrap { padding-inline: 16px; }
  .mnav, .hd-switch, .top-search, .me-txt, .me-chev { display: none; }
  .hd-in { height: 56px; gap: 10px; }
  .brand small { display: none; }
  .content { padding-top: 18px; padding-bottom: 28px; }
  .ft { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; }
  .flashes { bottom: calc(78px + env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }
  .grid-2, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .public { grid-template-columns: 1fr; }
  .public-art { padding: 28px 24px; min-height: auto; gap: 24px; }
  .public-art h1 { font-size: 1.6rem; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dd { border-top: 0; padding-top: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi b { font-size: 1.35rem; }
  .page-head.hero { padding: 20px; border-radius: 14px; }
  .page-head.hero h1 { font-size: 1.4rem; }
  .page-head.hero .actions { width: 100%; }
  .page-head.hero .actions .btn { flex: 1; }
}
@media (max-width: 600px) {
  table.t.stack-sm thead { display: none; }
  table.t.stack-sm tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.t.stack-sm td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; }
  table.t.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
  table.t.stack-sm td.actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Appel: champs complémentaires affichés selon le statut choisi */
.roll .rmin, .roll .dmot { display: none; margin-top: 6px; min-height: 30px; padding: 4px 8px; font-size: .82rem; }
.roll .rmin { width: 80px; }
.roll .dmot { width: 100%; }
.roll td.st:has(input[value=retard]:checked) .rmin { display: block; }
.roll td.st:has(input[value=depart_anticipe]:checked) .dmot { display: block; }
.roll .seg label { padding: 6px 10px; }
.actions form { display: inline-flex; margin: 0; }

/* ---------------------------------------------------------------------
   Pied de page
   --------------------------------------------------------------------- */
.ft { margin-top: auto; background: var(--brand); color: #B9C3DB; font-size: .88rem; position: relative; }
.ft::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--classique) 0 33%, var(--gold) 33% 66%, var(--tp) 66%); }
.ft-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 36px; padding-top: 44px; padding-bottom: 36px; }
.ft h3 { color: #fff; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 14px; }
.ft-col > a { display: block; color: #B9C3DB; padding: 4px 0; width: fit-content; }
.ft a:hover { color: #fff; text-decoration: none; }
.ft-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ft-brand img { border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.ft-brand b { display: block; color: #fff; font-size: 1.05rem; }
.ft-brand small { display: block; color: var(--gold); font-weight: 600; font-size: .74rem; }
.ft-about p { max-width: 40ch; color: #9AA7C6; margin-bottom: 16px; }
.ft-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ft-contact li { display: flex; gap: 10px; align-items: flex-start; }
.ft-contact .ic-sm { color: var(--gold); margin-top: 3px; }
.ft-contact a { color: #D6DDEE; }
.ft-apps { margin-bottom: 22px; display: grid; gap: 8px; }
.ft-apps h3 { margin-bottom: 6px; }
.store { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: #fff; width: 100%; max-width: 220px; }
.store:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); }
.store .ic { width: 22px; height: 22px; color: var(--gold); }
.store span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 650; font-size: .95rem; }
.store small { font-weight: 500; font-size: .7rem; color: #9AA7C6; }
.ft-social { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-social a { padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.16); color: #D6DDEE; font-size: .8rem; font-weight: 600; }
.ft-social a:hover { border-color: var(--gold); color: var(--gold); }
.ft-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.ft-bottom-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; font-size: .78rem; color: #8796B9; }
.ft-meta { display: inline-flex; align-items: center; gap: 8px; }
.ft-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
html.in-app .ft-apps { display: none; }
@media (max-width: 1100px) { .ft-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .ft-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; padding-top: 32px; padding-bottom: 24px; }
  .ft-about, .ft-grid > .ft-col:last-child { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------------
   Mobile / applications: barre d'onglets + menu plein écran
   --------------------------------------------------------------------- */
.tabbar {
  display: none; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -18px rgba(14,33,70,.5);
}
.tabbar a, .tabbar button {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
  border: 0; background: none; font: 600 .68rem/1.1 var(--font); color: var(--faint); cursor: pointer; border-radius: 10px;
}
.tabbar .ic { width: 22px; height: 22px; }
.tabbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabbar a:hover { text-decoration: none; }
.tabbar .on { color: var(--p); }
.tabbar .on .ic { transform: translateY(-1px); }

.sheet { position: fixed; inset: 0; z-index: 70; background: var(--paper); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); animation: sheet-in .2s ease-out; }
.sheet[hidden] { display: none; }
@keyframes sheet-in { from { transform: translateY(16px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 6px; background: var(--brand); color: #fff; }
.sheet-head .me-card b { color: #fff; }
.sheet-head .me-card small { color: #9AA7C6; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); }
.sheet .switch { display: grid; width: 100%; background: var(--brand); margin-bottom: 12px; }
.sheet .switch a { padding: 10px; font-size: .86rem; }
.sheet .switch-solo { display: flex; background: var(--brand); margin-bottom: 12px; padding: 10px 12px; }
.sheet-search { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.sheet-g { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.sheet-g summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-weight: 650; color: var(--ink); cursor: pointer; }
.sheet-g summary::-webkit-details-marker { display: none; }
.sheet-g summary .chev { margin-left: auto; color: var(--faint); transition: transform .15s; }
.sheet-g[open] summary .chev { transform: rotate(180deg); }
.sheet-g[open] { padding-bottom: 8px; }
.sheet-g .mega-sec { margin: 8px 14px 4px; }
.sheet-g .mega-link { margin: 0 6px; padding: 11px 10px; font-size: .94rem; }
.sheet-foot { margin-top: 16px; display: grid; gap: 4px; }
.sheet-foot a, .sheet-foot button { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; text-align: left; width: 100%; }
.sheet-foot button { color: var(--bad); }
.sheet-foot form { margin: 0; }
.sheet-foot p { margin: 12px 4px 0; }
body.sheet-open { overflow: hidden; }

/* Accueil: bandeau d'en-tête */
.page-head.hero {
  position: relative; overflow: hidden; align-items: center; padding: 26px 28px; border-radius: 16px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--p) 55%, transparent) 0%, transparent 55%), linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 18px 40px -26px rgba(14,33,70,.7);
}
.page-head.hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(201,161,74,.16); pointer-events: none; }
.page-head.hero h1 { color: #fff; font-size: 1.7rem; }
.page-head.hero .lead { color: #C7D0E6; }
.page-head.hero .parcours-tag { background: rgba(255,255,255,.14); color: #fff; }
.page-head.hero .actions { position: relative; z-index: 1; }
.page-head.hero .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.page-head.hero .btn:hover { background: rgba(255,255,255,.18); }
.page-head.hero .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.page-head.hero .btn-primary:hover { background: #D6B266; }

/* Chiffres clés en cartes */
.kpis { gap: 14px; background: none; border: 0; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 16px 20px; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--p); }
.kpi.alert::before { background: var(--bad); }
.kpi + .kpi, .kpi:first-child { border: 1px solid var(--line); }
.panel { border-radius: 14px; box-shadow: 0 1px 2px rgba(14,33,70,.04); }

/* Page « bientôt » */
.soon-page { text-align: center; padding: 48px 24px; }
.soon-ic { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); color: var(--warn); }
.soon-ic .ic { width: 28px; height: 28px; }
.soon-page h2 { margin-bottom: 10px; }
.soon-page p { max-width: 54ch; margin: 0 auto 22px; }
.soon-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 920px) {
  .tabbar { display: flex; }
  .hd-right { margin-left: auto !important; }
  .brand-t { display: flex; }
  .page-head.hero { padding: 18px; }
  .page-head.hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .page-head.hero .actions .btn { white-space: normal; text-align: center; min-height: 44px; font-size: .84rem; }
  .page-head.hero::after { width: 180px; height: 180px; right: -70px; bottom: -80px; border-width: 26px; }
}

/* Formulaires longs (contrats) */
.req { color: var(--bad); font-weight: 700; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 12px; margin-top: 4px; }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary h2 { flex: 1; }
details.panel[open] > summary .ic-sm { transform: rotate(180deg); }
details.panel:not([open]) > summary { border-bottom: 0; }
.tuteur-bloc { padding: 14px 16px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.tuteur-bloc + .tuteur-bloc { margin-top: 14px; }
.tuteur-bloc legend { padding: 0 6px; margin-bottom: 4px; }
table.remu td { padding: 6px 8px; }
table.remu select, table.remu input { min-height: 34px; font-size: .86rem; }

/* Espace tuteur */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.card-apprenti .who { display: flex; align-items: center; gap: 10px; }
.card-apprenti .who b { display: block; color: var(--ink); }
.card-apprenti .who small { color: var(--muted); }
.card-apprenti .who .avatar { background: var(--p-soft); color: var(--p); }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.mini-kpis > div { padding: 12px 14px; border-left: 1px solid var(--line); }
.mini-kpis > div:first-child { border-left: 0; }
.mini-kpis b { display: block; font-size: 1.3rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-kpis span { font-size: .74rem; color: var(--muted); line-height: 1.25; display: block; }
.mini-kpis .alert b { color: var(--bad); }
@media (max-width: 920px) { .form-grid .span-2 { grid-column: auto; } .cards { grid-template-columns: 1fr; } }
.grid > .panel + .panel, .grid > * + * { margin-top: 0; }
a.small .ic-sm, a .ic-sm.inline { display: inline-block; vertical-align: -2px; }

/* Remplissage automatique */
.auto-filled { animation: auto-fill 1.6s ease-out; }
@keyframes auto-fill { 0% { box-shadow: 0 0 0 3px rgba(201,161,74,.55); background: var(--gold-soft); } 100% { box-shadow: none; } }
.siret-search { display: flex; gap: 8px; }
.siret-search input { flex: 1; }
.sr-list { display: grid; gap: 6px; margin-top: 10px; }
.sr-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; color: var(--text); cursor: pointer; }
.sr-item:hover { border-color: var(--p); background: var(--p-soft); text-decoration: none; }
.sr-item b { display: block; color: var(--ink); }
.sr-item small { color: var(--muted); }
.sr-item.known { border-color: var(--warn); background: var(--warn-soft); }

/* Formulaires d'inscription (publics) */
.public-app .content { padding-top: 22px; }
.form-hd-btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.form-hd-btn:hover { background: rgba(255,255,255,.18); }
.form-hero { margin-bottom: 18px; }
.form-hero .lead { max-width: 70ch; }
.inscription-form .panel-head h2 { display: flex; align-items: center; gap: 10px; }
.step { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--p); color: #fff; font-size: .85rem; font-weight: 700; flex: none; }
body.public-app .step { background: var(--brand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); font-weight: 500; font-size: .88rem; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--p); background: var(--p-soft); color: var(--ink); font-weight: 600; }
.chip input { accent-color: var(--p); }
.consent { align-items: flex-start; font-weight: 400; line-height: 1.45; }
.consent input { margin-top: 3px; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 1rem; }
.decision .chip { padding: 8px 12px; }
[hidden] { display: none !important; }
@media (max-width: 600px) { .hide-sm { display: none; } }

/* ------------------------------------------------------------------
   Fiche entreprise publique (employeur sans compte)
   ------------------------------------------------------------------ */
.fe-steps { position: sticky; top: calc(var(--top) + env(safe-area-inset-top)); z-index: 6; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; margin: -4px 0 14px; background: var(--paper); scrollbar-width: none; }
.fe-steps::-webkit-scrollbar { display: none; }
.fe-steps a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: .86rem; font-weight: 600; white-space: nowrap; text-decoration: none; transition: border-color .15s, color .15s; }
.fe-steps a:hover { border-color: var(--brand-3); color: var(--ink); }
.fe-steps .step { width: 24px; height: 24px; font-size: .78rem; background: var(--line-strong); }
.fe-steps a.done { color: var(--ok); border-color: #BFE3CE; background: var(--ok-soft); }
.fe-steps a.done .step { background: var(--ok); font-size: 0; }
.fe-steps a.done .step::after { content: "✓"; font-size: .8rem; }
.fe-form .panel { scroll-margin-top: calc(var(--top) + 64px); }
.siret-box { padding: 14px 16px; margin-bottom: 18px; border-radius: 12px; background: linear-gradient(135deg, var(--gold-soft), #FBF7EC); border: 1px solid #EADBB4; }
.siret-box > label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.fe-ident-grid { grid-template-columns: 1fr 1fr auto; align-items: end; }
.fe-ident-btn .btn { min-height: 44px; }
.fe-ident-ok { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--ok-soft); border: 1px solid #BFE3CE; }
.fe-ident-ok > div { flex: 1; min-width: 0; }
.fe-ident-ok b { display: block; font-size: 1.05rem; color: var(--ink); }
.fe-ident-ok small { color: var(--muted); }
.fe-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; flex: none; }
.fe-avatar .ic { width: 22px; height: 22px; }
.fe-ident-msg:empty { display: none; }
.fe-verrou .fe-suite { opacity: .45; pointer-events: none; filter: grayscale(.4); transition: opacity .2s; }
.fe-hm { display: flex; align-items: center; gap: 6px; }
.fe-hm input { width: 76px; }
.fe-hm span { color: var(--muted); font-size: .9rem; }
.fe-h3 { margin: 18px 0 10px; font-size: 1rem; }
.fe-remu { margin-bottom: 12px; }
.fe-t2 { margin-top: 14px; }
.fe-t2 > summary { cursor: pointer; font-weight: 600; color: var(--ink-3); padding: 8px 0; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.fe-t2 > summary::-webkit-details-marker { display: none; }
.fe-t2[open] > summary { margin-bottom: 8px; }
.fe-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.fe-actions [data-fe-etat]:empty { display: none; }
.fe-actions.sticky-actions { background: linear-gradient(transparent, var(--paper) 22%); }
.fe-actions [data-fe-etat] { background: var(--paper); padding: 2px 6px; border-radius: 6px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--info); text-decoration: underline; cursor: pointer; }
.fe-merci { max-width: 640px; margin: 24px auto 40px; text-align: center; }
.fe-merci-ic { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); margin-bottom: 12px; }
.fe-merci-ic .ic { width: 38px; height: 38px; }
.fe-merci h1 { margin: 0 0 8px; }
.fe-next { text-align: left; margin: 22px auto; padding: 16px 18px 16px 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; }
.fe-merci-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 8px; }
.fe-share { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface); }
.fe-share b { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.fe-share code { font-size: .92rem; color: var(--ink); word-break: break-all; }
@media (max-width: 720px) {
  .fe-ident-grid { grid-template-columns: 1fr; }
  .fe-ident-btn .btn { width: 100%; justify-content: center; }
  .fe-step-l { display: none; }
  .fe-steps a { padding: 4px; }
  .fe-steps a.done .step, .fe-steps .step { width: 30px; height: 30px; }
  .fe-actions .btn-lg { width: 100%; justify-content: center; }
  .fe-actions [data-fe-etat] { width: 100%; text-align: center; }
}
.cerfa-manquants ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.field > .label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix label { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.choix label:hover { border-color: var(--brand-3); }
.choix label:has(input:checked) { border-color: var(--brand); background: var(--p-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--brand); }
.choix input { accent-color: var(--ink); margin: 0; }
.fe-secteur { margin-bottom: 14px; }
.fe-bachelor { margin-top: 8px; padding: 4px 16px 8px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #EADBB4; }
/* Automatisations */
.auto-list { display: grid; }
.auto-item { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); }
.auto-item:first-child { border-top: 0; }
.auto-item.off { background: var(--surface-2); }
.auto-item.off .auto-main > b { color: var(--muted); }
.auto-main { min-width: 0; flex: 1; }
.auto-main p { margin: 4px 0 6px; color: var(--muted); font-size: .9rem; max-width: 80ch; }
.auto-msg { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; }
.auto-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 720px) { .auto-item { flex-direction: column; } }
/* Rentrée */
.rt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 0; }
.rt-kpi { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.rt-kpi b { display: block; font-size: 1.6rem; color: var(--ink); line-height: 1.1; }
.rt-kpi span { font-size: .82rem; color: var(--muted); }
.rt-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.rt-step { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.rt-step.passe { background: var(--ok-soft); border-color: #BFE3CE; }
.rt-step b { display: block; color: var(--ink); }
.rt-step small { color: var(--muted); }
.reponse-box { max-width: 560px; margin: 30px auto; text-align: center; }
.auto-main small { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lettre-apercu { font-family: Arial, Helvetica, sans-serif; font-size: 14px; background: var(--surface-2); border-radius: 10px; }
/* Factures formateurs */
.fc-resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fc-pay { display: inline-flex; gap: 6px; align-items: center; }
/* Test de positionnement */
.test-form { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.test-bar { position: sticky; top: calc(var(--top) + env(safe-area-inset-top)); z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 0; background: var(--paper); }
.test-progress { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.test-progress span { display: block; height: 100%; background: var(--brand); transition: width .25s; }
.test-count { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.test-timer { font-weight: 700; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.test-timer.urgent { color: var(--bad); border-color: var(--bad); }
.test-q { border: 1px solid var(--line); margin: 0; }
.test-section { margin: 0 0 6px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold, #B88A2E); font-weight: 700; }
.test-texte { font-size: 1.15rem; font-weight: 700; color: var(--ink); line-height: 1.4; padding: 0; margin-bottom: 14px; }
.test-options { display: grid; gap: 10px; }
.test-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.test-opt:hover { border-color: var(--brand-3); }
.test-opt:has(input:checked) { border-color: var(--brand); background: var(--p-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.test-opt input { margin-top: 3px; accent-color: var(--ink); }
.test-nav { display: flex; justify-content: space-between; gap: 10px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

/* Documents et courriers */
.sig-pad { display: block; width: 100%; max-width: 640px; height: auto; aspect-ratio: 16 / 5; background: #fff; border: 1.5px dashed var(--line); border-radius: 12px; touch-action: none; cursor: crosshair; }
.attestation-apercu { border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px; background: #fff; overflow-x: auto; }
.attestation-doc { background: #fff; }
@media print { .attestation-doc { font-size: 14px; } }

/* Examens */
.form-grid [data-span="2"] { grid-column: span 2; }
.form-grid [data-span="3"] { grid-column: 1 / -1; }
@media (max-width: 920px) { .form-grid [data-span] { grid-column: auto; } }
.jauge { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; max-width: 140px; margin-bottom: 3px; }
.jauge > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.exam-day { margin: 0 0 6px; font-weight: 700; text-transform: capitalize; }
.exam-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.exam-list li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); }
.exam-list .h { font-weight: 700; font-variant-numeric: tabular-nums; }
.exam-confirm { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

/* Livrets d'apprentissage */
.niv { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.niv input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.niv label { min-width: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-weight: 700; font-size: .82rem; cursor: pointer; background: var(--card, #fff); user-select: none; }
.niv input:focus-visible + label { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.niv input:checked + label { color: #fff; background: var(--brand); border-color: var(--brand); }
.niv input:checked + label[data-v="AC"] { background: var(--ok); border-color: var(--ok); }
.niv input:checked + label[data-v="EC"] { background: var(--info); border-color: var(--info); }
.niv input:checked + label[data-v="NAC"] { background: var(--bad); border-color: var(--bad); }
.niv input:disabled + label { cursor: default; opacity: .7; }
.livret-grille td:first-child { width: 58%; }
.livret-grille tr.grp th { text-align: left; background: var(--bg, #F4F6FA); font-size: .85rem; }
.livret-lecture h3 { margin: 18px 0 8px; font-size: 1rem; }
.livret-lecture .livret-grille { margin-bottom: 10px; }
.livret-actions { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -6px 18px rgba(14, 33, 70, .08); }
@media (max-width: 760px) { .livret-grille td:first-child { width: auto; } .livret-grille tr { display: block; padding: 6px 0; } .livret-grille td { display: block; border: 0; } }
.questionnaire .niv label { min-width: 0; flex: 1 1 140px; font-weight: 600; }

/* ---------- Messagerie ---------- */
.fils { list-style: none; margin: 0; padding: 0; }
.fils li a { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.fils li:first-child a { border-top: 0; }
.fils li a:hover { background: var(--surface-2); }
.fils .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--p-soft); color: var(--p); font-weight: 700; font-size: .85rem; }
.fils .t { min-width: 0; }
.fils .t b, .fils .t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fils .t span { color: var(--muted); font-size: .88rem; }
.fils .nl b { color: var(--ink); }
.fils .meta { text-align: right; font-size: .8rem; color: var(--faint); }
.fils .pill { display: inline-block; min-width: 22px; padding: 2px 7px; border-radius: 99px; background: var(--p); color: #fff; font-weight: 700; font-size: .75rem; text-align: center; margin-top: 4px; }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 18px; max-height: 62vh; overflow-y: auto; background: var(--surface-2); }
.msg { max-width: min(78%, 640px); align-self: flex-start; }
.msg.moi { align-self: flex-end; }
.msg .bulle { background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 14px; overflow-wrap: anywhere; }
.msg.moi .bulle { background: var(--p); border-color: var(--p); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg.moi .bulle a { color: #fff; }
.msg .qui { font-size: .78rem; color: var(--muted); margin: 0 4px 3px; }
.msg.moi .qui { text-align: right; }
.msg .pj { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg .pj a { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; padding: 4px 8px; border-radius: 6px; background: rgba(127, 140, 170, .14); text-decoration: none; color: inherit; }
.chat .sep { align-self: center; font-size: .75rem; color: var(--bad); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.repondre { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }
.repondre textarea { flex: 1; min-height: 46px; resize: vertical; }
.dest-liste { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; }
.dest-liste .check { padding: 4px 0; font-weight: 400; }
/* ---------- Annonces (bandeau) ---------- */
.annonce-bandeau { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); color: #fff; margin-bottom: 14px; }
.annonce-bandeau h2 { font-size: 1rem; margin: 0 0 2px; color: #fff; }
.annonce-bandeau p { margin: 0; opacity: .92; font-size: .9rem; }
.annonce-bandeau .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); color: #fff; }
.annonce-bandeau form { margin-left: auto; }
@media (max-width: 640px) { .msg { max-width: 92%; } .annonce-bandeau { flex-wrap: wrap; } }
/* ---------- Relations entreprises: pipeline ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px; }
.kanban .col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.kanban .col h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.kanban .carte { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; color: inherit; text-decoration: none; }
.kanban .carte:hover { border-color: var(--p); }
.kanban .carte b { display: block; font-size: .9rem; }
.kanban .carte small { color: var(--muted); display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 18px; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .q { font-size: .78rem; color: var(--muted); }
.devis-doc { background: #fff; color: #16213B; max-width: 820px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); }
.devis-doc table { width: 100%; border-collapse: collapse; }
.devis-doc th, .devis-doc td { padding: 8px 10px; border-bottom: 1px solid #E0E5EF; text-align: left; }
.devis-doc .num { text-align: right; }

/* Robustesse téléphone: rien ne doit élargir la page.
   - le tableau défilant contient aussi ses éléments positionnés (boutons radio de l'appel…) ;
   - les colonnes de grille peuvent rétrécir sous la largeur de leur contenu ;
   - les mots très longs (noms de fichiers, adresses) passent à la ligne. */
.table-wrap { position: relative; }
.grid > *, .cards > *, .kpis > *, .form-grid > *, .fc-resume > *, .rt-kpis > *, .mini-kpis > *, .kanban > *, .panel, .notice > div { min-width: 0; }
.panel, .notice, .lead, .crumbs { overflow-wrap: break-word; }

/* Progressions: regroupement par bloc de compétences, choix des modules */
.t tr.row-group td { background: var(--surface-2, var(--bg)); font-size: .82rem; letter-spacing: .01em; padding-top: 10px; padding-bottom: 8px; }
.mod-pick { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.mod-pick:first-child { border-top: 0; }
.mod-pick select, .mod-pick input:not([type=checkbox]) { max-width: 100%; }

/* Bandeau « application mobile » (accueil sur le navigateur d'un téléphone) */
.app-bandeau { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.app-bandeau[hidden] { display: none; }
.app-bandeau img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.app-bandeau-t { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: .86rem; }
.app-bandeau-t span { color: var(--muted); font-size: .8rem; }
.app-bandeau .icon-btn { flex: none; }
@media (max-width: 480px) { .app-bandeau { padding: 10px 12px; gap: 10px; } .app-bandeau img { width: 36px; height: 36px; } .app-bandeau-t span { display: none; } }
.row-actions .btn { padding: 5px 7px; }
.row-actions { text-align: right; }
@media (max-width: 720px) { .row-actions { text-align: left; } }

/* ---------------------------------------------------------------------
   Assistant PBA (IA) : bulle et panneau
   --------------------------------------------------------------------- */
.ia-bouton { position: fixed; z-index: 45; right: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px;
  border: 0; border-radius: 999px; background: var(--brand); color: #fff; font: 700 .92rem/1 var(--font); box-shadow: var(--shadow-pop); cursor: pointer; }
.ia-bouton .ic { width: 20px; height: 20px; color: var(--gold); }
.ia-bouton:hover { filter: brightness(1.12); }
.ia.ouvert .ia-bouton { display: none; }
.ia-bulle .ia-panneau { position: fixed; z-index: 46; right: 20px; bottom: 20px; width: min(400px, calc(100vw - 40px)); height: min(620px, calc(100vh - 110px));
  box-shadow: var(--shadow-pop); }
.ia-panneau { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ia-panneau[hidden] { display: none; }
.ia-page .ia-panneau { height: calc(100vh - 190px); min-height: 460px; max-width: 860px; margin: 0 auto; }
.ia-tete { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--brand); color: #fff; }
.ia-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.12); flex: none; }
.ia-logo .ic { width: 19px; height: 19px; color: var(--gold); }
.ia-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ia-titre small { color: rgba(255,255,255,.7); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ia-ic { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: rgba(255,255,255,.85); cursor: pointer; }
.ia-ic:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.ia-ic .ic { width: 18px; height: 18px; }
.ia-fil { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); overscroll-behavior: contain; }
.ia-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: .93rem; line-height: 1.5; overflow-wrap: anywhere; }
.ia-msg p { margin: 0; } .ia-msg p + p, .ia-msg p + ul, .ia-msg p + ol, .ia-msg ul + p, .ia-msg ol + p { margin-top: 7px; }
.ia-msg ul, .ia-msg ol { margin: 4px 0 0; padding-left: 20px; } .ia-msg li + li { margin-top: 3px; }
.ia-assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--text); }
.ia-moi { align-self: flex-end; background: var(--p); color: #fff; border-bottom-right-radius: 4px; }
.ia-erreur { border-color: var(--bad); background: var(--bad-soft); }
.ia-avis { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .76rem; color: var(--muted); }
.ia-avis button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; font: 600 .74rem/1.4 var(--font); color: var(--muted); cursor: pointer; }
.ia-avis button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ia-attente p { display: flex; gap: 4px; padding: 4px 0; }
.ia-attente span { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: ia-point 1s infinite ease-in-out; }
.ia-attente span:nth-child(2) { animation-delay: .15s; } .ia-attente span:nth-child(3) { animation-delay: .3s; }
@keyframes ia-point { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ia-attente span { animation: none; } }
.ia-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; background: var(--surface-2); }
.ia-suggestions[hidden] { display: none; }
.ia-sugg { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 11px; font: 600 .8rem/1.25 var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.ia-sugg:hover { border-color: var(--p); color: var(--p); }
.ia-saisie { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.ia-saisie textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; font: inherit; font-size: 16px; line-height: 1.35; }
.ia-envoyer { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 12px; background: var(--brand); color: #fff; cursor: pointer; }
.ia-saisie.occupe .ia-envoyer { opacity: .45; cursor: wait; }
.ia-note { margin: 0; padding: 0 14px 10px; background: var(--surface); font-size: .72rem; line-height: 1.35; color: var(--faint); }
@media (max-width: 920px) {
  .ia-bouton { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); height: 46px; width: 46px; padding: 0; justify-content: center; }
  .ia-bouton span { display: none; }
  .ia-bulle .ia-panneau { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; z-index: 70; }
  .ia-page .ia-panneau { height: calc(100vh - 200px - env(safe-area-inset-bottom)); border-radius: 14px; }
  .ia-msg { max-width: 92%; }
}
@media print { .ia { display: none !important; } }


/* Footer: store badges, social buttons and assistant entry. */
.ft-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ft-store-badge { display: inline-flex; border-radius: 11px; overflow: hidden; max-width: 174px; min-height: 48px; }
.ft-store-badge img { display: block; width: 174px; max-width: 100%; height: auto; object-fit: contain; }
.ft-store-badge:focus-visible, .ft-assistant-link:focus-visible, .ft-social a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.ft-assistant-link { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; padding: 11px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; background: rgba(255,255,255,.055); width: fit-content; max-width: 100%; }
.ft-assistant-link .ic { color: var(--gold); width: 20px; height: 20px; }
.ft-assistant-link:hover { background: rgba(255,255,255,.12); }
.ft-social a { box-sizing: border-box; display: inline-flex; justify-content: center; align-items: center; width: 43px; height: 43px; border-radius: 50%; padding: 0; }
.ft-social svg { width: 19px; height: 19px; fill: currentColor; }
.ft-credit a { color: #fff; font-weight: 700; }
.ft-credit a:hover { color: var(--gold); }
@media (max-width: 600px) { .ft-badges { gap: 7px; } .ft-store-badge img { width: 160px; } }


/* Correctif badges: utilise le visuel officiel Apple, sans icone re-dessinee. */
.ft-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ft-store-badge { display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 174px; max-width: 100%; border: 0; border-radius: 0;
  overflow: visible; min-height: 0; background: none; }
.ft-store-badge img { display: block; width: 174px; max-width: 100%; height: auto;
  object-fit: contain; border: 0; border-radius: 0; }
@media (min-width: 1101px) { .ft-grid { grid-template-columns: 1.4fr .8fr .8fr 1.8fr; gap: 24px; } }
@media (max-width: 600px) { .ft-store-badge, .ft-store-badge img { width: 165px; } }
/* Logo complet sur la page de connexion */
.public-art .brand-logo{display:inline-flex;align-self:flex-start;background:#fff;border-radius:16px;padding:10px 18px;box-shadow:0 10px 30px rgba(0,0,0,.18)}
.public-art .brand-logo img{width:auto;height:64px;max-width:100%;border-radius:0;box-shadow:none}
@media (max-width:720px){.public-art .brand-logo img{height:48px}}


/* =====================================================================
   Apparence choisie dans Mon profil : thème sombre et couleur d'accent
   ===================================================================== */
html[data-mode="sombre"] {
  --paper: #0D1424; --surface: #151E31; --surface-2: #1B2740; --line: #27334D; --line-strong: #36445F;
  --text: #E2E7F2; --muted: #A2AEC7; --faint: #7A87A2; --ink: #F1F4FA; --ink-2: #CBD5EA; --ink-3: #AEBBD8;
  --brand: #1A2F63; --brand-2: #1C3266; --brand-3: #2B4485;
  --gold-soft: #3A311F; --classique: #8EA5F5; --classique-soft: #1D2A50; --tp: #4EC6B5; --tp-soft: #11322E;
  --ok: #5CC992; --ok-soft: #12301F; --warn: #E6B35A; --warn-soft: #342812; --bad: #F08A7D; --bad-soft: #3A1915;
  --info: #8EA5F5; --info-soft: #1D2A50;
  --chip: #24314D; --chip-ink: #CBD5EA;
  --shadow-pop: 0 12px 32px -8px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
html[data-accent] body { --p: var(--accent); --p-soft: var(--accent-soft); }
html[data-mode="sombre"][data-accent] body { --p: color-mix(in srgb, var(--accent) 55%, #fff); --p-soft: color-mix(in srgb, var(--accent) 24%, #151E31); }
/* Documents (attestations, devis, signatures) : toujours sur papier blanc */
html[data-mode="sombre"] .attestation-apercu, html[data-mode="sombre"] .devis-doc { color: #16213B; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--surface); font-size: .88rem; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; background: var(--c, var(--p)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch:has(input:checked) { border-color: var(--p); box-shadow: 0 0 0 2px var(--p-soft); font-weight: 600; }
.swatch:has(input:focus-visible) { outline: 2px solid var(--p); outline-offset: 2px; }
html[data-mode="sombre"] .avatar { color: #0E2146; }
html[data-mode="sombre"] .profile-head .avatar { color: var(--p); }
.swatch i.parcours { background: var(--classique); }
body.is-tp .swatch i.parcours { background: var(--tp); }

/* Appel : élève non pointé sur un créneau commencé */
.roll tr.appel-manquant td { background: color-mix(in srgb, var(--bad) 10%, transparent) !important; }
.roll tr.appel-manquant td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
