/* Mise en page de l'appli. Tout ce qui est couleur, espacement ou police vient des jetons de la
   charte (tokens.css) ; les composants cf-* viennent de composants.css. Aucun style en ligne. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/22px var(--font-sans);
}
[data-profile="kid"] body { background: var(--kid-bg); }
h1, h2 { overflow-wrap: anywhere; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[data-focus]:focus { outline: none; }
.loading { padding: var(--space-6); color: var(--ink-muted); text-align: center; }

/* Options de lecture et accessibilité (PLA-MOI) */
.compte-exemple-lecture {
  font-size: 1em;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  margin: 0;
  width: 100%;
}
html[data-text-size="large"] {
  --type-body: 400 19px/27px "Alegreya Sans", system-ui, sans-serif;
  --type-body-strong: 700 19px/27px "Alegreya Sans", system-ui, sans-serif;
  --type-body-lg: 400 20px/30px "Alegreya Sans", system-ui, sans-serif;
  --type-small: 400 17px/22px "Alegreya Sans", system-ui, sans-serif;
  --type-label: 700 16px/20px "Alegreya Sans", system-ui, sans-serif;
  --type-kid-body: 600 20px/28px "Nunito", "Inter", system-ui, sans-serif;
}
html[data-text-size="xlarge"] {
  --type-body: 400 21px/30px "Alegreya Sans", system-ui, sans-serif;
  --type-body-strong: 700 21px/30px "Alegreya Sans", system-ui, sans-serif;
  --type-body-lg: 400 23px/33px "Alegreya Sans", system-ui, sans-serif;
  --type-small: 400 19px/24px "Alegreya Sans", system-ui, sans-serif;
  --type-label: 700 18px/22px "Alegreya Sans", system-ui, sans-serif;
  --type-kid-body: 600 22px/30px "Nunito", "Inter", system-ui, sans-serif;
}
html[data-reduced-motion="true"] {
  --motion-fast: 0s !important;
  --motion-base: 0s !important;
  --motion-slow: 0s !important;
  --motion-aurora: 0s !important;
}
html[data-reduced-motion="true"] * {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
html[data-high-contrast="true"] {
  --border: var(--ink);
  --border-strong: var(--ink);
  --glass-border: var(--ink);
}

/* ----- Coquille ----- */
.app { min-height: 100vh; }
.app__main { padding: var(--space-4) var(--space-4) 112px; }
.nav-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); }
[data-profile="kid"] .nav-bottom { background: var(--kid-bg); }
.nav-side { display: none; }

