/* Gestionnaire de consentement de chef-be.fr : bandeau, panneau et vignettes de blocage. Fichier propre à chef-be.fr. */
:root {
  --cbe-bg: #ffffff;
  --cbe-bg2: #f4f6f8;
  --cbe-fg: #1b1e23;
  --cbe-muted: #545c68;
  --cbe-line: #dfe3e8;
  --cbe-btn-bg: #0a6aa1;
  --cbe-btn-bg-h: #08577f;
  --cbe-btn-fg: #ffffff;
  --cbe-link: #075e8f;
  --cbe-focus: #0a84c6;
  --cbe-shadow: 0 18px 48px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .08);
  --cbe-banner-h: 0px;
}
.cbe-theme-dark {
  --cbe-bg: #1e2127;
  --cbe-bg2: #272b32;
  --cbe-fg: #eef1f4;
  --cbe-muted: #b3bac4;
  --cbe-line: #383e47;
  --cbe-btn-bg: #47b8ee;
  --cbe-btn-bg-h: #6cc8f3;
  --cbe-btn-fg: #08141c;
  --cbe-link: #7fd0f7;
  --cbe-focus: #7fd0f7;
  --cbe-shadow: 0 18px 48px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
}

.cbe-root, .cbe-root *, .cbe-cph, .cbe-cph * { box-sizing: border-box; }
.cbe-root { font-family: Lato, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--cbe-fg); line-height: 1.5; letter-spacing: 0; }
.cbe-root [hidden], .cbe-cph [hidden] { display: none !important; }
.cbe-root h2, .cbe-root h3 { font-family: inherit; color: var(--cbe-fg); letter-spacing: 0; }
.cbe-root a { color: var(--cbe-link); text-decoration: underline; text-underline-offset: 2px; }
.cbe-root button, .cbe-cph button { font-family: inherit; }
.cbe-root :focus-visible, .cbe-cph :focus-visible { outline: 3px solid var(--cbe-focus); outline-offset: 2px; }

/* Boutons du bandeau et du panneau : tous du même poids visuel. */
.cbe-root .cbe-btn {
  appearance: none; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--cbe-btn-bg) !important; color: var(--cbe-btn-fg) !important;
  font-size: 14.5px; font-weight: 700; line-height: 1.2; padding: 12px 16px; min-height: 44px;
  transition: background-color .15s ease, transform .1s ease;
}
.cbe-root .cbe-btn:hover { background: var(--cbe-btn-bg-h) !important; }
.cbe-root .cbe-btn:active { transform: translateY(1px); }

/* ───────────── Bandeau ───────────── */
.cbe-banner {
  position: fixed; z-index: 2147483000; left: 20px; bottom: 20px;
  width: min(540px, calc(100vw - 40px));
  background: var(--cbe-bg); border: 1px solid var(--cbe-line); border-radius: 16px; box-shadow: var(--cbe-shadow);
  animation: cbe-rise .28s ease-out;
}
.cbe-banner-in { padding: 20px 22px 18px; }
.cbe-banner-title { margin: 0 0 6px; font-size: 18px; font-weight: 800; line-height: 1.3; }
.cbe-banner-text { margin: 0 0 10px; font-size: 14px; color: var(--cbe-muted); }
.cbe-context {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 6px 11px;
  background: var(--cbe-bg2); border: 1px solid var(--cbe-line); border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--cbe-fg);
}
.cbe-context::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e53935; flex: none; }
.cbe-gpc-note { margin: 0 0 12px; font-size: 12.5px; color: var(--cbe-muted); border-left: 3px solid var(--cbe-btn-bg); padding-left: 9px; }
.cbe-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
@keyframes cbe-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Le bouton flottant « + » du site remonte au-dessus du bandeau. */
.cbe-banner-open .fixed-action-btn { transition: bottom .2s ease; }

@media (max-width: 767px) {
  .cbe-banner { left: 0; right: 0; bottom: 0; width: 100%; border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
  .cbe-banner-in { padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); }
  .cbe-banner-title { font-size: 16px; margin-bottom: 4px; }
  .cbe-banner-text { font-size: 13px; margin-bottom: 8px; }
  .cbe-context { font-size: 12.5px; margin-bottom: 8px; padding: 4px 10px; }
  .cbe-gpc-note { font-size: 12px; margin-bottom: 8px; }
  .cbe-actions { gap: 6px; }
  .cbe-actions .cbe-btn { font-size: 13px; padding: 10px 6px; }
  .cbe-banner-open .fixed-action-btn { bottom: calc(var(--cbe-banner-h) + 14px) !important; }
  .cbe-banner-open body { padding-bottom: var(--cbe-banner-h); }
}