.page { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-4); }
.page--center { max-width: 420px; padding-top: var(--space-8); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.page-head__date { color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.page-head__date::first-letter { text-transform: uppercase; }
.page-title { margin: 0; font: 700 28px/34px var(--font-sans); }
.kid-hello { margin: 0; font: 600 30px/36px var(--font-kid-fun); }
.avatar-button { padding: 0; border: 0; border-radius: var(--radius-full); background: transparent; cursor: pointer; }

/* Mon compte : profil et appareils */
.account-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }
.account-col { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.account-link__chevron { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.account-who { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0 var(--space-3); font-size: 18px; }
.account-row__label { flex: 0 0 96px; color: var(--ink-muted); }

.account-row__note { color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.device-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.device-row__seen { color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.push-intro { margin: 0 0 var(--space-3); color: var(--ink-muted); }
.push-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.push-help { color: var(--ink-muted); font-size: 13px; line-height: 18px; text-align: center; }
.push-note { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: var(--space-2) 0; border-top: 1px solid var(--border); color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.push-note__icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.push-example { align-items: flex-start; }
.push-new { margin-left: var(--space-2); vertical-align: middle; } /* « Nouveau » à côté de « Agenda » (tâche 70 b) */
.push-example__icon { width: 20px; height: 20px; flex: none; color: var(--ink-muted); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.push-example__foot { display: block; padding-bottom: var(--space-2); }
.quiet-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); padding: var(--space-1) 0 var(--space-3); }
.quiet-actions { padding-bottom: var(--space-3); }
/* Date de naissance (tâche 69) : ligne avec « Modifier », formulaire en ligne sous la ligne. */
.birth-row { align-items: center; }
.birth-form { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-2) 0 var(--space-3); }
.birth-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.birth-form[hidden], .birth-row .cf-btn[hidden], .birth-actions .cf-btn[hidden], .admin-birth[hidden] { display: none; }
.quiet-title { flex: 1; }
.block-link { text-decoration: none; }
.block-link__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.account-appearance { flex-direction: column; align-items: stretch; gap: var(--space-2); }
.account-appearance .account-row__label { flex: none; }
.child-row__avatar { flex: none; }
.child-head { display: flex; align-items: center; gap: var(--space-3); }
.child-head__text { display: flex; flex-direction: column; min-width: 0; }
.child-head h1 { margin: 0; }
.child-note { margin: 0 0 var(--space-3); color: var(--ink-muted); }
.child-foot { margin: var(--space-3) 0 0; color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.block-empty { margin: 0; padding: var(--space-2) 0; color: var(--ink-muted); }
.note-empty-create { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-bottom: var(--space-3); } /* liste vide : Note, Liste, Note sensible (tâche 72) */
.checklist__where { margin: var(--space-2) 0 0; } /* « Sous « … » » au-dessus de la barre d'ajout (tâche 72) */
.checklist__where-chip { max-width: 100%; gap: var(--space-1); padding-right: var(--space-1); }
.checklist__where-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist__where-clear { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-full); background: transparent; color: inherit; cursor: pointer; }
.checklist__where-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.checklist__where-clear:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.kid-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.kid-tiles .cf-kidtile { text-decoration: none; }
.cf-tiles .cf-tile { text-decoration: none; }

/* Connexion (ENV-MAQ-094) et États communs (ENV-MAQ-093) : placement seulement. */
.connexion-page { display: grid; place-items: center; min-height: 100vh; padding: var(--space-6) var(--space-4); }
.connexion-col { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 400px; gap: var(--space-4); }
.connexion-card { width: 100%; display: flex; flex-direction: column; gap: var(--space-4); }
.connexion-secret-row { display: flex; align-items: center; gap: var(--space-2); width: 100%; }
.connexion-secret-row .cf-field__input { flex: 1; min-width: 0; }
.connexion-actions { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; }
@media (min-width: 768px) {
  .connexion-actions { flex-direction: row; justify-content: flex-end; }
}
.standalone {
  min-height: 100vh; display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  gap: var(--space-4); max-width: 440px; margin: 0 auto; padding: var(--space-6) var(--space-4);
}
.standalone .cf-state { width: 100%; max-width: 440px; }
.etat-page { display: grid; place-items: center; min-height: 70vh; }
.etat-page .cf-state { width: 100%; max-width: 440px; }
.etat-marque { text-align: center; }
.unlock-form { display: flex; flex-direction: column; gap: var(--space-3); }

/* ----- Menu du compte ----- */
.overlay { position: fixed; inset: 0; z-index: 1100; }
.overlay--sheet .cf-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow: auto; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.overlay--menu .menu-popover { position: absolute; left: var(--space-4); bottom: 72px; width: 288px; }
.menu-hint { display: block; color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.overlay--sheet .cf-menu__head { padding: var(--space-2) var(--space-3); }
.overlay .cf-alert { margin: var(--space-2) var(--space-3); }
.sidenav-me { width: 100%; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.sidenav-me:hover { background: var(--surface-2); }

/* ----- Ordinateur et tablette (barre latérale à partir de 780 px) ----- */
@media (min-width: 780px) {
  .nav-bottom, .only-narrow { display: none; }
  .nav-side { display: block; position: fixed; top: 0; bottom: 0; left: 0; width: 240px; z-index: 5; }
  .nav-side .cf-sidenav { height: 100%; }
  .app__main { margin-left: 240px; padding: var(--space-8) var(--space-6); }
  .account-grid { grid-template-columns: 1fr 1fr; }
  .kid-tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .cf-tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ----- Notes ----- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.note-head-actions { display: flex; align-items: center; gap: var(--space-1); }
.note-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.note-sort-field { min-width: 220px; }
.note-list { display: flex; flex-direction: column; gap: var(--space-3); }
.note-more { display: flex; justify-content: center; }
.note-card { display: flex; flex-direction: column; gap: var(--space-2); color: inherit; text-decoration: none; }
.note-card .cf-card__head { margin-bottom: 0; }
.note-card__title { min-width: 0; overflow-wrap: anywhere; }
.note-card__marks { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.note-star svg { width: 18px; height: 18px; fill: var(--accent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.note-card__preview { margin: 0; color: var(--ink-muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.note-card__sensitive { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--ink-muted); }
.note-card__sensitive svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.note-card__news { margin: 0; }
.note-card__tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.note-card__foot { display: flex; align-items: center; gap: var(--space-1); }
.note-fab { position: fixed; right: var(--space-4); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 4; text-decoration: none; }

.app--bare .nav-bottom { display: none; }
.note { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-4); }
.note-topbar { position: sticky; top: 0; z-index: 4; margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0; }
.note-content { display: flex; flex-direction: column; gap: var(--space-4); }
.note-choices { display: flex; flex-direction: column; gap: var(--space-2); }
.note-title { margin: 0; font: 700 24px/30px var(--font-sans); overflow-wrap: anywhere; }
.note-body { margin: 0; font: 400 16px/24px var(--font-sans); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-owner { display: inline-flex; align-items: center; gap: var(--space-1); }
.note-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.note-bar[hidden], .note-bar .cf-btn[hidden] { display: none; }
.sheet-field, .sheet-actions { padding: var(--space-2) var(--space-3); }
.sheet-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.overlay--sheet .cf-choices { padding: var(--space-2) var(--space-3); }
.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.share-row { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.share-row:first-child { border-top: 0; }
.share-row.is-disabled { opacity: .6; }
.share-row__text { flex: 1; display: flex; flex-direction: column; }
.share-row__name { font-size: 15px; line-height: 22px; font-weight: 600; }
.dialog-list { margin: 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); text-align: left; font-size: 14px; line-height: 20px; }
.overlay--dialog { display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.overlay--dialog .cf-dialog { position: relative; width: 100%; }
.cf-topbar__title--center { flex: 1; text-align: center; }

@media (min-width: 780px) {
  .note-fab { bottom: var(--space-6); right: var(--space-6); }
  .note-bar { left: 240px; }
  .note-topbar { margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-6)) 0; }
}

/* ----- Liste à cocher ----- */
.checklist { display: flex; flex-direction: column; gap: var(--space-3); }
.checklist__head { display: flex; flex-direction: column; gap: var(--space-3); }
.checklist__head:empty { display: none; }
.checklist__mask { align-self: flex-start; }
.checklist__stars { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.checklist__count { font: 600 20px/26px var(--font-kid-fun); white-space: nowrap; }
.cf-checklist[hidden], .cf-checklist__row[hidden] { display: none; }
.cf-checklist__row .cf-check { flex: none; }
button.cf-checklist__text, .checklist__text-button { min-height: 44px; padding: 0; border: 0; background: transparent; color: inherit; font-family: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.cf-checklist--kid button.cf-checklist__text, .cf-checklist--kid .checklist__text-button { min-height: 56px; }
.cf-checklist__level { margin-right: var(--space-1); }
.cf-checklist__highlights { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; }
.cf-checklist__highlight-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--radius-full); border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; flex: none; padding: 0; transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard); }
.cf-checklist__highlight-btn:hover { color: var(--ink); background: var(--surface-2); }
.cf-checklist__highlight-btn svg { width: 18px; height: 18px; }
.cf-checklist__row.is-done .cf-checklist__highlights { opacity: 0.5; }
.note-composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
[data-profile="kid"] .note-title { font-family: var(--font-kid-fun); font-weight: 600; font-size: 28px; line-height: 34px; }
[data-profile="kid"] .note-list { gap: var(--space-3); }
.sheet-form { display: flex; flex-direction: column; }

@media (min-width: 780px) {
  .note-composer { left: 240px; }
}

/* ----- Ordinateur : menu, liste et note côte à côte ----- */
.note-placeholder { margin: 0; padding: var(--space-8) var(--space-4); text-align: center; color: var(--ink-muted); }
@media (min-width: 1060px) {
  .notes-split { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .notes-pane { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow: auto; }
  .notes-pane .page { max-width: none; }
  .note-pane .note { margin: 0; max-width: 720px; }
  .note-pane .note-topbar { position: static; margin: 0; }
  .note-pane .cf-topbar__back { display: none; }
  .note-pane .note-bar, .note-pane .note-composer { position: sticky; left: auto; right: auto; bottom: 0; }
}

/* ----- Administration (tâche 42) ----- */
.admin-entry .login__card { gap: var(--space-3); }
.admin-steps { justify-content: center; }
.admin-steps--compact { display: none; }
.admin-steps[hidden] { display: none; }
@media (max-width: 779px) {
  .admin-steps--full { display: none; }
  .admin-steps--compact:not([hidden]) { display: flex; }
}

.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; max-width: 960px; margin: 0 auto var(--space-4); }
.admin-timer { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.admin-timer svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.admin-timer.is-low { color: var(--danger); font-weight: 600; }
.admin-quit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.admin-topbar { margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-3); }
.admin-card { display: flex; flex-direction: column; gap: var(--space-4); }

.admin-sheet__meta { margin: var(--space-2) 0; font-size: 13px; line-height: 18px; }
.admin .cf-sidenav { overflow-y: auto; }
.admin .cf-sidenav__item { min-height: 44px; }
.admin-nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-3); }
.admin-nav-group__title { padding: var(--space-1) var(--space-3); font: var(--type-label); color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-sheet-links { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2) var(--space-1); }
.admin-sheet-group { padding: var(--space-1) var(--space-2); }
.admin-sheet-group__body { gap: 2px; padding: 0 0 var(--space-1) var(--space-2); }
@media (min-width: 780px) {
  .admin-topbar, .admin-rows { display: none; }
}

/* L'attribut `hidden` doit toujours gagner sur les `display` des composants (cf-field, cf-otp…). */
[hidden] { display: none !important; }
.admin-entry { display: flex; flex-direction: column; gap: var(--space-4); }

/* ----- Administration : supervision (tâche 43) ----- */
.only-wide { display: none; }
@media (min-width: 780px) { .only-wide { display: block; } .only-narrow { display: none; } }
.admin-page { max-width: 1100px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-message:empty { display: none; }
.admin-overview, .admin-block-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.admin-headline { margin: 0; font: 600 20px/26px var(--font-sans); }
.admin-headline--ok { color: var(--success); }
.admin-headline--warn { color: var(--warning); }
.admin-headline--down { color: var(--ink); }
.admin-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 780px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
.admin-block { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.admin-more { font-size: 13px; line-height: 18px; }
.admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.admin-list__item { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.admin-list__item:first-child { border-top: 0; }
.admin-list__item--between { justify-content: space-between; }
.admin-list__text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.admin-gauges { display: flex; flex-direction: column; gap: var(--space-4); }
.admin-unmeasured { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.is-muted { color: var(--ink-muted); }
.admin-cards { display: flex; flex-direction: column; gap: var(--space-3); }
.admin-mini .cf-card__head { margin-bottom: var(--space-2); }
.admin-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); font-size: 14px; line-height: 20px; }
.admin-dl dt { color: var(--ink-muted); }
.admin-dl dd { margin: 0; overflow-wrap: anywhere; }
.admin-result { display: flex; flex-direction: column; gap: var(--space-3); }
.admin-diagnostic { display: flex; flex-direction: column; gap: var(--space-3); }
.admin-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.admin-check { padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.admin-check:first-child { border-top: 0; }
.admin-check__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.admin-check__detail { margin: var(--space-1) 0 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.admin-charts { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 1060px) { .admin-charts { grid-template-columns: 1fr 1fr; align-items: start; } }
.admin-chart .cf-chart__plot { min-height: 140px; }
.admin-link { align-self: flex-start; }
.cf-table-wrap .is-muted { color: var(--ink-muted); }
.admin-loadable .loading { padding: var(--space-4); text-align: left; }
.cf-card__head { gap: var(--space-3); }
.admin-overview .cf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 780px) { .admin-overview .cf-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.admin-chart { margin: 0; }
@media (min-width: 780px) { .admin-cards { display: none; } }

/* --- Comptes, sessions, bloqués et journal d'audit (tâche 44) --- */
.admin-person { display: inline-flex; align-items: center; gap: var(--space-3); min-width: 0; }
.admin-person__text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.admin-person__sub { color: var(--ink-muted); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.admin-me { margin-left: var(--space-2); }
.admin-states { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.admin-split { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1060px) { .admin-split:has(.admin-panel) { grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); } }
.admin-panel-slot:empty { display: none; }
.admin-panel { min-width: 0; }
.admin-form { display: flex; flex-direction: column; gap: var(--space-4); }
.admin-zone { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.admin-zone__title { margin: 0; font: 600 14px/20px var(--font-sans); }
.admin-facts { margin: 0; padding-left: var(--space-4); color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.overlay--sheet .admin-panel { border: 0; box-shadow: none; }
.admin-filters { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
.admin-filters > * { min-width: 0; }
.admin-filters .cf-field__input { width: 100%; box-sizing: border-box; min-width: 0; }
@media (min-width: 780px) { .admin-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1060px) { .admin-filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); } }
.admin-day { margin: var(--space-3) 0 var(--space-1); font: 600 13px/18px var(--font-sans); color: var(--ink-muted); text-transform: uppercase; }
.admin-entry { align-items: flex-start; }
.admin-entry__time { flex: none; min-width: 48px; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.admin-results { display: flex; flex-direction: column; }

/* Sauvegardes, restauration, alertes (tâche 45) : mise en page seulement, les composants sont ceux de la charte. */
.admin-form-wrap { display: flex; flex-direction: column; gap: var(--space-3); }
.admin-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.admin-task { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.admin-task:first-child { border-top: 0; padding-top: 0; }
.admin-task__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.admin-task__detail { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.admin-task__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.admin-alert { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-alert__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.admin-alert__body { display: flex; flex-direction: column; gap: var(--space-1); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.admin-rule { text-align: left; height: auto; min-height: 44px; white-space: normal; }
.admin-procedure { max-height: 85vh; overflow: auto; text-align: left; }
.admin-steps-list { margin: 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); font-size: 14px; line-height: 20px; }
.admin-steps-list li { display: flex; flex-direction: column; gap: var(--space-1); overflow-wrap: anywhere; }
.admin-plain-list { margin: 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); font-size: 14px; line-height: 20px; }
.admin-code { min-height: 0; resize: none; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13px; line-height: 18px; }
.admin-restore-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.admin-restore-step { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 44px; padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.admin-restore-step:first-child { border-top: 0; }
.admin-restore-step[aria-current="step"] { font-weight: 600; }

/* Bandeau de maintenance (composant Banner), collé en haut de toutes les pages. */
.maintenance-host { position: sticky; top: 0; z-index: 30; width: 100%; }
.maintenance-host:empty { display: none; }
@media (min-width: 780px) {
  body:has(.nav-side) .maintenance-host { margin-left: 240px; width: calc(100% - 240px); }
}
/* Échéances et maintenance (tâche 46) : commande à copier, aperçu du bandeau. */
.admin-command { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.admin-command .admin-code { width: 100%; box-sizing: border-box; }
.admin-step { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-preview { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
/* Inventaire des secrets (tâche 46) : tableau et fiche côte à côte, texte de procédure. */
.admin-secrets-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-4); align-items: start; }
.admin-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-table tr.is-selected { background: var(--accent-soft); }

/* Base de données (tâche 47b, écrans 29 à 31) : mise en page seulement, les composants sont ceux de la charte
   (PickList, Pager, DataTable, Tabs, Segmented, Tag, Alert, StatePanel). */
.db-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
.db-main, .db-table { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.db-page .page-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.db-table-name { margin: 0; font-size: 20px; line-height: 28px; }
.db-name, .db-table-name code, .db-masked code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.db-masked { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.db-masked svg, .db-lock { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.db-lockwrap { display: inline-flex; color: var(--ink-muted); }
.db-filter { display: none; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.db-filter .cf-field__input { width: auto; min-width: 0; }
.db-filter[hidden] { display: none; }
.db-active-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.db-records { display: flex; flex-direction: column; gap: var(--space-2); }
.db-indexes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-2); overflow-wrap: anywhere; font-size: 12px; }
.db-phone-list { display: flex; flex-direction: column; gap: var(--space-2); }
.db-phone-list .admin-row { width: 100%; text-align: left; }
.db-only-desktop, .db-only-tablet, .db-only-wide-empty { display: none; }
@media (min-width: 780px) {
  .db-filter { display: flex; }
  .db-only-wide-empty { display: block; }
  .db-phone-list { display: none; }
  .db-only-tablet { display: flex; }
}
@media (max-width: 779px) {
  .db-filter.is-open { display: flex; flex-direction: column; align-items: stretch; }
  .db-layout.has-table .db-phone-list { display: none; }
}
@media (min-width: 1060px) {
  .db-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .db-only-desktop { display: flex; }
  .db-only-tablet { display: none; }
}

/* Suivi des fils rouges (ENV-MAQ-172 / PLA-ADM-007, PLA-ADM-009) */

/* Anciens styles en ligne de la page, refusés par la CSP (style-src 'self') : ils passent ici. */

/* Accueil modulable (tâche 61) : la grille et les widgets viennent de la charte ; ici, le contenu. */
.page--home { max-width: 1280px; }
.widget-body { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.widget-empty { margin: 0; padding: var(--space-2) 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.cf-widget--kid .widget-empty { color: var(--kid-on-color); font-size: 16px; line-height: 24px; font-weight: 600; }
.widget-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.widget-row__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-widget__row.cf-activity { align-items: center; }
.widget-counters { display: flex; flex-direction: column; gap: var(--space-2); }
.widget-counters--inline { flex-direction: row; align-items: center; gap: var(--space-4); }
.widget-counter { display: flex; align-items: baseline; gap: var(--space-2); color: inherit; text-decoration: none; }
.widget-counter__label { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.cf-widget--kid .widget-counter__label { color: var(--kid-on-color); font-size: 16px; font-weight: 600; }

/* Bandeau du jour et règle rien à montrer (PLA-ACC-008a / PLA-ACC-004, maquette ENV-MAQ-162) */
.day-briefing { margin-bottom: var(--space-4); }
.day-briefing__content { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.day-briefing__weather-block { display: inline-flex; align-items: center; gap: var(--space-2); }
.day-briefing__weather { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; text-decoration: none; color: inherit; }
.day-briefing__weather:hover { text-decoration: underline; }
.day-briefing__temp { font-size: 15px; }
.day-briefing__sky { font-size: 14px; color: var(--ink-muted); }
.day-briefing__birthday { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 14px; color: var(--ink-muted); }
.day-briefing__alert-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; cursor: pointer; border-radius: var(--radius-full); }
.home-all-empty { grid-column: 1 / -1; text-align: center; padding: var(--space-6) var(--space-4); color: var(--ink-muted); font-size: 15px; }
.cf-widget.is-editing.is-empty-state { opacity: 0.65; border-style: dashed; }
.cf-widget.is-editing .is-empty-hint { font-style: italic; color: var(--ink-muted); }
.home-avatar-button { position: relative; }
.home-avatar-button .cf-tile__badge { position: absolute; top: -4px; right: -4px; }

/* Modifier l'accueil (tâche 61) */
.cf-widget[hidden] { display: none; }
.home-edit__bar { position: sticky; top: 0; z-index: 5; margin: 0 calc(-1 * var(--space-4)); }
.home-edit__bar .cf-topbar__title { flex: 1; }
.home-edit__help { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.home-edit--kid .home-edit__help { font: 600 16px/24px "Nunito", system-ui, sans-serif; }
.home-edit__fill { flex: 1; }
.home-edit__layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
.home-edit__layout:not(.home-edit__layout--single) { grid-template-columns: minmax(0, 1fr) 320px; }
.home-edit__main { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.home-edit__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.home-edit__panel { position: sticky; top: 72px; display: flex; flex-direction: column; gap: var(--space-3); }
.home-edit__panel-block { display: flex; flex-direction: column; gap: var(--space-2); }
.home-edit__sheet-actions { padding: var(--space-3) var(--space-3) 0; }
.home-edit__catalog { padding: 0 var(--space-3); }
.cf-sheet .cf-segmented { margin: var(--space-2) var(--space-3); }
.home-edit__removed-title { margin: 0; font: 700 20px/28px "Fredoka", "Nunito", system-ui, sans-serif; }
.home-edit__removed-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.home-edit__main .cf-widget__tip { border: 1px solid var(--border); }
.home-edit__main .cf-widget__tip[hidden] { display: none; }
.widget-foot { display: block; padding-top: var(--space-1); }
.cf-widget--kid .cf-widget__link { color: var(--kid-on-color); }
.cf-widget.widget--compact { flex-direction: row; align-items: center; gap: var(--space-3); }
.widget--compact .cf-widget__head { flex: none; margin: 0; }
.widget--compact .widget-body { justify-content: center; }
.widget--compact .widget-empty { padding: 0; }
.widget--compact .cf-widget__row { border-top: 0; }

/* Météo (tâche 64) : les blocs viennent de la charte (Weather, KidWeather) ; ici, la mise en page. */
/* min-width: 0 : la bande « heure par heure » défile dans sa carte, elle ne doit pas élargir la page. */
.weather, .weather-slot, .weather-body, .weather-cols, .weather-col, .weather-card { min-width: 0; }
/* Les textes réservés aux lecteurs d'écran (sr-only, en position absolue) restent dans leur bande : sinon ils élargissent la page. */
.cf-weather-hours, .cf-weather-hour, .cf-weather-day, .cf-kidmoment, .cf-kidforecast__row { position: relative; }
.weather-head { flex-wrap: wrap; align-items: flex-end; }
.weather-where { margin: var(--space-1) 0 0; color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.weather-picker { min-width: 200px; }

.weather-body--kid { gap: var(--space-3); }
.weather-cols, .weather-col { display: contents; }
.weather-card { display: flex; flex-direction: column; gap: var(--space-3); }
.weather-card .cf-card__head { margin: 0; }
.weather-card--now { order: 1; }
.weather-card--rain { order: 2; }
.weather-card--hourly { order: 3; }
.weather-card--daily { order: 4; }
.weather-card--air { order: 5; }
.weather-card--vigilances { order: 6; }
.weather-cols { display: flex; flex-direction: column; gap: var(--space-4); }
.weather-note { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.weather-air { display: flex; align-items: center; gap: var(--space-2); }
.weather-air__index { color: var(--ink-muted); font-size: 13px; }
.weather-pollens { margin: 0; padding-left: var(--space-4); font-size: 14px; line-height: 20px; }
.weather-vigilance { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: var(--space-1) 0; border-top: 1px solid var(--border); }
.weather-vigilance__text { display: flex; flex-direction: column; min-width: 0; }
.weather-vigilance__text small { color: var(--ink-muted); }
.weather-foot { margin: 0; color: var(--ink-muted); font-size: 12px; line-height: 16px; }
.weather-skeleton { border-radius: var(--radius-md); background: var(--surface-2); }
.weather-skeleton--tall { height: 140px; }
.weather-skeleton--short { height: 72px; }
.weather-body.is-loading .weather-card { opacity: 0.6; }
@media (min-width: 1060px) {
  /* Ordinateur : deux colonnes de même hauteur (gauche : Maintenant, pluie, heure par heure, vigilances ; droite : 14 jours, air). */
  .weather-cols { flex-direction: row; align-items: stretch; }
  
  .weather-card { order: 0; }
  .weather-col > .weather-card:last-child { flex: 1; } /* la dernière carte comble le bas de la colonne : même hauteur des deux côtés */
}
.weather-results { margin-top: var(--space-2); }
.weather-results__list { margin: 0; }
.weather-result { width: 100%; min-height: 48px; border-width: 1px 0 0; border-style: solid; border-color: var(--border); background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.weather-result:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.weather-search-block { padding-bottom: var(--space-3); }

.weather-source { gap: var(--space-3); }
.home-edit__place { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-3) 0; }

/* Widgets Météo : tout le widget est un lien. */
.widget-weather-link { display: flex; flex-direction: column; flex: 1; min-height: 0; color: inherit; text-decoration: none; }
.widget-weather-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-md); }
.widget-weather-link--text { color: var(--accent); font-weight: 600; }
.widget-weather { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.widget-weather svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.widget-weather__icon { width: 28px; height: 28px; flex: none; }
.widget-weather__where { font-size: 12px; line-height: 16px; opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-weather__now { display: flex; align-items: center; gap: var(--space-2); }
.widget-weather__temp { font-size: 28px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.widget-weather__sky { font-size: 14px; line-height: 20px; font-weight: 600; }
.widget-weather__range, .widget-weather__rain { font-size: 13px; line-height: 18px; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-weather__advice { font-size: 15px; line-height: 20px; font-weight: 700; }
.widget-weather__alert { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; font-weight: 600; }
.widget-weather--line { flex-direction: row; align-items: center; gap: var(--space-3); }
.widget-weather__text { display: flex; flex-direction: column; min-width: 0; }
.widget-weather__text strong, .widget-weather__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-week { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-1); }
.widget-week__day { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; line-height: 18px; }
.widget-week__day svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.widget-week__name { font-weight: 600; }
.widget-week__min { color: var(--ink-muted); }
.widget-week__rain { color: var(--info); font-size: 12px; min-height: 16px; }

/* ----- Tâches (tâche 67, maquette « Écrans Tâches ») : mise en page seulement, les composants sont dans la charte ----- */
.tasks-head { align-items: center; flex-wrap: wrap; }
.tasks-head .page-title { flex: 1 0 auto; }
.tasks-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.tasks-topbar { position: sticky; top: 0; z-index: 4; margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0; }
.tasks-body { display: flex; flex-direction: column; gap: var(--space-3); }
.tasks-body.is-loading .cf-task-list { opacity: 0.6; }
.tasks-group { display: flex; flex-direction: column; gap: var(--space-2); }
.tasks-group .cf-task__title { overflow-wrap: anywhere; }
.tasks-group .cf-task .cf-tag { flex: none; }

.tasks-empty { text-align: center; padding: var(--space-6) 0; }
.tasks-note { margin: 0; padding: 0 var(--space-1); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.tasks-fab { position: fixed; right: var(--space-4); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 4; width: 56px; height: 56px; padding: 0; justify-content: center; text-decoration: none; }
.tasks-person-view { justify-content: center; color: var(--accent); }
.tasks-person-view__icon { width: 40px; height: 40px; display: grid; place-items: center; }
.tasks-person-view__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tasks-person { display: flex; align-items: center; gap: var(--space-3); }
.tasks-person__name { margin: 0; font: 700 24px/30px var(--font-sans); }
.tasks-person__kind { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.tasks-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.tasks-stats .cf-stat { padding: var(--space-3); color: inherit; text-decoration: none; }
.tasks-stat--late { color: var(--danger); }
.tasks-done-link { align-self: flex-start; }
.tasks-filters { display: flex; flex-direction: column; gap: var(--space-3); }
.tasks-more { display: flex; justify-content: center; }
.tasks-more:empty { display: none; }
.tasks-detail__title { display: flex; flex-direction: column; gap: var(--space-2); }
.tasks-detail__name { margin: 0; font: 700 24px/30px var(--font-sans); overflow-wrap: anywhere; }
.tasks-detail__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tasks-card { display: flex; flex-direction: column; gap: var(--space-2); }
.tasks-card__title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.tasks-card__foot { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.tasks-description { margin: 0; font-size: 14px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tasks-step__when { color: var(--ink-muted); }
.tasks-placeholder { margin: 0; padding: var(--space-8) var(--space-4); text-align: center; color: var(--ink-muted); }
.tasks-actions-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.tasks-detail__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tasks-detail__remove { display: flex; }
.tasks-danger { color: var(--danger); }
.tasks-history { display: flex; flex-direction: column; }
.tasks-reviews { display: flex; flex-direction: column; gap: var(--space-3); }
.tasks-sheet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); padding-bottom: var(--space-4); }
.tasks-counter { align-self: flex-end; font-size: 12px; line-height: 16px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tasks-note-area { min-height: 112px; }
/* Formulaire : sections en colonne, barre « Annuler | Créer » fixée en bas (comme le formulaire des notes). */
.tasks-form { max-width: 720px; margin: 0 auto; padding-bottom: 96px; }
.tasks-form__top { display: flex; flex-direction: column; gap: var(--space-2); }
.tasks-form__top:empty { display: none; }
.tasks-form__top .cf-alert:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.tasks-form__body { display: flex; flex-direction: column; }
.tasks-form__body.is-stale { opacity: 0.5; }
.tasks-form__head { display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: var(--space-4); }
.tasks-form__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.tasks-description-field { min-height: 88px; }
.tasks-error { color: var(--danger); font-weight: 600; }
.tasks-editrows { display: flex; flex-direction: column; gap: var(--space-2); }
.tasks-step-when select { min-height: 36px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.tasks-reminder-add select { min-height: 34px; padding-top: 0; padding-bottom: 0; border-radius: var(--radius-full); font-size: 13px; font-weight: 600; }
.cf-fsection .cf-chip svg { width: 14px; height: 14px; margin-left: var(--space-1); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tasks-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
.tasks-form--kid .tasks-form__body { gap: var(--space-6); padding-top: var(--space-4); }
.tasks-kid-question { font: 700 22px/28px var(--font-kid-fun); color: var(--ink); }
.tasks-kid-when { display: flex; flex-direction: column; gap: var(--space-3); }
.tasks-kid-help { margin: 0; font-size: 16px; line-height: 22px; color: var(--ink-muted); }
.tasks-form--kid .cf-chip--kid[aria-pressed="true"] { color: var(--kid-on-color); }
@media (min-width: 780px) {
  .tasks-fab { bottom: var(--space-6); right: var(--space-6); }
  .tasks-bar { left: 240px; }
  .tasks-topbar { margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-6)) 0; }
}
/* Ordinateur (980 px et plus) : liste à gauche, détail de la tâche choisie à droite, dans une carte. */
@media (min-width: 980px) {
  .tasks-split { display: grid; grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); gap: var(--space-4); align-items: start; }
  .tasks-pane { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow: auto; }
  .tasks-pane .page { max-width: none; }
  .task-pane .tasks-detail { max-width: 720px; margin: 0; padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-ml); }
  .task-pane .tasks-topbar { position: static; margin: 0; padding: 0; height: auto; border: 0; background: none; }
  .task-pane .cf-topbar__back { display: none; }
  .task-pane .tasks-card { padding: var(--space-3) 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; }
}
@media (min-width: 980px) and (max-width: 1059px) {
  .task-pane .tasks-detail { padding: var(--space-4); }
}
@media (min-width: 1200px) {
  .tasks-split { grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: var(--space-6); }
}

/* Tâches, enfant (écrans 9 et 14c) et widgets (écrans 10 et 11) */
.tasks--kid .tasks-kid-body { display: flex; flex-direction: column; gap: var(--space-4); }
.tasks-kid-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.tasks-kid-sub { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink-muted); }
.tasks-kid-sub:empty { display: none; }
.tasks-kid-title { margin: 0; font: 700 22px/28px var(--font-kid-fun); }
.tasks-kid-soon { display: flex; flex-direction: column; gap: var(--space-2); }
.tasks-kid-link { color: inherit; text-decoration: none; }
.tasks-kid-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: var(--radius-sm); }
.tasks-kid-add { align-self: stretch; justify-content: center; text-decoration: none; }
.tasks-kid-done { align-self: center; font-size: 17px; }
.cf-kidday__task:disabled { cursor: default; }
.tasks-widget-row { gap: var(--space-1); }
.tasks-widget-box { width: 44px; height: 44px; flex: none; display: grid; place-items: center; margin-left: -12px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.tasks-widget-box:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; border-radius: var(--radius-md); }
.tasks-widget-box:disabled { cursor: default; opacity: 0.6; }
.tasks-widget-box .cf-widget__check { display: grid; place-items: center; }
.tasks-widget-box .cf-widget__check.is-checked { border-color: var(--success); background: var(--success); color: var(--on-accent); }
.tasks-widget-box svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tasks-widget-box--kid { margin-left: -8px; width: 48px; height: 48px; }
.tasks-widget-box--kid svg { width: 22px; height: 22px; }
.tasks-widget-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: inherit; text-decoration: none; }
.tasks-widget-row.is-done .tasks-widget-title, .cf-widget__task.is-done .tasks-widget-title { color: var(--ink-muted); text-decoration: line-through; }
.tasks-widget-late { color: var(--danger); font-weight: 600; }
.tasks-widget-more { margin-top: auto; padding-top: var(--space-1); color: inherit; }
.tasks-widget-say { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.tasks-widget-say:empty { display: none; }
.tasks-widget-count { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1; color: inherit; text-decoration: none; }
.tasks-widget-count .cf-tag { margin-top: auto; }
.tasks-widget-line { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-widget-stars { display: flex; }
.tasks-widget-star svg { width: 20px; height: 20px; fill: var(--kid-sun); stroke: var(--ink); stroke-width: 1.5; }
.cf-widget--kid .tasks-widget-title { white-space: normal; }
.cf-widget--kid .cf-widget__task + .cf-widget__task { margin-top: var(--space-2); }
.cf-widget--kid .tasks-widget-count .cf-widget__meta { color: inherit; font-size: 16px; line-height: 22px; font-weight: 700; }

/* Agenda (tâche 71, docs/domaines/ENV/MAQ/maquettes/agenda.md). Placement des blocs : les nombres viennent d'agenda-layout.js et
   arrivent en propriétés CSS par le CSSOM (--top, --height en minutes ; --col, --cols ; --at, --now, --hours) ;
   jamais d'attribut style (CSP). */
.agenda-head__actions { display: flex; align-items: center; gap: var(--space-2); }
.agenda-new { display: none; }
.agenda-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.agenda-toolbar .cf-tabs { border-bottom: 0; }
.agenda-people[hidden] { display: none; }
.agenda-slot { display: flex; flex-direction: column; gap: var(--space-3); }
.agenda-slot > .is-loading { opacity: 0.5; }
.agenda-label { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); }
.agenda-day, .agenda-week, .agenda-month { display: flex; flex-direction: column; gap: var(--space-3); }
.agenda-allday, .agenda-band, .agenda-rows { display: flex; flex-direction: column; gap: var(--space-2); }
.agenda-daylink__text { flex: 1; }
button.cf-event { cursor: pointer; }
button.cf-event:not(.cf-event--block) { width: 100%; }
.cf-event svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agenda-grid { --hour-h: 48px; margin-top: 10px; margin-bottom: 10px; }
.agenda-hour { top: calc(var(--at) * var(--hour-h)); }
.agenda-block { top: calc(var(--top) * var(--hour-h) / 60); height: calc(var(--height) * var(--hour-h) / 60 - 2px);
  left: calc((100% - 4px) * var(--col) / var(--cols)); width: calc((100% - 4px) / var(--cols) - 4px); }
.agenda-block.cf-event--cancel .cf-tag { align-self: flex-start; }
.agenda-now { top: calc(var(--now) * var(--hour-h) / 60); }
.agenda-now[hidden] { display: none; }
.agenda-weekbody { --hour-h: 44px; padding: 10px 0; }
.agenda-weekbody .cf-weekgrid__gutter span { top: calc(var(--at) * var(--hour-h)); }
.agenda-grid--week { --hour-h: 44px; height: 100%; margin: 0; }
.agenda-grid--week .agenda-hour { display: none; }
.agenda-allday-label { align-self: center; padding-left: 6px; font-size: 11px; line-height: 14px; color: var(--ink-muted); }
.agenda-span { grid-column: var(--from) / span var(--span); }
.agenda-legend-vacation { background: var(--surface-2); border: 1px solid var(--border-strong); }

.agenda-open-day { align-self: flex-start; text-decoration: none; }
.agenda-month-note { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
button.cf-month__ev { width: 100%; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.cf-month__ev:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.agenda-month-period { border-color: transparent; background: var(--surface-2); color: var(--ink-muted); }
.agenda-month-period::before { display: none; }
.agenda-busy__body { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4) var(--space-4); text-align: center; }
.agenda-busy__title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; }
.agenda-busy__when { margin: 0; font-weight: 600; }
.agenda-busy__text { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.agenda-fab { position: fixed; right: var(--space-4); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 4; width: 56px; height: 56px; padding: 0; justify-content: center; text-decoration: none; }
@media (min-width: 780px) {
  .agenda-new { display: inline-flex; }
  .agenda-fab { display: none; }
  .agenda-grid:not(.agenda-grid--week) { --hour-h: 52px; }
}
@media (min-width: 1060px) {
  .agenda--wide-month { max-width: 1200px; }
}
/* Agenda : détail, formulaire, vacances (tâche 71, séance 3). Ordinateur : la journée à gauche, le détail à droite. */

.agenda-next__row { color: inherit; text-decoration: none; }
.agenda-next__row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.agenda-next__day { flex: 1; }
.agenda-sheet__body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-2) var(--space-4) var(--space-4); }
.agenda-sheet__title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; }
.agenda-sheet__text { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.agenda-sheet__actions { display: flex; justify-content: flex-end; gap: var(--space-2); }

.agenda-form__add { align-self: end; }

.agenda-vacations__list { display: flex; flex-direction: column; gap: var(--space-2); }
.agenda-vacation .cf-editrow__text { display: flex; flex-direction: column; }
.agenda-vacation__dates { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
@media (min-width: 1060px) {
  .agenda-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: var(--space-6); align-items: start; }
  .agenda-pane .page { max-width: none; }
  .agenda-detail-pane { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow: auto; }
  
  .agenda-detail--split .tasks-topbar { position: static; margin: 0; padding: 0; height: auto; border: 0; background: none; }
  .agenda-split .agenda-fab { display: none; }
}
/* Agenda : enfant (écrans 11, 12, 17d) et widgets (écrans 13 et 14), tâche 71 séance 4. */
.agenda-kid { gap: var(--space-4); }
.agenda-kid__empty, .agenda-kid__text { margin: 0; font-size: 17px; line-height: 24px; font-weight: 700; }
.agenda-kid__cancel { text-decoration: line-through; }
.agenda-kid__soon { display: flex; flex-direction: column; gap: var(--space-2); }
.agenda-kid__soon-title { margin: 0; font: 700 22px/28px var(--font-kid-fun); color: var(--ink); }
.agenda-kid__add { align-self: stretch; justify-content: center; text-decoration: none; }

.agenda-widget { display: flex; flex-direction: column; min-height: 0; }
.agenda-widget-kid { display: flex; flex-direction: column; gap: var(--space-2); }
.agenda-widget-busy { width: 100%; border-width: 1px 0 0; border-style: solid; border-color: var(--border); background: none; color: var(--ink-muted); font: inherit; text-align: left; cursor: pointer; }
.agenda-widget-busy .cf-widget__event-title { font-weight: 400; }
.agenda-widget-cancel .cf-widget__event-title { color: var(--ink-muted); text-decoration: line-through; }
.agenda-widget-next { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.agenda-widget-next__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-widget__event:focus-visible, .cf-widget__day:focus-visible, .agenda-widget-next:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.home-edit__setting-help { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.home-edit__settings svg { width: 16px; height: 16px; }

/* ----- Place du mini-lecteur (tâche A031) -----
   Hors de #app (mini-player.js) : la lecture continue d'un écran à l'autre. Limite de 780 px, celle de la
   coquille : en dessous, en haut (D2 et D3 ; une tablette en portrait de moins de 780 px aussi, Q2) ;
   à partir de 780 px, en bas, à droite de la barre latérale. `body.has-mini` : la place est affichée. */
:root { --mini-h: 56px; }
.mini-host { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; box-sizing: border-box; height: var(--mini-h); background: var(--surface); border-bottom: 1px solid var(--border); }
[data-profile="kid"] .mini-host { background: var(--kid-bg); }
.mini-host[hidden] { display: none; }
@media (max-width: 779px) {
  /* Au-dessus des barres collées en haut (4 et 5), sous les fenêtres (10) et le bandeau (50). */
  body.has-mini .note-topbar, body.has-mini .tasks-topbar, body.has-mini .home-edit__bar { top: var(--mini-h); }
  /* Q1 : le bandeau de maintenance défile avec la page, le mini-lecteur reste collé en haut. */
  body.has-mini .maintenance-host { position: static; }
}
@media (min-width: 780px) {
  :root { --mini-h: 72px; }
  .mini-host { position: fixed; top: auto; left: 240px; right: 0; bottom: 0; z-index: 5; border-bottom: 0; border-top: 1px solid var(--border); }
  body.has-mini .app__main { padding-bottom: calc(var(--space-8) + var(--mini-h)); }
  body.has-mini .note-fab, body.has-mini .tasks-fab { bottom: calc(var(--space-6) + var(--mini-h)); }
  body.has-mini .note-bar, body.has-mini .note-composer, body.has-mini .tasks-bar { bottom: var(--mini-h); }
}
@media (min-width: 980px) {
  body.has-mini .tasks-pane { max-height: calc(100vh - 3rem - var(--mini-h)); }
}
@media (min-width: 1060px) {
  body.has-mini .notes-pane, body.has-mini .agenda-detail-pane { max-height: calc(100vh - 3rem - var(--mini-h)); }
}

/* ----- Médiathèque et musique (tâche A033, maquette « Écrans Médiathèque », a1 à a3, b5 à b14) -----
   Composants de la charte (TypeCard, ResumeRow, MediaGrid, Browse, Artwork, TrackList, Player, MiniPlayer,
   DropZone, UploadList, AiDraft) ; ici seulement la mise en page propre à l'appli. */
.media { max-width: 1100px; }
.section-title { margin: var(--space-2) 0 0; font: 600 17px/24px var(--font-sans); color: var(--ink); }
.media-head { align-items: flex-end; flex-wrap: wrap; }
.media-head__actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.media-search { width: 280px; max-width: 100%; }
.media-search input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--ink); font: 400 15px/22px var(--font-sans); }
.media-search input:focus { outline: none; }
.media-search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.cf-typecard.is-soon { opacity: .72; cursor: default; }
.media-empty { align-items: center; }
.media-card, .resume-play, .track-play { border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.media-card .cf-cover { width: 100%; }
.resume-play { width: 100%; }
.resume-play:focus-visible, .media-card:focus-visible, .track-play:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cf-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cf-cover.is-sm { flex: none; }
.track-play { display: flex; flex-direction: column; min-width: 0; min-height: 44px; justify-content: center; }
.track-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-sub { font-size: 12px; line-height: 16px; color: var(--ink-muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-track.is-playing .track-sub { color: var(--accent); }
.cf-track .cf-btn--icon { justify-self: end; }
.playlist-row { grid-template-columns: 56px minmax(0, 1fr) auto 24px; min-height: 72px; color: var(--ink); text-decoration: none; }
.playlist-row > svg { width: 18px; height: 18px; color: var(--ink-muted); fill: none; stroke: currentColor; stroke-width: 2; }
.playlist-track.is-editable, .queue-track { grid-template-columns: 40px 32px minmax(0, 1fr) 56px 44px; }
.queue-track { grid-template-columns: 40px 32px minmax(0, 1fr) 56px; }
.playlist-picks { display: flex; flex-direction: column; padding: 0 var(--space-3) var(--space-3); }
.playlist-pick { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; cursor: pointer; }
.playlist-pick__text { display: flex; flex-direction: column; min-width: 0; }
.overlay--sheet .sheet-actions { padding: 0 var(--space-3); }
.music-section { display: flex; flex-direction: column; gap: var(--space-3); }
.music-section__actions { display: flex; justify-content: flex-end; }
.music-titles { display: flex; flex-direction: column; }
.music-recent { display: flex; flex-direction: column; gap: var(--space-2); }
.cf-browse { display: flex; flex-direction: column; gap: var(--space-3); }
.cf-browse__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.cf-browse__head .cf-segmented { min-width: 320px; }
.cf-facet { color: var(--ink); text-decoration: none; }
.facet--album .cf-facet__strip { grid-template-columns: 1fr; }
.facet--album .cf-cover.is-sm { width: 100%; }
.album-head { display: flex; align-items: flex-end; gap: var(--space-6); flex-wrap: wrap; }
.album-head__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.album-head__meta { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.album-head__title { overflow-wrap: anywhere; }
.album-head__artist { color: var(--ink); }
.album-head__actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.track-edit { max-width: 520px; }
.track-edit__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.playlist-new .cf-segmented { margin-top: 2px; }
.media-notice { position: fixed; left: 50%; bottom: calc(var(--space-6) + var(--mini-h)); transform: translateX(-50%); z-index: 9; box-shadow: var(--shadow-2); max-width: calc(100vw - 32px); }
/* Envoi (a2, a3) */
.drop-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cf-drop { position: relative; cursor: pointer; text-align: center; }
.cf-drop.is-over, .cf-drop:focus-within { background: var(--accent-soft); border-color: var(--accent); }
.draft-note { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.draft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.draft-tracks { display: flex; flex-direction: column; gap: var(--space-2); }
.draft-track { display: grid; grid-template-columns: 72px minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-2); align-items: center; }
.draft-track--head { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.draft-track .is-error { grid-column: 1 / -1; color: var(--danger); font-weight: 600; }
/* Lecteur complet (b7) et mini-lecteur (b8) */
.player-cover .cf-cover { width: 260px; }
.player-queue { display: flex; flex-direction: column; gap: var(--space-2); }
.player-message, .mini-message { margin: 0; font-size: 13px; color: var(--danger); }
.mini-message:empty { display: none; }
.seek-range { cursor: pointer; }
.seek-range:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.seek-time { min-width: 40px; }
.mini-player { flex: 1; min-width: 0; display: flex; align-items: center; height: 100%; }
.mini-player .cf-mini, .mini-player .cf-minibar { flex: 1; min-width: 0; margin: 0; }
.mini-player .cf-mini { border-top: 0; box-shadow: none; padding-top: 6px; padding-bottom: 6px; }
.mini-cover { display: flex; flex: none; }
.mini-cover .cf-cover.is-sm { width: 40px; }
.mini-open { color: inherit; text-decoration: none; flex: 1; }
.mini-message { position: absolute; right: var(--space-4); }
@media (max-width: 779px) {
  .mini-player .mini-wide { display: none; }
  .mini-player .cf-minibar { background: transparent; box-shadow: none; padding: 0 var(--space-1) 0 var(--space-2); height: 100%; border-radius: 0; }
  .media-search { width: 100%; }
  .media-head__actions { width: 100%; }
  .cf-player { grid-template-columns: minmax(0, 1fr); }
  .player-cover .cf-cover { width: min(260px, 70vw); }
  .album-head { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .album-head .cf-cover { width: 200px; }
  .cf-browse__head .cf-segmented { min-width: 0; width: 100%; }
  .cf-facets { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 124px; overflow-x: auto; }
  .draft-grid, .track-edit__grid { grid-template-columns: minmax(0, 1fr); }
  .draft-track { grid-template-columns: 56px minmax(0, 1fr); }
  .draft-track > input:nth-child(3) { grid-column: 2; }
  .playlist-row { grid-template-columns: 56px minmax(0, 1fr) 24px; }
  .playlist-row .cf-tag { display: none; }
  .cf-track { grid-template-columns: 24px minmax(0, 1fr) 44px 36px; gap: var(--space-2); padding-left: 10px; }
  .cf-track > span:nth-child(3):empty { display: none; }
  .playlist-track.is-editable { grid-template-columns: 40px 24px minmax(0, 1fr) 44px 36px; }
  .queue-track { grid-template-columns: 40px 24px minmax(0, 1fr) 44px; }
}
@media (min-width: 780px) {
  .mini-player .mini-narrow { display: none; }
}
.media > .cf-topbar__back, .media > .cf-crumbs { align-self: flex-start; }

/* Composant Toast (b16, MED-MUS-001) */
.cf-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-6) + var(--mini-h));
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  box-sizing: border-box;
}
.cf-toast--success {
  border-left: 4px solid var(--success);
}
.cf-toast__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
}
.cf-toast__text {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cf-toast__action {
  background: transparent;
  border: 0;
  color: var(--accent);
  font: 600 14px/20px var(--font-sans);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex: none;
}
.cf-toast__action:hover {
  text-decoration: underline;
}
.cf-toast__action:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.cf-toast__progress {
  height: 3px;
  background: var(--accent);
  width: 100%;
  transform-origin: left;
  animation: toast-countdown linear forwards;
}
.cf-toast.is-paused .cf-toast__progress {
  animation-play-state: paused;
}
@keyframes toast-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Corbeille de la musique (b15, MED-MUS-001) */
.music-trash__intro {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 20px;
}
.music-trash__groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.music-trash__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}
.music-trash__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.music-trash__group-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}
.music-trash__group-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.music-trash__album-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  overflow-wrap: anywhere;
}
.music-trash__album-sub {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-muted);
}
.music-trash__tracks {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.music-trash__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-1);
  border-bottom: 1px solid var(--border);
}
.music-trash__row:last-child {
  border-bottom: 0;
}
.music-trash__track {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.music-trash__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.music-trash__sub {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-muted);
}
.music-trash__retention {
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.music-trash__action {
  display: flex;
  align-items: center;
}
.music-kid-footer {
  text-align: center;
  padding: var(--space-4) 0;
}

/* Module Lecture (tâche MED-LEC-001a) */
.book-row {
  grid-template-columns: 32px 56px minmax(0, 1fr) auto auto;
  min-height: 64px;
}
.book-row__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: center;
}
.book-row__title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-row__sub {
  font-size: 12px;
  color: var(--ink-muted);
}
@media (max-width: 779px) {
  .book-row {
    grid-template-columns: 24px 44px minmax(0, 1fr) auto;
    gap: var(--space-2);
  }
  .book-row .cf-tag {
    display: none;
  }
}

/* File d'envois temporaires VPS (MED-HUB-004) */
.cf-upload__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}
.cf-upload__ico svg,
.cf-uploadlist__icon svg {
  width: 20px;
  height: 20px;
}

/* ---------- Photos et Vidéos (tâche MED-PHO-001) ---------- */
.cf-tabs__item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cf-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.photos-page { display: flex; flex-direction: column; gap: var(--space-4); }
.photos-toolbar { display: flex; flex-direction: column; gap: var(--space-3); }
.photos-toolbar__chips { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.photos-timeline { display: flex; flex-direction: column; gap: var(--space-4); }
.photos-month { display: flex; flex-direction: column; gap: var(--space-3); }
.photos-month__title { font: 600 16px/22px "Inter", system-ui, sans-serif; color: var(--ink); margin: 0; }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--space-2); }
@media (min-width: 780px) {
  .photos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
}
.photo-card {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: var(--radius-md);
  overflow: hidden; background: var(--surface-2); cursor: pointer; display: block; width: 100%;
}
.photo-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); }
.photo-card__placeholder svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; }
.photo-card__video-badge {
  position: absolute; bottom: 6px; right: 6px; background: rgba(0, 0, 0, 0.65); color: #fff;
  border-radius: var(--radius-full); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.photo-card__video-badge svg { width: 12px; height: 12px; fill: currentColor; }

/* Albums */
.albums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-4); }
.album-card { display: flex; flex-direction: column; gap: var(--space-2); text-decoration: none; color: var(--ink); }
.album-card__cover {
  aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2);
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px;
}
.album-card__cover.is-empty { display: flex; align-items: center; justify-content: center; color: var(--ink-muted); }
.album-card__cover.is-empty svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2; }
.album-card__cover img:first-child { grid-row: 1 / 3; width: 100%; height: 100%; object-fit: cover; }
.album-card__cover img:not(:first-child) { width: 100%; height: 100%; object-fit: cover; }
.album-card__title { font: 600 14px/20px "Inter", system-ui, sans-serif; }
.album-card__count { font: 400 12px/16px "Inter", system-ui, sans-serif; color: var(--ink-muted); }
.album-detail__head { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.album-detail__meta { color: var(--ink-muted); font-size: 14px; }

/* Visionneuse */
.cf-viewer-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.95);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cf-viewer__close {
  position: absolute; top: var(--space-4); right: var(--space-4); background: rgba(255, 255, 255, 0.15);
  border: 0; color: #fff; width: 44px; height: 44px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10;
}
.cf-viewer__close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.cf-viewer__nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.15);
  border: 0; color: #fff; width: 48px; height: 48px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10;
}
.cf-viewer__nav svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; }
.cf-viewer__nav--prev { left: var(--space-4); }
.cf-viewer__nav--next { right: var(--space-4); }
.cf-viewer__content {
  flex: 1; width: 100%; max-height: calc(100vh - 120px); display: flex; align-items: center;
  justify-content: center; padding: var(--space-4); box-sizing: border-box;
}
.cf-viewer__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-md); }
.cf-viewer__video { max-width: 100%; max-height: 100%; border-radius: var(--radius-md); outline: none; }
.cf-viewer__panel {
  width: 100%; max-width: 800px; padding: var(--space-3) var(--space-4); box-sizing: border-box;
  color: #fff; display: flex; flex-direction: column; gap: var(--space-1); background: rgba(0, 0, 0, 0.4);
}
.cf-viewer__title { font: 600 15px/22px "Inter", system-ui, sans-serif; margin: 0; }
.cf-viewer__info-row { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.cf-viewer__info-row svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.cf-viewer__tags { display: flex; gap: var(--space-1); flex-wrap: wrap; margin-top: 4px; }

/* Widgets photos accueil */
.cf-widget-photos-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); width: 100%; }
.cf-widget-photo-thumb { aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); display: block; }
.cf-widget-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cf-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* Comparaison de doublon (MED-PHO-004) */
.cf-duplicate-dialog {
  max-width: 640px;
  width: 100%;
}
.cf-duplicate-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}
/* Petit écran : le dialogue ne dépasse jamais la fenêtre, son contenu défile et les actions restent en bas. */
.cf-duplicate-dialog {
  max-height: calc(100dvh - 2 * var(--space-4));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cf-duplicate-dialog .cf-dialog__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-2);
  background: var(--surface, #fff);
}
@media (max-width: 540px) {
  .cf-duplicate-compare {
    gap: var(--space-2);
  }
  .cf-duplicate-thumb {
    aspect-ratio: 1;
  }
  .cf-duplicate-card {
    padding: var(--space-2);
  }
  .cf-duplicate-dialog .cf-dialog__actions .cf-btn {
    min-height: 44px;
  }
}
.cf-duplicate-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  position: relative;
}
.cf-duplicate-card__tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  background: var(--surface-3, #e2e8f0);
  color: var(--ink-muted, #64748b);
}
.cf-duplicate-card__tag.is-new {
  background: var(--accent-subtle, #e0f2fe);
  color: var(--accent, #0284c7);
}
.cf-duplicate-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md, 8px);
  background: var(--surface-1, #ffffff);
}
.cf-duplicate-thumb.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted, #94a3b8);
}
.cf-duplicate-thumb.is-placeholder svg {
  width: 40px;
  height: 40px;
}
.cf-duplicate-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cf-duplicate-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #0f172a);
  word-break: break-all;
}
.cf-duplicate-card__meta {
  font-size: 12px;
  color: var(--ink-muted, #64748b);
}

/* --- Cartes Monopoly et Effet Flip 3D (CUI-REP-001) --- */
.monopoly-card-wrap {
  perspective: 1000px;
  width: 100%;
  max-width: 270px;
  min-height: 330px;
  height: 340px;
  position: relative;
  transition: transform 0.25s ease-out;
}

.monopoly-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.monopoly-card-wrap.is-flipped .monopoly-card-inner {
  transform: rotateY(180deg);
}

.monopoly-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 330px;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-strong, #CBD5E1);
  background-color: var(--surface, #FFFFFF);
  box-shadow: var(--shadow-1);
}

.monopoly-card-wrap.is-today .monopoly-card {
  border-color: var(--accent, #2F6FD1);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-2);
}

.monopoly-card-wrap.is-past {
  opacity: 0.9;
}

.monopoly-card-wrap.is-past .monopoly-card {
  border-color: var(--border-strong, #CBD5E1);
  background-color: var(--surface-2, #EEF1F5);
}

.monopoly-card-wrap.is-past .meal-slot__content {
  color: var(--ink-muted, #5A6578);
}

.monopoly-badge-past {
  display: inline-block;
  background: rgba(0, 0, 0, 0.25);
  color: #FFFFFF;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  text-transform: none;
  font-weight: 600;
  letter-spacing: normal;
}

.monopoly-header__date {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
  text-transform: none;
  margin-left: 4px;
}

.monopoly-card--back {
  transform: rotateY(180deg);
}

/* Header style Monopoly */
.monopoly-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 14px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-strong, #CBD5E1);
  color: #FFFFFF;
}

.monopoly-header--lundi { background-color: var(--member-navy, #1F3A6E); }
.monopoly-header--mardi { background-color: var(--member-teal, #1A7A70); }
.monopoly-header--mercredi { background-color: var(--member-ochre, #B4530F); }
.monopoly-header--jeudi { background-color: var(--member-plum, #86327F); }
.monopoly-header--vendredi { background-color: var(--member-blue, #2F6FD1); }
.monopoly-header--samedi { background-color: var(--member-green, #347A3C); }
.monopoly-header--dimanche { background-color: var(--member-rose, #C93F72); }

.monopoly-header--back {
  justify-content: center;
  font-size: 13px;
}

.monopoly-header__dummy {
  width: 24px;
}

.monopoly-header__title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.monopoly-badge-today {
  display: inline-block;
  background: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  text-transform: none;
  font-weight: 600;
  letter-spacing: normal;
}

.monopoly-header__btn-edit {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.2s, background-color 0.2s;
}

.monopoly-header__btn-edit:hover,
.monopoly-header__btn-edit:focus-visible {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.25);
}

.monopoly-header__btn-edit svg {
  width: 16px;
  height: 16px;
}

/* Corps de la carte */
.monopoly-body {
  padding: var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.meal-slot {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meal-slot__label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.meal-slot__content {
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}

.meal-slot__content.is-empty {
  color: var(--ink-muted);
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
}

.meal-slot__sep {
  height: 1px;
  background-color: var(--border, #E2E8F0);
  margin: var(--space-1) 0;
  border-style: dashed;
}

.meal-slot__label--snack {
  font-size: 14px;
  font-weight: 700;
  color: var(--member-ochre, #B4530F);
}

.meal-slot__content--snack {
  color: var(--member-ochre, #B4530F);
}

/* Verso de la carte / Formulaire d'édition */
.monopoly-form {
  padding: var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.monopoly-form__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.monopoly-form__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.monopoly-form__optional {
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  color: var(--ink-muted);
}

.monopoly-form__input {
  width: 100%;
  font-size: 13px;
  padding: 6px 8px;
}

.monopoly-form__sep {
  height: 1px;
  background-color: var(--border, #E2E8F0);
  margin: 2px 0;
}

.monopoly-form__actions--center {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-2);
}

/* --- Vue Semaine PC & Tablette : 2 Lignes Centrées (4 puis 3) --- */
.meals-desktop-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
}

.meals-row {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  flex-wrap: wrap;
}

.meals-row--4 .monopoly-card-wrap {
  flex: 0 1 calc(25% - var(--space-4));
  min-width: 220px;
}

.meals-row--3 .monopoly-card-wrap {
  flex: 0 1 calc(25% - var(--space-4));
  min-width: 220px;
}

/* --- Vue Mobile : Carrousel avec Flèches Latérales Discrètes Animées --- */
.meals-mobile-view {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.carousel-side-nav {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  width: 36px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
  touch-action: manipulation;
}

.carousel-side-nav:hover,
.carousel-side-nav:focus-visible {
  opacity: 1;
  color: var(--accent);
  background-color: var(--accent-soft, rgba(47, 111, 209, 0.1));
  transform: scale(1.1);
}

.carousel-side-nav:active {
  transform: scale(0.92);
}

.carousel-side-nav.is-disabled {
  opacity: 0.15 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
}

.carousel-side-nav svg {
  width: 26px;
  height: 26px;
}

.carousel-card-slot {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 280px;
}

.carousel-card-slot .monopoly-card-wrap {
  width: 100% !important;
  max-width: 310px !important;
  min-height: 380px !important;
  height: 400px !important;
}

/* Animations de glissement de carte au changement de jour */
.anim-slide-left {
  animation: slideInFromRight 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.anim-slide-right {
  animation: slideInFromLeft 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(45px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-45px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* --- Barre de pagination par semaine (CUI-REP-002) --- */
.meals-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-3) 0 var(--space-4) 0;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.meals-nav-bar__group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.meals-week-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  min-width: 220px;
  text-align: center;
}

.meals-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
}

.meals-btn-today {
  font-size: 13px;
  padding: 6px 14px;
}

/* Adaptation Responsive */
@media (max-width: 768px) {
  .meals-nav-bar {
    display: none;
  }
  .meals-desktop-view {
    display: none;
  }
  .meals-mobile-view {
    display: flex;
  }
}

/* Styles Widget « Au menu aujourd'hui » */
.widget-meal-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.meal-tag {
  font-weight: 700;
  min-width: 50px;
  text-align: center;
  justify-content: center;
}

.meal-tag--snack {
  background-color: color-mix(in srgb, var(--member-ochre) 15%, var(--surface));
  color: var(--member-ochre);
  border: 1px solid var(--member-ochre);
}
/* ==========================================================================
   Carnet de santé (BIE-SAN, tâche BIE-SAN-001, écran n°77)
   ========================================================================== */

.health-page {
  padding-bottom: var(--space-8);
}

.health-header {
  margin-bottom: var(--space-4);
}

.health-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.health-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Icônes blanches et nettes */
.health-page svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

.health-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #DC2626;
  color: #FFFFFF;
}

.health-title-icon svg {
  width: 18px;
  height: 18px;
  stroke: #FFFFFF !important;
}

.health-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.health-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Sélecteur tactile horizontal des membres */
.health-members-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
}

.health-member-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: all 0.2s ease;
  min-height: 42px;
}

.health-member-badge:hover {
  background: var(--surface-2);
  border-color: var(--ink-muted);
}

.health-member-badge.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.health-member-badge__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.health-member-badge__meta small {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.health-badge-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.health-badge-indicator--alert {
  background: #DC2626;
  color: #FFFFFF;
}

.health-badge-indicator--rx {
  background: #2563EB;
  color: #FFFFFF;
}

/* Bandeau d'urgence vitale */
.health-emergency-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.health-emergency-banner__left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.health-emergency-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #DC2626;
  color: #FFFFFF;
  flex-shrink: 0;
}

.health-emergency-icon svg {
  width: 16px;
  height: 16px;
  stroke: #FFFFFF !important;
}

.health-emergency-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.health-blood-badge {
  display: inline-flex;
  padding: 2px 8px;
  background: #DC2626;
  color: #FFFFFF;
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.health-allergy-alert {
  color: #991B1B;
  font-weight: 700;
  font-size: 0.85rem;
}

.health-safe-tag {
  color: #065F46;
  font-weight: 600;
  font-size: 0.825rem;
}

.health-emergency-contact {
  margin: 3px 0 0 0;
  font-size: 0.825rem;
  color: #7F1D1D;
}

.health-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #DC2626;
  font-weight: 700;
  text-decoration: underline;
}

.health-phone-link svg {
  width: 14px;
  height: 14px;
  stroke: #DC2626 !important;
}

/* Barre d'onglets thématiques */
.health-tabs-bar {
  display: flex;
  gap: var(--space-2);
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.health-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  min-height: 40px;
}

.health-tab-btn svg {
  width: 16px;
  height: 16px;
  stroke: #FFFFFF !important;
  opacity: 0.8;
}

.health-tab-btn:hover {
  color: var(--ink);
}

.health-tab-btn.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.health-tab-btn.is-active svg {
  opacity: 1;
}

.health-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
}

.health-tab-btn.is-active .health-tab-badge {
  background: var(--accent);
  color: #FFFFFF;
}

/* Cartes de sections */
.health-card {
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--surface);
}

.health-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.health-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.health-card-title svg {
  width: 18px;
  height: 18px;
  stroke: #FFFFFF !important;
}

.health-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Grille de Constantes */
.health-constants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.health-stat-tile {
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.health-stat-tile__label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.health-stat-tile__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.health-stat-tile__value small {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.health-stat-tile__sub {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.health-stat-tile__badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface);
}

.health-imc--normal .health-stat-tile__value { color: #16A34A; }
.health-imc--normal .health-stat-tile__badge { background: #DCFCE7; color: #15803D; }

.health-imc--warning .health-stat-tile__value { color: #D97706; }
.health-imc--warning .health-stat-tile__badge { background: #FEF3C7; color: #B4530F; }

.health-imc--alert .health-stat-tile__value { color: #DC2626; }
.health-imc--alert .health-stat-tile__badge { background: #FEE2E2; color: #B91C1C; }

.health-secu-text {
  font-family: monospace;
  font-size: 0.95rem !important;
  letter-spacing: 0.5px;
}

/* Section Courbe SVG réglable en temps */
.health-weight-chart-section {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.health-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.health-chart-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.health-chart-sub {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.health-chart-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.health-period-pills {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
}

.health-period-pill {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.health-period-pill.is-active {
  background: var(--accent);
  color: #FFFFFF;
}

.health-svg-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.health-weight-svg {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
}

/* Allergies (lisibles sur fond neutre) */
.health-two-cols-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.health-allergies-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.health-allergy-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.health-allergy-item--vitale {
  border-left: 4px solid #DC2626;
  border-color: #F87171 #CBD5E1 #CBD5E1 #DC2626;
}

.health-allergy-item--modérée {
  border-left: 4px solid #D97706;
}

.health-allergy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.health-allergy-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.health-allergy-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.health-severity-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.health-severity-badge--vitale {
  background: #991B1B;
  color: #FFFFFF;
}

.health-severity-badge--modérée {
  background: #D97706;
  color: #FFFFFF;
}

.health-severity-badge--légère {
  background: #E2E8F0;
  color: #334155;
}

.health-allergy-reaction {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.35;
}

.health-delete-mini-btn {
  padding: 2px 6px !important;
  color: var(--ink-muted) !important;
}

.health-delete-mini-btn:hover {
  color: #DC2626 !important;
}

.health-delete-mini-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor !important;
}

/* Historique médical */
.health-antecedents-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.health-antecedent-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.health-antecedent-year {
  font-weight: 700;
  color: var(--accent);
  min-width: 42px;
  font-size: 0.85rem;
}

.health-antecedent-type {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-muted);
}

.health-antecedent-label {
  font-size: 0.875rem;
  color: var(--ink);
  flex: 1;
}

/* Praticiens */
.health-practitioners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.health-practitioner-card {
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.health-practitioner-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.health-practitioner-name {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--ink);
}

.health-practitioner-address {
  margin: 0 0 var(--space-2) 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Vaccins : Cartes 2 lignes claires et complètes */
.health-vaccines-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-3);
}

.health-vaccine-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.health-vaccine-card--ok {
  border-left: 4px solid #16A34A;
}

.health-vaccine-card--pending {
  border-left: 4px solid #F59E0B;
}

.health-vaccine-card__row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.health-vaccine-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.health-vaccine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.health-vaccine-card--ok .health-vaccine-dot { background: #16A34A; }
.health-vaccine-card--pending .health-vaccine-dot { background: #F59E0B; }

.health-vaccine-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.health-vaccine-card__row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--ink-muted);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.health-vaccine-details {
  display: flex;
  align-items: center;
  gap: 8px;
}

.health-vaccine-lot {
  font-family: monospace;
  font-size: 0.75rem;
  padding: 1px 5px;
  background: var(--surface-2);
  border-radius: 3px;
  color: var(--ink-muted);
}

.health-vaccine-next {
  text-align: right;
}

/* Puce 'À jour' sur une seule ligne */
.health-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap !important;
}

.health-status-badge--ok {
  background: #DCFCE7;
  color: #15803D;
}

.health-status-badge--pending {
  background: #FEF3C7;
  color: #B4530F;
}

.health-status-badge--warning {
  background: #FEE2E2;
  color: #B91C1C;
}

.health-next-alert {
  color: #D97706;
  font-weight: 700;
  white-space: nowrap;
}

/* Contrôles périodiques */
.health-checkups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--space-4);
}

.health-checkup-card {
  height: 100%;
}

.health-checkup-top-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.health-checkup-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.875rem;
}

.health-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}

.health-detail-label {
  color: var(--ink-muted);
  font-size: 0.825rem;
}

.health-equipment-text {
  margin: 2px 0 0 0;
  font-weight: 600;
  color: var(--ink);
}

/* Ophtalmologie & Correction individuelle */
.health-diopter-section {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: 4px;
  border: 1px solid var(--border);
}

.health-diopter-section-title {
  margin: 0 0 var(--space-2) 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

.health-diopter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.health-diopter-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.health-diopter-eye-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.health-diopter-eye {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.health-diopter-main-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.health-diopter-eye-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}

.health-next-recommended-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  background: rgba(47, 111, 209, 0.08);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.825rem;
  margin-top: 4px;
}

.health-next-recommended-box svg {
  width: 15px;
  height: 15px;
  stroke: #FFFFFF !important;
}

.health-checkup-note {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-style: italic;
  margin: 4px 0 0 0;
}

/* Ordonnances & Bouton switch en haut à droite */
.health-rx-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.health-section-heading {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.health-section-sub {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.health-rx-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
}

.health-switch-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.health-prescriptions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.health-rx-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
}

.health-rx-card__main {
  flex: 1;
}

.health-rx-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 4px;
}

.health-rx-med-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.health-rx-days-tag {
  background: #E0E7FF;
  color: #3730A3;
  font-weight: 600;
  font-size: 0.75rem;
}

.health-rx-posology {
  margin: 0 0 4px 0;
  font-size: 0.9rem;
}

.health-rx-note {
  margin: 0 0 6px 0;
  font-size: 0.825rem;
  color: var(--ink-muted);
  font-style: italic;
}

.health-rx-meta {
  display: flex;
  gap: var(--space-4);
  font-size: 0.8rem;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

.health-rx-card__doc {
  flex-shrink: 0;
}

.health-doc-preview-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.health-doc-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.health-doc-info svg {
  width: 14px;
  height: 14px;
  stroke: #FFFFFF !important;
}

.health-rx-row-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Grille d'icônes */
.health-rx-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}

@media (min-width: 900px) {
  .health-rx-grid-view {
    grid-template-columns: repeat(4, 1fr);
  }
}

.health-rx-tile {
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  text-align: center;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.health-rx-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: #2563EB;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.health-rx-tile-icon svg {
  width: 20px;
  height: 20px;
  stroke: #FFFFFF !important;
}

.health-rx-tile-title {
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.health-rx-tile-days {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}

.health-rx-tile-pos {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.health-rx-tile-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: center;
  margin-top: auto;
}

/* Modale et Tableau Historique des Mensurations */
.health-measurements-modal {
  max-width: 680px;
}

.health-measurements-content {
  padding: var(--space-4);
  max-height: 60vh;
  overflow-y: auto;
}

.health-period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.health-period-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.health-period-buttons {
  display: flex;
  gap: 4px;
}

.health-imc-pill {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Modales */
.health-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.health-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.health-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.health-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.health-modal-sub {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.health-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.health-viewer-viewport {
  padding: var(--space-4);
  overflow-y: auto;
  background: #F1F5F9;
  display: flex;
  justify-content: center;
}

.health-prescription-sheet {
  background: #FFF;
  border: 1px solid #CBD5E1;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  padding: var(--space-4);
  width: 100%;
  max-width: 480px;
  border-radius: 4px;
  color: #1E293B;
  font-family: serif;
}

.health-rx-sheet-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  color: #334155;
}

.health-rx-sheet-divider {
  border: 0;
  border-top: 2px solid #0F172A;
  margin: var(--space-3) 0;
}

.health-rx-sheet-body h4 {
  font-family: sans-serif;
  letter-spacing: 1px;
  margin-bottom: var(--space-2);
  font-size: 0.85rem;
}

.health-rx-sheet-med {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.health-rx-sheet-pos {
  font-size: 0.95rem;
  margin: 0 0 4px 0;
}

.health-rx-sheet-footer {
  margin-top: var(--space-4);
  display: flex;
  justify-content: flex-end;
}

.health-rx-stamp {
  border: 1.5px dashed #94A3B8;
  padding: 6px 12px;
  text-align: center;
  border-radius: 4px;
}

.health-rx-signature {
  font-family: cursive;
  font-size: 1rem;
  color: #1E3A8A;
}

.health-viewer-security {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.health-upload-form {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  max-height: 70vh;
}

.health-form-subheading {
  margin: var(--space-2) 0 4px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.health-dropzone {
  border: 2px dashed var(--border);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--surface-2);
}

.health-hidden-file-input {
  display: none;
}

.health-file-label {
  cursor: pointer;
  display: inline-block;
}

.health-upload-fileinfo {
  margin: 6px 0 0 0;
  font-size: 0.8rem;
  color: var(--accent);
}

.health-form-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.health-form-field label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--ink);
}

.health-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.health-form-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Responsive Téléphone < 768px */
@media (max-width: 768px) {
  .health-two-cols-grid {
    grid-template-columns: 1fr;
  }

  .health-vaccines-cards-grid {
    grid-template-columns: 1fr;
  }

  .health-emergency-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .health-emergency-banner__right {
    width: 100%;
  }

  .health-samu-btn {
    width: 100%;
    justify-content: center;
  }

  .health-rx-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .health-rx-card__doc {
    width: 100%;
  }

  .health-doc-preview-box {
    align-items: stretch;
    width: 100%;
  }

  .health-view-doc-btn {
    width: 100%;
    justify-content: center;
  }

  .health-form-row,
  .health-form-row--3 {
    grid-template-columns: 1fr;
  }

  .health-rx-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .health-rx-controls {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .health-switch-view-btn {
    width: auto;
    padding: var(--space-2);
  }

  .health-upload-btn {
    width: auto;
  }
}

/* Nouveaux styles Santé : informations de base et contrôles don du sang / bilan */
.health-stat-tile__header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.health-edit-mini-btn,
.health-blood-edit-btn {
  padding: 2px 6px;
  line-height: 1;
  color: var(--ink-muted);
}

.health-edit-mini-btn:hover,
.health-blood-edit-btn:hover {
  color: var(--accent);
}

.health-counter-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(47, 111, 209, 0.12);
  color: var(--accent);
}

.health-findings-text {
  margin: 3px 0 0 0;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.4;
}

.health-status-badge--neutral {
  background: var(--surface-2);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

.health-textarea {
  resize: vertical;
  font-family: inherit;
}

/* Compléments de style carnet de santé (BIE-SAN) */
.health-tab-pane--profile,
.health-tab-pane--vaccines,
.health-tab-pane--checkups,
.health-tab-pane--prescriptions {
  width: 100%;
}

.health-badge-imc {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.health-badge-imc.health-imc--normal {
  background: #d1fae5;
  color: #065f46;
}

.health-badge-imc.health-imc--warning {
  background: #fef3c7;
  color: #92400e;
}

.health-badge-imc.health-imc--alert {
  background: #fee2e2;
  color: #991b1b;
}

.health-tab-btn__text {
  margin-left: 4px;
}

.health-card-desc {
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin: 2px 0 0 0;
}

.health-vaccine-item {
  display: flex;
  gap: 4px;
  font-size: 0.85rem;
}

.health-doc-filename {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
}

.health-rx-sheet-item {
  margin-top: 12px;
}

.health-rx-sheet-note {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.health-rx-sheet-dur {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 4px;
}

.health-rx-sheet-date {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.health-modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.health-content-area {
  margin-top: var(--space-4);
}

.health-forbidden {
  padding: var(--space-6);
  text-align: center;
  color: var(--ink-muted);
}

.health-empty-card {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.health-empty-icon svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
  margin-bottom: var(--space-2);
}

.health-empty-text {
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-style: italic;
  padding: var(--space-2) 0;
}

.health-field-help {
  color: var(--ink-muted);
  font-size: 0.8rem;
  display: block;
  margin-top: 4px;
}

.health-error-box {
  background: var(--surface-2);
  color: var(--danger, #b91c1c);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.health-measurements-table-wrap {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.health-doc-preview-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}

.health-doc-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.health-doc-placeholder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  color: var(--ink-muted);
}

.health-dropzone-prompt {
  margin-bottom: 8px;
  color: var(--ink-muted);
}

.health-detail-block {
  margin-top: 6px;
}

.health-stat-tile--imc {
  border-left: 3px solid var(--accent);
}

.health-tab-pane {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.health-form-modal {
  max-width: 540px;
}

.health-viewer-modal {
  max-width: 680px;
}

.health-upload-modal {
  max-width: 580px;
}

.health-measurements-modal {
  max-width: 720px;
}

.health-close-btn {
  padding: 4px;
}

.health-avatar {
  flex-shrink: 0;
}

/* --- ENV-MAQ-081 : Accueil enrichi Médiathèque --- */
.media-search--smart {
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}

.media-more-wrapper {
  position: relative;
  display: inline-block;
}

.media-more-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-1);
}
.media-more-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}
.media-more-btn[aria-expanded="true"] {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.music-management-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 290px;
  max-width: 340px;
  z-index: 150;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: musicDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

@keyframes musicDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.music-management-dropdown[hidden] {
  display: none !important;
}

.music-dropdown-header {
  padding: 8px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.music-dropdown-header__title {
  font: 700 13px/18px var(--font-sans);
  color: var(--ink);
}

.music-dropdown-header__sub {
  font: 400 11px/15px var(--font-sans);
  color: var(--ink-muted);
}

.music-dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.music-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease, transform 0.15s ease;
}

.music-dropdown-item:hover {
  background: var(--surface-2);
}

.music-dropdown-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.music-dropdown-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.music-dropdown-icon--upload {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

.music-dropdown-icon--sync {
  background: color-mix(in srgb, #06b6d4 15%, transparent);
  color: #06b6d4;
}

.music-dropdown-icon--trash {
  background: color-mix(in srgb, #ef4444 15%, transparent);
  color: #ef4444;
}

.music-dropdown-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.music-dropdown-item-title {
  font: 600 13px/17px var(--font-sans);
  color: var(--ink);
}

.music-dropdown-item-desc {
  font: 400 11px/15px var(--font-sans);
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-dropdown-item:hover .music-dropdown-item-title {
  color: var(--accent);
}

.music-dropdown-item--trash:hover .music-dropdown-item-title {
  color: #ef4444;
}

.music-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 6px;
}

.music-dropdown-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.music-dropdown-storage {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.music-dropdown-storage__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 12px/16px var(--font-sans);
  color: var(--ink);
}

.music-dropdown-storage__pct {
  font-weight: 700;
  color: var(--accent);
}

.music-dropdown-storage__footer {
  font: 400 11px/14px var(--font-sans);
  color: var(--ink-muted);
}

.media-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.media-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.section-sub {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ==========================================================================
   CARROUSEL 3D COVERFLOW (Style Cover Flow / McDonald's interactif)
   ========================================================================== */
.coverflow-wrap {
  position: relative;
  width: 100%;
  margin: 12px 0 24px;
  background: transparent;
  border: none;
  padding: 16px 16px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  box-shadow: none;
}

.coverflow-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 290px;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coverflow-card {
  position: absolute;
  width: 240px;
  height: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.45s ease, filter 0.45s ease, z-index 0.45s ease;
  will-change: transform, opacity;
  user-select: none;
}

/* Carte centrale active */
.coverflow-card.is-active {
  transform: translate3d(0, 0, 80px) scale(1.1);
  z-index: 10;
  opacity: 1;
  filter: none;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Carte précédente (gauche 3D) - effet transparent et recul */
.coverflow-card.is-prev {
  transform: translate3d(-170px, 0, -40px) rotateY(32deg) scale(0.88);
  z-index: 5;
  opacity: 0.55;
  filter: brightness(0.8) blur(0.3px);
}

/* Carte suivante (droite 3D) - effet transparent et recul */
.coverflow-card.is-next {
  transform: translate3d(170px, 0, -40px) rotateY(-32deg) scale(0.88);
  z-index: 5;
  opacity: 0.55;
  filter: brightness(0.8) blur(0.3px);
}

/* Cartes lointaines - encore plus transparentes */
.coverflow-card.is-far-prev {
  transform: translate3d(-310px, 0, -120px) rotateY(45deg) scale(0.72);
  z-index: 1;
  opacity: 0.18;
  filter: brightness(0.6) blur(0.8px);
  pointer-events: none;
}
.coverflow-card.is-far-next {
  transform: translate3d(310px, 0, -120px) rotateY(-45deg) scale(0.72);
  z-index: 1;
  opacity: 0.18;
  filter: brightness(0.6) blur(0.8px);
  pointer-events: none;
}

.coverflow-card__poster {
  width: 100%;
  height: 130px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.coverflow-card__poster .cf-thumb,
.coverflow-card__poster .cf-cover {
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.coverflow-card__poster .cf-thumb > svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coverflow-card__meta {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--surface);
}

.coverflow-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}
.coverflow-badge svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coverflow-card__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverflow-card__sub {
  font-size: 11px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverflow-card__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.coverflow-card__progress-text {
  font-size: 10px;
  color: var(--ink-muted);
}

/* Flèches géantes du coverflow */
.coverflow-nav {
  position: absolute;
  top: 52%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.coverflow-nav:hover {
  background: var(--surface-2);
  transform: translateY(-50%) scale(1.1);
}
.coverflow-nav--prev {
  left: 12px;
}
.coverflow-nav--next {
  right: 12px;
}
.coverflow-nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coverflow-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 38px;
  width: 100%;
}

.coverflow-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coverflow-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}
.coverflow-dot.is-active {
  width: 22px;
  background: var(--accent);
}

.coverflow-counter {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* ==========================================================================
   CARROUSEL AJOUTS RÉCENTS (Horizontal scroll fluide)
   ========================================================================== */
.media-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.media-carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 6px 4px 14px;
  width: 100%;
  scrollbar-width: thin;
}

.media-carousel-track::-webkit-scrollbar {
  height: 6px;
}
.media-carousel-track::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.media-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.media-carousel__nav:hover {
  opacity: 1;
  transform: translateY(-60%) scale(1.06);
}
.media-carousel__nav--prev {
  left: -14px;
}
.media-carousel__nav--next {
  right: -14px;
}
.media-carousel__nav svg {
  width: 18px;
  height: 18px;
}

.media-carousel-media-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.media-carousel-media-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.media-carousel-media-card .cf-thumb,
.media-carousel-media-card .cf-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
}
.media-carousel-media-card .cf-thumb.is-tall {
  aspect-ratio: 3 / 4;
}
.media-carousel-media-card__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-carousel-media-card__meta {
  font-size: 11px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive Coverflow sur petits écrans */
@media (max-width: 600px) {
  .coverflow-card {
    width: 200px;
    height: 240px;
  }
  .coverflow-card.is-prev {
    transform: translate3d(-110px, 0, -30px) rotateY(25deg) scale(0.85);
  }
  .coverflow-card.is-next {
    transform: translate3d(110px, 0, -30px) rotateY(-25deg) scale(0.85);
  }
  .coverflow-card.is-far-prev,
  .coverflow-card.is-far-next {
    opacity: 0;
  }
}

/* Encart mémoriel */
.media-memory-section {
  background: color-mix(in srgb, var(--member-teal) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--member-teal) 25%, var(--border));
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
}

.media-memory-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.media-memory-header__title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--member-teal);
  font-weight: 600;
}

.media-memory-header__title svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-memory-header__sub {
  font-size: 12px;
  color: var(--ink-muted);
}

.media-memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.media-memory-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.media-memory-card:hover {
  border-color: var(--member-teal);
  transform: translateY(-1px);
}

.media-memory-card .cf-thumb {
  width: 48px;
  height: 48px;
  flex: none;
}

.media-memory-card__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.media-memory-card__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-memory-card__meta {
  font-size: 11px;
  color: var(--ink-muted);
}

/* Encart Esthétique de stockage */
.media-storage-card {
  margin-top: 32px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.media-storage-card__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.media-storage-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  flex: none;
}
.media-storage-icon-wrap svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-storage-card__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.media-storage-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.media-storage-card__sub {
  font-size: 13px;
  color: var(--ink-muted);
}

.media-storage-card__right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-storage-stats {
  display: flex;
  justify-content: space-between;
}

.media-storage-stat {
  display: flex;
  flex-direction: column;
}

.media-storage-stat__val {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.media-storage-stat__lbl {
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 779px) {
  .media-storage-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
}

/* ==========================================================================
   HUB MUSIQUE (ENV-MAQ-082 - Disquaire & Studio)
   ========================================================================== */

.music-hub-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.music-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.music-quick-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--ink);
}

.music-quick-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-1);
}

.music-quick-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--member-plum) 15%, var(--surface));
  color: var(--member-plum);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.music-quick-card__icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.music-quick-card__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.music-quick-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-quick-card__meta {
  font-size: 11px;
  color: var(--ink-muted);
}

.music-quick-card--new {
  border-style: dashed;
  color: var(--ink-muted);
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
}

.music-quick-card--new:hover {
  color: var(--ink);
  border-color: var(--accent);
}

/* Styles spécifiques Hub Musique (ENV-MAQ-082 - Ajustements) */

/* En-tête Musique : alignement du titre et du menu ⋯ sur la même ligne */
.music-head--inline {
  width: 100%;
}

.music-head__titlebar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.music-head__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.music-header-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font: 600 13px/18px var(--font-sans);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  transition: all 0.15s ease;
  text-decoration: none;
  box-sizing: border-box !important;
}

.music-header-upload-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

.music-header-upload-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
}

/* Menu de gestion soigné et moderne pour la musique et la médiathèque */
.music-management-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 290px;
  max-width: 340px;
  z-index: 150;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: musicDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

@keyframes musicDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.music-management-dropdown[hidden] {
  display: none !important;
}

.music-dropdown-header {
  padding: 8px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.music-dropdown-header__title {
  font: 700 13px/18px var(--font-sans);
  color: var(--ink);
}

.music-dropdown-header__sub {
  font: 400 11px/15px var(--font-sans);
  color: var(--ink-muted);
}

.music-dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.music-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease, transform 0.15s ease;
}

.music-dropdown-item:hover {
  background: var(--surface-2);
}

.music-dropdown-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.music-dropdown-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.music-dropdown-icon--upload {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

.music-dropdown-icon--sync {
  background: color-mix(in srgb, #06b6d4 15%, transparent);
  color: #06b6d4;
}

.music-dropdown-icon--trash {
  background: color-mix(in srgb, #ef4444 15%, transparent);
  color: #ef4444;
}

.music-dropdown-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.music-dropdown-item-title {
  font: 600 13px/17px var(--font-sans);
  color: var(--ink);
}

.music-dropdown-item-desc {
  font: 400 11px/15px var(--font-sans);
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-dropdown-item:hover .music-dropdown-item-title {
  color: var(--accent);
}

.music-dropdown-item--trash:hover .music-dropdown-item-title {
  color: #ef4444;
}

.music-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 6px;
}

.music-dropdown-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.music-dropdown-storage {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.music-dropdown-storage__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 12px/16px var(--font-sans);
  color: var(--ink);
}

.music-dropdown-storage__pct {
  font-weight: 700;
  color: var(--accent);
}

.music-dropdown-storage__footer {
  font: 400 11px/14px var(--font-sans);
  color: var(--ink-muted);
}

/* Carrousel horizontal pour les facettes de Parcourir */
.music-facets-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.music-facets-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 2px 12px;
  width: 100%;
  scrollbar-width: thin;
}

.music-facets-track::-webkit-scrollbar {
  height: 6px;
}
.music-facets-track::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.music-carousel-card {
  flex: 0 0 160px;
  min-width: 160px;
}

.music-track-nav {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-1);
}
.music-track-nav:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

/* Barre d'outils Tous les titres : recherche compacte + switch grille/liste */
.music-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.music-search-compact {
  flex: 1;
  max-width: 320px;
}

.music-view-switch {
  flex-shrink: 0;
}
.music-view-switch .cf-segmented__item {
  padding: 6px 12px;
  display: grid;
  place-items: center;
}
.music-view-switch svg {
  width: 16px;
  height: 16px;
}

/* Grille titres */
.music-titles-grid {
  margin-top: var(--space-2);
}
.music-grid-item {
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.music-grid-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* Barre d'en-tête Playlists : onglets segmentés à gauche + switch à droite */
.music-playlist-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.music-playlist-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.music-playlists-grid {
  margin-top: var(--space-2);
}
.playlist-grid-card {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.playlist-grid-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* Mosaïque 2x2 Windows pour pochettes de styles, artistes, années et playlists */
.music-windows-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 100%;
  height: 100%;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.music-mosaic-cell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint, var(--member-slate)) 70%, var(--surface)), color-mix(in srgb, var(--tint, var(--member-slate)) 30%, var(--ink)));
  display: grid;
  place-items: center;
  color: var(--surface);
}

.music-mosaic-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-mosaic-cell svg {
  width: 18px;
  height: 18px;
  opacity: 0.95;
  color: var(--surface);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pochette unique pleine (vignette carrée standard) */
.music-windows-mosaic.is-single-cover {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  position: relative !important;
  background: var(--surface-2) !important;
}

.music-mosaic-single-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.music-windows-mosaic.music-mosaic-placeholder {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint, var(--member-slate)) 70%, var(--surface)), color-mix(in srgb, var(--tint, var(--member-slate)) 30%, var(--ink))) !important;
  color: var(--surface) !important;
}

.music-mosaic-placeholder-icon {
  width: 44px !important;
  height: 44px !important;
  stroke: var(--surface) !important;
  stroke-width: 2 !important;
  opacity: 0.9 !important;
  fill: none !important;
}

.music-quick-card .music-windows-mosaic {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.playlist-row .music-windows-mosaic {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.playlist-grid-card .music-windows-mosaic {
  width: 100%;
  margin-bottom: var(--space-2);
}

/* Réparation barre de recherche */
.music-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-muted);
  width: 320px;
  max-width: 100%;
  box-sizing: border-box;
}

.music-search-bar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 14px/20px var(--font-sans);
  outline: none;
}

.music-search-bar:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.music-search-bar svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ink-muted);
}

/* Bouton switch d'icône unique */
.music-single-switch {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.music-single-switch:hover {
  border-color: var(--accent) !important;
  background: var(--surface-2) !important;
  color: var(--accent) !important;
}

.music-single-switch svg {
  width: 18px !important;
  height: 18px !important;
}

/* Conteneur carrousel discothèque */
.music-browse-coverflow-container {
  width: 100%;
  margin-top: var(--space-2);
}

/* Bouton [+] avec bordure visible et actions playlists au-dessus */
.music-btn-bordered {
  border: 1px solid var(--border-strong) !important;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  padding: 0;
}
.music-btn-bordered:hover {
  border-color: var(--accent) !important;
  color: var(--accent);
}

.music-playlist-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  margin-bottom: var(--space-2);
  flex-wrap: nowrap;
}

.music-playlist-header-row .cf-segmented {
  flex-shrink: 0;
}

.music-playlist-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}

/* En-tête Parcourir avec bouton Tout voir */
.music-browse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.music-browse-head__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.music-browse-see-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  white-space: nowrap;
}

/* Feuille (Sheet) complète pour parcourir tout le catalogue d'une catégorie */
.music-cat-sheet {
  max-width: 600px;
  margin: 0 auto;
}

.music-cat-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.music-cat-sheet__head .cf-sheet__title {
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.music-cat-sheet__count {
  font-size: 13px;
  color: var(--ink-muted);
}

.music-cat-sheet__list {
  display: flex;
  flex-direction: column;
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.music-cat-sheet__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.music-cat-sheet__item:hover {
  background: var(--surface-2);
}

.music-cat-sheet__item .music-windows-mosaic {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.music-cat-sheet__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.music-cat-sheet__title {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-cat-sheet__sub {
  font-size: 12px;
  color: var(--ink-muted);
}

.music-cat-sheet__item > svg {
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

/* Mise en page propre des playlists affichées en liste */
.music-playlists-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.music-playlist-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  min-height: 68px;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background 0.15s ease;
}

.music-playlist-row:first-child {
  border-top: none;
}

.music-playlist-row:hover {
  background: var(--surface-2);
}

.music-playlist-row .music-windows-mosaic {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.music-playlist-row__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.music-playlist-row__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-playlist-row__meta {
  font-size: 12px;
  color: var(--ink-muted);
}

.music-playlist-row .cf-tag {
  flex-shrink: 0;
}

.music-playlist-row > svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ink-muted);
}

/* ==========================================================================
   REFONTE DISCOTHÈQUE & PAGES DÉDIÉES (ENV-MAQ-082)
   ========================================================================== */

/* 1. Barre de navigation rapide en pilules sous le titre Musique */
.music-quick-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-top: calc(-1 * var(--space-2));
  scrollbar-width: thin;
}

.music-quick-nav::-webkit-scrollbar {
  height: 4px;
}
.music-quick-nav::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.music-quick-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font: 600 13px/18px var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.music-quick-nav__btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

.music-quick-nav__btn svg {
  width: 15px;
  height: 15px;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   TUILES MUSIQUE EN GRILLE (ENV-MAQ-082)
   Les éléments de la page d'accueil Musique sont TOUJOURS EN GRILLE :
   - Playlists : strictement 3 colonnes sur 2 lignes (3x2 = 5 playlists + Tout voir)
   - Rayons : strictement 2 colonnes sur 2 lignes (2x2 = Artistes/Albums + Styles/Années)
   Pas de bascule en liste à une seule colonne sur mobile.
   ========================================================================== */

/* 1. Grille playlists : TOUJOURS 3 par ligne sur 2 lignes */
.music-playlists-grid-3x2 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Tuile de playlist en grille : cover carrée au-dessus, titre et métadonnées en dessous */
.music-playlist-tile,
.music-playlists-grid-3x2 .music-quick-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--ink);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.music-playlist-tile:hover,
.music-playlists-grid-3x2 .music-quick-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-1);
}

/* La mosaïque Windows est carrée et prend toute la largeur de la tuile */
.music-playlist-tile .music-windows-mosaic,
.music-playlists-grid-3x2 .music-quick-card .music-windows-mosaic {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.music-playlist-tile__content,
.music-playlists-grid-3x2 .music-quick-card__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.music-playlist-tile__title,
.music-playlists-grid-3x2 .music-quick-card__title {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-playlist-tile__meta,
.music-playlists-grid-3x2 .music-quick-card__meta {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 6ème tuile « Tout voir » au format tuile carrée */
.music-playlist-tile--see-all,
.music-playlists-grid-3x2 .music-quick-card--see-all {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px dashed var(--accent);
}
.music-playlist-tile--see-all:hover,
.music-playlists-grid-3x2 .music-quick-card--see-all:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: var(--accent);
}

.music-playlist-tile__see-all-icon,
.music-playlists-grid-3x2 .music-quick-card__see-all-icon {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.music-playlist-tile__see-all-icon svg,
.music-playlists-grid-3x2 .music-quick-card__see-all-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 2. Les 4 Grands Rayons de la discothèque : TOUJOURS EN GRILLE 2x2 */
.music-rayons-grid-2x2 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

/* Adaptations d'espacement pour petits écrans (mobile) SANS casser la grille */
@media (max-width: 640px) {
  .music-playlists-grid-3x2 {
    gap: 6px;
  }
  .music-playlist-tile,
  .music-playlists-grid-3x2 .music-quick-card {
    padding: 6px;
  }
  .music-playlist-tile__title,
  .music-playlists-grid-3x2 .music-quick-card__title {
    font-size: 11px;
  }
  .music-playlist-tile__meta,
  .music-playlists-grid-3x2 .music-quick-card__meta {
    font-size: 10px;
  }
  .music-playlist-tile__see-all-icon svg,
  .music-playlists-grid-3x2 .music-quick-card__see-all-icon svg {
    width: 22px;
    height: 22px;
  }
  .music-rayons-grid-2x2 {
    gap: 8px;
  }
  .music-rayon-carousel-card {
    padding: 10px;
  }
  .rayon-carousel__top {
    aspect-ratio: 1 / 1 !important;
    max-height: none !important;
    border-radius: var(--radius-md) !important;
    clip-path: inset(0 round var(--radius-md)) !important;
  }
  .rayon-carousel__item-title {
    font-size: 14px;
    line-height: 18px;
  }
  .rayon-carousel__item-sub {
    font-size: 11px;
    line-height: 15px;
  }
}

.music-rayon-carousel-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.music-rayon-carousel-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}

.rayon-carousel__top {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1 !important;
  max-height: none !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  clip-path: inset(0 round var(--radius-md)) !important;
  margin-bottom: var(--space-3);
  background: var(--surface-2);
}

.rayon-carousel__visual-holder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
}

.rayon-carousel__visual-holder .music-windows-mosaic {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
}

.rayon-carousel__nav {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10;
  width: 34px !important;
  height: 34px !important;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  box-sizing: border-box !important;
}
.rayon-carousel__nav:hover {
  opacity: 1;
  background: var(--surface);
  color: var(--accent);
}
.rayon-carousel__nav svg {
  width: 18px !important;
  height: 18px !important;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  margin: auto;
}

.rayon-carousel__nav--prev {
  left: 8px !important;
}
.rayon-carousel__nav--next {
  right: 8px !important;
}

.rayon-carousel__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rayon-carousel__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rayon-carousel__badge svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.rayon-carousel__item-title {
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rayon-carousel__item-sub {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rayon-carousel__explore {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.rayon-carousel__explore svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Ancienne classe conservée pour compatibilité */
.music-rayon-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.music-rayon-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}

.music-rayon-card__visual {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.music-rayon-card__visual .music-windows-mosaic {
  border-radius: var(--radius-md);
}

.music-rayon-card__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.music-rayon-card__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.music-rayon-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.music-rayon-card__badge svg {
  width: 14px;
  height: 14px;
}

.music-rayon-card__title {
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: var(--ink);
}

.music-rayon-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-muted);
  flex: 1;
}

.music-rayon-card__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.music-rayon-card__link svg {
  width: 14px;
  height: 14px;
}

/* 3. Barre d'outils uniforme des pages : recherche + switch affichage + trie sur UNE SEULE LIGNE */
.music-catalogue-toolbar {
  display: flex !important;
  align-items: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: var(--space-2);
  width: 100%;
  margin-bottom: var(--space-3);
  box-sizing: border-box;
}

.music-catalogue-toolbar .music-search-bar {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 40px !important;
  min-height: 40px !important;
}

.music-catalogue-toolbar .music-search-bar input {
  min-width: 0 !important;
  width: 100% !important;
}

/* Boutons menu de tri et menu burger : simples boutons d'icônes sans texte */
.music-sort-menu-wrapper,
.music-filter-burger-wrapper {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.music-sort-menu-btn,
.music-filter-burger-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.music-sort-menu-btn:hover,
.music-filter-burger-btn:hover,
.music-sort-menu-btn[aria-expanded="true"],
.music-filter-burger-btn[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--surface-2);
  color: var(--accent);
}

.music-sort-menu-btn svg,
.music-filter-burger-btn svg {
  width: 18px !important;
  height: 18px !important;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: block;
  margin: auto;
}

/* Menus déroulants (dropdowns) */
.music-sort-dropdown,
.music-filter-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  min-width: 220px;
  max-width: 320px;
  z-index: 120;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.music-filter-dropdown {
  left: 0 !important;
  right: auto !important;
}

.music-sort-dropdown {
  right: 0 !important;
  left: auto !important;
}

.music-sort-dropdown[hidden],
.music-filter-dropdown[hidden] {
  display: none !important;
}

.music-sort-dropdown .cf-menu__item,
.music-filter-dropdown .cf-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  font: 500 13px/18px var(--font-sans);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.music-sort-dropdown .cf-menu__item:hover,
.music-filter-dropdown .cf-menu__item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* Indicateur visuel du tri / filtre actif (checkmark + fond accentué + gras) */
.music-sort-dropdown .cf-menu__item.is-active,
.music-filter-dropdown .cf-menu__item.is-active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-weight: 700;
}

.music-menu-check {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  color: var(--accent);
  flex-shrink: 0;
}

.music-menu-check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.music-menu-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-menu-section-title {
  padding: 6px 10px 4px;
  font: 700 11px/14px var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  user-select: none;
}

.music-menu-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 6px;
}

.music-menu-action-item {
  color: var(--accent) !important;
  font-weight: 600 !important;
}

.music-menu-action-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent) !important;
}

.music-menu-action-item svg,
.music-filter-dropdown .cf-menu__item svg:first-child {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  margin-right: 6px;
}

/* 4. Carrousel Cover Flow Coups de cœur sur les pages catalogue, titres et playlists */
.music-fav-coverflow-section {
  margin-bottom: var(--space-4);
}

.music-fav-coverflow-section .coverflow-card__poster .music-windows-mosaic {
  width: 100%;
  height: 100%;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.music-fav-coverflow-section .coverflow-card {
  height: 290px !important;
}

.music-fav-coverflow-section .coverflow-card__poster {
  width: 100% !important;
  height: 190px !important;
  aspect-ratio: 1 / 1 !important;
}

.music-fav-carousel-track {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding: 4px 2px 14px;
  scrollbar-width: thin;
}

.music-fav-carousel-track::-webkit-scrollbar {
  height: 6px;
}
.music-fav-carousel-track::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.music-fav-card {
  flex: 0 0 170px;
  min-width: 170px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.music-fav-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.music-fav-card .music-windows-mosaic {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.music-fav-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.music-fav-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-fav-card__sub {
  font-size: 12px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 5. Grille & Liste Catalogue complet */
.music-catalogue-grid {
  margin-top: var(--space-2);
}

.music-catalogue-card {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.music-catalogue-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.music-catalogue-card .music-windows-mosaic {
  width: 100%;
  margin-bottom: var(--space-2);
}

.music-catalogue-card .cf-cover {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: var(--radius-md) !important;
  margin-bottom: var(--space-2) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  position: relative !important;
  color: var(--surface) !important;
}

.music-catalogue-card .cf-cover > svg {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  stroke-width: 1.8 !important;
  stroke: var(--surface) !important;
  color: var(--surface) !important;
  fill: none !important;
  opacity: 0.95 !important;
  margin: auto !important;
}

.music-catalogue-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.music-catalogue-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  min-height: 64px;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background 0.15s ease;
}

.music-catalogue-row:first-child {
  border-top: none;
}

.music-catalogue-row:hover {
  background: var(--surface-2);
}

.music-catalogue-row .music-windows-mosaic {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.music-catalogue-row .cf-cover {
  width: 44px !important;
  height: 44px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: var(--radius-sm) !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  box-shadow: none !important;
  position: relative !important;
  color: var(--surface) !important;
}

.music-catalogue-row .cf-cover > svg {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  stroke-width: 2 !important;
  stroke: var(--surface) !important;
  color: var(--surface) !important;
  fill: none !important;
  opacity: 0.95 !important;
  margin: auto !important;
}

.music-catalogue-card .cf-cover img,
.music-catalogue-row .cf-cover img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: inherit !important;
  display: block !important;
}

.music-catalogue-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.music-catalogue-row__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-catalogue-row__meta {
  font-size: 12px;
  color: var(--ink-muted);
}

.music-catalogue-row > svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ink-muted);
}

/* Onglets médias (ENV-MAQ-083, MED-MUS-016) */
.media-tabs {
  margin-bottom: var(--space-3);
}

.media-tabs .cf-tabs__item {
  gap: 8px;
}

/* ==========================================================================
   REFONTE DU HUB LECTURE (ENV-MAQ-083) : Librairie & Salon de lecture
   ========================================================================== */

/* Ruban marque-page en onglet haut-droit */
.cf-bookmark-ribbon {
  position: absolute;
  top: 0;
  right: 10px;
  width: 14px;
  height: 22px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* Jauge de lecture discrète en bas de couverture */
.cf-cover-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: rgba(0, 0, 0, 0.4);
  z-index: 4;
  overflow: hidden;
}
.cf-cover-progress__bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* Mosaïque 2x2 verticale pour collections et rayons de livres */
.book-windows-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 100%;
  height: 100%;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 2 / 3;
}

.book-mosaic-cell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint, var(--member-orange)) 70%, var(--surface)), color-mix(in srgb, var(--tint, var(--member-orange)) 30%, var(--ink)));
  display: grid;
  place-items: center;
  color: var(--surface);
}

.book-mosaic-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-mosaic-cell svg {
  width: 18px;
  height: 18px;
  opacity: 0.95;
  color: var(--surface);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.book-windows-mosaic.is-single-cover {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  position: relative !important;
  background: var(--surface-2) !important;
}

.book-mosaic-single-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* 1. Grille Piles & Ambiances 2x3 */
.book-piles-grid-3x2 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.book-pile-tile {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--ink);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.book-pile-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-1);
}

.book-pile-tile .cf-cover {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.book-pile-tile__content,
.book-pile-tile .music-playlist-tile__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.book-pile-tile__title,
.book-pile-tile .music-playlist-tile__title {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  width: 100%;
}

.book-pile-tile__meta,
.book-pile-tile .music-playlist-tile__meta {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  width: 100%;
}

.book-pile-tile--see-all {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px dashed var(--accent);
}
.book-pile-tile--see-all:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: var(--accent);
}

/* 2. Rayons 2x2 en carrousels 10 s */
.book-rayons-grid-2x2 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.book-rayon-top {
  aspect-ratio: 2 / 3 !important;
}

/* 3. Grille des cartes livres (portrait 2:3) */
.book-titles-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  gap: var(--space-3);
}

.book-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  text-decoration: none;
  color: var(--ink);
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.book-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-1);
}

.book-card .cf-cover {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}

.book-card.is-read {
  opacity: 0.85;
}

.book-series-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: var(--space-3);
}

.book-series-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  text-decoration: none;
  color: var(--ink);
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.book-series-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-1);
}

.book-series-card .book-windows-mosaic {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

/* 4. Barre d'outils uniforme sur UNE SEULE LIGNE */
.book-toolbar {
  display: flex !important;
  align-items: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: var(--space-2);
  width: 100%;
  margin-bottom: var(--space-3);
  box-sizing: border-box;
}

.book-toolbar .cf-search,
.book-toolbar .book-search-bar {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 40px !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
}

.book-toolbar .cf-search input,
.book-toolbar .book-search-bar input {
  min-width: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.book-toolbar .music-single-switch,
.book-toolbar .music-sort-menu-btn,
.book-toolbar .music-filter-burger-btn {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* 5. Menu contextuel d'options / gestion en-tête (positionné en absolute top right) */
.book-management-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 290px;
  max-width: 340px;
  z-index: 150;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: musicDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

.book-management-dropdown[hidden] {
  display: none !important;
}

/* 6. Vue Liste soignée, moderne et structurée pour les ouvrages */
.book-list-container {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.book-list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 14px;
  min-height: 76px;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background 0.15s ease;
  box-sizing: border-box;
  cursor: pointer;
  background: var(--surface);
}

.book-list-row:first-child {
  border-top: none;
}

.book-list-row:hover,
.book-list-row:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.book-list-row .cf-cover {
  width: 44px !important;
  height: 64px !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  color: var(--surface) !important;
}

.book-list-row .cf-cover > svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  stroke-width: 1.8 !important;
  stroke: var(--surface) !important;
  color: var(--surface) !important;
  fill: none !important;
  opacity: 0.95 !important;
  margin: auto !important;
}

.book-list-row .cf-cover img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: inherit !important;
  background: var(--surface-2);
  display: block !important;
}

.book-list-row .cf-bookmark-ribbon {
  right: 4px !important;
  width: 10px !important;
  height: 16px !important;
}

.book-list-row .book-windows-mosaic {
  width: 44px !important;
  height: 64px !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.book-list-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
}

.book-list-row__title {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-list-row__line2 {
  font-size: 12px;
  line-height: 1.25;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-list-row__line3 {
  font-size: 12px;
  line-height: 1.25;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-list-row__line3-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-tag-format {
  font-size: 10px !important;
  padding: 1px 6px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.book-list-row__meta {
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.book-list-row__subtext {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-list-row__status,
.book-list-row__progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}

.book-list-row__progress-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.book-list-row__progress .cf-progress {
  width: 80px;
}

.book-list-row__pages-badge {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.book-list-row__action {
  width: 36px !important;
  height: 36px !important;
  flex-shrink: 0;
  margin-left: 6px;
}

.book-list-row > svg:last-child,
.book-list-row > .cf-icon:last-child {
  width: 18px !important;
  height: 18px !important;
  color: var(--ink-muted);
  flex-shrink: 0;
  margin-left: auto;
  transition: color 0.15s ease;
}

.book-list-row:hover > svg:last-child,
.book-list-row:hover > .cf-icon:last-child {
  color: var(--ink);
}

.book-list-row .book-mosaic-cell svg {
  width: 11px !important;
  height: 11px !important;
}

.book-author-avatar {
  width: 44px !important;
  height: 64px !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: var(--radius-sm);
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-sizing: border-box;
}

.book-author-avatar svg {
  width: 22px !important;
  height: 22px !important;
  color: var(--ink-muted);
}

@media (max-width: 640px) {
  .book-piles-grid-3x2 {
    gap: 6px;
  }
  .book-pile-tile {
    padding: 6px;
  }
  .book-rayons-grid-2x2 {
    gap: 8px;
  }
  .book-titles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
}

/* 7. Onglets médias et écran des piles à lire (ENV-MAQ-083) */
.media-tabs {
  margin-bottom: var(--space-3);
}

.media-tabs .cf-tabs__item {
  gap: 8px;
}

.book-piles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.book-pile-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.book-pile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--accent);
}

.book-pile-card__header {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-pile-card .book-windows-mosaic {
  width: 52px !important;
  height: 78px !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.book-pile-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.book-pile-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-pile-card__sub {
  font-size: 12px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-pile-card__meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 2px;
}

.book-pile-card__progress {
  margin-top: auto;
  padding-top: var(--space-2);
}

/* Liseuse (MED-LEC-001b, maquette c3) : plein écran sur la scène sombre de la charte (`cf-reader is-dark`).
   Barres en surimpression, effacées après 3 s sans geste ; la scène occupe tout l'écran. */
.book-reader { position: fixed; inset: 0; z-index: 40; }
.book-reader .cf-reader__stage { position: absolute; inset: 0; padding: 0; gap: 4px; overflow: hidden; cursor: pointer; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.book-reader .cf-reader__bar,
.book-reader .cf-reader__foot { position: absolute; left: 0; right: 0; z-index: 2; background: color-mix(in srgb, var(--cf-stage) 88%, transparent); transition: opacity .2s ease; }
.book-reader .cf-reader__bar { top: 0; }
.book-reader .cf-reader__foot { bottom: 0; }
.book-reader.is-idle .cf-reader__bar,
.book-reader.is-idle .cf-reader__foot { opacity: 0; pointer-events: none; }
.book-reader__canvas { display: block; background: var(--surface); border-radius: 2px; box-shadow: 0 2px 12px color-mix(in srgb, #000 40%, transparent); }
.book-reader__spacer { flex: 1; }
.book-reader__range { flex: 1; min-width: 0; accent-color: var(--accent); }
.book-reader__count { min-width: 7ch; text-align: end; font-variant-numeric: tabular-nums; }
.book-reader__message { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; pointer-events: none; color: var(--cf-on-stage); }
.book-reader__message:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .book-reader .cf-reader__bar, .book-reader .cf-reader__foot { transition: none; } }

/* Liseuse PDF (MED-LEC-001c, maquette c4) : lecteur du navigateur dans un cadre, sous la barre de la liseuse. */
.book-pdf { position: fixed; inset: 0; z-index: 40; }
.book-pdf .cf-reader__bar { flex-wrap: wrap; }
.book-pdf__frame { flex: 1; min-height: 0; width: 100%; border: 0; background: var(--surface); }
.book-pdf__goto { display: flex; align-items: center; gap: 6px; }
.book-pdf__page { width: 5.5em; }
.book-pdf__hint, .book-pdf__status { flex: none; margin: 0; padding: 6px 16px; font-size: 12px; color: var(--ink-muted); }
.book-pdf__status:empty { display: none; }
.book-pdf__fallback { flex: 1; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px; text-align: center; }

/* Liseuse EPUB (MED-LEC-001d, maquette c5, P15) : le texte est dans un cadre (assets/lecteur.html) entre la barre et le pied. */
.book-epub { position: fixed; inset: 0; z-index: 40; }
.book-epub.is-light { --surface-2: #ffffff; --ink: #111111; --surface: #f7f8fa; background: #ffffff; color: #111111; }
.book-epub.is-sepia { --surface-2: #f4ecd8; --ink: #4b3b2a; --surface: #efe4c8; background: #f4ecd8; color: #4b3b2a; }
.book-epub.is-dark { --surface-2: #1e2025; --ink: #e6e8ec; --ink-muted: #9aa0a6; --surface: #282a30; --border: #383a42; --glass: rgba(26, 28, 33, 0.85); --glass-border: rgba(255, 255, 255, 0.12); background: #141619; color: #e6e8ec; }
.book-epub.is-black { --surface-2: #000000; --ink: #e6e8ec; --ink-muted: #9aa0a6; --surface: #0c0d10; --border: #22242a; --glass: rgba(0, 0, 0, 0.9); --glass-border: rgba(255, 255, 255, 0.12); background: #000000; color: #e6e8ec; }
.book-reader.is-dimmed canvas { filter: brightness(0.85) contrast(0.92); }
/* `hidden` doit l'emporter sur le `display` des composants de la charte. */
.book-epub [hidden] { display: none !important; }
.book-epub__body { position: relative; flex: 1; min-height: 0; display: flex; }
.book-epub__frame { flex: 1; width: 100%; border: 0; background: transparent; color-scheme: normal; }
.book-epub__toc { position: absolute; inset: 0 0 0 auto; width: min(22rem, 100%); overflow: auto; padding: 8px; background: var(--surface); color: var(--ink); border-left: 1px solid var(--border); box-shadow: var(--shadow-1); }
.book-epub__tocList { list-style: none; margin: 0; padding: 0; }
.book-epub__tocItem { width: 100%; justify-content: flex-start; text-align: start; white-space: normal; }
.book-epub__tocItem[data-level="1"] { padding-inline-start: 24px; }
.book-epub__tocItem[data-level="2"] { padding-inline-start: 40px; }
.book-epub__tocItem[data-level="3"] { padding-inline-start: 56px; }
.book-epub__tocItem[aria-current="true"] { font-weight: 700; color: var(--accent); }
.book-epub__settings { top: 8px; right: 8px; width: min(22rem, calc(100% - 16px)); }
.book-epub__setting .cf-segmented__item { padding: 0 var(--space-2); }
.book-epub__setting { display: flex; flex-direction: column; gap: 6px; }
.book-epub__settingLabel { font-size: 12px; color: var(--ink-muted); }
.book-epub__status { padding-top: 0; }
.book-epub .cf-reader__foot { justify-content: center; }
.book-epub__where { font-size: 12px; font-variant-numeric: tabular-nums; }

/* Fiche d'un livre (MED-LEC-001f, maquette c15) : jaquette à gauche, texte et actions à droite ; blocs de contenu dessous. */
.book-detail-page { padding-bottom: var(--space-8); }
.book-detail-page svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.book-detail-topbar { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.book-detail-hero { display: flex; flex-direction: column; gap: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-1); }
@media (min-width: 768px) { .book-detail-hero { flex-direction: row; align-items: flex-start; gap: var(--space-8); padding: var(--space-6); } }
.book-detail-cover-col { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; width: 100%; }
@media (min-width: 768px) { .book-detail-cover-col { width: 240px; } }
.book-detail-cover-card { width: 100%; max-width: 240px; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.book-detail-cover-card .cf-cover.is-tall { width: 220px; height: 330px; border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.book-detail-cover-meta { width: 100%; }
.book-detail-progress-box { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.book-detail-progress-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.book-detail-progress-pct { color: var(--accent); }
.book-detail-badge { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; box-sizing: border-box; padding: 8px 12px; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); }
.book-detail-badge svg { width: 14px; height: 14px; flex-shrink: 0; }
.book-detail-badge.is-read { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); }
.book-detail-badge.is-unread { background: var(--surface-2); color: var(--ink-muted); border: 1px solid var(--border); }
.book-detail-info-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.book-detail-title { font-size: clamp(22px, 3vw, 30px); font-weight: 700; color: var(--ink); line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.book-detail-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 15px; color: var(--ink-muted); }
.book-detail-series-link { font-weight: 600; color: var(--accent); text-decoration: none; }
.book-detail-series-link:hover, .book-detail-author a:hover { text-decoration: underline; }
.book-detail-author a { color: var(--ink); font-weight: 500; text-decoration: none; }
.book-detail-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.book-detail-actions-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.book-action-read { font-weight: 600; min-height: 44px; flex: 1 1 auto; max-width: 20rem; }
.book-action-fav, .book-action-more { width: 44px; height: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink-muted); }
.book-action-fav.is-fav { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.book-action-fav.is-fav svg { fill: var(--danger); stroke: var(--danger); }
.book-detail-section { margin-top: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.book-detail-section .section-title { margin-top: 0; }
.book-detail-synopsis { margin: 0; line-height: 1.6; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.book-detail-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--space-3) var(--space-6); margin: 0; }
.book-detail-fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.book-detail-fact dt { font-size: 12px; color: var(--ink-muted); }
.book-detail-fact dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.book-edit-dialog { max-height: 90vh; overflow: auto; }
.book-edit-error { color: var(--danger); }

/* Rangée « Reprendre la lecture » de la médiathèque et widget (MED-LEC-001e) : des liens qui ressemblent à la rangée de la musique. */
.book-resume-play, .book-resume-play:hover { color: inherit; text-decoration: none; }
.widget-book .cf-btn { flex: none; }

/* Page d'un auteur, d'un genre ou d'un type de lecture : les couvertures de ses livres à côté du titre (MED-LEC, correctif). */
.page-head.book-browse-head { display: flex; align-items: flex-end; justify-content: flex-start; gap: var(--space-4); }
.book-browse-head .book-windows-mosaic { flex: none; width: 96px; height: auto; box-shadow: var(--shadow-1); }
.book-browse-head > div { min-width: 0; flex: 1; text-align: start; }

/* Bords du livre (« Début du livre », « Fin du livre ») : un message bref au bas de la page, qui ne bloque aucun geste. */
.book-epub__hint { position: absolute; left: 50%; bottom: var(--space-3); transform: translateX(-50%); margin: 0; padding: 6px 14px; border-radius: var(--radius-full); background: var(--ink); color: var(--bg); font-size: 13px; pointer-events: none; }
.book-epub__hint:empty { display: none; }
.book-reader__hint { position: absolute; left: 50%; bottom: 72px; z-index: 3; transform: translateX(-50%); max-width: calc(100% - 32px); margin: 0; padding: 8px 16px; border-radius: var(--radius-md); background: var(--cf-on-stage); color: var(--cf-stage); font-size: 13px; text-align: center; pointer-events: none; }
.book-reader__hint:empty { display: none; }

/* ===== PLA-WEB-004, lot 1 : blocs de placement du prototype (Mon compte, mot de passe, heures calmes, enfant, Accueil).
   Copiés de famille-maquettes ; l'ancien CSS de ces écrans reste jusqu'au lot de bascule (règles mortes retirées alors). ===== */
/* Mon compte (ENV-MAQ-094) : placement seulement. */
.compte-entete-ordi { display: none; }
@media (min-width: 1200px) {
  .compte-entete-tel { display: none; }
  .compte-entete-ordi { display: block; }
}
.compte-grille { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 768px) {
  .compte-grille { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: start; }
}
.compte-col { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.compte-reglage { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
@media (max-width: 767px) {
  .compte-reglage { flex-direction: column; align-items: stretch; }
}
.mdp-page { display: flex; flex-direction: column; gap: var(--space-4); }
.mdp-card { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-4); }
.mdp-entete-ordi { display: none; }
@media (min-width: 1200px) {
  .mdp-entete-tel { display: none; }
  .mdp-entete-ordi { display: block; }
}
.heures-page { display: flex; flex-direction: column; gap: var(--space-4); }
.heures-page .cf-block { width: 100%; max-width: 560px; margin: 0 auto; }
.heures-paire { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); width: 100%; }
.heures-entete-ordi { display: none; }
@media (min-width: 1200px) {
  .heures-entete-tel { display: none; }
  .heures-entete-ordi { display: block; }
}
.enfant-page { display: flex; flex-direction: column; gap: var(--space-4); max-width: 640px; margin: 0 auto; }
.enfant-entete-ordi { display: none; }
@media (min-width: 1200px) {
  .enfant-entete-tel { display: none; }
  .enfant-entete-ordi { display: block; }
}

/* Accueil (ENV-MAQ-095) : placement seulement ; les blocs viennent de la charte. */
.home-modules-section { display: flex; flex-direction: column; gap: var(--space-4); }
.home-counters { display: flex; flex-direction: column; gap: var(--space-2); }
.home-counters--inline { flex-direction: row; align-items: center; gap: var(--space-4); }
.home-counter { display: flex; align-items: baseline; gap: var(--space-2); text-decoration: none; color: inherit; }
.home-pied { display: flex; justify-content: center; padding: var(--space-4) 0; }

.homeedit-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1060px) {
  .homeedit-layout:not(.homeedit-layout--single) { grid-template-columns: minmax(0, 1fr) 320px; }
}
.homeedit-main { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.home-edit-actions { display: flex; flex-direction: column; gap: var(--space-2); }
@media (min-width: 768px) {
  .home-edit-actions { flex-direction: row-reverse; justify-content: flex-start; }
}
.homeedit-panneau { position: sticky; top: 72px; display: flex; flex-direction: column; gap: var(--space-3); }
.homeedit-panneau-bloc { display: flex; flex-direction: column; gap: var(--space-2); }
.home-removed__title { margin: 0; font: 700 20px/28px "Fredoka", "Nunito", system-ui, sans-serif; }
.home-removed__list { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.home-edit__place { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-3) 0; }
.home-edit__place-label { font: var(--type-label); color: var(--ink-muted); }
.cf-sheet .cf-segmented { margin: var(--space-2) var(--space-3); }
.home-dialog-wide { max-width: 560px; width: 100%; }

/* Widgets partagés hors lot Accueil (conservés tant que les modules correspondants n'ont pas été refondus). */
.cf-widget[hidden] { display: none; }
.widget-body { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.widget-empty { margin: 0; padding: var(--space-2) 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.cf-widget--kid .widget-empty { color: var(--kid-on-color); font-size: 16px; line-height: 24px; font-weight: 600; }
.widget-foot { display: block; padding-top: var(--space-1); }
.cf-widget--kid .cf-widget__link { color: var(--kid-on-color); }
.cf-widget.widget--compact { flex-direction: row; align-items: center; gap: var(--space-3); }
.widget--compact .cf-widget__head { flex: none; margin: 0; }
.widget--compact .widget-body { justify-content: center; }
.widget--compact .widget-empty { padding: 0; }
.widget--compact .cf-widget__row { border-top: 0; }

/* ===== PLA-WEB-004, lot 2 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Notes (ENV-MAQ-096) : placement seulement. */
.notes-page { display: flex; flex-direction: column; gap: var(--space-4); }
.notes-container { display: flex; flex-direction: column; gap: var(--space-4); }
.notes-col-720 { max-width: 720px; margin: 0 auto; width: 100%; }
.notes-grid { display: flex; flex-direction: column; gap: var(--space-3); }
@media (min-width: 600px) {
  .notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
}
.notes-kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.notes-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.notes-owner { display: inline-flex; align-items: center; gap: var(--space-1); }
.notes-fab { position: fixed; right: var(--space-4); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 4; }
/* Pastille d'envoi affichée (UploadDock) : le bouton flottant monte d'un cran. */
body:has(> #envoi:not([hidden], .is-open)) .notes-fab { bottom: calc(160px + env(safe-area-inset-bottom)); }
.notes-create-ordi { display: none; }
@media (min-width: 780px) {
  .notes-fab { display: none; }
  .notes-create-ordi { display: inline-flex; }
}
.notes-card-open { display: flex; flex-direction: column; gap: var(--space-4); }
.notes-body-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes-save-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
.notes-save-bar[hidden], .notes-save-bar .cf-btn[hidden] { display: none; }
@media (min-width: 780px) {
  .notes-save-bar { left: 240px; }
}
.notes-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.notes-dialog-form { display: flex; flex-direction: column; gap: var(--space-3); }
.notes-share-list { display: flex; flex-direction: column; gap: var(--space-2); }
.notes-share-name { flex: 1; min-width: 0; }
.notes-link-previews { display: flex; flex-direction: column; gap: var(--space-3); }
.notes-link-preview { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-3); align-items: center; text-decoration: none; color: inherit; }
.notes-link-preview__thumb { width: 72px; height: 72px; border-radius: var(--radius-md); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-muted); overflow: hidden; flex-shrink: 0; }
.notes-link-preview__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.notes-link-preview__body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.notes-link-preview__desc { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notes-checklist { display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.notes-checklist-head { display: flex; flex-direction: column; gap: var(--space-3); }
.notes-checklist-head:empty { display: none; }
.notes-checklist-mask { align-self: flex-start; }
.notes-checklist-stars { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.notes-checklist-where { margin: var(--space-2) 0 0; }
button.cf-checklist__text { min-height: 44px; padding: 0; border: 0; background: transparent; color: inherit; font-family: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.cf-checklist--kid button.cf-checklist__text { min-height: 56px; }
.notes-composer-fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
@media (min-width: 780px) {
  .notes-composer-fixed { left: 240px; }
}
.notes-create-choices { display: flex; flex-direction: column; gap: var(--space-2); }
.notes-new-page { display: flex; flex-direction: column; gap: var(--space-4); }
.notes-new-body { max-width: 720px; margin: 0 auto; width: 100%; }
.notes-new-form { display: flex; flex-direction: column; gap: var(--space-4); }
.notes-new-section { display: flex; flex-direction: column; gap: var(--space-2); }
.notes-placeholder { padding: var(--space-8) var(--space-4); text-align: center; }
@media (min-width: 1060px) {
  .notes-split { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .notes-pane { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow: auto; }
  .notes-pane .page { max-width: none; }
  .note-pane { min-width: 0; }
  .note-pane .notes-container { margin: 0; max-width: 720px; }
  .note-pane .cf-topbar { position: static; margin: 0; }
  .note-pane .cf-topbar button[aria-label="Retour"] { display: none; }
  .note-pane .notes-save-bar, .note-pane .notes-composer-fixed { position: sticky; left: auto; right: auto; bottom: 0; }
}

/* ===== PLA-WEB-004, lot 3 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Tâches (ENV-MAQ-097) : placement seulement. */
.taches-entete-tel { display: flex; }
.taches-entete-ordi { display: none; }
.taches-creer-ordi { display: none; }
.taches-fab { position: fixed; right: var(--space-4); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 4; width: 56px; height: 56px; padding: 0; justify-content: center; text-decoration: none; }
body:has(> #envoi:not([hidden], .is-open)) .taches-fab { bottom: calc(160px + env(safe-area-inset-bottom)); }
.taches-slot { display: flex; flex-direction: column; gap: var(--space-3); }
.taches-corps { display: flex; flex-direction: column; gap: var(--space-3); }
.taches-corps.is-loading .cf-task-list { opacity: 0.6; }
.taches-groupe { display: flex; flex-direction: column; gap: var(--space-2); }
.taches-groupe .cf-task__title { overflow-wrap: anywhere; }
.taches-groupe .cf-task .cf-tag { flex: none; }
.taches-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.taches-stats .cf-stat { padding: var(--space-3); color: inherit; text-decoration: none; }
.taches-plus { display: flex; justify-content: center; }
.taches-actions-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); padding-bottom: var(--space-4); }

.taches-detail { display: flex; flex-direction: column; gap: var(--space-4); }
.taches-detail-tete { display: flex; flex-direction: column; gap: var(--space-2); }
.taches-detail-titre { margin: 0; font: 700 24px/30px var(--font-sans); overflow-wrap: anywhere; }
.taches-detail-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.taches-detail-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.taches-detail-supprimer { display: flex; }
.taches-description { margin: 0; font-size: 14px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.taches-steps { display: flex; flex-direction: column; gap: var(--space-2); }
.taches-actions-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.taches-history-plus { display: flex; justify-content: center; margin-top: var(--space-2); }

.taches-form { max-width: 720px; margin: 0 auto; padding-bottom: 96px; }
.taches-form-top { display: flex; flex-direction: column; gap: var(--space-2); }
.taches-form-top:empty { display: none; }
.taches-form-top .cf-alert:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.taches-form-corps { display: flex; flex-direction: column; }
.taches-form-corps.is-stale { opacity: 0.5; }
.taches-form-tete { display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: var(--space-4); }
.taches-form-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.taches-editrows { display: flex; flex-direction: column; gap: var(--space-2); }
.taches-step-when select { min-height: 36px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.taches-reminder-add select { min-height: 34px; padding-top: 0; padding-bottom: 0; border-radius: var(--radius-full); font-size: 13px; font-weight: 600; }
.taches-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
.taches-form-corps--kid { gap: var(--space-6); padding-top: var(--space-4); }
.taches-kid-question { font: 700 22px/28px var(--font-kid-fun); color: var(--ink); }
.taches-kid-when { display: flex; flex-direction: column; gap: var(--space-3); }
.taches-kid-aide { margin: 0; font-size: 16px; line-height: 22px; color: var(--ink-muted); }
.taches-form--kid .cf-chip--kid[aria-pressed="true"] { color: var(--kid-on-color); }

.taches-filtres { display: flex; flex-direction: column; gap: var(--space-3); }
.taches-note { margin: 0; padding: 0 var(--space-1); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.taches-validate-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }

.taches-kid { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-4); }
.taches-kid-corps { display: flex; flex-direction: column; gap: var(--space-4); }
.taches-kid-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.taches-kid-sub { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink-muted); }
.taches-kid-sub:empty { display: none; }
.taches-kid-titre { margin: 0; font: 700 22px/28px var(--font-kid-fun); }
.taches-kid-bientot { display: flex; flex-direction: column; gap: var(--space-2); }
.taches-kid-lien { color: inherit; text-decoration: none; }
.taches-kid-lien:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: var(--radius-sm); }
.taches-kid-ajouter { align-self: stretch; justify-content: center; text-decoration: none; }
.taches-kid-fait { align-self: center; font-size: 17px; }

.taches-widget-box { width: 44px; height: 44px; flex: none; display: grid; place-items: center; margin-left: -12px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.taches-widget-box:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; border-radius: var(--radius-md); }
.taches-widget-box:disabled { cursor: default; opacity: 0.6; }
.taches-widget-box .cf-widget__check { display: grid; place-items: center; }
.taches-widget-box .cf-widget__check.is-checked { border-color: var(--success); background: var(--success); color: var(--on-accent); }
.taches-widget-box svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.taches-widget-box--kid { margin-left: -8px; width: 48px; height: 48px; }
.taches-widget-box--kid svg { width: 22px; height: 22px; }
.taches-widget-titre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: inherit; text-decoration: none; }
.cf-widget__row.is-done .taches-widget-titre, .cf-widget__task.is-done .taches-widget-titre { color: var(--ink-muted); text-decoration: line-through; }
.taches-widget-retard { color: var(--danger); font-weight: 600; }
.taches-widget-plus { margin-top: auto; padding-top: var(--space-1); color: inherit; }
.taches-widget-message { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.taches-widget-message:empty { display: none; }
.taches-widget-compte { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1; color: inherit; text-decoration: none; }
.taches-widget-compte .cf-tag { margin-top: auto; }
.taches-widget-ligne { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taches-widget-etoiles { display: flex; }
.taches-widget-etoile svg { width: 20px; height: 20px; fill: var(--kid-sun); stroke: var(--ink); stroke-width: 1.5; }
.cf-widget--kid .taches-widget-titre { white-space: normal; }
.cf-widget--kid .cf-widget__task + .cf-widget__task { margin-top: var(--space-2); }
.cf-widget--kid .taches-widget-compte .cf-widget__meta { color: inherit; font-size: 16px; line-height: 22px; font-weight: 700; }

/* Classes conservées pour les autres écrans (agenda...) */

.tasks-form__body { display: flex; flex-direction: column; }
.tasks-form__head { display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: var(--space-4); }
.tasks-form__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.tasks-form__top { display: flex; flex-direction: column; gap: var(--space-2); }
@media (min-width: 780px) {
  .taches-creer-ordi { display: inline-flex; }
  .taches-fab { display: none; }
  .taches-bar { left: 240px; }
  .taches-validate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  
  
}
@media (min-width: 780px) and (max-width: 1059px) {
  .tasks-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: start; }
  .tasks-pane { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow: auto; }
  .tasks-pane .page { max-width: none; }
  .task-pane .taches-detail { margin: 0; padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-ml); }
  .task-pane .cf-topbar { position: static; margin: 0; padding: 0; height: auto; border: 0; background: none; }
  .task-pane .cf-topbar__back { display: none; }
  .task-pane .cf-card { padding: var(--space-3) 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; }
}
@media (min-width: 1060px) {
  .tasks-split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--space-6); align-items: start; }
  .tasks-pane { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow: auto; }
  .tasks-pane .page { max-width: none; }
  .task-pane .taches-detail { max-width: 720px; margin: 0; padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-ml); }
  .task-pane .cf-topbar { position: static; margin: 0; padding: 0; height: auto; border: 0; background: none; }
  .task-pane .cf-topbar__back { display: none; }
  .task-pane .cf-card { padding: var(--space-3) 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; }
  .taches-validate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .taches-entete-tel { display: none; }
  .taches-entete-ordi { display: flex; }
}
.tasks-placeholder { margin: 0; padding: var(--space-8) var(--space-4); text-align: center; color: var(--ink-muted); }

/* Agenda (tâche 71, docs/domaines/ENV/MAQ/maquettes/agenda.md). Placement des blocs : les nombres viennent d'agenda-layout.js et
   arrivent en propriétés CSS par le CSSOM (--top, --height en minutes ; --col, --cols ; --at, --now, --hours) ;
   jamais d'attribut style (CSP). */

/* ===== PLA-WEB-004, lot 4 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Agenda (ENV-MAQ-098) : placement seulement. */
.agenda-ligne-commandes { display: flex; flex-direction: column; gap: var(--space-3); }
.agenda-vues-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
@media (min-width: 820px) {
  .agenda-ligne-commandes { flex-direction: row; justify-content: space-between; align-items: center; }
}
.agenda-btn-new { display: none; }
.agenda-btn-fab { position: fixed; right: var(--space-4); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 4; }
@media (min-width: 780px) {
  .agenda-btn-new { display: inline-flex; }
  .agenda-btn-fab { display: none; }
  .cf-timegrid { --hour-h: 52px; }
}
.agenda-day, .agenda-week, .agenda-month { display: flex; flex-direction: column; gap: var(--space-3); }
.agenda-allday, .agenda-band { display: flex; flex-direction: column; gap: var(--space-2); }
.cf-weekgrid__allday > * { grid-column: var(--from, auto) / span var(--span, 1); }
@media (min-width: 1060px) {
  .agenda--wide-month { max-width: 1200px; }
}
.agenda-form__body { display: flex; flex-direction: column; gap: var(--space-4); }
.agenda-form__head { display: flex; flex-direction: column; gap: var(--space-3); }
.agenda-form__pair { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 540px) {
  .agenda-form__pair { grid-template-columns: 1fr 1fr; }
}
.agenda-detail { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 1060px) {
  .agenda-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: var(--space-6); align-items: start; }
  .agenda-detail-pane { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow-y: auto; }
  .agenda-detail--split { max-width: none; margin: 0; }
  .agenda-split .agenda-btn-fab { display: none; }
}
.agenda-vacations { display: flex; flex-direction: column; gap: var(--space-4); }
.agenda-vacations__grid { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 820px) {
  .agenda-vacations__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: start; }
}
.agenda-kid { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-4); }
.agenda-kid-soon { display: flex; flex-direction: column; gap: var(--space-2); }
.agenda-kid-form__body { display: flex; flex-direction: column; gap: var(--space-4); }

/* ===== PLA-WEB-004, lot 5 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Météo (ENV-MAQ-091) : placement seulement ; les blocs viennent de la charte (Weather, KidWeather, Widget). */
.weather, .weather-grille, .weather-col { min-width: 0; }
.cf-weather-hours, .cf-weather-hour, .cf-weather-day, .cf-kidmoment, .cf-kidforecast__row { position: relative; }
.weather { display: flex; flex-direction: column; gap: var(--space-4); }
.weather-slot, .weather-body, .weather-grille { display: flex; flex-direction: column; gap: var(--space-4); }
.weather-resultats { display: flex; flex-direction: column; }
.weather-col { display: contents; }
.weather-entete-ordi { display: none; }
.weather-attente { min-height: 72px; background: var(--surface-2); }
.weather-attente--haut { min-height: 140px; }
.weather-attente--long { min-height: 220px; }
.weather-enfant { display: flex; flex-direction: column; gap: var(--space-3); }
.weather-admin { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 768px) {
  .weather-grille { display: block; columns: 2; column-gap: var(--space-4); }
  .weather-col > * { break-inside: avoid; margin: 0 0 var(--space-4); }
  .weather-jours-plus { display: none; }
  .weather-enfant { width: 100%; max-width: 560px; margin-inline: auto; }
  .weather-admin { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (min-width: 1200px) {
  .weather-grille { display: grid; columns: auto; grid-template-columns: 1fr 1.15fr 1fr; gap: var(--space-4); align-items: start; }
  .weather-col { display: flex; flex-direction: column; gap: var(--space-4); }
  .weather-col > * { margin: 0; }
  .weather-entete-tel { display: none; }
  .weather-entete-ordi { display: flex; }
}

/* ===== PLA-WEB-004, lot 6 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Repas (ENV-MAQ-099) : placement seulement ; les cartes viennent de la charte (MealCard, Carousel, DateNav, Widget). */
.repas-tel { width: 100%; max-width: 420px; margin-inline: auto; }
.repas-grand { display: none; }
.repas-grille--kid { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--space-4); }
.repas-grille--kid > .cf-meal { width: 100%; max-width: 280px; }
@media (min-width: 768px) {
  .repas-tel { display: none; }
  .repas-grand.cf-datenav { display: flex; }
  .repas-grille.repas-grand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: center; gap: var(--space-4); }
  .repas-grille > .cf-meal { width: 100%; max-width: 280px; }
  .repas-grille--kid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .repas-grille.repas-grand { display: flex; }
  .repas-grille--kid { display: grid; }
}
.meals-table-wrap { width: 100%; max-width: 960px; margin-inline: auto; margin-top: var(--space-4); }
.meals-day-cell { display: inline-flex; align-items: center; gap: var(--space-2); }

/* ===== PLA-WEB-004, lot 9 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Administration (ENV-MAQ-105) : placement seulement. */
.admin-entry-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: var(--space-4);
}
.admin-entry-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 440px;
}
.admin-entry-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.admin-password-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.admin-password-row .cf-field__input {
  flex: 1;
}
.admin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.admin-timer-wrap,
.admin-timer-text {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.admin-sheet-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.admin-comptes-split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-4);
  align-items: start;
}
.admin-compte-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.admin-form-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}
.admin-page-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}
.admin .cf-sidenav__item { min-height: 44px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-sheet__meta { margin: var(--space-2) 0; }

/* L'attribut `hidden` doit toujours gagner sur les `display` des composants (cf-field, cf-otp…). */
[hidden] { display: none !important; }

/* ----- Administration : supervision (ENV-MAQ-104) : placement seulement. ----- */
.only-wide { display: none; }
@media (min-width: 780px) { .only-wide { display: block; } .only-narrow { display: none; } }
.admin-page { max-width: 1100px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-message:empty { display: none; }
.admin-block-stack { display: flex; flex-direction: column; gap: var(--space-4); }

.admin-grille { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }
.admin-grille--2 { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }
.admin-grille--3 { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 780px) {
  .admin-grille--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grille--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1060px) {
  .admin-grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.admin-block { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.admin-more { font-size: 13px; line-height: 18px; }
.admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.admin-list__item { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.admin-list__item:first-child { border-top: 0; }
.admin-list__item--between { justify-content: space-between; }
.admin-list__text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.is-muted { color: var(--ink-muted); }

.admin-link { align-self: flex-start; }
.cf-table-wrap .is-muted { color: var(--ink-muted); }
.admin-loadable .loading { padding: var(--space-4); text-align: left; }
.cf-card__head { gap: var(--space-3); }

.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }

.admin-accordion { overflow: hidden; }
.admin-accordion-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); cursor: pointer; }
.admin-accordion-title { display: flex; align-items: center; gap: var(--space-2); }
.admin-accordion-meta { display: flex; align-items: center; gap: var(--space-2); }
.admin-accordion[open] > summary svg { transform: rotate(180deg); }

.admin-sub-accordion { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.admin-sub-accordion-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); cursor: pointer; }
.admin-sub-accordion-title { display: flex; align-items: center; gap: var(--space-2); }
.admin-sub-accordion-meta { display: flex; align-items: center; gap: var(--space-2); }
.admin-sub-accordion[open] > summary svg { transform: rotate(180deg); }

.admin-dep-box { margin-top: var(--space-2); padding: var(--space-2); background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; }
.admin-dep-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.admin-dep-list { margin: 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }

/* --- Comptes, sessions, bloqués et journal d'audit (tâche 44) --- */
.admin-person { display: inline-flex; align-items: center; gap: var(--space-3); min-width: 0; }
.admin-person__sub { color: var(--ink-muted); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.admin-me { margin-left: var(--space-2); }
.admin-form { display: flex; flex-direction: column; gap: var(--space-4); }
.admin-zone { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.admin-zone__title { margin: 0; font: 600 14px/20px var(--font-sans); }
.admin-filters { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
.admin-filters > * { min-width: 0; }
.admin-filters .cf-field__input { width: 100%; box-sizing: border-box; min-width: 0; }
@media (min-width: 780px) { .admin-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1060px) { .admin-filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); } }

.admin-entry { align-items: flex-start; }
.admin-entry__time { flex: none; min-width: 48px; font-variant-numeric: tabular-nums; color: var(--ink-muted); }

/* Sauvegardes, restauration, alertes (tâche 45) : mise en page seulement, les composants sont ceux de la charte. */
.admin-form-wrap { display: flex; flex-direction: column; gap: var(--space-3); }

.admin-task { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.admin-task:first-child { border-top: 0; padding-top: 0; }
.admin-task__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.admin-task__detail { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.admin-task__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.admin-alert { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-alert__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.admin-alert__body { display: flex; flex-direction: column; gap: var(--space-1); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.admin-rule { text-align: left; height: auto; min-height: 44px; white-space: normal; }
.admin-procedure { max-height: 85vh; overflow: auto; text-align: left; }

.admin-plain-list { margin: 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); font-size: 14px; line-height: 20px; }
.admin-code { min-height: 0; resize: none; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13px; line-height: 18px; }

/* ===== PLA-WEB-004, lot 8 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Médiathèque (ENV-MAQ-101) : placement seulement ; accueil et envoi viennent de la charte (SectionHead, TypeCard, KidTile, ResumeRow, Coverflow, Gauge, DropZone, UploadList, AiDraft, ChoiceCard). */
.media-accueil { display: flex; flex-direction: column; gap: var(--space-4); }
.media-recherche { width: 100%; box-sizing: border-box; }
.media-menu-ancre { position: relative; }
.media-menu-ancre > .cf-menu { position: absolute; top: calc(100% + var(--space-1)); right: 0; z-index: 20; width: min(320px, calc(100vw - 2 * var(--space-4))); }
.media-section, .media-souvenirs { display: flex; flex-direction: column; gap: var(--space-3); margin-top: 0; }
.media-reprendre { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); overflow-x: auto; padding-block: var(--space-1); }
.media-souvenirs-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.media-souvenir { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.media-souvenir .cf-thumb { width: 72px; flex: none; }
.media-souvenir-texte { display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 768px) {
  .media-recherche { max-width: 480px; }
}
@media (min-width: 1200px) {
  .media-types.cf-typecards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Musique (ENV-MAQ-102) : placement seulement ; les écrans viennent de la charte (SectionHead, Tabs, Coverflow, Carousel, CollectionTile, MediaRow, TrackList, DetailHero, Player, MiniPlayer, Dialog, Sheet, Menu). */
.musique-ecran, .musique-fiche, .musique-lecteur { display: flex; flex-direction: column; gap: var(--space-4); max-width: 1100px; }
.musique-section { display: flex; flex-direction: column; gap: var(--space-3); }
.musique-defile { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 150px; overflow-x: auto; padding-block: var(--space-1); }
.musique-collections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.musique-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.musique-menu-ancre { position: relative; }
.musique-menu-flottant { position: absolute; top: calc(100% + var(--space-1)); left: 0; right: auto; z-index: 20; min-width: min(260px, calc(100vw - 2 * var(--space-4))); }
.musique-menu-flottant[hidden] { display: none; }
.musique-menu-filtre { left: 0; right: auto; }
.musique-menu-tri { right: 0; left: auto; }
.musique-choix-listes { display: flex; flex-direction: column; gap: var(--space-2); }
.musique-pochette-choix { display: flex; align-items: center; gap: var(--space-4); }
.musique-edit { max-width: 580px; max-height: calc(100vh - 40px); overflow-y: auto; }
.musique-edit-panneau { display: flex; flex-direction: column; gap: var(--space-4); }
.musique-edit-panneau[hidden] { display: none; }
.musique-edit-cover-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-2) var(--space-3); background: var(--surface-2); border-radius: var(--radius-md); }
.musique-edit-cover-info { display: flex; flex-direction: column; gap: var(--space-2); }
.musique-edit-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.musique-edit-grille .musique-edit-plein { grid-column: 1 / -1; }
.musique-notice { position: fixed; left: 50%; bottom: var(--space-6); z-index: 60; transform: translateX(-50%); }
.musique-fiche-corps { display: flex; flex-direction: column; gap: var(--space-4); }
.musique-fiche-contenu { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.musique-lecteur-pochette { display: flex; justify-content: center; }
/* Favoris de la musique (MED-MUS-007) : placement du cœur du titre en cours (lecteur et mini-lecteur large). */
/* Tuile « Mes favoris » vide (MED-MUS-007) : l'icône cœur au centre, deux fois plus grande que celle de charte (40 px). */
.cf-mosaic.is-empty.musique-favoris-vide { grid-template-rows: 1fr; }
.cf-mosaic.is-empty.musique-favoris-vide svg { width: 80px; height: 80px; }
.musique-coeur { display: inline-flex; align-items: center; justify-content: center; }
.musique-lecteur .musique-coeur { align-self: center; }
.musique-edit-fiche, .musique-dialog-fusion { max-width: 580px; width: 100%; }
.musique-dialog-corps { display: flex; flex-direction: column; gap: var(--space-4); margin-block: var(--space-4); max-height: calc(80vh - 120px); overflow-y: auto; padding-inline: 1px; }
.musique-fusion-cibles { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-2); }
.musique-fusion-schema { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.musique-fusion-sens { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.musique-fusion-boite { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.musique-fusion-fleche { font-size: 1.5rem; color: var(--ink-muted); flex: none; }
.musique-fusion-sous-texte { font: var(--type-small); color: var(--ink-muted); }
.musique-fusion-points { display: flex; flex-direction: column; gap: var(--space-2); padding-left: 0; margin: 0; list-style: none; font: var(--type-small); }
.musique-fusion-points li { display: flex; align-items: flex-start; gap: var(--space-2); }
.musique-fusion-points svg { width: 16px; height: 16px; flex: none; color: var(--accent); margin-top: 2px; }
@media (max-width: 500px) {
  .musique-fusion-sens { flex-direction: column; align-items: stretch; }
  .musique-fusion-fleche { align-self: center; transform: rotate(90deg); }
}
.musique-artistes-liste { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); margin-bottom: var(--space-2); }
.musique-artiste-ordonne { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.musique-artiste-info { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.musique-artiste-actions { display: flex; align-items: center; gap: var(--space-1); flex: none; }
.musique-fiche-selectionnee { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.draft-track-artists { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.draft-artist-chip { display: inline-flex; align-items: center; gap: var(--space-2); }
.draft-artist-remove { display: inline-flex; align-items: center; justify-content: center; background: none; border: none; padding: 0; cursor: pointer; color: var(--ink-muted); }
.draft-artist-remove:hover { color: var(--ink); }
.draft-artist-remove svg { width: 14px; height: 14px; }
@media (min-width: 768px) {
  .musique-collections { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .musique-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .musique-collections { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .musique-grille { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .musique-fiche-corps { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .musique-lecteur .cf-player { grid-template-columns: minmax(0, 1fr) 380px; }
  .musique-fiche-corps > .cf-hero { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767px) {
  .musique-edit-grille { grid-template-columns: minmax(0, 1fr); }
}

/* Lecture (ENV-MAQ-103) : placement seulement ; les écrans viennent de la charte (SectionHead, Tabs, Coverflow, Carousel, CollectionTile, MediaGrid, MediaRow, DetailHero, ChapterList, Reader, Popover, Dialog, Sheet).
   La page lue (BD, EPUB, PDF : `reader-comic-page`, `reader-epub-page`, `reader-pdf-page`, `comic-*`, `epub-*`, `pdf-*`) reste une zone propre : couleurs en jetons seulement. */
.lecture-ecran, .lecture-fiche { display: flex; flex-direction: column; gap: var(--space-4); max-width: 1100px; }
.lecture-section { display: flex; flex-direction: column; gap: var(--space-3); }
.lecture-reprendre { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); overflow-x: auto; padding-block: var(--space-1); }
.lecture-collections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lecture-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lecture-livres { display: flex; flex-direction: column; gap: var(--space-3); }
.lecture-fiche-corps { display: flex; flex-direction: column; gap: var(--space-4); }
.lecture-fiche-contenu { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.lecture-choix-piles { display: flex; flex-direction: column; gap: var(--space-2); }
.lecture-nouvelle-pile { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.lecture-nouvelle-pile .cf-field__input { flex: 1; min-width: 160px; }
.lecture-edition { max-width: 640px; max-height: calc(100vh - 40px); overflow-y: auto; }
.lecture-edition-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }
.lecture-apercu-couverture { display: flex; flex: none; }
.lecture-apercu-couverture .cf-cover { width: 72px; }
.lecture-liseuse { position: fixed; z-index: 1000; }
.lecture-liseuse .cf-reader__stage { padding: 0; }
.lecture-liseuse-page { position: relative; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; overflow: hidden; width: 100%; height: 100%; }
.lecture-tiroir-entete { display: flex; align-items: center; gap: var(--space-2); }
.lecture-tiroir-entete .cf-tabs { flex: 1; min-width: 0; }
.lecture-tiroir-contenu { display: flex; flex-direction: column; gap: var(--space-3); }
.lecture-signet { display: flex; align-items: center; gap: var(--space-1); }
.lecture-signet .cf-chapter { flex: 1; min-width: 0; }
.lecture-reglages { position: absolute; top: 72px; right: var(--space-4); z-index: 8; width: 320px; max-width: calc(100% - 2 * var(--space-4)); display: flex; flex-direction: column; gap: var(--space-3); }
@media (min-width: 768px) {
  .lecture-collections { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lecture-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .lecture-collections { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lecture-grille { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lecture-fiche-corps { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .lecture-fiche-corps > .cf-hero { flex-direction: column; align-items: flex-start; }
}

/* Mini-lecteur de la musique (ENV-MAQ-102) : placement seulement. Hors de #app (mini-player.js) : la lecture continue d'un écran à l'autre.
   Limite de 780 px, celle de la coquille : en dessous, en haut ; à partir de 780 px, en bas, à droite de la barre latérale.
   `body.has-mini` : la place est affichée (gardée : réserve de place posée sur le corps, aucun style visuel). */
:root { --mini-h: 56px; }
.musique-mini-hote { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; box-sizing: border-box; min-height: var(--mini-h); }
.musique-mini-hote[hidden] { display: none; }
@media (max-width: 779px) {
  /* Au-dessus des barres collées en haut (4 et 5), sous les fenêtres (10) et le bandeau (50). */
  body.has-mini .cf-topbar { top: var(--mini-h); }
  /* Q1 : le bandeau de maintenance défile avec la page, le mini-lecteur reste collé en haut. */
  body.has-mini .maintenance-host { position: static; }
}
@media (min-width: 780px) {
  :root { --mini-h: 72px; }
  .musique-mini-hote { position: fixed; top: auto; left: 240px; right: 0; bottom: 0; z-index: 5; }
  body.has-mini .app__main { padding-bottom: calc(var(--space-8) + var(--mini-h)); }
  body.has-mini .notes-fab, body.has-mini .taches-fab { bottom: calc(var(--space-6) + var(--mini-h)); }
  body.has-mini .notes-save-bar, body.has-mini .notes-composer-fixed { bottom: var(--mini-h); }
  body.has-mini #envoi { bottom: calc(var(--space-4) + var(--mini-h)); }
  body.has-mini #envoi .cf-updock__panel { max-height: calc(100vh - 2 * var(--space-4) - var(--mini-h)); }
}
@media (min-width: 980px) {
  body.has-mini .tasks-pane { max-height: calc(100vh - 3rem - var(--mini-h)); }
}
@media (min-width: 1060px) {
  body.has-mini .notes-pane, body.has-mini .agenda-detail-pane { max-height: calc(100vh - 3rem - var(--mini-h)); }
}

/* En-têtes de second niveau (ENV-MAQ-102 et 103) : la TopBar sur téléphone et tablette, le SectionHead sur ordinateur. */
.musique-entete-ordi, .lecture-entete-ordi { display: none; }
@media (min-width: 1200px) {
  .musique-entete-tel, .lecture-entete-tel { display: none; }
  .musique-entete-ordi, .lecture-entete-ordi { display: flex; }
}

/* ===== PLA-WEB-004 : règles du prototype pour les classes des écrans portés (purger-css.py). ===== */
.cf-track__fav { justify-self: end; width: 32px; height: 32px; color: var(--ink-muted); opacity: 0.4; transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; cursor: pointer; border-radius: var(--radius-full, 9999px); }
.cf-track:hover .cf-track__fav, .cf-track__fav:focus-visible { opacity: 1; }
.cf-track__fav.is-favorite { opacity: 0.88; color: var(--member-rose, #d84b7f); }
.cf-track__fav.is-favorite svg path { fill: currentColor; }
.cf-track__fav:hover { transform: scale(1.15); opacity: 1; }
.cf-cover { position: relative; }
.cf-media:hover .cf-cover__fav, .cf-cover:hover .cf-cover__fav, .cf-cover__fav:focus-visible { opacity: 1; }
.cf-cover__fav.is-favorite { opacity: 1; color: var(--member-rose, #ec7fa6); background: rgba(0, 0, 0, 0.55); border: 1.5px solid rgba(255, 255, 255, 0.35); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3); }
.cf-cover__fav.is-favorite svg { stroke: currentColor; }
.cf-cover__fav.is-favorite svg path { fill: currentColor; }
.musique-mini { width: 100%; display: flex; align-items: center; }
.musique-mini > .cf-mini { flex: 1; min-width: 0; margin: 0; }
.musique-mini > .cf-minibar { flex: 1; min-width: 0; }
.musique-mini-message { position: absolute; right: var(--space-4); }
.musique-mini-message:empty { display: none; }
@media (max-width: 779px) {
  .musique-mini .musique-mini-large { display: none; }
}
@media (min-width: 780px) {
  .musique-mini .musique-mini-etroit { display: none; }
}
@media (max-width: 779px) {
.cf-track { grid-template-columns: 24px minmax(0, 1fr) 28px 40px 32px; gap: var(--space-1); padding-left: 6px; }
}

/* ===== PLA-WEB-004, lot 7 : Santé, blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* ==========================================================================
   Santé (ENV-MAQ-100) : placement seulement.
   Zones propres conservées : health-rx-sheet*, health-diopter-*, health-svg-chart-wrap
   ========================================================================== */

.sante-grille {
  columns: 1;
  gap: var(--space-4);
}

.sante-grille > * {
  break-inside: avoid;
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .sante-grille {
    columns: 2;
  }
}

@media (min-width: 1200px) {
  .sante-grille {
    columns: 3;
  }
}

.sante-champs {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

@media (min-width: 768px) {
  .sante-champs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
}

.sante-champs--3 {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

@media (min-width: 768px) {
  .sante-champs--3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-3);
  }
}

.sante-head-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.sante-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.sante-dialog-large {
  max-width: 720px;
  width: 90vw;
}

.sante-tabs-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-4);
}

@media (max-width: 767px) {
  .sante-vaccines-table {
    display: none;
  }
  .sante-vaccines-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }
}

@media (min-width: 768px) {
  .sante-vaccines-cards {
    display: none;
  }
  .sante-vaccines-table {
    display: block;
  }
}

/* Zone propre ZON-005 : Courbe de poids SVG */
.health-svg-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.health-weight-svg {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
}

/* Zone propre ECR-042 : Correction dioptrique ophtalmo */
.health-diopter-section {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: 4px;
  border: 1px solid var(--border);
}

.health-diopter-section-title {
  margin: 0 0 var(--space-2) 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

.health-diopter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.health-diopter-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.health-diopter-eye-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.health-diopter-eye {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.health-diopter-main-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.health-diopter-eye-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}

/* Santé (lot 7) : remplace les attributs style="" du prototype (interdits par la CSP du client). */
.sante-secu { margin-top: var(--space-3); }
.sante-periode { margin-bottom: var(--space-4); }
.sante-oeil { margin: var(--space-3) 0; }

/* ===== PLA-WEB-004, lot 10 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Photos et vidéos (MED-PHO-004 / ENV-MAQ-126) : placement seulement. */
.photos-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.photos-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.photos-entete-tel {
  display: flex;
}

.photos-entete-ordi {
  display: none;
}

.photos-albums-grille {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.photos-grille {
  display: grid;
  grid-template-columns: repeat(var(--timeline-cols, 4), minmax(0, 1fr));
  gap: var(--space-2);
}

.cf-timeline__grid {
  grid-template-columns: repeat(var(--timeline-cols, 8), minmax(0, 1fr)) !important;
}

@media (max-width: 779px) {
  .cf-timeline__grid {
    grid-template-columns: repeat(var(--timeline-cols, 4), minmax(0, 1fr)) !important;
  }
  .photos-grille {
    grid-template-columns: repeat(var(--timeline-cols, 3), minmax(0, 1fr));
  }
  .cf-timeline[style*="--timeline-cols: 8"] .photos-thumb-menu,
  .cf-timeline[style*="--timeline-cols:8"] .photos-thumb-menu {
    display: none;
  }
}

.photos-toolbar-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.photos-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex: none;
}

.photos-cols-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.photos-cols-label {
  font-weight: 600;
  font-size: 13px;
}

.photos-thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.photos-thumb {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  background: transparent;
  display: grid;
  place-items: center;
}

.photos-thumb-menu {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  z-index: 1;
}

.photos-select-btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.photos-thumb-wrap.is-selectable,
.photos-card-wrap.is-selectable {
  cursor: pointer;
  user-select: none;
}

.photos-thumb-check {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 2;
  width: 26px;
  height: 26px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid #fff;
  border-radius: var(--radius-full);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}

.photos-thumb-check.is-checked,
.photos-thumb-wrap.is-selected .photos-thumb-check,
.photos-card-wrap.is-selected .photos-thumb-check {
  background: var(--accent) !important;
  border-color: #fff !important;
  color: #fff !important;
}

.photos-thumb-check svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  stroke-width: 3;
}

.photos-thumb-wrap.is-selected .photos-thumb,
.photos-card-wrap.is-selected .photos-thumb {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: var(--radius-sm);
}

/* Visionneuse plein écran médias (photos et vidéos) */
.cf-viewer__stage {
  padding: 56px var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.cf-viewer__media {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: calc(100vh - 120px);
  aspect-ratio: auto;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
}

.cf-viewer__media > img,
.cf-viewer__media > video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  outline: none;
}

.cf-viewer__media > video {
  background: #000;
}

.photos-selection-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-3);
}

@media (min-width: 900px) {
  .photos-selection-bar {
    left: 240px;
  }
}

body.has-mini .photos-selection-bar {
  bottom: var(--mini-h);
}

.photos-selection-count {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
}

.photos-selection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.photos-dock-new-album-btn {
  margin-top: var(--space-2);
}

.photos-more-action {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-6) 0 var(--space-8);
}

.photos-more-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
}

.photos-card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.photos-card-menu {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  z-index: 1;
}

.photos-album-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.photos-choix-albums {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 240px;
  overflow-y: auto;
}

.photos-widget-bande {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.photos-widget-bande .cf-thumb {
  width: 56px;
  height: 56px;
  flex: none;
}

@media (min-width: 768px) {
  .photos-albums-grille {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .photos-grille {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
  }
}

@media (min-width: 1200px) {
  .photos-entete-tel {
    display: none;
  }

  .photos-entete-ordi {
    display: flex;
  }

  .photos-albums-grille {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .photos-grille {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-4);
  }
}

/* Corbeille musique et suivi des envois (ENV-MAQ-110) : placement seulement. */
.music-trash-page,
.media-uploads-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.music-trash-entete-tel,
.media-uploads-entete-tel {
  display: flex;
}

.music-trash-entete-ordi,
.media-uploads-entete-ordi {
  display: none;
}

.music-trash-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.music-trash-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.music-trash-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.music-trash-group-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.music-trash-group-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.music-trash-album-title {
  margin: 0;
}

.music-trash-album-sub {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.media-uploads-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.media-uploads-switch {
  display: flex;
}

.media-uploads-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: var(--space-1);
}

.media-uploads-row-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.media-uploads-row-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.media-uploads-progress {
  max-width: 320px;
}

@media (min-width: 1200px) {
  .music-trash-entete-tel,
  .media-uploads-entete-tel {
    display: none;
  }

  .music-trash-entete-ordi,
  .media-uploads-entete-ordi {
    display: flex;
  }

  .media-uploads-actions {
    display: none;
  }
}

/* Classes d'administration pour respecter la CSP sans style en ligne */
.admin-actions--spaced {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}
.admin-actions--bottom {
  margin-bottom: var(--space-3);
}
.admin-actions--spaced-top {
  margin-top: var(--space-4);
}
.admin-tag-inline {
  margin-left: 6px;
}
.admin-chips-spaced {
  margin: var(--space-3) 0;
}

/* Widgets Agenda : styles sans attributs style en ligne */
.cf-widget__event--busy {
  width: 100%;
  border-width: 1px 0 0;
  border-style: solid;
  border-color: var(--border);
  background: none;
  color: var(--ink-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cf-widget__event-title--regular {
  font-weight: 400;
}
.cf-widget__event-title--cancelled {
  color: var(--ink-muted);
  text-decoration: line-through;
}
.agenda-todo-link {
  color: inherit;
  text-decoration: none;
}
.agenda-todo-extra {
  color: var(--accent);
  text-decoration: none;
}
.agenda-todo-content {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cf-widget__body--column {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cf-widget__body--spaced {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cf-widget__cover--column {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}
.agenda-cover-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-cover-subtitle {
  font-weight: 600;
}
.admin-item-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.admin-item-body {
  flex: 1;
  min-width: 0;
}
.admin-item-label {
  display: block;
}
.admin-item-sub {
  font-size: 13px;
  color: var(--ink-muted);
}
.admin-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
}
.admin-stat-row--border {
  border-bottom: 1px solid var(--border);
}
.admin-history-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.admin-history-meta {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.admin-flex-1 {
  flex: 1;
  min-width: 0;
}
.admin-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.admin-tag-inline {
  margin-left: 6px;
}
.admin-chips {
  margin: var(--space-3) 0;
}
.admin-disk-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.admin-restore-list {
  list-style: disc;
  padding-left: 20px;
  margin: var(--space-2) 0;
}
.admin-restore-tick {
  margin: var(--space-3) 0;
}

/* Agenda : conformité CSP sans styles inline */
.agenda-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}
.agenda-detail-desc {
  margin: var(--space-2) 0;
  font: var(--type-body);
}
.agenda-detail-next {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.agenda-infoline-link {
  color: inherit;
  text-decoration: none;
}
.agenda-infoline-label {
  flex: 1;
}
.agenda-actionbar-end {
  justify-content: flex-end;
}
.agenda-form-custom-add {
  align-self: end;
}
.agenda-field-mt {
  margin-top: var(--space-2);
}
.agenda-kidweek-cancelled {
  text-decoration: line-through;
}
.agenda-kidweek-empty {
  margin: 0;
  font-size: 17px;
  line-height: 24px;
  font-weight: 700;
}
.agenda-btn-kid-block {
  align-self: stretch;
  justify-content: center;
  text-decoration: none;
}
.agenda-kidsoon-heading {
  margin: 0;
  font: 700 22px/28px var(--font-kid-fun);
  color: var(--ink);
}
.agenda-month-dialog-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.agenda-vacations__empty {
  padding: var(--space-4);
}
.agenda-block-meta-block {
  display: block;
}
.agenda-vacations__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.admin-restore-loss-item {
  padding: 2px 0;
}
.admin-restore-losses {
  list-style: disc;
  padding-left: 20px;
  margin: var(--space-2) 0;
}
.admin-restore-checkrow {
  margin: var(--space-3) 0;
}
.admin-restore-actions {
  margin-top: var(--space-4);
}
.admin-restore-step-status {
  margin-left: 8px;
}

/* Module Actualités (LOI-ACT-001a / ENV-MAQ-113) */
.news-catalogue,
.news-section,
.news-detail-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.news-grid-collections {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.news-search-wrap {
  flex: 1;
}

.news-card-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  position: relative;
}

.news-card-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  display: block;
}

.news-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card-banner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, var(--surface-2)), var(--surface-2));
  color: var(--ink-muted);
  position: relative;
  padding: var(--space-2);
  box-sizing: border-box;
}

.news-card-banner svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.news-card-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  font-size: 11px;
  padding: 2px 6px;
  pointer-events: none;
}

.news-detail-hero {
  width: 100%;
  max-height: 360px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-3);
  background: var(--surface-2);
}

.news-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.news-detail-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.news-detail-quote {
  border-left: 3px solid var(--accent, #3b82f6);
  padding-left: var(--space-3);
  margin: var(--space-2) 0;
  font-style: italic;
  color: var(--ink-muted);
}

.news-detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.news-sources-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Module « Le savais-tu ? » et sas parental (LOI-ACT-001b / ENV-MAQ-113) */
.dyk-inbox-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.dyk-archives-list,
.dyk-queue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--space-3);
}

@media (max-width: 480px) {
  .dyk-archives-list,
  .dyk-queue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.dyk-hero-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.dyk-question-box {
  padding: var(--space-3);
  margin: var(--space-3) 0 0;
  background: var(--surface-2, rgba(0, 0, 0, 0.03));
  border-radius: var(--radius-md, 8px);
}

.dyk-kid-content {
  font-size: 1.15rem;
  line-height: 1.6;
  margin: var(--space-3) 0;
}

.dyk-answer-text {
  padding: var(--space-3);
  font-weight: 500;
  color: var(--ink);
}

.dyk-widget-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dyk-widget-title {
  font-weight: 600;
  line-height: 1.3;
}

.dyk-widget-question {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-muted);
  margin-top: var(--space-1);
}

.dyk-widget-sub {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.dyk-card-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--surface-2);
}

.dyk-card-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.dyk-card-actions-row .cf-btn {
  flex: 1;
  min-width: 140px;
  justify-content: center;
}

.dyk-card-actions .cf-btn.is-assigned {
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  color: var(--ink-muted);
  cursor: default;
}

.dyk-queue-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.dyk-child-switch {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(110px, 1fr);
  max-width: 100%;
}

@media (max-width: 600px) {
  .dyk-queue-head {
    flex-direction: column;
    align-items: stretch;
  }
  .dyk-child-switch {
    width: 100%;
  }
}

.dyk-chip-alert {
  color: var(--warning);
  font-weight: bold;
}

.dyk-widget-alert {
  display: inline-block;
  margin-top: var(--space-1);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--warning);
  text-decoration: none;
}

.dyk-widget-alert:hover {
  text-decoration: underline;
}

.dyk-queue-section > .cf-alert {
  margin-bottom: var(--space-3);
}

.dyk-card-trash {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 3;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

.dyk-card-trash:hover {
  background: var(--danger);
  color: var(--on-accent, #ffffff);
  border-color: var(--danger);
  transform: scale(1.08);
}

.dyk-card-trash svg {
  width: 18px;
  height: 18px;
}

.dyk-card-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  display: block;
}

.dyk-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dyk-card-banner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, var(--surface-2)), var(--surface-2));
  color: var(--ink-muted);
  position: relative;
  padding: var(--space-2);
  box-sizing: border-box;
}

.dyk-card-banner[data-theme="Espace"] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, var(--surface-2)), var(--surface-2));
}

.dyk-card-banner[data-theme="Nature"] {
  background: linear-gradient(135deg, color-mix(in srgb, #22c55e 20%, var(--surface-2)), var(--surface-2));
}

.dyk-card-banner[data-theme="Histoire"] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 20%, var(--surface-2)), var(--surface-2));
}

.dyk-card-banner[data-theme="Animaux"] {
  background: linear-gradient(135deg, color-mix(in srgb, #f43f5e 20%, var(--surface-2)), var(--surface-2));
}

.dyk-card-banner[data-theme="Sciences"] {
  background: linear-gradient(135deg, color-mix(in srgb, #06b6d4 20%, var(--surface-2)), var(--surface-2));
}

.dyk-card-banner[data-theme="Inventions"] {
  background: linear-gradient(135deg, color-mix(in srgb, #eab308 20%, var(--surface-2)), var(--surface-2));
}

.dyk-card-banner svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.dyk-card-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  font-size: 11px;
  padding: 2px 6px;
  pointer-events: none;
}

.dyk-detail-hero {
  width: 100%;
  max-height: 360px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-3);
  background: var(--surface-2);
}

.dyk-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dyk-suggest-box {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dyk-suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.dyk-suggest-card {
  border: 1px solid var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease;
}

.dyk-suggest-card:hover {
  border-color: var(--accent);
}

.dyk-suggest-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.dyk-suggest-card span {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
}

/* ==========================================================================
   Coloriages et planches à imprimer (ENF-COL-001)
   ========================================================================== */

.coloring-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
  .coloring-hero {
    flex-direction: row;
    align-items: center;
  }
}

.coloring-hero__preview {
  flex: 0 0 200px;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.coloring-hero__preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.coloring-hero__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.coloring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

@media (min-width: 768px) {
  .coloring-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: var(--space-4);
  }
}

.coloring-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.coloring-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--accent);
}

.coloring-card__img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.coloring-card__img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.coloring-card__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 var(--space-1) 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coloring-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

/* Zone d'aperçu pour impression dans la modale / sheet */
.coloring-print-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  max-height: 55vh;
  overflow: hidden;
  margin: var(--space-3) 0;
}

.coloring-print-frame img {
  max-width: 100%;
  max-height: 48vh;
  object-fit: contain;
  filter: contrast(110%);
}

.coloring-print-cartel {
  display: none;
}

/* Widget Coloriage du jour */
.coloring-widget-content {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  cursor: pointer;
}

.coloring-widget-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.coloring-widget-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.coloring-widget-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.coloring-widget-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Impression papier A4 épurée (@media print) */
@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body, html {
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Masquer coquille applicative, barres d'outils, boutons et modales d'arrière-plan */
  body > *:not(.cf-layer):not(#layers) {
    display: none !important;
  }

  .cf-shell,
  .cf-topbar,
  .cf-topbar--kid,
  .cf-pagehead,
  .cf-toolbar,
  .cf-dialog__actions,
  .cf-sheet__grip,
  .cf-modal__overlay,
  .cf-btn,
  .cf-drop,
  .cf-chips {
    display: none !important;
  }

  /* Dans la boîte de dialogue, masquer tout sauf la zone d'impression */
  .cf-dialog > *:not(.coloring-print-area),
  .cf-sheet > *:not(.coloring-print-area) {
    display: none !important;
  }

  .cf-dialog,
  .cf-sheet {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Afficher uniquement la zone de dessin calibrée A4 sans débordement */
  .coloring-print-area {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: static !important;
    width: 100% !important;
    max-height: calc(100vh - 20mm) !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    overflow: hidden !important;
  }

  .coloring-print-frame {
    border: none !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    max-height: calc(100vh - 35mm) !important;
    height: auto !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .coloring-print-frame img {
    max-height: calc(100vh - 38mm) !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .coloring-print-cartel {
    display: flex !important;
    flex-shrink: 0 !important;
    justify-content: space-between !important;
    font-size: 10pt;
    font-family: inherit;
    border-top: 1px solid #333333;
    padding-top: 4mm;
    margin-top: 2mm;
    color: #000000 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

/* ==========================================================================
   MUSÉE NUMÉRIQUE DES DESSINS D'ENFANTS (ENF-COL, tâche ENF-COL-002 / ENV-MAQ-073)
   Galerie d'art, passe-partout virtuel, cartel d'exposition et cadre photo
   ========================================================================== */

.drawings-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-8);
}

.drawing-tabs {
  margin-bottom: var(--space-2);
}

.drawing-kid-nav {
  margin-bottom: var(--space-2);
}

.drawing-filters-slot {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.drawing-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.drawing-kid-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Grille des créations */
.drawing-grid-wrap {
  width: 100%;
}

.drawings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.drawing-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: transform var(--speed-normal) ease, box-shadow var(--speed-normal) ease;
}

.drawing-card:hover {
  transform: translateY(-2px);
}

/* Passe-partout et cadre virtuel */
.drawing-card-frame {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  overflow: hidden;
  box-shadow: inset 0 0 0 4px var(--bg-surface), inset 0 0 0 5px var(--border-subtle);
}

.drawing-card-frame svg,
.drawing-card-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.drawing-card-fav {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: color var(--speed-fast) ease, transform var(--speed-fast) ease;
  z-index: 2;
}

.drawing-card-fav svg {
  width: 18px;
  height: 18px;
}

.drawing-card-fav:hover {
  color: var(--text-primary);
  transform: scale(1.08);
}

.drawing-card-fav:active {
  transform: scale(0.92);
}

.drawing-card-fav[aria-pressed="true"] {
  color: var(--danger);
}

.drawing-card-fav[aria-pressed="true"] svg {
  fill: currentColor;
}

/* Carrousel des favoris (Coverflow médiathèque) */
.drawing-favorites-wrap {
  width: 100%;
}

.drawing-favorites-section {
  width: 100%;
  margin-bottom: var(--space-6);
}

.drawing-coverflow-visual {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2, #fdfbf7);
  padding: 8px;
  overflow: hidden;
}

.drawing-coverflow-visual svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  border-radius: 2px;
}

.drawing-coverflow-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawing-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drawing-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: auto;
}

.drawing-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8);
  text-align: center;
  color: var(--text-secondary);
}

/* Dialogue Cartel de musée */
.drawing-dialog-detail {
  max-width: 680px;
  width: 100%;
}

.drawing-sheet-detail {
  max-height: 90vh;
  overflow-y: auto;
}

.drawing-modal-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.drawing-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.drawing-artwork-frame {
  width: 100%;
  min-height: 280px;
  max-height: 440px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  overflow: hidden;
  box-shadow: inset 0 0 0 10px var(--bg-surface), inset 0 0 0 12px var(--border-subtle);
}

.drawing-artwork-frame svg,
.drawing-artwork-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.drawing-cartel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.drawing-cartel--kid {
  border: 2px dashed var(--kid-primary);
  background: var(--kid-paper);
}

.drawing-cartel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.drawing-cartel__artist {
  font-size: var(--text-md);
  color: var(--text-primary);
}

.drawing-cartel__date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.drawing-cartel__anecdote {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--accent);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.drawing-cartel__tech {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 0;
}

.drawing-modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

@media (min-width: 768px) {
  .drawing-modal-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* Dialogue d'ajout */
.drawing-dialog-upload {
  max-width: 600px;
  width: 100%;
}

.drawing-sheet-upload {
  max-height: 90vh;
  overflow-y: auto;
}

.drawing-dropzone {
  cursor: pointer;
  margin-bottom: var(--space-3);
}

.drawing-file-input {
  display: none;
}

.drawing-upload-preview {
  width: 100%;
  max-height: 140px;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  overflow: hidden;
}

.drawing-upload-preview svg,
.drawing-upload-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.drawing-img-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.drawing-placeholder-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.drawing-upload-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.drawing-upload-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .drawing-upload-row {
    grid-template-columns: 1fr 1fr;
  }
}

.drawing-checkrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
  margin-top: var(--space-2);
}

/* Widget accueil */
.drawing-widget-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
}

.drawing-widget-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

.drawing-widget-thumb svg,
.drawing-widget-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.drawing-widget-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.drawing-widget-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawing-widget-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Impression A4 du cartel et de l'œuvre */
@media print {
  .drawing-print-page {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100vh !important;
    width: 100% !important;
    padding: 10mm !important;
    box-sizing: border-box !important;
  }

  .drawing-print-visual {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-height: 75vh !important;
    width: 100% !important;
  }

  .drawing-print-visual img,
  .drawing-print-visual svg {
    max-height: 72vh !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }

  .drawing-print-cartel {
    display: flex !important;
    flex-direction: column !important;
    gap: 2mm !important;
    border: 2px dashed #666666 !important;
    border-radius: 4px !important;
    padding: 4mm 6mm !important;
    margin-top: 6mm !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .drawing-print-cartel-header {
    display: flex !important;
    justify-content: space-between !important;
    font-weight: bold !important;
    font-size: 13pt !important;
  }

  .drawing-print-cartel-meta {
    font-size: 10pt !important;
    color: #444444 !important;
  }

  .drawing-print-cartel-anecdote {
    font-style: italic !important;
    font-size: 10pt !important;
    margin-top: 2mm !important;
  }
}

/* =============================================================================
   Auto-formation & Apprentissage (ENF-FOR-001 / ENV-MAQ-075)
   ============================================================================= */
:root {
  --bg-surface: var(--surface);
  --border-subtle: var(--border);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-muted);
  --text-muted: var(--ink-muted);
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --speed-fast: 0.15s;
  --speed-normal: 0.25s;
  --shadow-sm: var(--shadow-1);
  --kid-paper: var(--kid-card);
  --surface-muted: var(--surface-2);
  --kid-forest: #2DB563;
}

.md-content {
  line-height: 1.6;
}
.md-h1 {
  font-size: 22px;
  margin: var(--space-4) 0 var(--space-2);
}
.md-h2 {
  font-size: 18px;
  margin: var(--space-3) 0 var(--space-2);
}
.md-h3 {
  font-size: 16px;
  margin: var(--space-2) 0 var(--space-1);
}
.md-p {
  margin: 0 0 var(--space-3);
}
.md-ul, .md-ol {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-4);
}
.md-ul li, .md-ol li {
  margin-bottom: var(--space-1);
}
.md-quote {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-left: 4px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.learning-page {
  gap: var(--space-4);
}
.learning-tabs-slot {
  margin-bottom: var(--space-2);
}
.learning-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-muted) 100%);
  border: 2px solid var(--border);
  padding: var(--space-4);
}
.learning-hero-info {
  flex: 1;
  min-width: 0;
}
.learning-hero-title {
  margin: var(--space-1) 0;
  font-size: 20px;
}
.learning-hero-meta {
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
  font-size: 14px;
}
.learning-progress-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  max-width: 320px;
}
.learning-progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}
.learning-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.learning-kid-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.learning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.learning-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.learning-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.learning-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  border-bottom: 2px solid var(--theme-color, var(--primary));
  padding-bottom: var(--space-2);
}
.learning-card-emoji {
  font-size: 28px;
}
.learning-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.learning-card-title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  line-height: 1.3;
}
.learning-card-desc {
  flex: 1;
  margin: 0 0 var(--space-3);
  color: var(--ink-muted);
  font-size: 14px;
}
.learning-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.learning-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--ink-muted);
}
.learning-tracks-grid, .learning-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}
.learning-track-card, .learning-badge-card {
  padding: var(--space-4);
}
.learning-track-list {
  padding-left: var(--space-4);
  margin: var(--space-2) 0 0;
}
.learning-badge-icon {
  font-size: 40px;
  margin-bottom: var(--space-2);
}

.learning-reader-page {
  max-width: 840px;
  margin: 0 auto;
}
.learning-reader-head {
  margin-bottom: var(--space-4);
}
.learning-reader-head-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.learning-reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.learning-stepper {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.learning-stepper-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
}
.learning-stepper-btn.is-current {
  border-color: var(--primary);
  background: var(--surface-muted);
  font-weight: 600;
}
.learning-stepper-btn.is-done {
  border-color: var(--success, #2DB563);
}
.learning-stepper-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  font-size: 12px;
}
.learning-stepper-btn.is-done .learning-stepper-num {
  background: var(--success, #2DB563);
  color: #fff;
}
.learning-step-view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.learning-step-badge {
  color: var(--ink-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.learning-step-title {
  margin: var(--space-1) 0 0;
  font-size: 24px;
}
.learning-checkpoint-box {
  background: var(--surface-muted);
  border: 2px dashed var(--primary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
}
.learning-checkpoint-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.learning-reader-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.learning-complete-dialog {
  text-align: center;
  padding: var(--space-6);
}
.learning-complete-icon {
  font-size: 56px;
  margin-bottom: var(--space-3);
}

.learning-memo-dialog {
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.learning-memo-body {
  overflow-y: auto;
  padding: var(--space-4) 0;
}
.learning-memo-title {
  font-size: 26px;
  margin: var(--space-2) 0;
}
.learning-memo-section {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.learning-memo-materials, .learning-memo-list {
  padding-left: var(--space-4);
  margin: var(--space-2) 0;
}
.learning-gemini-box {
  background: linear-gradient(135deg, rgba(107, 70, 193, 0.08) 0%, rgba(43, 108, 176, 0.08) 100%);
  border: 1px solid rgba(107, 70, 193, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.learning-gemini-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.learning-gemini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.learning-gemini-ideas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.learning-idea-card {
  text-align: left;
  padding: var(--space-3);
  cursor: pointer;
}
.learning-dyn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2);
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
}
.learning-dyn-input-group {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.learning-step-editor-card {
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  border: 1px solid var(--border);
}
.learning-step-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.learning-widget-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  height: 100%;
}
.learning-widget-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  height: 100%;
}
.learning-widget-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.learning-widget-step {
  font-size: 12px;
  color: var(--ink-muted);
}
.learning-widget-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}
.learning-widget-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-1) 0;
}
.learning-widget-bar-fill {
  height: 100%;
  background: var(--kid-forest, #2DB563);
  border-radius: var(--radius-full);
}
.learning-widget-action {
  margin-top: auto;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

@media print {
  .learning-memo-dialog, .learning-memo-sheet {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
    display: block !important;
  }
  .learning-memo-body {
    overflow: visible !important;
    padding: 0 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }
}

/* Inventaires et Lieux (MAI-INV, ENV-MAQ-047) : placement seulement. */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .inventory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

/* ==========================================================================
   PLA-ACC-005 : Widgets raccourcis 1x1 et recherche au catalogue
   ========================================================================== */

.cf-widget--shortcut {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2);
  gap: var(--space-1);
}

.cf-widget--shortcut:hover {
  text-decoration: none;
}

.cf-widget--shortcut .cf-shortcut__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.cf-widget--shortcut .cf-shortcut__icon svg {
  width: 20px;
  height: 20px;
}

.cf-widget--shortcut .cf-shortcut__label,
.cf-widget__body--shortcut .cf-widget__name {
  font: var(--type-small);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cf-widget--kid.cf-widget--shortcut {
  background: var(--tile, var(--kid-sky));
  color: var(--kid-on-color, #ffffff);
  border: none;
}

.cf-widget--kid.cf-widget--shortcut .cf-shortcut__icon {
  background: rgba(255, 255, 255, 0.25);
  color: var(--kid-on-color, #ffffff);
}

.cf-widget--kid.cf-widget--shortcut .cf-shortcut__label {
  color: var(--kid-on-color, #ffffff);
}

.cf-widget.is-editing.cf-widget--shortcut {
  padding: var(--space-1);
}

.cf-widget.is-editing.cf-widget--shortcut .cf-widget__tools {
  width: 100%;
}

.cf-widget__body--shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  gap: var(--space-1);
  min-width: 0;
}

.cf-widget__body--shortcut .cf-shortcut__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--accent);
}

.cf-widget__body--shortcut .cf-shortcut__icon svg {
  width: 18px;
  height: 18px;
}

/* Recherche au catalogue */
.home-catalog__search-box {
  margin-bottom: var(--space-3);
}

.home-catalog__search {
  width: 100%;
  max-width: 100%;
}

.home-catalog__empty {
  text-align: center;
  padding: var(--space-4) var(--space-2);
  color: var(--ink-muted);
}

/* Gestion des modules (PLA-ACC-007) */
.modules-manage__tabs {
  width: fit-content;
  min-width: 340px;
  max-width: 100%;
  margin: var(--space-2) 0 var(--space-3);
}

.modules-manage__toolbar {
  margin: var(--space-3) 0 var(--space-2);
}

.modules-manage__quick-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.modules-manage__counter {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.modules-manage__sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cf-modules-manage__grid,
.modules-manage__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
  width: 100%;
}

.cf-module-card,
.module-card {
  padding: var(--space-3);
}

.cf-module-card__lead,
.module-card__lead {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.cf-module-card__icon,
.module-card__icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
}

.cf-module-card__icon svg,
.module-card__icon svg {
  width: 20px;
  height: 20px;
}

.cf-module-card__info,
.module-card__info {
  min-width: 0;
}

.cf-module-card__info .cf-card__title,
.module-card__info .cf-card__title {
  font: var(--type-body-strong);
  margin: 0;
}

.cf-module-card__info .cf-card__meta,
.module-card__info .cf-card__meta {
  margin: 0;
  font: var(--type-small);
  color: var(--ink-muted);
}

@media (max-width: 640px) {
  .modules-manage__toolbar .btn-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .modules-manage__family .cf-accordion__body {
    padding-left: 0;
  }
}

/* Équipements du logement, consommables et énergies (MAI-GAR-002) */
.equipements-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.equipements-head__text {
  flex: 1 1 auto;
  min-width: 0;
}

.equipements-head__actions {
  flex-shrink: 0;
}

.equipements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 600px) {
  .equipements-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .equipements-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.equipements-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Vue « À ranger » de la musique (MED-MUS-008b, planche b22, ECR-169) */
.music-tidy-page { display: flex; flex-direction: column; gap: var(--space-4); }
.music-tidy-content { display: flex; flex-direction: column; gap: var(--space-4); }
.music-tidy-filter-bar { margin-bottom: var(--space-2); }
.music-tidy-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); }
.music-tidy-left { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.music-tidy-info { min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.music-tidy-title { font: var(--type-body-strong); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-tidy-artist { font: var(--type-small); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-tidy-badges { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.music-tidy-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.music-tidy-list { display: flex; flex-direction: column; gap: var(--space-2); }
.music-tidy-duplicate-card { padding: var(--space-4); margin-bottom: var(--space-3); }
.music-tidy-dup-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.music-tidy-dup-title { font: var(--type-title); margin: 0; }
.music-tidy-dup-meta { font: var(--type-small); color: var(--ink-muted); }
.music-tidy-duplicate-list { display: flex; flex-direction: column; gap: var(--space-2); }
.music-tidy-dup-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.music-tidy-dup-details { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex-wrap: wrap; }
.music-tidy-dup-title-text { font: var(--type-body-strong); color: var(--ink); }
.music-tidy-dup-sub { font: var(--type-small); color: var(--ink-muted); }
.music-tidy-dup-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.music-tidy-intro { font: var(--type-small); color: var(--ink-muted); margin: 0 0 var(--space-2); }
.music-tidy-cover { cursor: pointer; }

/* ==========================================================================
   Module Recettes de cuisine (CUI-REC - ENV-MAQ-118)
   Livre familial, recalcul des portions 2 à 10, mode En cuisine et Petits chefs
   ========================================================================== */

.page-recipes {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.recipes-kid-banner {
  margin-bottom: var(--space-2);
}

.recipes-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .recipes-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.recipe-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.recipe-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.recipe-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-3);
}

.portions-stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.portions-stepper__value {
  font: var(--type-body-strong);
  min-width: 90px;
  text-align: center;
}

.cooking-hero-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
}

.cooking-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-2) 0 var(--space-8);
  width: 100%;
}

.cooking-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.cooking-timers-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.cooking-timer-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.cooking-timer-card.is-finished {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger);
}

.cooking-timer-digits {
  font: var(--type-headline);
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.cooking-stage {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.cooking-stage__step-num {
  font: var(--type-subtitle);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cooking-stage__text {
  font: var(--type-headline);
  line-height: 1.45;
  color: var(--ink);
}

.cooking-stage__ingredients {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
}

.cooking-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.recipe-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.recipe-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.recipe-form-row > * {
  flex: 1 1 200px;
}

/* ===== PLA-WEB-004, lot MED-HUB-008 : blocs de placement du prototype (l'ancien CSS reste jusqu'au lot de bascule). ===== */
/* Envoi de la médiathèque (ENV-MAQ-123) : placement seulement (composant UploadDock). Hors de #app (upload-dock.js) :
   l'envoi continue d'un écran à l'autre. La pastille se pose au-dessus de la barre du bas (téléphone) ou du mini-lecteur
   (à partir de 780 px, règle rangée avec le mini-lecteur) ; les boutons flottants Notes et Tâches montent d'un cran (leurs blocs). */
#envoi[hidden] { display: none; }
#envoi.is-still .cf-updock__pill, #envoi.is-still .cf-updock__panel { animation: none; } /* redessiné sur place : l'entrée ne se rejoue pas */
#envoi.is-step .cf-updock__body { animation: cf-fade-in var(--motion-slow) var(--ease-enter); } /* nouvelle étape : fondu du contenu seulement */
@media (prefers-reduced-motion: reduce) { #envoi.is-step .cf-updock__body { animation: none; } }
@media not all and (min-width: 780px) {
  #envoi:not(.is-open) { bottom: calc(var(--space-4) + 72px + env(safe-area-inset-bottom)); }
}
.envoi-duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.envoi-piste { display: grid; grid-template-columns: 72px 1fr 1fr; gap: var(--space-2); align-items: start; }
.envoi-piste > .cf-field__help { grid-column: 1 / -1; }

/* Images des fiches et des listes de musique (MED-MUS-003b, planches ENV-MAQ-124) : placement seulement. */
.musique-pochettes-vue {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.musique-pochettes-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-3);
  max-height: 50vh;
  overflow-y: auto;
  padding: var(--space-2);
}
.musique-pochette-tuile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
}
.musique-pochette-titre,
.musique-pochette-artiste {
  display: block;
  width: 100%;
}
.musique-conversion-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}
.musique-preview-cadre {
  display: flex;
  justify-content: center;
  margin: var(--space-3) 0;
}

/* « Modifier le titre » : la barre d'onglets garde sa hauteur (placement seulement). Dans la boîte, qui défile quand le
   contenu est long, elle était écrasée à 4 px par le « flex-shrink » : les onglets, « Droits & Accès » compris,
   n'étaient plus visibles. */
.musique-edit > .cf-tabs {
  flex: none;
}
@media (max-width: 480px) {
  /* Téléphone : les trois onglets tiennent dans la boîte sans défiler (« Droits & Accès » restait caché à droite). */
  .musique-edit > .cf-tabs { gap: 0; }
  .musique-edit > .cf-tabs .cf-tabs__item { padding-inline: var(--space-1); }
}

/* Mix de la musique (MED-MUS-019b, ENV-MAQ-125) : placement seulement. */
.musique-mix-pochette { width: 200px; flex: none; }
@media (min-width: 768px) { .musique-mix-pochette { width: 220px; } }

/* Notifications (ENV-MAQ-042, PLA-NTF-002b) : placement seulement. */
.notification-bell {
  position: relative;
}
.notification-bell .cf-tile__badge {
  position: absolute;
  top: 2px;
  right: 2px;
}
.notif-entete-tel {
  display: flex;
}
.notif-entete-ordi {
  display: none;
}
@media (min-width: 1200px) {
  .notif-entete-tel {
    display: none;
  }
  .notif-entete-ordi {
    display: flex;
  }
}
.notif-list-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.notif-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.notif-line {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
}
.notif-line__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
}
.notif-line__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.notif-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  width: 100%;
}
.notif-toolbar .cf-search {
  flex: 1;
}
.notif-menu-ancre {
  position: relative;
}
.notif-menu-flottant {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 5;
  min-width: 250px;
}
.notif-menu-filtre {
  right: auto;
  left: 0;
}
.notif-menu-flottant[hidden] {
  display: none;
}
.notif-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.notif-group__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-1);
}
.notif-group__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cf-sidenav__item .cf-tag {
  margin-left: auto;
}
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.compte-tete { align-items: center; }

/* Export de mes données (ENV-MAQ-163) : placement seulement. */
.export-page { display: flex; flex-direction: column; gap: var(--space-4); max-width: 680px; margin: 0 auto; width: 100%; }
.export-status { display: flex; flex-direction: column; gap: var(--space-4); }
.export-entete-ordi { display: none; }
@media (min-width: 1200px) {
  .export-entete-tel { display: none; }
  .export-entete-ordi { display: block; }
}

/* Compagnon jeux vidéo (LOI-CMP / ENV-MAQ-151) : placement seulement. */
.game-lead-row { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.game-lead-row > .cf-cover { flex: none; }
.game-lead-row > h1, .game-lead-row > h2, .game-lead-row > h3 { margin: 0; min-width: 0; }
.companion-hof-section { margin-bottom: var(--space-6); }
/* Dialogue long du compagnon (« Ajouter un jeu ») : défile dans l'écran au lieu de déborder (LOI-CMP-001e). */
.overlay--dialog .companion-dialog { max-height: calc(100dvh - 2 * var(--space-4)); overflow-y: auto; }
.companion-back-nav { margin-bottom: var(--space-3); }
.companion-game-header-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.companion-tabs { margin-bottom: var(--space-4); }
.companion-head-actions { flex: none; display: flex; align-items: center; gap: var(--space-2); }
.companion-continue__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.companion-blocks { display: flex; flex-direction: column; gap: var(--space-4); }
.companion-block .cf-block__text { display: flex; flex-direction: column; gap: 2px; }
.companion-block + .companion-block { margin-top: var(--space-4); }
.companion-rating .cf-field__input { width: 96px; }
.companion-game-pagehead { width: 100%; flex-direction: column; align-items: stretch; }
.companion-game-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.companion-platform-tag { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); flex-shrink: 0; }
.companion-tab-content { display: flex; flex-direction: column; gap: var(--space-4); }
.companion-section { display: flex; flex-direction: column; gap: var(--space-3); }
.companion-section-closed { margin-top: var(--space-6); }
.grid-layout { display: grid; gap: var(--space-4); width: 100%; }
.grid-layout.grid--1 { grid-template-columns: minmax(0, 1fr); }
.grid-layout.grid--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  .grid-layout.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Assistant (PLA-IA-004b, maquette ENV-MAQ-078) : placement seulement. */
.page-assistant, .page-assistant-journal { display: flex; flex-direction: column; gap: var(--space-4); }
.assistant-entete-tel { display: block; }
.assistant-entete-ordi { display: none; }
@media (min-width: 1200px) {
  .assistant-entete-tel { display: none; }
  .assistant-entete-ordi { display: flex; }
}
.assistant-aids, .assistant-module { display: flex; flex-direction: column; gap: var(--space-3); }
.assistant-aid { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.assistant-aid + .assistant-aid { padding-top: var(--space-3); border-top: 1px solid var(--border); }
.assistant-aid__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.assistant-aid__sends, .assistant-aid__exception { margin: 0; }
.assistant-aid__exception { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.assistant-journal__more { margin-top: var(--space-3); }
.assistant-limits { display: flex; flex-direction: column; gap: var(--space-4); }
.assistant-limits__fields { display: grid; gap: var(--space-4); }
@media (min-width: 768px) { .assistant-limits__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.assistant-limits__actions { display: flex; justify-content: flex-end; }
.learning-gemini-box[hidden], .learning-gemini-actions .cf-btn[hidden] { display: none; }
.page-assistant .cf-block__text, .page-assistant-journal .cf-block__text { display: flex; flex-direction: column; gap: var(--space-1); }
.page-assistant .cf-block__row > .cf-switch-row { flex: 1; }

/* Travaux de l'assistant (PLA-IA-005b, maquette ENV-MAQ-178, composant UploadDock) : placement seulement. */
#assistant-dock[hidden] {
  display: none;
}

@media not all and (min-width: 780px) {
  #assistant-dock:not(.is-open) {
    bottom: calc(var(--space-4) + 72px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 780px) {
  body.has-mini #assistant-dock {
    bottom: calc(var(--space-4) + var(--mini-h));
  }
}

body.has-mini #assistant-dock .cf-updock__panel {
  max-height: calc(100vh - 2 * var(--space-4) - var(--mini-h));
}

body:has(> #assistant-dock:not([hidden], .is-open)) .notes-fab {
  bottom: calc(160px + env(safe-area-inset-bottom));
}
body:has(> #assistant-dock:not([hidden], .is-open)) .taches-fab {
  bottom: calc(160px + env(safe-area-inset-bottom));
}

#envoi:not([hidden]) ~ #assistant-dock:not([hidden]) {
  right: calc(var(--space-4) + 336px);
}

@media (max-width: 779px) {
  #envoi:not([hidden]) ~ #assistant-dock:not([hidden]) {
    right: var(--space-4);
    bottom: calc(var(--space-4) + 72px + env(safe-area-inset-bottom) + 64px);
  }
}

.assistant-jobs-block {
  display: flex;
  flex-direction: column;
}

.assistant-jobs-cap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.assistant-jobs-cap-text,
.assistant-jobs-link-text {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.assistant-jobs-cap-title,
.assistant-jobs-link-title {
  font: var(--type-body-strong);
}

.assistant-jobs-cap-desc,
.assistant-jobs-link-desc {
  margin: 0;
  font: var(--type-small);
  color: var(--ink-muted);
}

.assistant-jobs-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.assistant-jobs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.assistant-job-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.assistant-job-card__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.assistant-job-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.assistant-job-card__title {
  font: var(--type-body-strong);
}

.assistant-job-card__progress {
  display: flex;
  flex-direction: column;
}

.assistant-job-card__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.assistant-steps-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.assistant-step-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.assistant-step-item--error {
  border: 1px solid var(--danger);
}

.assistant-step-item__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.assistant-step-item__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.assistant-step-item__name {
  font: var(--type-small-strong);
}

.assistant-step-item__cost {
  margin-left: auto;
  font: var(--type-small);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums lining-nums;
}

.assistant-step-item__desc {
  margin: 0;
  font: var(--type-small);
  color: var(--ink-muted);
}

.assistant-step-error {
  margin-top: var(--space-2);
}

.assistant-job-card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.assistant-job-card__cancelled-note {
  font: var(--type-small);
  color: var(--ink-muted);
  font-style: italic;
}

/* Écran « Jeu » du compagnon (LOI-CMP-003c, maquette ENV-MAQ-177, ECR-217) : placement seulement. */
.companion-game-title { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.companion-game-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.companion-chapter-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.companion-chapter-row .cf-field__input { flex: 0 1 auto; width: auto; min-width: 0; max-width: 100%; }
.companion-top-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.companion-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.companion-tip-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-1); }
.companion-tip-level { margin-top: var(--space-2); }
.companion-tip-solution { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.companion-tip-solution[hidden], .companion-tip-level[hidden] { display: none; }
.companion-tip-shot { display: block; max-width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
.companion-fold { display: flex; flex-direction: column; gap: var(--space-3); }
.companion-fold-trigger { cursor: pointer; font: var(--type-body-strong); padding: var(--space-2) 0; display: flex; gap: var(--space-2); align-items: center; }
.companion-chapter-body { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.companion-chapter.is-locked { border-style: dashed; }
.companion-candidate { display: flex; flex-direction: column; gap: var(--space-1); text-align: left; width: 100%; }
.companion-check { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; }
.companion-souvenir__cover { display: block; max-width: 220px; width: 100%; margin: 0 auto; border-radius: var(--radius-md); }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-2); }
@media print {
  body.is-printing-souvenir > *:not(.overlay) { display: none !important; }
  body.is-printing-souvenir .companion-souvenir .cf-dialog__actions { display: none; }
}

/* ==================== Pokémon (LOI-PKM-002c / ENV-MAQ-179) : placement seulement. ==================== */
.pokemon-page { display: flex; flex-direction: column; gap: var(--space-4); }
.pokemon-entete-tel { display: flex; flex-direction: column; gap: var(--space-2); }
.pokemon-entete-ordi { display: none; }
@media (min-width: 1200px) {
  .pokemon-entete-tel { display: none; }
  .pokemon-entete-ordi { display: flex; }
}

.pokemon-games-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); margin-top: var(--space-4); }
@media (min-width: 768px) {
  .pokemon-games-grid { grid-template-columns: repeat(2, 1fr); }
}

.pokemon-game-card { display: flex; flex-direction: column; gap: var(--space-3); }
.pokemon-game-cover-wrap { width: 100%; max-height: 180px; overflow: hidden; display: flex; justify-content: center; }
.pokemon-game-cover { width: auto; height: 160px; max-width: 100%; border-radius: var(--radius-md); object-fit: contain; }
.pokemon-game-card-body { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.pokemon-progress-wrap { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-2) 0; }
.pokemon-progress-labels { display: flex; justify-content: space-between; align-items: center; }
.pokemon-card-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: auto; }

.pokemon-sprite-box { width: 48px; height: 48px; min-width: 48px; min-height: 48px; display: flex; align-items: center; justify-content: center; position: relative; border-radius: var(--radius-sm); background: var(--tint, var(--surface-2)); }
.pokemon-sprite-box--sm { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
.pokemon-sprite-initials { display: inline-flex; align-items: center; justify-content: center; font: var(--type-small); font-weight: 700; color: #fff; }
.pokemon-sprite-sparkle { position: absolute; top: 2px; right: 2px; display: inline-flex; }
.pokemon-sprite-link { display: inline-flex; flex-shrink: 0; }
.pokemon-sprite-img { width: 48px; height: 48px; min-width: 48px; min-height: 48px; image-rendering: pixelated; object-fit: contain; }
.pokemon-sprite-img--sm { width: 32px; height: 32px; min-width: 32px; min-height: 32px; image-rendering: pixelated; object-fit: contain; }

.pokemon-tabs-bar { margin-bottom: var(--space-4); }

.pokemon-dex-progress-card { margin-bottom: var(--space-4); }
.pokemon-dex-filters { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
@media (min-width: 768px) {
  .pokemon-dex-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; }
}

.pokemon-pokedex-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 768px) {
  .pokemon-pokedex-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .pokemon-pokedex-grid { grid-template-columns: repeat(3, 1fr); }
}

.pokemon-dex-card { display: flex; flex-direction: column; gap: var(--space-2); }
.pokemon-dex-card-top { display: flex; align-items: center; gap: var(--space-3); }
.pokemon-dex-card-meta { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; flex: 1; }
.pokemon-dex-card-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.pokemon-dex-card-name:hover { text-decoration: underline; }
.pokemon-card-types { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.pokemon-dex-card-bottom { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2); margin-top: auto; }

.pokemon-team-head { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (min-width: 768px) {
  .pokemon-team-head { display: flex; flex-direction: row; justify-content: space-between; align-items: flex-end; }
}
.pokemon-team-select-wrap { min-width: 240px; }
.pokemon-team-select { width: 100%; min-width: 220px; }
.pokemon-team-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

.pokemon-team-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (min-width: 768px) {
  .pokemon-team-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .pokemon-team-grid { grid-template-columns: repeat(3, 1fr); }
}

.pokemon-team-slot { display: flex; flex-direction: column; gap: var(--space-2); }
.pokemon-slot-free { display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.pokemon-slot-head { display: flex; align-items: center; gap: var(--space-3); }
.pokemon-slot-info { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; min-width: 0; }
.pokemon-tag-row { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.pokemon-slot-moves { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: var(--space-1) 0; }
.pokemon-slot-actions { display: flex; justify-content: flex-end; margin-top: auto; }

.pokemon-matrix-card { margin-top: var(--space-4); }
.pokemon-matrix-table th, .pokemon-matrix-table td { padding: var(--space-1) var(--space-2); text-align: center; }
.pokemon-matrix-table th:first-child, .pokemon-matrix-table td:first-child { text-align: left; }
.pokemon-matrix-cell-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  font: inherit;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  min-width: 28px;
  min-height: 28px;
}
.pokemon-matrix-cell-btn:hover {
  background: var(--surface-2);
}
.pokemon-settings-subtabs {
  margin-bottom: var(--space-4);
}
.pokemon-matrix-alert { margin-top: var(--space-3); }
.pokemon-coverage-wrap { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.pokemon-coverage-title { display: block; margin-bottom: var(--space-1); }
.pokemon-coverage-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.pokemon-calc-form { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
.pokemon-calc-row { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 768px) {
  .pokemon-calc-row { grid-template-columns: repeat(2, 1fr); }
}
.pokemon-calc-options { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.pokemon-calc-result { display: flex; flex-direction: column; gap: var(--space-2); }
.pokemon-calc-result-alert { margin-top: var(--space-2); }
.pokemon-calc-big-verdict { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-2) 0; }
.pokemon-calc-numbers { display: block; margin: var(--space-1) 0; font: var(--type-title); }

.pokemon-fiche-page { display: flex; flex-direction: column; gap: var(--space-4); }
.pokemon-url-row { display: flex; align-items: center; gap: var(--space-2); }
.pokemon-url-row .cf-field__input { flex: 1; min-width: 0; }
.pokemon-fiche-hero { display: flex; flex-direction: column; gap: var(--space-3); }
.pokemon-fiche-header { display: flex; align-items: center; gap: var(--space-4); }
.pokemon-fiche-meta { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; }
.pokemon-fiche-types { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.pokemon-fiche-mark-row { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.pokemon-fiche-abilities { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }

.pokemon-stats-list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.pokemon-stat-row { display: grid; grid-template-columns: 120px 40px 1fr; align-items: center; gap: var(--space-2); }
.pokemon-stat-name { display: block; }
.pokemon-stat-val { display: block; text-align: right; }

.pokemon-defense-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.pokemon-sens-chip { display: inline-flex; align-items: center; gap: var(--space-1); }

.pokemon-evo-chain { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.pokemon-evo-step { display: flex; align-items: center; gap: var(--space-2); }
.pokemon-evo-trigger { display: flex; align-items: center; gap: var(--space-1); }
.pokemon-evo-card { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-2); }
.pokemon-evo-name { display: block; margin-left: var(--space-2); }

.pokemon-fiche-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); }

.pokemon-dialog-list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) 0; }
.pokemon-dialog-fields { display: grid; grid-template-columns: 1fr; gap: var(--space-2); }
@media (min-width: 768px) {
  .pokemon-dialog-fields { grid-template-columns: repeat(2, 1fr); }
}
.pokemon-dialog-moves { display: flex; flex-direction: column; gap: var(--space-2); }
.pokemon-dialog-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.pokemon-dialog-centered { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-4) 0; }
.pokemon-dialog-preview-list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) 0; }
.pokemon-advice-list { display: flex; flex-direction: column; gap: var(--space-2); padding-left: 0; }
.pokemon-advice-item { display: flex; align-items: flex-start; gap: var(--space-2); }
.pokemon-dialog-suggestions { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-2) 0; }
.pokemon-dialog-where-list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-2) 0; }

.pokemon-widget-team-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.pokemon-widget-member { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); }
.pokemon-widget-member-lvl { font: var(--type-small); color: var(--ink-muted); }

/* Raccourcis de navigation et ordre des modules (PLA-ACC-001b, ECR-164) */
.nav-edit-entete-ordi { display: none; }
@media (min-width: 780px) {
  .nav-edit-entete-tel { display: none; }
  .nav-edit-entete-ordi { display: flex; }
}
.nav-edit-help { margin: 0; }
.nav-edit-alert__body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.nav-edit-alert__text { margin: 0; }
.nav-edit-alert__list { margin: 0; padding-left: var(--space-4); }
.nav-edit-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  padding: var(--space-3);
}
@media (min-width: 780px) {
  .nav-edit-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1060px) {
  .nav-edit-preview { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.nav-edit-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  min-width: 0;
}
.nav-edit-slot--fixed { background: var(--surface-2); }
.nav-edit-slot--empty { border-style: dashed; opacity: 0.75; }
.nav-edit-slot__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  width: 100%;
}
.nav-edit-slot__label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-edit-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
  padding: var(--space-3);
}
.nav-edit-pick {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-3);
  text-align: left;
  min-height: 44px;
  cursor: pointer;
}
.nav-edit-pick.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.nav-edit-pick__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.nav-edit-pick__head svg { width: 20px; height: 20px; flex: none; }
.nav-edit-pick__label { display: block; overflow-wrap: anywhere; }
.nav-edit-list { display: flex; flex-direction: column; }
.nav-edit-row { justify-content: space-between; gap: var(--space-2); }
.nav-edit-row.is-dragging { opacity: 0.6; background: var(--accent-soft); }
.nav-edit-row__lead { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex: 1; }
.nav-edit-row__lead > svg { width: 20px; height: 20px; flex: none; }
.nav-edit-row__label { min-width: 0; overflow-wrap: anywhere; }
.nav-edit-row__actions { display: flex; align-items: center; gap: var(--space-1); flex: none; }
.nav-edit-grip {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--ink-muted);
  cursor: grab;
  touch-action: none;
}
.nav-edit-grip svg { width: 20px; height: 20px; }
.nav-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
  padding: var(--space-2) 0;
}

/* mBot2 (LOI-MBT-002b / ENV-MAQ-180) : placement et disposition */
.mbot-pagehead-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.mbot-page .cf-pagehead__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.mbot-header-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.mbot-menu-ancre {
  position: relative;
}

.mbot-menu-ancre > .cf-menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 20;
  min-width: 240px;
}

.mbot-lang-segmented {
  flex: none;
  min-width: max-content;
  grid-auto-columns: max-content;
}

.mbot-resume-card {
  margin-bottom: var(--space-4);
}

.mbot-resume-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.mbot-levels-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .mbot-levels-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .mbot-levels-section {
    grid-template-columns: repeat(4, 1fr);
  }
}

.mbot-level-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
}

.mbot-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mbot-tab-content {
  margin-top: var(--space-4);
}

.mbot-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.mbot-feasible-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.mbot-level-group {
  margin-bottom: var(--space-5);
}

.mbot-group-title {
  margin-bottom: var(--space-3);
}

.mbot-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .mbot-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .mbot-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mbot-project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mbot-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}

.mbot-missing-warning {
  padding: var(--space-1) var(--space-2);
}

.mbot-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-2);
}

.mbot-card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.mbot-tuto-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mbot-tuto-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.mbot-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.mbot-nav-top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mbot-identity-block {
  margin-bottom: var(--space-4);
}