/* ───────────── Panneau ───────────── */
.cbe-overlay {
  position: fixed; inset: 0; z-index: 2147483001; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(10, 14, 20, .55); backdrop-filter: blur(2px);
}
.cbe-panel {
  width: min(680px, 100%); max-height: min(88vh, 860px); display: flex; flex-direction: column;
  background: var(--cbe-bg); border: 1px solid var(--cbe-line); border-radius: 18px; box-shadow: var(--cbe-shadow);
  outline: none; animation: cbe-rise .22s ease-out;
}
.cbe-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--cbe-line); }
.cbe-panel-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.cbe-close {
  appearance: none; border: 0; background: transparent; color: var(--cbe-fg); width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.cbe-close:hover { background: var(--cbe-bg2); }
.cbe-close svg { width: 22px; height: 22px; }
.cbe-panel-body { overflow-y: auto; padding: 14px 22px 8px; overscroll-behavior: contain; }
.cbe-intro { margin: 0 0 12px; font-size: 14px; color: var(--cbe-muted); }
.cbe-panel-body > .cbe-context { margin-bottom: 14px; }
.cbe-cat { border: 1px solid var(--cbe-line); border-radius: 14px; padding: 14px 16px; margin: 0 0 12px; background: var(--cbe-bg); }
.cbe-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cbe-cat-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.cbe-cat-text { margin: 6px 0 0; font-size: 13.5px; color: var(--cbe-muted); }
.cbe-always { font-size: 12.5px; font-weight: 700; color: var(--cbe-muted); background: var(--cbe-bg2); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* Interrupteur (case à cocher native, donc accessible au clavier et aux lecteurs d'écran). */
.cbe-switch { position: relative; display: inline-flex; flex: none; width: 48px; height: 28px; cursor: pointer; margin: 0; }
.cbe-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.cbe-track { position: absolute; inset: 0; border-radius: 999px; background: #8a939f; transition: background-color .15s; }
.cbe-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.cbe-switch input:checked + .cbe-track { background: var(--cbe-btn-bg); }
.cbe-switch input:checked + .cbe-track::after { transform: translateX(20px); }
.cbe-switch input:indeterminate + .cbe-track { background: linear-gradient(90deg, var(--cbe-btn-bg) 50%, #8a939f 50%); }
.cbe-switch input:indeterminate + .cbe-track::after { transform: translateX(10px); }
.cbe-switch input:focus-visible + .cbe-track { outline: 3px solid var(--cbe-focus); outline-offset: 2px; }

.cbe-provs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.cbe-prov { background: var(--cbe-bg2); border-radius: 11px; padding: 10px 12px; }
.cbe-prov p { margin: 4px 0 0 32px; font-size: 13px; color: var(--cbe-muted); }
.cbe-prov-row { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-weight: 700; }
.cbe-prov-name { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; color: var(--cbe-fg); }
.cbe-cs-check { position: relative; width: 22px; height: 22px; flex: none; }
.cbe-cs-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.cbe-cs-check span { position: absolute; inset: 0; border-radius: 6px; border: 2px solid #8a939f; background: var(--cbe-bg); transition: all .12s; }
.cbe-cs-check input:checked + span { background: var(--cbe-btn-bg); border-color: var(--cbe-btn-bg); }
.cbe-cs-check input:checked + span::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid var(--cbe-btn-fg); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.cbe-cs-check input:focus-visible + span { outline: 3px solid var(--cbe-focus); outline-offset: 2px; }
.cbe-here { margin-left: auto; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: #d32f2f; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.cbe-cph-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--cbe-prov, #607d8b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cbe-prov, #607d8b) 25%, transparent); flex: none; }

.cbe-details { margin-top: 10px; }
.cbe-details summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--cbe-link); padding: 4px 0; }
.cbe-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.cbe-items li { background: var(--cbe-bg2); border-radius: 10px; padding: 8px 11px; }
.cbe-item-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cbe-items code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--cbe-fg); background: transparent; padding: 0; white-space: normal; word-break: break-word; }
.cbe-item-dur { font-size: 12px; color: var(--cbe-muted); white-space: nowrap; }
.cbe-items p { margin: 3px 0 0; font-size: 12.8px; color: var(--cbe-muted); }
.cbe-item-who { display: inline-block; font-size: 11.5px; font-weight: 700; border: 1px solid var(--cbe-line); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
.cbe-policy { font-size: 13px; margin: 4px 0 10px; }
.cbe-panel-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--cbe-line); }
.cbe-panel-open, .cbe-panel-open body { overflow: hidden; }

@media (max-width: 767px) {
  .cbe-overlay { padding: 0; align-items: stretch; }
  .cbe-panel { width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .cbe-panel-head { padding: 14px 16px 10px; }
  .cbe-panel-head h2 { font-size: 18px; }
  .cbe-panel-body { padding: 12px 16px 6px; flex: 1; }
  .cbe-panel-foot { grid-template-columns: 1fr 1fr; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .cbe-panel-foot [data-cbe-do="save"] { grid-column: 1 / -1; order: -1; }
  .cbe-panel-foot .cbe-btn { font-size: 13.5px; padding: 11px 8px; }
  .cbe-prov p { margin-left: 0; }
}

/* ───────────── Vignette à la place d'un lecteur externe ───────────── */
.cbe-cph {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  container-type: inline-size; overflow: hidden; color: #f3f5f7; border-radius: inherit;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--cbe-prov, #607d8b) 38%, transparent), transparent 70%),
    linear-gradient(180deg, #171a1f, #0d0f12);
  font-family: Lato, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.45;
}
.cbe-cph.cbe-cph-fill { position: absolute; inset: 0; z-index: 2; }
.cbe-cph.cbe-cph-box { min-height: 170px; border-radius: 12px; margin: 8px 0; }
.cbe-cph-in { padding: 16px 20px; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cbe-cph-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .02em; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 12px; }
.cbe-cph-txt { margin: 0; font-size: 15px; font-weight: 600; color: #f3f5f7; }
.cbe-cph-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cbe-cph-btn {
  appearance: none; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; border-radius: 999px;
  font-size: 14px; font-weight: 800; padding: 10px 18px; min-height: 42px; line-height: 1.1;
  transition: background-color .15s ease, color .15s ease;
}
.cbe-cph .cbe-cph-play { background: #ffffff !important; color: #111418 !important; border: 2px solid #ffffff !important; }
.cbe-cph .cbe-cph-play:hover { background: #e8ebef !important; border-color: #e8ebef !important; }
.cbe-cph-play svg { width: 18px; height: 18px; }
.cbe-cph .cbe-cph-always { background: transparent !important; color: #ffffff !important; border: 2px solid rgba(255,255,255,.75) !important; }
.cbe-cph .cbe-cph-always:hover { background: rgba(255,255,255,.12) !important; }
.cbe-cph-more { appearance: none; background: none; border: 0; padding: 2px 4px; color: #c9d1da; font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cbe-cph-more:hover { color: #ffffff; }
.cbe-cph :focus-visible { outline: 3px solid #7fd0f7; outline-offset: 2px; }
/* Plateforme coupée par l'administration : pas de lecture possible. */
.cbe-cph.cbe-cph-off { background: linear-gradient(180deg, #23262b, #16181c); }
.cbe-cph-off .cbe-cph-txt { font-weight: 500; color: #d5dae0; }
.cbe-cph-off .cbe-cph-dot { background: #8a939f; box-shadow: none; }
.cbe-root .cbe-cat-text a, .cbe-root .cbe-banner-text a, .cbe-root .cbe-intro a { color: var(--cbe-link); }
@container (max-width: 460px) {
  .cbe-cph-in { padding: 10px 12px; gap: 7px; }
  .cbe-cph-txt { font-size: 13px; }
  .cbe-cph-badge { font-size: 12px; padding: 3px 10px; }
  .cbe-cph-btn { font-size: 12.5px; padding: 7px 12px; min-height: 36px; }
  .cbe-cph-more { font-size: 12px; }
}
@container (max-width: 300px) {
  .cbe-cph-txt { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cbe-banner, .cbe-panel { animation: none; }
  .cbe-btn, .cbe-track, .cbe-track::after { transition: none; }
}