.mbot-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.mbot-project-summary {
  margin-bottom: var(--space-2);
}

.mbot-project-metadata-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-2);
}

.mbot-feats-list, .mbot-notions-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.mbot-member-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mbot-missing-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.mbot-steps-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.mbot-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.mbot-steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mbot-step-image {
  max-width: 100%;
  height: auto;
  margin-top: var(--space-2);
}

.mbot-final-section, .mbot-challenges-card {
  margin-bottom: var(--space-4);
}

.mbot-challenge-item {
  margin-bottom: var(--space-2);
}

.mbot-tracking-section {
  margin-top: var(--space-5);
  margin-bottom: var(--space-5);
}

.mbot-tracking-subblock {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
}

.mbot-tracking-subblock:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.mbot-success-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.mbot-program-download-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.mbot-program-preview {
  margin-top: var(--space-2);
}

.mbot-photos-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.mbot-photo-thumb {
  width: 80px;
  height: 80px;
  overflow: hidden;
}

.mbot-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mbot-photo-btn {
  position: relative;
  overflow: hidden;
}

.mbot-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.mbot-scratch-svg {
  overflow-x: auto;
  max-width: 100%;
}

.mbot-scratch-svg svg {
  display: block;
}

.mbot-feature-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.mbot-block-sample, .mbot-py-sample {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mbot-pitfalls-card {
  margin-bottom: var(--space-4);
}

.mbot-editor-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mbot-editor-steps-section {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}

.mbot-editor-steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mbot-editor-step-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mbot-step-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.mbot-step-editor-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.mbot-step-editor-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mbot-step-preview-container {
  padding: var(--space-2);
  margin: var(--space-1) 0;
}

.mbot-add-step-row {
  margin-top: var(--space-3);
}

.mbot-editor-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
}

.mbot-dialog-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mbot-codeblock-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.media-pending-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block: var(--space-4);
}
.media-pending-banner__text { flex: 1; }

.media-classify-list {
  display: grid;
  gap: var(--space-4);
}
.media-classify-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.media-classify-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.media-classify-card__info { min-width: 0; flex: 1; }
.media-classify-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --- Recettes (CUI-REC-001b) --- */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.recipes-card__row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.recipes-card__thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.recipes-card__body { flex: 1; min-width: 0; }
.recipes-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.recipes-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.recipes-hero-img { max-width: 100%; max-height: 320px; border-radius: var(--radius-lg); object-fit: cover; }
.recipes-servings { display: inline-flex; align-items: center; gap: var(--space-2); }
.recipes-servings__val { min-width: 96px; text-align: center; font-weight: 600; }
.recipes-ingredients { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: var(--space-2); }
.recipes-ingredients__item { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.recipes-ingredients__qty { min-width: 72px; }
.recipes-steps { padding-left: 1.4rem; display: grid; gap: var(--space-3); }
.recipes-steps__head { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-1); }
.recipes-log-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.recipes-log-form .cf-field__input { flex: 1; min-width: 180px; }
.recipes-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
.recipes-assist-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.recipes-cook__stage { display: grid; gap: var(--space-4); margin-top: var(--space-3); }
.recipes-cook__text { font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.5; }
.recipes-cook__step-timers { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.recipes-cook__nav { display: flex; justify-content: space-between; gap: var(--space-3); }
.recipes-timers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }
.recipes-timer { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.recipes-timer__info { display: flex; align-items: center; gap: var(--space-2); }
.recipes-timer__time { font-variant-numeric: tabular-nums; font-weight: 700; }
.recipes-timer__actions { display: flex; gap: var(--space-1); }
.print-only { display: none; }

@media print {
  .cf-sidenav, .cf-bottomnav, .print-hide, .maintenance-host, #mini-player { display: none !important; }
  .print-only { display: block !important; }
  .page-recipes { max-width: none; padding: 0; }
  .cf-card { box-shadow: none !important; border: 1px solid var(--border); break-inside: avoid; }
}

/* --- Courses et stock (CUI-COU-001b) --- */
.groceries-add-form { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.groceries-add-form .cf-field__input:first-child { flex: 1; min-width: 180px; }
.groceries-qty-in { width: 100px; }
.groceries-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.groceries-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 44px; }
.groceries-item.is-checked .groceries-item__name { text-decoration: line-through; color: var(--ink-muted); }
.groceries-shop-row { min-height: 52px; padding: var(--space-2); border-radius: var(--radius-md); }
.groceries-shop-row.is-checked { opacity: 0.6; text-decoration: line-through; }

/* --- Atelier de coloriage (ENF-COL-005b) --- */
.coloring-studio__palette { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-block: var(--space-3); }
.coloring-swatch { min-height: 44px; border-left: 8px solid var(--swatch, var(--accent)); }
.coloring-swatch.is-active { outline: 2px solid var(--accent); outline-offset: 2px; }
.coloring-studio__stage { position: relative; overflow: hidden; touch-action: manipulation; }
.coloring-studio__svg, .coloring-studio__strokes { width: 100%; height: auto; display: block; }
.coloring-studio__strokes { position: absolute; inset: 0; pointer-events: none; }
.coloring-studio__svg [data-zone] { cursor: pointer; }

/* --- Cartes d'idées Auto-formation (ENF-FOR-004b) --- */
.learning-idea-card { text-align: left; width: 100%; display: grid; gap: var(--space-2); }
.learning-idea-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.learning-idea-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }

/* --- Calendrier de l'Avent (FAM-FET-002b) --- */
.advent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--space-2); }
.advent-door { min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); transition: transform 0.25s ease; }
.advent-door.is-opened { transform: scale(1.02); }
.advent-door.is-sealed { opacity: 0.6; }
.advent-door__num { font-weight: 700; font-size: 1.15rem; }
@media (prefers-reduced-motion: reduce) {
  .advent-door { transition: none; }
  .advent-door.is-opened { transform: none; }
}

/* --- Arbre généalogique (FAM-GEN-001b) --- */
.gen-tree-scroll { overflow-x: auto; padding-block: var(--space-3); }
.gen-branch { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.gen-parents { display: flex; gap: var(--space-3); position: relative; padding-top: var(--space-3); border-top: 2px solid var(--border-strong); }
.gen-node { min-width: 150px; text-align: center; display: grid; gap: var(--space-1); }

/* --- Jeux ROM / Romhacks / Fangames (MED-JEU-001b) --- */
.page-games, .page-game-detail, .page-game-upload { display: grid; gap: var(--space-4); }
.games-card-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.games-detail-section { display: grid; gap: var(--space-3); }
.games-meta-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.games-hash-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.games-hash-label { min-width: 72px; font-weight: 600; color: var(--ink-muted); }
.games-hash-val { flex: 1 1 200px; overflow-wrap: anywhere; font-size: 0.85rem; }
.games-patch-steps { display: grid; gap: var(--space-2); margin-block: var(--space-2); }
.games-patch-ready { display: grid; gap: var(--space-2); justify-items: start; }

/* --- Livres audio (MED-AUD-001b) --- */
.page-audiobooks, .page-audiobook-detail, .page-audiobook-upload { display: grid; gap: var(--space-4); }
.audiobooks-section { display: grid; gap: var(--space-3); }
.audiobook-progress-wrap { margin-top: var(--space-2); }
.audiobook-meta-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* --- Films et séries (MED-FIL-001b / 002b) --- */
.page-films, .page-film-detail, .page-film-new { display: grid; gap: var(--space-4); }
.films-section { display: grid; gap: var(--space-3); }
.films-card-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.films-meta-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.films-posters-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.films-poster-choice img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm); }
.films-link-broken { opacity: 0.55; text-decoration: line-through; }
.films-add-link { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.films-episode-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.films-liked-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Placement Actualités (LOI-ACT-002b) */
.news-cover-wrap {
  width: 44px;
  height: 44px;
  flex: none;
}
.news-cover-sm {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}
.news-cover-fallback {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
}
.news-manage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.news-child-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-2) 0;
}
.news-cat-select {
  width: auto;
  min-width: 140px;
}
.news-catalog-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* Placement Le savais-tu ? (LOI-ACT-003b) */
.dyk-card-head-spaced {
  margin-top: var(--space-2);
}
.dyk-cover-fallback {
  display: grid;
  place-items: center;
}
.dyk-suggest-btn {
  align-self: flex-start;
  margin-top: var(--space-1);
}
.dyk-refill-line {
  margin-bottom: var(--space-3);
}
.dyk-assist-themes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}
.dyk-assist-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

/* Placement LEGO (LOI-LEG-001b / 002b) */
.page-lego,
.page-lego-detail,
.page-lego-bin,
.page-lego-creation {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.lego-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}
.lego-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.lego-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}
.lego-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.lego-visual {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-muted);
}
.lego-visual--lg {
  padding: var(--space-4);
  min-width: 112px;
  min-height: 96px;
  justify-content: center;
  flex-direction: column;
}
.lego-visual__img {
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.lego-visual__fallback {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.lego-visual__num {
  font: var(--type-label);
}
.lego-toolbar {
  flex-wrap: wrap;
}
.lego-filter {
  width: auto;
  min-width: 0;
  flex: 1 1 140px;
}
.lego-chips,
.lego-inline-actions,
.lego-photos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.lego-card-progress {
  margin-top: var(--space-2);
}
.lego-hero {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-start;
}
.lego-hero-body {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.lego-proposal {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.lego-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.lego-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.lego-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-3);
  align-items: center;
}
.lego-bar-label {
  font: var(--type-small);
}
.lego-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.lego-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.lego-infolist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}
.lego-info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-2);
}
.lego-info-row dt {
  color: var(--ink-muted);
  font: var(--type-small);
}
.lego-info-row dd {
  margin: 0;
  font: var(--type-body);
}

/* Catégories et lieux (PLA-CAT-001b, ENV-MAQ-170) : placement seulement. */
.categories-familles, .lieux-pieces, .lieu-blocs { display: grid; gap: var(--space-4); align-items: start; }
.cf-block__row .categories-ligne-detail, .cf-block__row .lieu-ligne-detail, .lieux-piece-resume { display: block; margin-left: 0; }
.categories-sans-icone { flex: none; width: 20px; }
.categories-ajout, .lieux-ajout { width: 100%; }
.page-categories > .cf-search, .lieux-outils .cf-search { width: 100%; }
.categories-fenetre { max-height: calc(100dvh - 2 * var(--space-4)); overflow-y: auto; }
.categories-fenetre > * { flex-shrink: 0; }
.categories-icones { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-2); }
.categories-icones .cf-chip { justify-content: center; min-height: 44px; padding: 0; }
.categories-icones .cf-chip svg { width: 20px; height: 20px; }
.categories-choix { display: flex; flex-direction: column; max-height: 45dvh; overflow-y: auto; }
.categories-choix .categories-choix--dedans-1 { padding-left: var(--space-6); }
.categories-choix .categories-choix--dedans-2 { padding-left: calc(var(--space-6) + var(--space-6)); }
.categories-coche { display: flex; flex: none; width: 20px; }
.categories-picker-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.lieux-outils { display: grid; gap: var(--space-3); }
.lieux-piece-tete { align-items: center; }
.lieux-piece-pied { display: flex; }
.lieux-piece-pied .cf-block__more { flex: 1; }
.lieux-piece-pied .cf-block__more + .cf-block__more { justify-content: flex-end; }
.lieux-ligne--dedans-1 { padding-left: var(--space-6); }
.lieux-ligne--dedans-2 { padding-left: calc(var(--space-6) + var(--space-6)); }
@media (min-width: 600px) {
  .lieux-outils { grid-template-columns: minmax(0, 1fr) auto; }
  .lieux-outils .lieux-ajout { order: 2; width: auto; }
  .categories-ajout { width: auto; align-self: flex-start; }
}
@media (min-width: 900px) {
  .categories-familles, .lieux-pieces, .lieu-blocs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Centres d'intérêt (PLA-INT-001b, ENV-MAQ-161) : placement seulement. */
.plateforme-interets-page, .interets-page { display: flex; flex-direction: column; gap: var(--space-4); }
.plateforme-interets-grid, .interets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.plateforme-interets-item, .interets-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.plateforme-interets-item-actions, .interets-item-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.plateforme-interets-member-subgroup { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.plateforme-interets-level-radios { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-1); }
.plateforme-interets-radio-label { display: inline-flex; align-items: center; gap: var(--space-2); }
.plateforme-interets-picker, .interets-picker { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.plateforme-interets-section, .interets-section { display: flex; flex-direction: column; gap: var(--space-3); }
.plateforme-interets-themes-list { display: flex; flex-direction: column; gap: var(--space-2); max-height: 50vh; overflow-y: auto; }
.interets-tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.interets-picker-title { margin-right: var(--space-1); }
.interets-proposals-box { display: flex; flex-direction: column; gap: var(--space-3); }
.interets-proposal-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.interets-proposal-info { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; flex: 1; min-width: 240px; }
.interets-proposal-input { max-width: 280px; flex: 1; }
.interets-proposal-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.interets-shared-card { display: flex; flex-direction: column; gap: var(--space-2); }
.interets-shared-members, .interets-tag-list { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.interets-themes-admin-list { display: flex; flex-direction: column; gap: var(--space-2); }
.interets-theme-admin-row, .interets-theme-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.interets-theme-info { display: flex; flex-direction: column; gap: var(--space-1); }
.interets-sheet-content { display: flex; flex-direction: column; gap: var(--space-3); }

/* Comptes et sécurité (PLA-CPT-003b, ENV-MAQ-164) : placement seulement. */
.twofa-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.connexion-step2 { display: flex; flex-direction: column; gap: var(--space-2); }

/* Vacances et valises (LOI-VAC-001b / 002b) : placement seulement. */
.vac-inline-actions,
.vac-avatars,
.vac-meta-row,
.vac-files,
.vac-hero__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.vac-hero__foot { justify-content: space-between; }
.vac-form-stack,
.vac-program-list,
.vac-bag-list,
.vac-weather-days { display: flex; flex-direction: column; gap: var(--space-3); }
.vac-form-row,
.vac-grid,
.vac-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.vac-inline-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.vac-inline-row__text { flex: 1 1 auto; min-width: 0; }
.vac-head-left { display: flex; align-items: center; gap: var(--space-3); }
.vac-member-pill { display: inline-flex; align-items: center; gap: var(--space-2); }
.vac-weather-day { display: flex; align-items: center; gap: var(--space-2); }
.vac-tpl-list { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); }

/* Contacts (ORG-CTC-001b) : placement seulement. */
.contacts-etat { display: flex; flex-direction: column; gap: var(--space-2); }
.contacts-etat:empty { display: none; }
.contacts-liste { display: flex; flex-direction: column; gap: var(--space-4); }
.contacts-groupe { display: flex; flex-direction: column; gap: var(--space-2); }
.contacts-cartes { display: flex; flex-direction: column; gap: var(--space-2); }
.contacts-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.contacts-urgences { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3); }
.contacts-row-head { display: flex; align-items: center; gap: var(--space-3); }
.contacts-row-body { flex: 1 1 0; min-width: 0; }
.contacts-champs-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.contacts-point-row { display: grid; grid-template-columns: minmax(110px, 0.8fr) minmax(90px, 0.8fr) minmax(0, 1.4fr) auto; gap: var(--space-2); align-items: center; }
.contacts-results { max-height: 240px; overflow: auto; }
.contacts-fiche { width: 100%; max-width: 720px; }
.contacts-form { width: 100%; max-width: 720px; padding-bottom: 96px; }
.contacts-barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
.contacts-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-6); align-items: start; }
.contacts-pane, .contact-pane { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow: auto; }
.contacts--volet { max-width: none; margin: 0; }
@media (min-width: 780px) {
  .contacts-barre { left: 240px; }
}
@media (min-width: 980px) {
  .contacts-tel-only { display: none; }
}
@media not all and (min-width: 980px) {
  .contacts-ordi-only { display: none; }
}

/* Échéances (ORG-ECH-001b) : placement seulement. */
.echeances-etat { display: flex; flex-direction: column; gap: var(--space-2); }
.echeances-etat:empty { display: none; }
.echeances-liste { display: flex; flex-direction: column; gap: var(--space-6); }
.echeances-groupe { display: flex; flex-direction: column; gap: var(--space-3); }
.echeances-cartes { display: flex; flex-direction: column; gap: var(--space-3); }
.echeances-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.echeances-champs-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.echeances-fiche { width: 100%; max-width: 720px; }
.echeances-titre { flex: 1 1 0; min-width: 0; }
.echeances-form { width: 100%; max-width: 720px; padding-bottom: 96px; }
.echeances-barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
@media (min-width: 780px) {
  .echeances-barre { left: 240px; }
}
@media (min-width: 1200px) {
  .echeances-entete-tel { display: none; }
}
@media not all and (min-width: 1200px) {
  .echeances-entete-ordi { display: none; }
}

/* Projets (ORG-PRJ-002b) : placement seulement. */
.projets-etat { display: flex; flex-direction: column; gap: var(--space-2); }
.projets-etat:empty { display: none; }
.projets-liste { display: flex; flex-direction: column; gap: var(--space-6); }
.projets-groupe { display: flex; flex-direction: column; gap: var(--space-3); }
.projets-cartes { display: flex; flex-direction: column; gap: var(--space-3); }
.projets-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.projets-champs-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.projets-resultats { max-height: 240px; overflow: auto; }
.projets-lien { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); }
.projets-fiche { width: 100%; max-width: 720px; }
.projets-titre { flex: 1 1 0; min-width: 0; }
.projets-form { width: 100%; max-width: 720px; padding-bottom: 96px; }
.projets-barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
.projets-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-6); align-items: start; }
.projets-volet { position: sticky; top: var(--space-6); max-height: calc(100vh - 3rem); overflow: auto; padding: var(--space-1); }
.projets--volet { max-width: none; margin: 0; }
@media (min-width: 780px) {
  .projets-barre { left: 240px; }
}
@media (min-width: 1200px) {
  .projets-entete-tel { display: none; }
}
@media not all and (min-width: 1200px) {
  .projets-entete-ordi { display: none; }
}

/* Widget Bourse (ARG-BOU-002) : mise en page compacte dans 2 cases de haut sans débordement. */
.market-widget { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-1); border-top: 1px solid var(--border); }
.market-widget__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; }
.market-widget__name { flex: 1 1 auto; min-width: 0; font: var(--type-body-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-widget__main { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; }
.market-widget__price { font: var(--type-headline); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.market-widget__chart { flex: 0 0 auto; width: 112px; height: 34px; }
.market-widget__chart .market-chart__svg { display: block; width: 100%; height: 100%; }
.market-widget__foot { margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Aperçu d'une évolution (administration › Évolutions) : « avant » et « après » côte à côte. */
.evo-apercu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.evo-apercu__fig { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.evo-apercu__img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
@media (max-width: 600px) { .evo-apercu { grid-template-columns: minmax(0, 1fr); } }
/* Avancement en direct de l'atelier : dernières lignes de sortie. */
.evo-live { margin: 0; padding: var(--space-3); max-height: 14rem; overflow: auto; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border); border-radius: var(--radius-md); font: var(--type-small); }

/* Widget « Écouté récemment » en carrousel */
.music-recent-carousel { display: flex; flex-direction: column; justify-content: center; gap: var(--space-2); flex: 1; min-width: 0; min-height: 0; }
.music-recent-carousel__stage { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.music-recent-carousel__slide { display: flex; align-items: center; gap: var(--space-2); flex: 1; min-width: 0; padding: var(--space-2); border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.music-recent-carousel.is-compact .music-recent-carousel__slide { padding: var(--space-1) var(--space-2); }
.music-recent-carousel__slide .cf-track__main { flex: 1; min-width: 0; }
.music-recent-carousel__nav { flex: none; width: 32px; min-height: 32px; height: 32px; }
.music-recent-carousel__nav svg { width: 18px; height: 18px; }
.music-recent-carousel__play { flex: none; width: 36px; min-height: 36px; height: 36px; background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.music-recent-carousel__play:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.music-recent-carousel__play svg { width: 16px; height: 16px; }
.music-recent-carousel__foot { display: flex; align-items: center; justify-content: center; gap: var(--space-1); }
.cf-widget--kid .music-recent-carousel__slide { background: var(--kid-card); color: var(--kid-ink); border: 2px solid var(--kid-ink); }
.cf-widget--kid .music-recent-carousel__nav { color: var(--kid-on-color); }
.cf-widget--kid .music-recent-carousel__play { background: var(--kid-sun); color: var(--kid-on-color); border: 2px solid var(--kid-ink); }
.cf-widget--kid .music-recent-carousel__dot { background: color-mix(in srgb, var(--kid-on-color) 35%, transparent); }
.cf-widget--kid .music-recent-carousel__dot[aria-current="true"] { background: var(--kid-on-color); }

/* Administration › Développement (PLA-ADM-012c) : placement seulement ; les composants sont ceux de la charte. */
.dev-page { display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: calc(96px + env(safe-area-inset-bottom)); min-width: 0; }
.dev-chips, .dev-chips-actifs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: var(--space-1); }
.dev-chips > .cf-chip, .dev-chips-actifs > .cf-chip { flex: none; white-space: nowrap; }
.dev-chips-actifs[hidden] { display: none; }
.dev-colonne { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.dev-par-fil { display: flex; flex-direction: column; gap: var(--space-3); }
.dev-card { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.dev-card__head { display: flex; align-items: center; gap: var(--space-2); }
.dev-card__head > .cf-tag { margin-left: auto; }
.dev-card__code { font: var(--type-label); color: var(--ink); }
.dev-card__titre { margin: 0; font: var(--type-body-strong); }
.dev-card__lien { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.dev-card__lien:hover, .dev-card__lien:focus-visible { text-decoration: underline; }
.dev-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dev-card .cf-card__meta .ic { width: 16px; height: 16px; vertical-align: -3px; }
.dev-vide { padding: var(--space-6) 0; text-align: center; }
.dev-fab { position: fixed; right: var(--space-4); bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); z-index: 4; text-decoration: none; }
.dev-menu { position: fixed; z-index: 30; }
.dev-popover { position: fixed; width: 360px; max-height: calc(100vh - 160px); overflow-y: auto; }
.dev-filtre { display: flex; flex-direction: column; gap: var(--space-2); }
.dev-tache__barre { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.dev-tache { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.dev-tache__kicker { margin: 0; font: var(--type-label); color: var(--ink-muted); }
.dev-tache__titre { margin: 0; overflow-wrap: anywhere; }
.dev-onglet { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.dev-texte { display: flex; flex-direction: column; gap: var(--space-2); overflow-wrap: anywhere; }
.dev-texte p { margin: 0; white-space: pre-wrap; }
.dev-texte__titre { font: var(--type-body-strong); }
.dev-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.dev-photo { display: block; width: 100%; height: auto; border-radius: var(--radius-md); }
.dev-jour { display: flex; flex-direction: column; gap: var(--space-2); }
.dev-nouvelle { display: flex; flex-direction: column; gap: var(--space-4); }
.dev-nouvelle__bas { justify-content: flex-end; }
.dev-nouvelle__bas > .cf-btn { flex: 1 1 0; min-width: 0; }
.dev-photo-ajout { align-self: flex-start; cursor: pointer; }
@media (min-width: 780px) {
  .dev-fab { right: var(--space-6); bottom: var(--space-6); }
  .dev-par-fil { flex-direction: row; align-items: flex-start; overflow-x: auto; }
  .dev-par-fil > .dev-fil { flex: 0 0 320px; }
}

/* Administration › Documentation (PLA-ADM-015a) : mise en page responsive, schémas interactifs et composants ludiques CSP. */
.admin-doc-page { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.admin-doc-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.admin-doc-tabs[hidden] { display: none; }
.admin-doc-tabs > .cf-tabs__item { flex: none; white-space: nowrap; }
.admin-doc-body { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.admin-doc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.admin-doc-stack { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.admin-doc-card { min-width: 0; }
.admin-doc-desc { margin: 0; color: var(--ink-muted); overflow-wrap: anywhere; }
.admin-doc-hint { margin: 0; font: var(--type-small); color: var(--ink-muted); font-style: italic; }
.admin-doc-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.admin-doc-link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.admin-doc-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-doc-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-doc-chips .cf-chip.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.admin-doc-callout { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.admin-doc-callout--kid { border-left: 4px solid var(--accent); background: var(--accent-soft); }
.admin-doc-callout--example { border-left: 4px solid var(--info, var(--accent)); }
.admin-doc-callout--tip { border-left: 4px solid var(--success); }
.admin-doc-callout--warn { border-left: 4px solid var(--warning); }
.admin-doc-callout__head { display: flex; align-items: center; gap: var(--space-2); font: var(--type-small); color: var(--ink); }
.admin-doc-callout__head svg { width: 16px; height: 16px; flex: none; }
.admin-doc-callout__text { margin: 0; font: var(--type-small); color: var(--ink); overflow-wrap: anywhere; }
.admin-doc-cmd { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.admin-doc-cmd__bar { display: flex; justify-content: flex-end; }
.admin-doc-rule { display: flex; flex-direction: column; gap: var(--space-2); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.admin-doc-rule:last-child { padding-bottom: 0; border-bottom: none; }
.admin-doc-accordion-body { display: flex; flex-direction: column; gap: var(--space-3); }
.admin-doc-accordion-body[hidden] { display: none; }
.admin-doc-steps { margin: 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.admin-doc-step { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.admin-doc-step__label { display: flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; }
.admin-doc-step-check { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); cursor: pointer; }
.admin-doc-step__title { font: var(--type-body-strong); color: var(--ink); }
.admin-doc-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.admin-doc-order__item { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.admin-doc-order__num { flex: none; width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font: var(--type-body-strong); }
.admin-doc-order__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-doc-stack-row { min-width: 0; }
.admin-doc-stack-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.admin-doc-kidline { margin: 0; font: var(--type-small); color: var(--ink); }
.admin-doc-exline { color: var(--ink-muted); font-style: italic; }
.admin-doc-glossary dt { font-family: var(--font-mono, monospace); }
.admin-doc-diagram-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.admin-doc-diagram { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); padding: var(--space-2); }
.admin-doc-svg { display: block; width: 100%; height: auto; min-width: 0; }
.admin-doc-svg__node { cursor: pointer; outline: none; }
.admin-doc-svg__box { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; transition: stroke 0.15s, fill 0.15s; }
.admin-doc-svg__node--accent .admin-doc-svg__box { fill: var(--accent-soft); stroke: var(--accent); }
.admin-doc-svg__node--ok .admin-doc-svg__box { fill: var(--surface); stroke: var(--success); }
.admin-doc-svg__node--warn .admin-doc-svg__box { fill: var(--surface); stroke: var(--warning); }
.admin-doc-svg__node.is-selected .admin-doc-svg__box,
.admin-doc-svg__node:focus-visible .admin-doc-svg__box { stroke: var(--accent); stroke-width: 3; fill: var(--accent-soft); }
.admin-doc-svg__title { fill: var(--ink); font: 700 12px/16px var(--font-sans); }
.admin-doc-svg__sub { fill: var(--ink-muted); font: 400 10px/14px var(--font-sans); }
.admin-doc-svg__edge { stroke: var(--ink-muted); stroke-width: 1.5; fill: none; transition: stroke 0.15s, stroke-width 0.15s; }
.admin-doc-svg__edge.is-active { stroke: var(--accent); stroke-width: 2.5; }
.admin-doc-svg__arrow { fill: var(--ink-muted); }
.admin-doc-svg__edgelabel { fill: var(--ink-muted); font: 600 10px/12px var(--font-sans); }
.admin-doc-node-detail { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.admin-doc-node-detail__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.admin-doc-wizard__stage { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.admin-doc-wizard__q { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-doc-wizard__result { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.admin-doc-map__interactions, .admin-doc-map__links { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-doc-map__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.admin-doc-map__item { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); min-width: 0; }
.admin-doc-map__flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); font: var(--type-small); color: var(--ink); }
.admin-doc-map__subchips { padding-top: var(--space-1); border-top: 1px dashed var(--border); }
.admin-doc-map__methods { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-doc-map__method { padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font: 600 12px/18px var(--font-mono, monospace); color: var(--accent); }
.admin-doc-map-svg { min-width: 720px; }
.admin-doc-map-sec__box { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; transition: stroke 0.15s, stroke-width 0.15s, fill 0.15s; }
.admin-doc-map-sec--accent .admin-doc-map-sec__box { fill: color-mix(in srgb, var(--accent) 10%, var(--surface)); stroke: var(--accent); }
.admin-doc-map-sec--info .admin-doc-map-sec__box { fill: color-mix(in srgb, var(--info, var(--accent)) 8%, var(--surface)); stroke: color-mix(in srgb, var(--info, var(--accent)) 60%, var(--border)); }
.admin-doc-map-sec--ok .admin-doc-map-sec__box { fill: color-mix(in srgb, var(--success) 8%, var(--surface)); stroke: color-mix(in srgb, var(--success) 60%, var(--border)); }
.admin-doc-map-sec--violet .admin-doc-map-sec__box { fill: color-mix(in srgb, #8b5cf6 9%, var(--surface)); stroke: color-mix(in srgb, #8b5cf6 60%, var(--border)); }
.admin-doc-map-sec--warn .admin-doc-map-sec__box { fill: color-mix(in srgb, var(--warning) 9%, var(--surface)); stroke: color-mix(in srgb, var(--warning) 60%, var(--border)); }
.admin-doc-map-sec--danger .admin-doc-map-sec__box { fill: color-mix(in srgb, var(--danger, #ef4444) 8%, var(--surface)); stroke: color-mix(in srgb, var(--danger, #ef4444) 60%, var(--border)); }
.admin-doc-map-sec--neutral .admin-doc-map-sec__box { fill: var(--surface-2); stroke: var(--border-strong); }
.admin-doc-map-sec.is-active .admin-doc-map-sec__box { stroke-width: 2.5; }
.admin-doc-map-sec__stereo { fill: var(--ink-muted); font: 600 9px/12px var(--font-mono, monospace); }
.admin-doc-map-sec__title { fill: var(--ink); font: 700 13px/16px var(--font-sans); }
.admin-doc-map-page { cursor: pointer; outline: none; }
.admin-doc-map-page__box { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.4; transition: stroke 0.15s, fill 0.15s, stroke-width 0.15s; }
.admin-doc-map-page--accent .admin-doc-map-page__box { stroke: var(--accent); }
.admin-doc-map-page--info .admin-doc-map-page__box { stroke: color-mix(in srgb, var(--info, var(--accent)) 65%, var(--border)); }
.admin-doc-map-page--ok .admin-doc-map-page__box { stroke: color-mix(in srgb, var(--success) 65%, var(--border)); }
.admin-doc-map-page--violet .admin-doc-map-page__box { stroke: color-mix(in srgb, #8b5cf6 65%, var(--border)); }
.admin-doc-map-page--warn .admin-doc-map-page__box { stroke: color-mix(in srgb, var(--warning) 65%, var(--border)); }
.admin-doc-map-page--danger .admin-doc-map-page__box { stroke: color-mix(in srgb, var(--danger, #ef4444) 65%, var(--border)); }
.admin-doc-map-page.is-selected .admin-doc-map-page__box,
.admin-doc-map-page:focus-visible .admin-doc-map-page__box { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; }
.admin-doc-map-page__stereo { fill: var(--ink-muted); font: 500 9px/11px var(--font-mono, monospace); }
.admin-doc-map-page__title { fill: var(--ink); font: 700 12px/15px var(--font-sans); }
.admin-doc-map-page__method { fill: var(--ink); font: 600 10px/13px var(--font-mono, monospace); }
.admin-doc-map-wire__frame { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.admin-doc-map-wire__bar { fill: var(--accent); opacity: 0.75; }
.admin-doc-map-wire__tile { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.admin-doc-map-iedge { stroke: var(--ink-muted); stroke-width: 1.2; fill: none; opacity: 0.8; }
.admin-doc-map-iedge.is-dashed { stroke-dasharray: 4 3; }
.admin-doc-map-edge { stroke: var(--ink-muted); stroke-width: 1.5; fill: none; opacity: 0.45; transition: opacity 0.15s, stroke-width 0.15s; }
.admin-doc-map-edge.is-dashed { stroke-dasharray: 5 4; }
.admin-doc-map-edge.is-active { opacity: 1; stroke-width: 2.4; }
.admin-doc-map-edge--info { stroke: var(--info, var(--accent)); }
.admin-doc-map-edge--ok { stroke: var(--success); }
.admin-doc-map-edge--violet { stroke: #8b5cf6; }
.admin-doc-map-edge--warn { stroke: var(--warning); }
.admin-doc-map-edge--danger { stroke: var(--danger, #ef4444); }
.admin-doc-map-edgelabel-bg { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.admin-doc-map-edgelabel { fill: var(--ink); font: 600 9px/11px var(--font-sans); }
.admin-doc-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font: var(--type-small); color: var(--ink-muted); }
.admin-doc-breadcrumb__link { color: var(--accent); text-decoration: none; }
.admin-doc-breadcrumb__link:hover { text-decoration: underline; }
.admin-doc-breadcrumb__current { color: var(--ink); font-weight: 600; }
.admin-doc-quickbar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.admin-doc-search-results { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.admin-doc-shelf { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.admin-doc-shelf-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.15s; min-width: 0; }
.admin-doc-shelf-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.admin-doc-shelf-card__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.admin-doc-shelf-card__icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.admin-doc-shelf-card__icon svg { width: 20px; height: 20px; }
.admin-doc-shelf-card__title { font: var(--type-body-strong); color: var(--ink); }
.admin-doc-shelf-card__desc { margin: 0; font: var(--type-small); color: var(--ink-muted); overflow-wrap: anywhere; }
.admin-doc-entry-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.admin-doc-entry-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.15s; min-width: 0; }
.admin-doc-entry-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.admin-doc-entry-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; }
.admin-doc-entry-card__icon { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--accent); display: grid; place-items: center; flex: none; }
.admin-doc-entry-card__icon svg { width: 16px; height: 16px; }
.admin-doc-entry-card__title { font: var(--type-body-strong); color: var(--ink); overflow-wrap: anywhere; }
.admin-doc-entry-card__kid { margin: 0; font: var(--type-small); color: var(--ink-muted); overflow-wrap: anywhere; }
.admin-doc-entry-card__more { margin-top: auto; display: inline-flex; align-items: center; gap: var(--space-1); font: var(--type-small); font-weight: 600; color: var(--accent); }
.admin-doc-entry-card__more svg { width: 14px; height: 14px; }
.admin-doc-article-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); }
@media (min-width: 680px) {
  .admin-doc-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-doc-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 820px) {
  .admin-doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .admin-doc-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-doc-entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
