/*
 * Espace de gestion d'un événement — mobile d'abord.
 * Coque : barre latérale (ordinateur) / barre du bas avec bouton Scanner (téléphone).
 * Chargements : barre de progression de navigation, boutons occupés, squelettes, listes « périmées » pendant la recherche.
 * Mouvement : entrées en cascade, compteurs, jauges, barres qui poussent, feuilles qui glissent. Tout respecte prefers-reduced-motion.
 */
@layer components {
  /* ---------- Coque ---------- */
  .ws { display: grid; gap: var(--sp-5); padding-bottom: calc(96px + env(safe-area-inset-bottom)); min-width: 0; }
  .ws-main { display: grid; gap: var(--sp-5); min-width: 0; align-content: start; }
  .ws-head { display: grid; gap: var(--sp-2); min-width: 0; view-transition-name: ws-head; }
  .ws-head-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-width: 0; }
  .ws-title { margin: 0; font: 760 var(--fs-xl)/1.1 var(--font-display); letter-spacing: -0.02em; min-width: 0; overflow-wrap: anywhere; }
  .ws-event { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; color: var(--c-text-muted); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
  .ws-event > span:not(.pill) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ws-side { display: none; }

  /* Barre du bas (téléphone) */
  .bnav { position: fixed; z-index: 40; inset: auto 0 0 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--c-surface) 88%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid var(--c-border); view-transition-name: bnav; }
  .bnav-item { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 2px 2px; border-radius: 14px;
    color: var(--c-text-muted); text-decoration: none; font-size: 0.68rem; font-weight: 650; -webkit-tap-highlight-color: transparent; min-width: 0; }
  .bnav-item > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bnav-item .icon { width: 22px; height: 22px; transition: transform var(--dur-base) var(--ease-spring); }
  .bnav-item[aria-current="page"] { color: var(--c-accent); }
  .bnav-item[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 4px 4px;
    background: var(--c-accent); animation: grow-x var(--dur-base) var(--ease-out) both; }
  .bnav-item[aria-current="page"] .icon { transform: translateY(-1px) scale(1.08); }
  .bnav-item:active .icon { transform: scale(0.88); }
  .bnav-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--c-danger); color: white; font-size: 0.66rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--c-surface);
    animation: pop 0.5s var(--ease-spring) both; }
  .bnav-scan { display: grid; justify-items: center; gap: 2px; margin-top: -26px; color: var(--c-text); text-decoration: none; font-size: 0.68rem; font-weight: 700; }
  .bnav-scan-btn { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 22px 26px 22px 26px;
    background: var(--g-accent); color: var(--c-accent-contrast); box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--c-accent) 70%, transparent), 0 0 0 4px var(--c-surface);
    transition: transform var(--dur-base) var(--ease-spring); }
  .bnav-scan-btn .icon { width: 28px; height: 28px; }
  .bnav-scan-btn { animation: scan-glow 2.6s var(--ease-out) infinite; }
  @media (max-width: 22rem) { .bnav-scan-btn { width: 52px; height: 52px; } .bnav-scan { margin-top: -20px; } }
  .bnav-scan:active .bnav-scan-btn { transform: scale(0.92) rotate(-4deg); }
  .bnav-scan-off { visibility: hidden; }

  /* ---------- Ordinateur : barre latérale ---------- */
  @media (min-width: 60rem) {
    .ws { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; padding-bottom: var(--sp-7); }
    .ws-side { position: sticky; top: var(--sp-5); display: grid; gap: 2px; padding: var(--sp-3); border-radius: var(--radius-lg); background: var(--c-surface);
      border: 1px solid var(--c-border); box-shadow: var(--shadow-1); view-transition-name: ws-side; }
    .ws-side-title { margin: 0 0 var(--sp-2); padding: var(--sp-2) var(--sp-3); font: 700 var(--fs-sm)/1.3 var(--font-display); overflow-wrap: anywhere; }
    .ws-side a { position: relative; display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; padding: 0 var(--sp-3); border-radius: 12px;
      color: var(--c-text-muted); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; transition: background var(--dur-micro), color var(--dur-micro); }
    .ws-side a:hover { background: var(--c-surface-2); color: var(--c-text); }
    .ws-side a[aria-current="page"] { background: var(--c-accent-soft); color: var(--c-accent); }
    .ws-side .icon { width: 18px; height: 18px; flex: none; }
    .ws-side .side-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--c-danger); color: white; font-size: 0.7rem; font-weight: 800; text-align: center; }
    .ws-side .side-scan { margin-top: var(--sp-2); background: var(--g-accent); color: var(--c-accent-contrast); }
    .ws-side .side-scan:hover { background: var(--g-accent); color: var(--c-accent-contrast); filter: brightness(1.08); }
    .bnav { display: none; }
  }

  /* ---------- Plus : grille de sections ---------- */
  .tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: var(--sp-3); }
  .tile { display: grid; gap: var(--sp-3); align-content: space-between; min-height: 112px; padding: var(--sp-4); border-radius: var(--radius-lg);
    background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text); text-decoration: none; font-weight: 700; box-shadow: var(--shadow-1);
    transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base); min-width: 0; overflow-wrap: anywhere; }
  .tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
  .tile:active { transform: scale(0.97); }
  .tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-blob); background: var(--c-accent-soft); color: var(--c-accent); }
  .tiles li:nth-child(3n+2) .tile-icon { background: color-mix(in srgb, var(--c-accent-2) 18%, var(--c-surface)); color: color-mix(in srgb, var(--c-accent-2) 70%, var(--c-ink)); border-radius: var(--radius-blob-2); }
  .tiles li:nth-child(3n) .tile-icon { background: color-mix(in srgb, var(--c-accent-3) 30%, var(--c-surface)); color: color-mix(in srgb, var(--c-accent-3) 40%, var(--c-ink)); }

  /* ---------- Recherche et filtres ---------- */
  .searchbar { position: sticky; top: var(--app-top, var(--topbar-h, 0px)); z-index: 20; display: grid; gap: var(--sp-3); padding: var(--sp-2) 0 var(--sp-3);
    background: linear-gradient(var(--c-bg) 82%, transparent); }
  .search { position: relative; display: flex; align-items: center; min-width: 0; }
  .search .icon { position: absolute; left: 14px; color: var(--c-text-muted); pointer-events: none; }
  .search .input { padding-left: 44px; border-radius: var(--radius-pill); min-height: 50px; }
  .search-spinner { position: absolute; right: 14px; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--c-border); border-top-color: var(--c-accent);
    opacity: 0; transition: opacity var(--dur-micro); animation: spin 0.8s linear infinite; }
  .is-searching .search-spinner { opacity: 1; }
  .chips-scroll { display: flex; gap: var(--sp-2); overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 0; scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .chips-scroll::-webkit-scrollbar { display: none; }
  .fchip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 38px; padding: 0 14px; border-radius: var(--radius-pill); scroll-snap-align: start;
    background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text); font-size: var(--fs-sm); font-weight: 650; text-decoration: none;
    transition: background var(--dur-micro), color var(--dur-micro), transform var(--dur-micro); }
  .fchip:active { transform: scale(0.95); }
  .fchip[aria-current="true"] { background: var(--c-ink); border-color: var(--c-ink); color: white; }
  .fchip-count { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--c-surface-2); color: var(--c-text-muted); font-size: 0.72rem; font-weight: 800; text-align: center; }
  .fchip[aria-current="true"] .fchip-count { background: color-mix(in srgb, white 22%, transparent); color: white; }
  .fchip-hot .fchip-count { background: var(--c-danger); color: white; }

  /* ---------- Listes ---------- */
  .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); transition: opacity var(--dur-base); }
  .row { display: flex; align-items: center; gap: var(--sp-3); min-height: 68px; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-lg);
    background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text); text-decoration: none; min-width: 0;
    transition: transform var(--dur-micro) var(--ease-out), border-color var(--dur-micro), box-shadow var(--dur-base); }
  a.row:hover { border-color: color-mix(in srgb, var(--c-accent) 35%, var(--c-border)); box-shadow: var(--shadow-1); }
  a.row:active { transform: scale(0.985); }
  .row-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
  .row-title { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row-sub { font-size: var(--fs-xs); color: var(--c-text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row-end { display: grid; justify-items: end; gap: 4px; flex: none; text-align: right; }
  .row-amount { font: 760 var(--fs-sm)/1 var(--font-display); white-space: nowrap; }
  .avatar { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: var(--radius-blob); background: var(--c-accent-soft);
    color: var(--c-accent); font: 760 0.9rem/1 var(--font-display); }
  .rows > li:nth-child(4n+2) .avatar { background: color-mix(in srgb, var(--c-accent-2) 20%, var(--c-surface)); color: color-mix(in srgb, var(--c-accent-2) 65%, var(--c-ink)); border-radius: var(--radius-blob-2); }
  .rows > li:nth-child(4n+3) .avatar { background: color-mix(in srgb, var(--c-accent-3) 34%, var(--c-surface)); color: color-mix(in srgb, var(--c-accent-3) 35%, var(--c-ink)); }
  .rows > li:nth-child(4n) .avatar { background: color-mix(in srgb, var(--c-success) 16%, var(--c-surface)); color: var(--c-success); border-radius: var(--radius-blob-2); }
  .avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
  .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c-border); flex: none; }
  .dot-ok { background: var(--c-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-success) 20%, transparent); }
  .tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 0.7rem; font-weight: 750; white-space: nowrap;
    background: var(--c-surface-2); color: var(--c-text-muted); }
  .tag-ok { background: color-mix(in srgb, var(--c-success) 15%, var(--c-surface)); color: var(--c-success); }
  .tag-warn { background: color-mix(in srgb, var(--c-warning) 28%, var(--c-surface)); color: color-mix(in srgb, var(--c-warning) 38%, var(--c-text)); }
  .tag-bad { background: color-mix(in srgb, var(--c-danger) 12%, var(--c-surface)); color: var(--c-danger); }
  .tag-accent { background: var(--c-accent-soft); color: var(--c-accent); }
  .list-foot { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; align-items: center; }
  .empty { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--c-text-muted); }
  .empty-blob { display: grid; place-items: center; width: 84px; height: 84px; border-radius: var(--radius-blob); background: var(--c-accent-soft); color: var(--c-accent);
    animation: morph 8s var(--ease-in-out) infinite alternate; }
  .empty-blob .icon { width: 34px; height: 34px; }

  /* ---------- Fiche (détail) ---------- */
  .sheet-head { display: grid; justify-items: center; gap: var(--sp-2); text-align: center; padding: var(--sp-5) var(--sp-4); border-radius: var(--radius-xl);
    background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-2); position: relative; overflow: hidden; isolation: isolate; }
  .sheet-head::before { content: ""; position: absolute; inset: 0 0 55% 0; z-index: -1; background: var(--g-accent); opacity: 0.12; }
  .sheet-name { margin: 0; font: 760 var(--fs-lg)/1.2 var(--font-display); overflow-wrap: anywhere; }
  .actions-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: var(--sp-2); width: 100%; }
  .dl { margin: 0; display: grid; gap: 0; }
  .dl > div { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px dashed var(--c-border); min-width: 0; }
  .dl > div:last-child { border-bottom: 0; }
  .dl dt { color: var(--c-text-muted); font-size: var(--fs-sm); flex: none; max-width: 45%; }
  .dl dd { margin: 0; font-weight: 650; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .decide { display: grid; gap: var(--sp-3); }
  .decide-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
  .btn-success { background: var(--c-success); box-shadow: none; }
  .btn-outline-danger { background: var(--c-surface); color: var(--c-danger); border: 1px solid color-mix(in srgb, var(--c-danger) 40%, var(--c-border)); box-shadow: none; }

  /* ---------- Tableau de bord ---------- */
  .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  @media (min-width: 40rem) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .kpi { position: relative; display: grid; gap: 4px; padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--c-surface); border: 1px solid var(--c-border);
    color: var(--c-text); text-decoration: none; min-width: 0; overflow: hidden; isolation: isolate; }
  .kpi::after { content: ""; position: absolute; right: -18px; bottom: -22px; z-index: -1; width: 74px; height: 74px; border-radius: var(--radius-blob); background: var(--c-accent-soft); }
  .kpi:nth-child(2)::after { background: color-mix(in srgb, var(--c-success) 14%, transparent); border-radius: var(--radius-blob-2); }
  .kpi:nth-child(3)::after { background: color-mix(in srgb, var(--c-accent-3) 30%, transparent); }
  .kpi:nth-child(4)::after { background: color-mix(in srgb, var(--c-accent-2) 18%, transparent); border-radius: var(--radius-blob-2); }
  .kpi-value { font: 780 clamp(1.3rem, 1rem + 2vw, 1.8rem)/1.05 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
  .kpi-label { font-size: var(--fs-xs); font-weight: 650; color: var(--c-text-muted); }
  .kpi-alert .kpi-value { color: var(--c-danger); }
  .fill { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--sp-4); }
  .ring { width: 92px; height: 92px; transform: rotate(-90deg); }
  .ring-track { fill: none; stroke: var(--c-surface-2); stroke-width: 10; }
  .ring-val { fill: none; stroke: var(--c-accent); stroke-width: 10; stroke-linecap: round; animation: ring-draw 1.2s var(--ease-out) 0.2s both; }
  .ring-text { font: 780 1.25rem/1 var(--font-display); }
  .chart { width: 100%; height: 120px; display: block; overflow: visible; }
  .chart-axis-row { display: flex; justify-content: space-between; margin: -6px 0 0; font-size: var(--fs-xs); color: var(--c-text-muted); font-weight: 600; }
  .ws-when { display: flex; align-items: center; gap: 6px; margin: 0; }
  .ws-when .icon { width: 16px; height: 16px; flex: none; }
  @media (min-width: 60rem) { .dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); align-items: start; } }
  .chart-bar { fill: var(--c-accent); transform-box: fill-box; transform-origin: bottom; animation: bar-grow 0.7s var(--ease-spring) both; }
  .chart-bar-zero { fill: var(--c-surface-2); }
  .chart-axis { fill: var(--c-text-muted); font: 600 9px var(--font-sans); }
  .chart g > rect:nth-child(5n+1) { animation-delay: 0.05s; } .chart g > rect:nth-child(5n+2) { animation-delay: 0.1s; }
  .chart g > rect:nth-child(5n+3) { animation-delay: 0.15s; } .chart g > rect:nth-child(5n+4) { animation-delay: 0.2s; } .chart g > rect:nth-child(5n) { animation-delay: 0.25s; }
  .meter { height: 10px; border-radius: 6px; background: var(--c-surface-2); overflow: hidden; }
  .meter > svg { display: block; width: 100%; height: 100%; }
  .meter rect { fill: var(--c-accent); transform-box: fill-box; transform-origin: left; animation: grow-x 0.9s var(--ease-out) 0.15s both; }
  .meter-row { display: grid; gap: 6px; }
  .meter-head { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 650; min-width: 0; }
  .meter-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: var(--sp-2); }
  .quick a { display: grid; justify-items: start; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-lg); background: var(--c-surface);
    border: 1px solid var(--c-border); color: var(--c-text); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; transition: transform var(--dur-micro); }
  .quick a:active { transform: scale(0.97); }
  .quick .icon { color: var(--c-accent); }

  /* ---------- Formulaires en carte et feuilles repliables ---------- */
  .fold { border: 1px solid var(--c-border); border-radius: var(--radius-lg); background: var(--c-surface); overflow: hidden; }
  .fold > summary { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: 0 var(--sp-4); cursor: pointer; list-style: none; font-weight: 700; }
  .fold > summary::-webkit-details-marker { display: none; }
  .fold > summary .icon:first-child { color: var(--c-accent); }
  .fold > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2.5px solid var(--c-text-muted); border-bottom: 2.5px solid var(--c-text-muted);
    transform: rotate(45deg) translateY(-3px); transition: transform var(--dur-base) var(--ease-out); flex: none; }
  .fold[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
  .fold-body { display: grid; gap: var(--sp-4); padding: 0 var(--sp-4) var(--sp-4); animation: fold-in var(--dur-base) var(--ease-out); }
  .fold-primary > summary { color: var(--c-accent); }
  .checks { display: grid; gap: var(--sp-2); }
  .check-card { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3); border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-surface);
    cursor: pointer; transition: border-color var(--dur-micro), background var(--dur-micro); min-width: 0; }
  .check-card:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-soft); }
  .check-card input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--c-accent); flex: none; }
  .check-card-text { display: grid; gap: 2px; min-width: 0; }
  .check-card-text strong { font-size: var(--fs-sm); }
  .check-card-text small { color: var(--c-text-muted); font-size: var(--fs-xs); }
  .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--c-surface-2); }
  .seg label { position: relative; display: grid; place-items: center; min-height: 40px; padding: 0 var(--sp-2); border-radius: var(--radius-pill); cursor: pointer;
    font-size: var(--fs-sm); font-weight: 650; color: var(--c-text-muted); text-align: center; }
  .seg input { position: absolute; opacity: 0; inset: 0; }
  .seg label:has(input:checked) { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-1); }
  .seg label:has(input:focus-visible) { outline: 3px solid var(--c-focus); }
  .secret-box { display: grid; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--c-ink); color: white; }
  .secret-box .mono { overflow-wrap: anywhere; font-size: var(--fs-sm); }
  .secret-row { display: flex; align-items: center; gap: var(--sp-2); justify-content: space-between; min-width: 0; }
  .secret-row code { min-width: 0; overflow-wrap: anywhere; }
  .timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); position: relative; }
  .timeline::before { content: ""; position: absolute; left: 52px; top: 8px; bottom: 8px; width: 2px; background: var(--c-border); border-radius: 2px; }
  .tl-item { display: grid; grid-template-columns: 44px 1fr; gap: var(--sp-4); align-items: start; min-width: 0; }
  .tl-time { padding-top: 14px; font: 750 var(--fs-sm)/1 var(--font-display); font-variant-numeric: tabular-nums; text-align: right; }
  .tl-card { position: relative; display: grid; gap: 4px; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-lg); background: var(--c-surface); border: 1px solid var(--c-border); min-width: 0; color: var(--c-text); text-decoration: none; }
  .tl-card::before { content: ""; position: absolute; left: -14px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 3px var(--c-bg); }
  .tl-break .tl-card { background: var(--c-surface-2); }
  .tl-break .tl-card::before { background: var(--c-accent-3); }
  .day-label { margin: var(--sp-3) 0 var(--sp-1); font: 750 var(--fs-sm)/1.2 var(--font-display); text-transform: capitalize; color: var(--c-text-muted); }
  .people-strip { display: flex; flex-wrap: wrap; gap: 6px; }

  /* ---------- Toast ---------- */
  .toast { position: fixed; z-index: 60; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: var(--sp-2);
    max-width: min(92vw, 26rem); padding: 12px 18px; border-radius: var(--radius-pill); background: var(--c-ink); color: white; font-weight: 650; font-size: var(--fs-sm);
    box-shadow: var(--shadow-3); transform: translateX(-50%); animation: toast-in 0.5s var(--ease-spring) both, toast-out 0.4s var(--ease-in) 3.4s both; pointer-events: none; }
  .toast .icon { color: var(--c-success); flex: none; }
  @media (min-width: 60rem) { .toast { bottom: var(--sp-6); } }

  /* ---------- Feuille de confirmation (créée par ui.js) ---------- */
  .confirm-sheet { width: min(100%, 30rem); max-width: 100%; margin: auto auto 0; padding: 0; border: 0; border-radius: 26px 26px 0 0; background: var(--c-surface); color: var(--c-text);
    box-shadow: var(--shadow-3); }
  .confirm-sheet[open] { animation: sheet-up 0.42s var(--ease-spring) both; }
  .confirm-sheet::backdrop { background: oklch(15% 0.03 270 / 0.45); backdrop-filter: blur(3px); animation: fade-in var(--dur-base) both; }
  .confirm-body { display: grid; gap: var(--sp-4); padding: var(--sp-5) var(--sp-5) calc(var(--sp-5) + env(safe-area-inset-bottom)); }
  .confirm-body::before { content: ""; justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--c-border); }
  .confirm-text { margin: 0; font: 700 var(--fs-lg)/1.3 var(--font-display); text-align: center; }
  @media (min-width: 40rem) { .confirm-sheet { margin: auto; border-radius: 26px; } }

  /* Chargements (barre de navigation, boutons occupés) : base.css, partagés avec les pages publiques. */
  [data-results].is-stale { opacity: 0.45; filter: saturate(0.6); pointer-events: none; }
  .skeleton { position: relative; overflow: hidden; background: var(--c-surface-2); border-radius: 12px; }
  .skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, color-mix(in srgb, white 55%, transparent), transparent); animation: shimmer 1.3s infinite; }
  .sk-line { height: 14px; }
  .sk-row { height: 68px; border-radius: var(--radius-lg); }
  .spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--c-border); border-top-color: var(--c-accent); animation: spin 0.8s linear infinite; }
  .loader-blob { width: 64px; height: 64px; border-radius: var(--radius-blob); background: var(--g-accent); animation: morph 1.6s var(--ease-in-out) infinite alternate, spin 6s linear infinite; }

  /* ---------- Entrées en cascade ---------- */
  .rows > li, .tiles > li, .kpis > *, .timeline > li { animation: rise-in 0.5s var(--ease-out) both; }
  .rows > li:nth-child(1), .tiles > li:nth-child(1), .kpis > :nth-child(1), .timeline > li:nth-child(1) { animation-delay: 0.02s; }
  .rows > li:nth-child(2), .tiles > li:nth-child(2), .kpis > :nth-child(2), .timeline > li:nth-child(2) { animation-delay: 0.06s; }
  .rows > li:nth-child(3), .tiles > li:nth-child(3), .kpis > :nth-child(3), .timeline > li:nth-child(3) { animation-delay: 0.1s; }
  .rows > li:nth-child(4), .tiles > li:nth-child(4), .kpis > :nth-child(4), .timeline > li:nth-child(4) { animation-delay: 0.14s; }
  .rows > li:nth-child(5), .tiles > li:nth-child(5), .timeline > li:nth-child(5) { animation-delay: 0.18s; }
  .rows > li:nth-child(6), .tiles > li:nth-child(6), .timeline > li:nth-child(6) { animation-delay: 0.22s; }
  .rows > li:nth-child(7), .tiles > li:nth-child(7), .timeline > li:nth-child(7) { animation-delay: 0.26s; }
  .rows > li:nth-child(8), .tiles > li:nth-child(8), .timeline > li:nth-child(8) { animation-delay: 0.3s; }
  .rows > li:nth-child(n+9), .tiles > li:nth-child(n+9), .timeline > li:nth-child(n+9) { animation-delay: 0.33s; }
  .ws-main > * { animation: rise-in 0.45s var(--ease-out) both; }
  .ws-main > :nth-child(2) { animation-delay: 0.04s; } .ws-main > :nth-child(3) { animation-delay: 0.08s; }
  .ws-main > :nth-child(4) { animation-delay: 0.12s; } .ws-main > :nth-child(n+5) { animation-delay: 0.16s; }
}

@layer components {
  @keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }
  @keyframes grow-x { from { transform: scaleX(0); } }
  @keyframes bar-grow { from { transform: scaleY(0); } }
  @keyframes ring-draw { from { stroke-dashoffset: 100; } }
  @keyframes scan-glow {
    0% { box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--c-accent) 70%, transparent), 0 0 0 4px var(--c-surface), 0 0 0 4px color-mix(in srgb, var(--c-accent) 45%, transparent); }
    70%, 100% { box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--c-accent) 70%, transparent), 0 0 0 4px var(--c-surface), 0 0 0 16px transparent; } }
  @keyframes ring-pulse { 0% { transform: scale(0.9); opacity: 0.9; } 70%, 100% { transform: scale(1.25); opacity: 0; } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes shimmer { to { transform: translateX(100%); } }
  @keyframes shimmer-x { to { background-position: -200% 0; } }
  @keyframes nav-progress { from { transform: scaleX(0); } 20% { transform: scaleX(0.45); } to { transform: scaleX(0.94); } }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 24px) scale(0.92); } }
  @keyframes toast-out { to { opacity: 0; transform: translate(-50%, 12px); } }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes fold-in { from { opacity: 0; transform: translateY(-6px); } }
  @keyframes morph { 0% { border-radius: 58% 42% 52% 48% / 46% 54% 46% 54%; } 50% { border-radius: 42% 58% 38% 62% / 55% 38% 62% 45%; } 100% { border-radius: 50% 50% 60% 40% / 40% 60% 40% 60%; } }
  @media (prefers-reduced-motion: reduce) {
    .rows > li, .tiles > li, .kpis > *, .timeline > li, .ws-main > *, .chart-bar, .meter rect, .ring-val, .toast, .confirm-sheet[open],
    .bnav-scan-btn, .empty-blob, .loader-blob, .bnav-badge { animation: none !important; }
    .toast { animation: toast-out 0.2s linear 3.4s both !important; }
  }
}

@layer components {
  .stack-sm { display: grid; gap: 4px; min-width: 0; }
  .checks-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
  .h-icon { display: flex; align-items: center; gap: var(--sp-2); }
  .h-icon .icon { color: var(--c-accent); }
  body:has(.bnav) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  @media (min-width: 60rem) { body:has(.bnav) { padding-bottom: 0; } }
  .field-row-3 { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; }
  @media (min-width: 30rem) { .field-row-3 { grid-template-columns: 1.4fr 1fr 1fr; } }
  .input-upper { text-transform: uppercase; letter-spacing: 0.06em; }
  .member > summary { min-height: 68px; }
  .member > summary .avatar { flex: none; }
  .rows > li > .fold { border-radius: var(--radius-lg); }
  .order-btns { display: flex; gap: 2px; flex: none; }
  .order-btns form { margin: 0; }
  .btn-up .icon { transform: rotate(-90deg); }
  .rank { font-size: 0.95rem; }
  .promo-off { opacity: 0.6; }
  .promo-row .meter { display: block; height: 6px; margin-top: 6px; }
  .live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c-border); flex: none; }
  .live-on { background: var(--c-danger); box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-danger) 60%, transparent); animation: live-pulse 1.6s infinite; }
  @keyframes live-pulse { 70% { box-shadow: 0 0 0 10px transparent; } }

  /* Interrupteur */
  .switch { position: relative; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 16px; background: var(--c-border); cursor: pointer; flex: none;
    transition: background var(--dur-base) var(--ease-out); }
  .switch span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: white; box-shadow: var(--shadow-1);
    transition: transform var(--dur-base) var(--ease-spring); }
  .switch-on { background: var(--c-success); }
  .switch-on span { transform: translateX(20px); }

  /* Contrôle */
  .checkin-hero { display: flex; align-items: center; gap: var(--sp-5); }
  .ring-lg { width: 120px; height: 120px; flex: none; }
  .ring-success { stroke: var(--c-success); }
  .scan-cta { min-height: 64px; font-size: 1.1rem; }
  .res-admitted { background: color-mix(in srgb, var(--c-success) 16%, var(--c-surface)) !important; color: var(--c-success) !important; }
  .res-duplicate { background: color-mix(in srgb, var(--c-warning) 26%, var(--c-surface)) !important; color: color-mix(in srgb, var(--c-warning) 40%, var(--c-text)) !important; }
  .res-invalid, .res-cancelled, .res-wrong_event { background: color-mix(in srgb, var(--c-danger) 12%, var(--c-surface)) !important; color: var(--c-danger) !important; }
  .res-undone { background: var(--c-surface-2) !important; color: var(--c-text-muted) !important; }

  /* ---------- Scanner plein écran ---------- */
  body.scanner { position: fixed; inset: 0; margin: 0; display: grid; grid-template-rows: auto 1fr auto; background: #0f0e1d; color: white; overflow: hidden;
    font-family: var(--font-sans); -webkit-user-select: none; user-select: none; }
  .sc-top { display: flex; align-items: center; gap: var(--sp-3); padding: calc(10px + env(safe-area-inset-top)) var(--sp-4) 10px; z-index: 3;
    background: linear-gradient(#0f0e1d, color-mix(in srgb, #0f0e1d 70%, transparent)); }
  .sc-head { flex: 1; min-width: 0; }
  .sc-title { margin: 0; font: 760 1rem/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sc-status { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 0.75rem; color: color-mix(in srgb, white 70%, transparent); }
  .sc-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.25); }
  .sc-status.is-off .sc-dot { background: #ffb020; box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.25); animation: live-pulse 1.6s infinite; }
  .sc-queue { padding: 1px 8px; border-radius: 10px; background: #ffb020; color: #1a1300; font-weight: 800; }
  .sc-counter { position: relative; display: grid; place-items: center; width: 58px; height: 58px; flex: none; }
  .sc-counter svg { position: absolute; inset: 0; transform: rotate(-90deg); }
  .sc-counter .ring-track { stroke: rgba(255, 255, 255, 0.14); stroke-width: 9; fill: none; }
  .sc-ring-val { fill: none; stroke: #3ddc84; stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 0.6s var(--ease-out); }
  .sc-counter span { position: relative; font: 780 0.95rem/1 var(--font-display); text-align: center; }
  .sc-counter small { font-size: 0.65rem; opacity: 0.7; }
  .sc-view { position: relative; overflow: hidden; display: grid; place-items: center; }
  .sc-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s; }
  .is-live .sc-view video { opacity: 1; }
  .sc-frame { position: relative; width: min(72vw, 300px); aspect-ratio: 1; z-index: 1; opacity: 0; transition: opacity 0.4s 0.2s; box-shadow: 0 0 0 100vmax rgba(10, 9, 22, 0.45); border-radius: 28px; }
  .is-live .sc-frame { opacity: 1; }
  .sc-frame i { position: absolute; width: 46px; height: 46px; border: 5px solid white; }
  .sc-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 26px 0 0 0; }
  .sc-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 26px 0 0; }
  .sc-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 26px; }
  .sc-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 26px 0; }
  .sc-laser { position: absolute; left: 10%; right: 10%; height: 3px; top: 50%; border-radius: 3px; background: linear-gradient(90deg, transparent, #3ddc84, transparent);
    box-shadow: 0 0 14px #3ddc84; animation: laser 2.2s var(--ease-in-out) infinite alternate; }
  @keyframes laser { from { top: 12%; } to { top: 88%; } }
  .sc-loading, .sc-error { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: var(--sp-4); padding: var(--sp-5); text-align: center; }
  .sc-loading[hidden], .sc-error[hidden], .sc-result[hidden], .sc-search[hidden] { display: none; }
  .sc-loading-text, .sc-error-text { margin: 0; max-width: 22rem; color: color-mix(in srgb, white 80%, transparent); font-weight: 600; }
  .sc-result { position: absolute; z-index: 4; left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); display: grid; justify-items: center; gap: 4px;
    padding: var(--sp-5) var(--sp-4); border-radius: 28px; text-align: center; color: white; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
    transform: translateY(40px) scale(0.94); opacity: 0; transition: transform 0.45s var(--ease-spring), opacity 0.25s; }
  .sc-result.is-in { transform: none; opacity: 1; }
  .sc-admitted { background: linear-gradient(160deg, #1fae63, #0e7a42); }
  .sc-duplicate { background: linear-gradient(160deg, #f4a11a, #c7710b); }
  .sc-invalid, .sc-cancelled, .sc-wrong_event { background: linear-gradient(160deg, #e5484d, #a3191f); }
  .sc-result p { margin: 0; }
  .sc-result-title { font: 800 1.5rem/1.1 var(--font-display); letter-spacing: -0.01em; }
  .sc-result-name { font: 700 1.15rem/1.25 var(--font-display); overflow-wrap: anywhere; }
  .sc-result-ticket, .sc-result-detail { font-size: 0.9rem; opacity: 0.9; }
  .sc-result-icon svg { width: 64px; height: 64px; fill: none; stroke: white; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
  .sc-result-icon circle { stroke: rgba(255, 255, 255, 0.35); }
  .sc-result-icon path { stroke-dasharray: 40; stroke-dashoffset: 40; }
  .sc-admitted.is-in .sc-check { animation: draw 0.45s var(--ease-out) 0.15s forwards; }
  .sc-admitted .sc-cross, .sc-duplicate .sc-check, .sc-invalid .sc-check, .sc-cancelled .sc-check, .sc-wrong_event .sc-check { display: none; }
  .sc-result.is-in .sc-cross { animation: draw 0.35s var(--ease-out) 0.1s forwards; }
  .sc-duplicate.is-in, .sc-invalid.is-in, .sc-cancelled.is-in, .sc-wrong_event.is-in { animation: shake 0.45s var(--ease-out); }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(3px); } }
  .sc-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 12px var(--sp-4) calc(14px + env(safe-area-inset-bottom)); z-index: 3;
    background: linear-gradient(transparent, #0f0e1d 30%); }
  .sc-icon-btn { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, 0.1); color: white; cursor: pointer; flex: none; text-decoration: none; }
  .sc-icon-btn.is-on { background: #f2cf4a; color: #1a1300; }
  .sc-icon-btn[hidden] { visibility: hidden; display: grid; }
  .sc-find { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; min-height: 52px; border: 0; border-radius: 26px;
    background: white; color: #0f0e1d; font: 700 0.95rem/1 var(--font-sans); cursor: pointer; }
  .sc-search { position: fixed; inset: 0; z-index: 10; display: grid; grid-template-rows: auto 1fr; background: var(--c-bg); color: var(--c-text);
    transform: translateY(100%); transition: transform 0.4s var(--ease-spring); }
  .sc-search.is-in { transform: none; }
  .sc-search-head { display: flex; gap: var(--sp-2); align-items: center; padding: calc(12px + env(safe-area-inset-top)) var(--sp-4) 12px; border-bottom: 1px solid var(--c-border); }
  .sc-search-head .search { flex: 1; }
  .sc-search .sc-icon-btn { background: var(--c-surface-2); color: var(--c-text); }
  .sc-search-list { list-style: none; margin: 0; padding: var(--sp-3) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom)); overflow-y: auto; display: grid; gap: var(--sp-2); align-content: start; }
  .sc-person { display: grid; gap: 2px; width: 100%; min-height: 60px; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--c-border); border-radius: 18px;
    background: var(--c-surface); color: var(--c-text); text-align: left; cursor: pointer; font: inherit; }
  .sc-person small { color: var(--c-text-muted); }
  .sc-person.is-in { border-color: color-mix(in srgb, var(--c-success) 40%, var(--c-border)); background: color-mix(in srgb, var(--c-success) 8%, var(--c-surface)); }
  .sc-person.is-cancelled { opacity: 0.55; }
  @media (prefers-reduced-motion: reduce) { .sc-laser { animation: none; } .sc-result { transition: opacity 0.2s; transform: none; } }
}

@layer components {
  /* Pied de page : liens */
  .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }

  /* Découverte */
  .disc-head { display: grid; gap: var(--sp-2); }
  .ev-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); }
  .ev-cards > li { animation: rise-in 0.5s var(--ease-out) both; }
  .ev-cards > li:nth-child(2) { animation-delay: .05s; } .ev-cards > li:nth-child(3) { animation-delay: .1s; } .ev-cards > li:nth-child(n+4) { animation-delay: .15s; }
  .ev-card { display: grid; height: 100%; border-radius: var(--radius-xl); overflow: hidden; background: var(--c-surface); border: 1px solid var(--c-border);
    color: var(--c-text); text-decoration: none; box-shadow: var(--shadow-1); transition: transform .4s var(--ease-out), box-shadow .4s; }
  .ev-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); }
  .ev-card:active { transform: scale(.985); }
  .ev-card-art { position: relative; display: block; height: 128px; background: var(--g-accent); overflow: hidden; }
  .ev-card-art .art { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .8s var(--ease-out); }
  .ev-card:hover .ev-card-art .art { transform: scale(1.06); }
  .ev-card-date { position: absolute; left: var(--sp-4); bottom: -1px; display: grid; justify-items: center; padding: 8px 12px 6px; border-radius: 16px 16px 0 0;
    background: var(--c-surface); color: var(--c-text); }
  .ev-card-date b { font: 800 1.5rem/1 var(--font-display); letter-spacing: -.03em; }
  .ev-card-date small { font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent); }
  .ev-card-body { display: grid; gap: 6px; align-content: start; padding: var(--sp-3) var(--sp-4) var(--sp-4); min-width: 0; }
  .ev-card-body .tag { justify-self: start; }
  .ev-card-title { font: 750 1.15rem/1.2 var(--font-display); letter-spacing: -.015em; overflow-wrap: anywhere; }
  .ev-card-meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-text-muted); min-width: 0; }
  .ev-card-meta .icon { width: 16px; height: 16px; flex: none; }
  .ev-card-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ev-card-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); margin-top: 4px; padding-top: var(--sp-3); border-top: 1px dashed var(--c-border); min-width: 0; }
  .ev-card-foot .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ev-card-price { font-weight: 750; font-size: var(--fs-sm); white-space: nowrap; color: var(--c-accent); }

  /* Organisateur public */
  .org-hero { display: grid; gap: var(--sp-4); align-items: center; padding: var(--sp-5); border-radius: var(--radius-xl); background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-2); }
  @media (min-width: 40rem) { .org-hero { grid-template-columns: auto 1fr; } }
  .org-logo { display: grid; place-items: center; width: 88px; height: 88px; border-radius: var(--radius-blob); background: var(--g-accent); color: white; font: 800 1.8rem/1 var(--font-display);
    animation: morph 9s var(--ease-in-out) infinite alternate; }

  /* Textes légaux */
  .legal h1 { margin: var(--sp-4) 0 0; }
  .legal h2 { margin: var(--sp-5) 0 0; font: 750 var(--fs-lg)/1.25 var(--font-display); }
  .legal p, .legal li { line-height: 1.7; color: color-mix(in srgb, var(--c-text) 85%, transparent); }
  .legal ul { padding-left: 1.2rem; }
  .legal { max-width: 44rem; }
  .legal h2 { scroll-margin-top: 5rem; }
  .legal a { color: var(--c-accent); font-weight: 600; text-underline-offset: 3px; }
  .legal-updated { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--c-text-muted); }
  .legal-toc { margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-lg); background: var(--c-surface-2); border: 1px solid var(--c-border); }
  .legal-toc-title { margin: 0 0 var(--sp-2); font: 750 var(--fs-sm)/1.2 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-muted) !important; }
  .legal-toc ol { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 2px; columns: 1; }
  .legal-toc a { display: block; padding: 4px 0; color: var(--c-text); font-weight: 550; text-decoration: none; }
  .legal-toc a:hover { color: var(--c-accent); }
  @media (min-width: 40rem) { .legal-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-5); } }
  .legal-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0 0;
    padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--c-surface); border: 1px solid var(--c-border); }
  .legal-facts dt { color: var(--c-text-muted); font-size: var(--fs-sm); }
  .legal-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
  @media (max-width: 28rem) { .legal-facts { grid-template-columns: minmax(0, 1fr); } .legal-facts dd { margin-bottom: var(--sp-2); } }
  .legal h2:target { color: var(--c-accent); }

  .account .ws-head { justify-items: center; text-align: center; }

  /* ---------- Participant : questions, sondages, réseau, avis ---------- */
  .part { display: grid; gap: var(--sp-4); }
  .part-tabs { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  [data-live] { display: grid; gap: var(--sp-4); min-width: 0; }
  .ask-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
  .qa-list { margin: 0; }
  .qa-row { align-items: flex-start; }
  .qa-body { overflow-wrap: anywhere; white-space: pre-line; }
  .qa-answered { opacity: 0.62; }
  .qa-hidden { opacity: 0.45; }
  .qa-hidden .qa-body { text-decoration: line-through; }
  .qa-vote-form { flex: none; }
  .qa-vote { display: grid; justify-items: center; gap: 2px; min-width: 48px; min-height: 52px; padding: var(--sp-1) var(--sp-2); border-radius: 14px;
    border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text-muted); cursor: pointer;
    transition: transform 0.2s var(--ease-spring), background 0.2s, color 0.2s; }
  .qa-vote .icon { transform: rotate(-90deg); width: 16px; height: 16px; }
  .qa-vote b { font-variant-numeric: tabular-nums; color: var(--c-text); }
  .qa-vote:hover { border-color: var(--c-accent); }
  .qa-vote:active { transform: scale(0.92); }
  .qa-vote.is-on { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-accent-contrast); }
  .qa-vote.is-on b { color: inherit; }
  .qa-vote.is-on .icon { animation: vote-pop 0.4s var(--ease-spring); }
  .qa-count { display: grid; justify-items: center; flex: none; min-width: 48px; }
  .qa-count b { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
  .qa-count small { color: var(--c-text-muted); font-size: var(--fs-xs); }
  @keyframes vote-pop { 50% { transform: rotate(-90deg) translateX(4px) scale(1.25); } }

  .poll { display: grid; gap: var(--sp-3); border: 2px solid var(--c-accent); animation: poll-in 0.5s var(--ease-spring) both; }
  .poll-closed { border-color: var(--c-border); }
  .poll-status { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); font-weight: 650; color: var(--c-text-muted); }
  .live-dot.live-on { background: var(--c-danger); width: 10px; height: 10px; animation: blink 1.4s ease-in-out infinite; }
  .poll-options { display: grid; gap: var(--sp-2); }
  .poll-option { min-height: 48px; padding: var(--sp-3) var(--sp-4); border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-surface);
    color: var(--c-text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: border-color 0.2s, transform 0.15s; }
  .poll-option:hover { border-color: var(--c-accent); }
  .poll-option:active { transform: scale(0.98); }
  .poll-results { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
  .poll-results li { position: relative; display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; padding: var(--sp-2) var(--sp-3);
    border-radius: 12px; background: var(--c-surface-2); overflow: hidden; isolation: isolate; }
  .poll-bar { position: absolute; inset: 0; z-index: -1; }
  .poll-bar svg { display: block; width: 100%; height: 100%; }
  .poll-bar rect { fill: var(--c-accent-soft); transform-origin: left; animation: bar-grow 0.8s var(--ease-out) both; }
  .poll-results .is-mine { outline: 2px solid var(--c-accent); outline-offset: -2px; }
  .poll-results .is-correct .poll-bar rect { fill: color-mix(in srgb, var(--c-success) 28%, transparent); }
  .poll-results .is-correct .poll-label::after { content: " ✓"; color: var(--c-success); font-weight: 700; }
  .poll-label { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
  .poll-pct { font-variant-numeric: tabular-nums; font-weight: 700; }
  .poll-actions { justify-content: flex-end; }
  @keyframes poll-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
  @keyframes bar-grow { from { transform: scaleX(0); } }

  .net-row { align-items: flex-start; }
  .net-about { display: block; margin-top: var(--sp-1); color: var(--c-text-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }

  .stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: var(--sp-1); border: 0; margin: 0; padding: 0; }
  .stars input { position: absolute; opacity: 0; pointer-events: none; }
  .stars label { font-size: 2.6rem; line-height: 1; color: var(--c-border); cursor: pointer; transition: transform 0.2s var(--ease-spring), color 0.15s; padding: 2px; }
  .stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--c-warning); }
  .stars input:checked + label { transform: scale(1.15); }
  .stars input:focus-visible + label { outline: 2px solid var(--c-accent); border-radius: 8px; }
  .fb-summary { display: grid; gap: var(--sp-2); }
  .fb-summary .kpi-value { margin: 0; }

  .toast-error { background: var(--c-danger); color: #fff; }

  /* ---------- Écran de salle (projection) ---------- */
  .screen { min-height: 100vh; margin: 0; display: grid; grid-template-rows: auto 1fr; gap: 3vh; padding: 4vh 5vw;
    background: #0b0b14; color: #fff; font-size: clamp(16px, 1.6vw, 30px); }
  .screen-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1em; }
  .screen-head .logo { height: 1.6em; width: auto; color: #fff; }
  .screen-title { margin: 0; font-weight: 700; font-size: 1.3em; flex: 1; min-width: 0; }
  .screen-hint { margin: 0; opacity: 0.6; font-size: 0.8em; }
  .screen-main { display: grid; gap: 4vh; align-content: start; }
  .screen.has-poll .screen-main { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  @media (max-width: 50rem) { .screen.has-poll .screen-main { grid-template-columns: 1fr; } }
  .screen-poll:empty { display: none; }
  .screen-q { margin: 0 0 0.8em; font-size: 2em; line-height: 1.15; }
  .screen-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6em; }
  .screen-bars li { position: relative; display: flex; align-items: center; gap: 1em; padding: 0.6em 0.9em; border-radius: 0.6em;
    background: rgba(255, 255, 255, 0.08); overflow: hidden; isolation: isolate; }
  .screen-bar { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); z-index: -1; background: #3b4fd9; transition: width 0.8s var(--ease-out); }
  .screen-opt { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
  .screen-pct { font-variant-numeric: tabular-nums; }
  .screen-total { opacity: 0.6; }
  .screen-qa ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7em; }
  .screen-qa li { display: flex; gap: 0.9em; align-items: flex-start; padding: 0.8em 1em; border-radius: 0.7em; background: rgba(255, 255, 255, 0.06);
    animation: poll-in 0.5s var(--ease-spring) both; }
  .screen-qa li:first-child { background: #fff; color: #0b0b14; font-size: 1.25em; }
  .screen-votes { flex: none; min-width: 2.2em; text-align: center; font-variant-numeric: tabular-nums; color: #ef8a5b; }
  .screen-text { display: grid; gap: 0.2em; min-width: 0; overflow-wrap: anywhere; }
  .screen-text small { opacity: 0.6; font-size: 0.7em; }
  .screen-empty { opacity: 0.6; background: none !important; color: inherit !important; }
  @media (prefers-reduced-motion: reduce) { .poll, .poll-bar rect, .screen-qa li, .qa-vote.is-on .icon { animation: none; } .screen-bar { transition: none; } }

  /* ---------- Interactions : réglages, validation, remerciements ---------- */
  .inter-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .inter-actions .btn { flex: 1 1 14rem; }
  .inter-state { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; }
  .inter-state:empty { display: none; }
  .fchip-alert { background: var(--c-warning) !important; color: var(--c-ink) !important; animation: pulse-dot 1.6s ease-in-out infinite; }
  .qa-pending { background: color-mix(in srgb, var(--c-warning) 10%, var(--c-surface)); }
  .qa-vote-wait { display: grid; place-items: center; color: var(--c-text-muted); }
  .qa-mod-note { display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
  .qa-mod-note .icon { flex: none; width: 16px; height: 16px; }
  .thanks-card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); border: 2px dashed var(--c-accent); }
  .thanks-text { flex: 1 1 12rem; min-width: 0; }
  .thanks-text p { margin: 0; }
  @media (prefers-reduced-motion: reduce) { .fchip-alert { animation: none; } }

  .segmented-row { display: flex; flex-wrap: wrap; gap: var(--sp-4); }

  /* ---------- Adresse web ---------- */
  .addr-url { margin: 0; font-size: var(--fs-lg); font-weight: 700; overflow-wrap: anywhere; color: var(--c-accent); }
  .addr-sub { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
  .addr-sub .input { flex: 1; min-width: 0; }
  .addr-suffix { flex: none; color: var(--c-text-muted); font-weight: 600; }
  .addr-host { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0; font-weight: 700; overflow-wrap: anywhere; }
  .dns-table { display: grid; gap: 1px; border: 1px solid var(--c-border); border-radius: 14px; overflow: hidden; background: var(--c-border); }
  .dns-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-2); align-items: center; padding: var(--sp-2) var(--sp-3); background: var(--c-surface); }
  .dns-row .mono { overflow-wrap: anywhere; font-size: var(--fs-sm); user-select: all; }
  .dns-head { background: var(--c-surface-2); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-muted); }
  @media (max-width: 30rem) { .dns-row { grid-template-columns: 1fr; } .dns-head { display: none; } }

  .meter-alt rect { fill: var(--c-accent-2); }

  .part-head { display: grid; gap: var(--sp-1); }
  .part-title { margin: 0; overflow-wrap: anywhere; text-wrap: balance; }

  .short-row { align-items: center; }
  .short-row .short-url { white-space: normal; overflow-wrap: break-word; font-size: 0.92rem; text-overflow: clip; }
  .short-row .short-meta { white-space: normal; text-overflow: clip; }
}

/* ---------- Consentements, audience ---------- */
@layer components {
  .consent { display: grid; gap: var(--sp-2); border: 0; padding: 0; margin: 0; }
  .check-line { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3); border-radius: 14px; border: 1px solid var(--c-border);
    background: var(--c-bg); cursor: pointer; line-height: 1.45; transition: border-color var(--dur-micro) var(--ease-out), background var(--dur-micro); }
  .check-line input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--c-accent); }
  .check-line:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-soft); }
  .aud-chart { display: block; width: 100%; height: 150px; }
  .aud-rect { fill: var(--c-accent); transform-box: fill-box; transform-origin: bottom; }
  .aud-rect:hover { fill: var(--c-accent-2); }
  .aud-bars-axis { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--c-text-muted); }
  .aud-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
  .aud-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
  .aud-item { position: relative; display: flex; justify-content: space-between; gap: var(--sp-3); padding: 6px 10px; border-radius: 10px; overflow: hidden; font-size: var(--fs-sm); }
  .aud-item > span { position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .aud-item > b { position: relative; flex: none; }
  .aud-fill { position: absolute; inset: 0; width: 100%; height: 100%; }
  .aud-fill rect { fill: var(--c-accent-soft); transform-box: fill-box; transform-origin: left; }
  @media (prefers-reduced-motion: no-preference) {
    .aud-rect { animation: bar-up 0.7s var(--ease-out) backwards; }
    .aud-fill rect { animation: fill-in 0.8s var(--ease-out) backwards; }
  }
  @keyframes bar-up { from { transform: scaleY(0); } }
  @keyframes fill-in { from { transform: scaleX(0); } }
}

/* ---------- Console SMS ---------- */
@layer components {
  .sms-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
  .badge-ok { background: color-mix(in srgb, var(--c-success) 15%, transparent); color: var(--c-success); }
}

/* ---------- Console : conversations WhatsApp ---------- */
@layer components {
  .inbox-last { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36rem; }
  .inbox-meta { display: grid; justify-items: end; gap: 4px; flex: none; }
  .chat { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
  .chat-msg { max-width: min(36rem, 88%); padding: var(--sp-2) var(--sp-3); border-radius: 16px; display: grid; gap: 4px; }
  .chat-in { justify-self: start; background: var(--c-surface); border: 1px solid var(--c-border); border-bottom-left-radius: 4px; }
  .chat-out { justify-self: end; background: var(--c-accent-soft); border: 1px solid color-mix(in srgb, var(--c-accent) 25%, var(--c-border)); border-bottom-right-radius: 4px; }
  .chat-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
  .chat-meta { font-size: var(--fs-xs); color: var(--c-text-muted); justify-self: end; }
  .chat-tag { font: 700 var(--fs-xs)/1 ui-monospace, Menlo, monospace; color: var(--c-accent); }
  .chat-reply { position: sticky; bottom: calc(var(--tabbar-h, 0px) + var(--sp-2)); }

  /* Champs photo (Apparence) : aperçu, adresse, envoi depuis l'appareil */
  .photo-field { display: grid; gap: var(--sp-2); }
  .photo-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-sm, 10px); border: 1px solid var(--c-border); background: #fff; }
  .photo-upload { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-muted); }
  .photo-upload > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--c-text); }
  .photo-upload input { min-width: 0; max-width: 100%; font-size: var(--fs-sm); }
  .photo-upload input::file-selector-button { margin-right: var(--sp-2); padding: 8px 14px; border: 1px solid var(--c-border); border-radius: 999px;
    background: var(--c-surface); color: var(--c-text); font: inherit; font-weight: 650; cursor: pointer; }
}

/* ---------- Jour J et documents : badges, rapport, présences par séance, liste d'appel, vérification ---------- */
@layer components {
  .dj-card { min-width: 0; }
  .dj-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dj-options { display: grid; gap: var(--sp-2); }
  .dj-option { display: flex; gap: var(--sp-3); align-items: flex-start; min-height: 56px; padding: var(--sp-3) var(--sp-4); border-radius: 14px;
    border: 1px solid var(--c-border); background: var(--c-surface); cursor: pointer; min-width: 0; transition: border-color var(--dur-micro), background var(--dur-micro); }
  .dj-option:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-soft); }
  .dj-option > input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--c-accent); }
  .dj-option > span { display: grid; gap: var(--sp-2); min-width: 0; flex: 1; }
  .dj-option > span > span, .dj-option small { color: var(--c-text-muted); font-size: var(--fs-xs); font-weight: 650; }
  .dj-option select { width: 100%; }
  .dj-segmented { grid-template-columns: 1fr; }
  @media (min-width: 40rem) { .dj-segmented { grid-template-columns: 1fr 1fr; } }
  .dj-segmented span { min-height: 48px; padding: 0 var(--sp-3); text-align: center; }
  .dj-picks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); max-height: 26rem; overflow-y: auto; overscroll-behavior: contain; }
  .dj-pick { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: var(--sp-2) var(--sp-4); border-radius: 14px;
    border: 1px solid var(--c-border); background: var(--c-surface); cursor: pointer; min-width: 0; }
  .dj-pick:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-soft); }
  .dj-pick > input { width: 22px; height: 22px; min-height: 0; margin: 0; flex: none; accent-color: var(--c-accent); }

  .dj-session { display: grid; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--c-surface); border: 1px solid var(--c-border); min-width: 0; }
  .dj-session .row-title { white-space: normal; }
  .dj-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: var(--sp-2); }
  .dj-actions .btn { min-height: 48px; }
  .dj-marks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
  .dj-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--c-surface-2); border: 1px solid var(--c-border); }
  .dj-mark.is-on { background: var(--c-success); border-color: var(--c-success); }

  /* Liste d'appel : une ligne = une cible tactile de 64 px */
  .dj-roll > li { scroll-margin-top: 30vh; }
  .dj-roll form { margin: 0; }
  .dj-roll-btn { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 64px; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-lg);
    border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); font: inherit; text-align: left; cursor: pointer; min-width: 0;
    transition: transform var(--dur-micro) var(--ease-out), background var(--dur-base), border-color var(--dur-base); }
  button.dj-roll-btn:active { transform: scale(0.985); }
  .dj-roll-btn.is-in { border-color: color-mix(in srgb, var(--c-success) 45%, var(--c-border)); background: color-mix(in srgb, var(--c-success) 9%, var(--c-surface)); }
  .dj-check { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--c-border); color: transparent; }
  .dj-roll-btn.is-in .dj-check { background: var(--c-success); border-color: var(--c-success); color: white; }

  /* Vérification publique d'une attestation */
  .dj-verify { padding-block: var(--sp-6); }
  .dj-verdict.is-ok { border-color: color-mix(in srgb, var(--c-success) 45%, var(--c-border)); }
  .dj-verdict.is-bad { border-color: color-mix(in srgb, var(--c-danger) 45%, var(--c-border)); }
  .dj-verdict-title { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font: 760 var(--fs-lg)/1.2 var(--font-display); }
  .dj-verdict.is-ok .dj-verdict-title { color: var(--c-success); }
  .dj-verdict.is-bad .dj-verdict-title { color: var(--c-danger); }

  /* Scanner en mode séance */
  .sc-session { margin: 2px 0 0; font-size: 0.78rem; font-weight: 650; color: color-mix(in srgb, white 85%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (prefers-reduced-motion: reduce) { .dj-roll-btn, .dj-option, .dj-pick { transition: none; } }
}

/* ---------- Transfert de billet ----------
 * Page de transfert d'un billet (/t/<jeton>/transferer),
 * historique des transferts (fiche de l'inscrit). */
@layer components {
  .transfer { max-width: 34rem; }
  .transfer .lead { margin: 0; }
  .transfer-warn { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4);
    border: 1px solid color-mix(in srgb, var(--c-warning) 55%, var(--c-border)); border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--c-warning) 10%, var(--c-surface)); font-size: var(--fs-sm); }
  .transfer-warn p { margin: 0; }
  .transfer-warn .icon { flex: none; margin-top: 2px; }
  .transfer-history { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
  .transfer-history li { display: flex; gap: var(--sp-3); align-items: flex-start; }
  .transfer-history li > span { display: grid; gap: 2px; }
  .transfer-history .icon { flex: none; margin-top: 3px; color: var(--c-text-muted); }
}

/* ---------- Logo de l'organisation (pages publiques et application) ---------- */
@layer components {
  .logo-img { object-fit: contain; background: #fff; border: 1px solid var(--c-border); }
  .org-logo.logo-img { padding: 8px; border-radius: 22px; animation: none; }
}

/* ---------- Jeux : score, classement, mur, tirage au sort ---------- */
@layer components {
  .score-card { display: grid; gap: var(--sp-3); }
  .score-pts { margin: 0; font: 800 clamp(2.6rem, 9vw, 3.4rem)/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
  .score-pts span { font-size: 0.4em; color: var(--c-text-muted); font-weight: 700; }
  .rules { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid; gap: 2px; }
  .rules li { display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; }
  .rules li .icon { width: 18px; height: 18px; color: var(--c-accent); flex: none; }
  .rules li span { flex: 1; min-width: 0; }
  .rules li b { font-variant-numeric: tabular-nums; color: var(--c-success); }
  .board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: none; }
  .board-row { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 0 var(--sp-4); border-radius: var(--radius-lg);
    background: var(--c-surface); border: 1px solid var(--c-border); }
  .board-row.is-me { border-color: var(--c-accent); background: var(--c-accent-soft); }
  .board-rank { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c-surface-2);
    font: 800 var(--fs-sm)/1 var(--font-display); font-variant-numeric: tabular-nums; }
  .board-rank.rank-1 { background: #f5c542; color: #000; }
  .board-rank.rank-2 { background: #d5d9e2; color: #000; }
  .board-rank.rank-3 { background: #e0a372; color: #000; }
  .board-name { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
  .board-pts { font-variant-numeric: tabular-nums; }
  .board-pts small { color: var(--c-text-muted); font-weight: 600; }
  .wall { list-style: none; margin: 0; padding: 0; columns: 2 14rem; column-gap: var(--sp-3); }
  .wall-post { break-inside: avoid; margin: 0 0 var(--sp-3); padding: var(--sp-4); border-radius: var(--radius-lg); background: var(--c-surface);
    border: 1px solid var(--c-border); }
  .wall-post.is-pending { border-style: dashed; opacity: 0.8; }
  .wall-body { margin: 0; font-size: var(--fs-md); overflow-wrap: anywhere; white-space: pre-line; }
  .wall-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0 0; color: var(--c-text-muted); font-size: var(--fs-sm); }
  .win-card { display: flex; align-items: center; gap: var(--sp-4); border-color: color-mix(in srgb, var(--c-success) 40%, var(--c-border));
    background: color-mix(in srgb, var(--c-success) 8%, var(--c-surface)); }
  .win-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-blob, 50%); background: var(--c-success); color: #fff; }
  .win-prize { margin: 0; font: 750 var(--fs-lg)/1.2 var(--font-display); }
  .draw-names { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
  @media (prefers-reduced-motion: no-preference) {
    .board-row { animation: rise-in 0.45s var(--ease-out) backwards; }
    .board-row:nth-child(2) { animation-delay: 50ms; } .board-row:nth-child(3) { animation-delay: 100ms; }
    .board-row:nth-child(n+4) { animation-delay: 150ms; }
    .win-card { animation: win-pop 0.6s var(--ease-spring) backwards; }
    .win-icon { animation: win-spin 0.9s var(--ease-out) 0.15s backwards; }
    .wall-post { animation: rise-in 0.4s var(--ease-out) backwards; }
  }
  @keyframes win-pop { from { opacity: 0; transform: scale(0.9); } }
  @keyframes win-spin { from { transform: rotate(-120deg) scale(0.4); } }

  /* Écran de salle : podium et mur à droite, gagnant annoncé en plein écran. */
  .screen-side { display: grid; gap: 3vh; align-content: start; }
  .screen-side:empty { display: none; }
  .screen-side h3 { margin: 0 0 0.4em; font-size: 0.9em; opacity: 0.6; font-weight: 700; }
  .screen-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4em; }
  .screen-board li { display: flex; gap: 0.8em; align-items: center; padding: 0.5em 0.8em; border-radius: 0.6em; background: rgba(255, 255, 255, 0.06); }
  .screen-board li b:last-child { margin-left: auto; font-variant-numeric: tabular-nums; color: #ef8a5b; }
  .screen-wall { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5em; }
  .screen-wall li { padding: 0.6em 0.9em; border-radius: 0.6em; background: rgba(255, 255, 255, 0.06); overflow-wrap: anywhere; }
  .screen-wall small { display: block; opacity: 0.6; font-size: 0.7em; margin-top: 0.2em; }
  .screen-main { grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 60rem) { .screen-main:has(.screen-side:not(:empty)) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
    .screen.has-poll .screen-main:has(.screen-side:not(:empty)) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.8fr); } }
  .screen-winner { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; gap: 0.3em; text-align: center; background: #000; }
  .screen-winner[hidden] { display: none; }
  .screen-winner p { margin: 0; }
  .screen-winner .sw-label { font-size: 1.4em; opacity: 0.7; }
  .screen-winner .sw-name { font: 800 clamp(3rem, 12vw, 9rem)/1 var(--font-display); letter-spacing: -0.03em; }
  .screen-winner .sw-prize { font-size: 1.6em; color: #ef8a5b; }
  @media (prefers-reduced-motion: no-preference) {
    .screen-winner:not([hidden]) .sw-label { animation: rise-in 0.6s var(--ease-out) 0.1s backwards; }
    .screen-winner:not([hidden]) .sw-name { animation: win-name 1.1s var(--ease-spring) 0.5s backwards; }
    .screen-winner:not([hidden]) .sw-prize { animation: rise-in 0.6s var(--ease-out) 1.2s backwards; }
  }
  @keyframes win-name { from { opacity: 0; transform: scale(0.6); } }
}

/* ---------- Formulaires (enquêtes, collectes, avis) ---------- */
@layer components {
  .tpl-grid { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
  .tpl { position: relative; display: block; min-width: 0; }
  .tpl input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; }
  .tpl-body { display: grid; gap: 4px; height: 100%; padding: var(--sp-3) var(--sp-4); border: 1.5px solid var(--c-border); border-radius: 14px;
    background: var(--c-surface); transition: border-color var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out); }
  .tpl-body small { color: var(--c-text-muted); font-size: var(--fs-sm); }
  .tpl input:checked + .tpl-body { border-color: var(--c-accent); background: var(--c-accent-soft); }
  .tpl input:focus-visible + .tpl-body { outline: 3px solid var(--c-focus); }
  .fm-row-end { display: grid; justify-items: end; gap: 4px; flex: none; }
  .pill-fm-draft { background: var(--c-surface-2); color: var(--c-text-muted); }
  .pill-fm-published { background: color-mix(in srgb, var(--c-success) 15%, transparent); color: var(--c-success); }
  .pill-fm-closed { background: color-mix(in srgb, var(--c-danger) 12%, transparent); color: var(--c-danger); }
  .pill-fm-r-new { background: var(--c-accent-soft); color: var(--c-accent); }
  .pill-fm-r-processed { background: var(--c-surface-2); color: var(--c-text-muted); }
  .fm-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
  .fm-status p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
  .fm-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
  .fm-q > .row { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); }
  .fm-q-section > .row { background: var(--c-surface-2); }
  .fm-q-num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent);
    font: 750 var(--fs-sm)/1 var(--font-display); }
  .fm-q-num .icon { width: 16px; height: 16px; }
  .fm-req { color: var(--c-danger); margin-left: 2px; }
  .fm-minmax { grid-template-columns: 1fr 1fr; }
  .fm-foot { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: flex-end; }
  .fm-resps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
  .fm-resp > details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-height: 56px; }
  .fm-resp > details > summary::-webkit-details-marker { display: none; }
  .fm-resp > details[open] > summary { border-bottom: 1px solid var(--c-border); }
  .fm-answers { margin: 0; padding: var(--sp-4); display: grid; gap: 2px var(--sp-4); }
  .fm-answers dt { color: var(--c-text-muted); font-size: var(--fs-sm); margin-top: var(--sp-2); }
  .fm-answers dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
  .fm-resp-actions, .fm-resp > details > form:last-child { padding: 0 var(--sp-4) var(--sp-4); }
  .fm-results { display: grid; gap: var(--sp-3); }
  .fm-result .h4 { margin: 0; }
  .fm-big { margin: var(--sp-2) 0; }
  .fm-big b { font: 800 2.4rem/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
  .fm-bars { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
  .fm-bars li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 3.2rem; align-items: center; gap: var(--sp-3); }
  .fm-bar-label { font-size: var(--fs-sm); overflow-wrap: anywhere; }
  .fm-bar-pct { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
  .fm-words { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--sp-3) 0 0; }
  .fm-words small { color: var(--c-text-muted); }
  .fm-texts { margin: var(--sp-3) 0 0; padding-left: 1.2em; display: grid; gap: var(--sp-2); }
  .fm-texts li { overflow-wrap: anywhere; white-space: pre-line; }

  /* Page publique */
  .fm-head { display: grid; gap: var(--sp-2); }
  .fm-title { margin: 0; }
  .fm-org { margin: 0; }
  .fm-intro { white-space: pre-line; }
  .fm-form { gap: var(--sp-5); position: relative; overflow: hidden; }
  .fm-progress { position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c-surface-2); }
  .fm-progress span { display: block; height: 100%; width: var(--p, 0%); background: var(--c-accent); transition: width 0.4s var(--ease-out); }
  .fm-section { padding-top: var(--sp-3); border-top: 1px solid var(--c-border); }
  .fm-section .h3 { margin: 0; }
  .fm-field[hidden], .fm-section[hidden] { display: none; }
  .fm-field.has-error .input { border-color: var(--c-danger); }
  .field-error { margin: 0; color: var(--c-danger); font-size: var(--fs-sm); font-weight: 600; }
  .fm-choice { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 0 var(--sp-4); border: 1.5px solid var(--c-border); border-radius: 14px;
    background: var(--c-surface); cursor: pointer; transition: border-color var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out); }
  .fm-choice input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; accent-color: var(--c-accent); }
  .fm-choice:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-soft); }
  .fm-scale { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
  .fm-nps { gap: 3px; }
  .fm-scale label, .fm-stars label { position: relative; min-width: 0; }
  .fm-scale input, .fm-stars input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; }
  .fm-scale span { display: grid; place-items: center; min-height: 46px; border: 1.5px solid var(--c-border); border-radius: 12px; background: var(--c-surface);
    font-weight: 700; font-variant-numeric: tabular-nums; transition: background var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
  .fm-nps span { min-height: 42px; border-radius: 10px; font-size: var(--fs-sm); }
  .fm-scale input:checked + span { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-accent-contrast, #fff); }
  .fm-scale input:focus-visible + span, .fm-stars input:focus-visible + span { outline: 3px solid var(--c-focus); }
  .fm-yesno span { min-height: 50px; }
  .fm-scale-ends { display: flex; justify-content: space-between; margin: 0; color: var(--c-text-muted); font-size: var(--fs-xs); }
  .fm-stars { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
  .fm-stars span { display: grid; place-items: center; width: 48px; height: 48px; font-size: 2rem; line-height: 1; color: var(--c-border); cursor: pointer;
    transition: color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
  .fm-stars input:checked + span, .fm-stars label:has(input:checked) ~ label span { color: #f5b301; }
  @media (hover: hover) { .fm-stars label:hover span, .fm-stars label:hover ~ label span { color: #f5b301; } }
  .fm-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  .fm-done { display: flex; align-items: center; gap: var(--sp-4); }
  .fm-done .h3 { margin: 0; white-space: pre-line; }
  .fm-closed-icon { background: var(--c-text-muted); }
  @media (prefers-reduced-motion: no-preference) {
    .fm-field, .fm-section { animation: rise-in 0.45s var(--ease-out) backwards; }
    .fm-field:nth-child(2) { animation-delay: 40ms; } .fm-field:nth-child(3) { animation-delay: 80ms; } .fm-field:nth-child(n+4) { animation-delay: 120ms; }
    .fm-appear { animation: fm-appear 0.4s var(--ease-out); }
    .fm-stars input:checked + span { animation: app-pop 0.3s var(--ease-spring); }
    .fm-done { animation: win-pop 0.6s var(--ease-spring) backwards; }
  }
  @keyframes fm-appear { from { opacity: 0; transform: translateY(-8px); } }
  @keyframes app-pop { from { transform: scale(0.8); } }
}
@layer components {
  .fm-q .row-title { white-space: normal; overflow-wrap: anywhere; }
  .fm-q .row-sub { white-space: normal; }
  .fm-q .order-btns { flex: none; flex-wrap: nowrap; gap: 0; }
  .fm-q .order-btns form, .fm-q .order-btns > a { flex: none; }
  .fm-q .btn-icon .icon { width: 18px; height: 18px; flex: none; }
  @media (max-width: 30rem) { .fm-q .btn-icon.btn-quiet { width: 34px; } }
}

/* ---------- Compte : numéro, e-mail et profil ---------- */
@layer components {
  .pf-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
  /* « Quelle ville ? » n'apparaît que pour « Autre ville » (visible partout où :has n'existe pas). */
  @supports selector(:has(*)) {
    .pf-form .pf-other { display: none; }
    .pf-form:has(.pf-city option[value="other"]:checked) .pf-other { display: grid; }
  }
  .pf-private { display: flex; gap: var(--sp-2); align-items: flex-start; margin: 0; }
  .pf-private .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
  .ct-flow .link-sms { justify-self: center; }
  .dl dd .tag { margin-inline-start: var(--sp-2); vertical-align: middle; }
}

/* Crédit camer.online (docs/16) : solde, recharges en tuiles, devis avant un message. */
@layer components {
  .credit-hero { text-align: center; }
  .credit-amount { font: 700 clamp(2.2rem, 9vw, 3.2rem) / 1.05 var(--font-display); margin: .25rem 0; }
  .credit-amount small { font-size: .4em; font-weight: 600; color: var(--c-text-muted); }
  .credit-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
  .credit-grid .h3 { display: flex; align-items: center; gap: .5rem; }
  .rows-compact .row { padding-block: .5rem; gap: .75rem; }
  .pack-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); }
  .pack-grid form { display: contents; }
  .pack {
    display: grid; gap: .15rem; justify-items: start; text-align: start; width: 100%;
    padding: .85rem 1rem; border: 1px solid var(--c-border); border-radius: var(--radius-md, .75rem);
    background: var(--c-surface); color: var(--c-text); font: inherit; cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
  }
  .pack:hover, .pack:focus-visible { border-color: var(--c-accent); }
  .pack-pay { font-size: .8rem; color: var(--c-text-muted); }
  .pack-get strong { font: 700 1.35rem / 1.1 var(--font-display); }
  .pack-bonus { font-size: .78rem; font-weight: 600; color: var(--c-success); }
  .credit-plus { color: var(--c-success); white-space: nowrap; }
  .credit-minus { white-space: nowrap; }
  .credit-quote { display: flex; gap: .65rem; align-items: flex-start; }
  .credit-quote p { margin: 0; }
}

/* À faire maintenant (tableau de bord) : chaque demande se traite sur place. */
@layer components {
  .todo-card { border-inline-start: 4px solid var(--c-warning); }
  .todo-card .h3 { display: flex; align-items: center; gap: .5rem; }
  .todo-row { flex-wrap: wrap; gap: .5rem .75rem; }
  .todo-actions { display: flex; gap: .5rem; align-items: center; margin-inline-start: auto; }
  .todo-actions form { display: contents; }
}

/* Tableau d'un événement : le travail à gauche, partage et réglages à droite (≥ 1100 px). */
@layer components {
  .ev-grid { display: grid; gap: var(--sp-4); }
  .ev-main, .ev-side { display: grid; gap: var(--sp-4); align-content: start; min-width: 0; }
  @media (min-width: 1100px) {
    .ev-grid { grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem); align-items: start; }
    .ev-side .share-card { display: grid; grid-template-columns: 1fr; }
    .ev-side .share-qr { justify-self: center; }
    .ev-side .share-actions { display: grid; grid-template-columns: 1fr; }
    .ev-side .share-actions .btn { width: 100%; justify-content: center; }
    .ev-side .pack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ev-main .quick { display: none; }
  }
  .boost-card .h3 { display: flex; align-items: center; gap: .5rem; }
}

/* ------------------------------------------------------------------------
   Assistance, accès du support, rapports (docs/19)
   ------------------------------------------------------------------------ */
.aide-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 900px) { .aide-grid { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.as-invite { border: 1px dashed var(--c-border); border-radius: var(--radius-lg, 16px); padding: var(--sp-3); display: grid; gap: var(--sp-2); background: var(--c-surface-2); }
.as-row { display: grid; gap: 4px; text-decoration: none; color: inherit; transition: transform var(--dur-micro, .12s) var(--ease-out, ease), box-shadow var(--dur-micro, .12s); }
.as-row:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(13 19 48 / .08); }
.as-row .row-sub { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.as-pill.as-st-open { background: var(--c-accent-soft); color: var(--c-accent); }
.as-pill.as-st-in_progress { background: color-mix(in srgb, var(--c-warning) 18%, transparent); color: var(--c-text); }
.as-pill.as-st-waiting { background: color-mix(in srgb, var(--c-danger) 14%, transparent); color: var(--c-danger); }
.as-pill.as-st-resolved, .as-pill.as-st-closed { background: color-mix(in srgb, var(--c-success) 16%, transparent); color: var(--c-success); }
.as-p-urgent { background: var(--c-danger); color: #fff; }
.as-p-high { background: color-mix(in srgb, var(--c-danger) 14%, transparent); color: var(--c-danger); }
.as-prio-urgent { border-left: 4px solid var(--c-danger); }
.as-live, .as-access-on p { display: flex; gap: var(--sp-2); align-items: center; color: var(--c-success); font-weight: 600; }
.as-access { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; }
.as-access-on { border: 2px solid color-mix(in srgb, var(--c-success) 45%, transparent); background: color-mix(in srgb, var(--c-success) 6%, var(--c-surface)); }
.as-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.as-entry { padding: var(--sp-3); border-radius: var(--radius-lg, 16px); background: var(--c-surface); border: 1px solid var(--c-border); animation: as-in var(--dur-base, .25s) var(--ease-out, ease) both; }
.as-entry.as-agent { border-color: color-mix(in srgb, var(--c-accent) 35%, transparent); background: color-mix(in srgb, var(--c-accent) 5%, var(--c-surface)); }
.as-entry.as-internal { border-style: dashed; background: var(--c-surface-2); }
.as-entry.as-k-access, .as-entry.as-k-status, .as-entry.as-k-action { background: transparent; border-style: dotted; padding-block: var(--sp-2); }
.as-entry-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: 0 0 4px; }
.as-entry-head b { display: inline-flex; gap: 6px; align-items: center; }
.as-body { white-space: pre-wrap; margin: 0; }
.as-event { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--c-text-muted); font-size: var(--fs-sm); }
.as-stars { display: flex; gap: var(--sp-2); }
.as-star input { position: absolute; opacity: 0; }
.as-star span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--c-border); cursor: pointer; transition: transform var(--dur-micro, .12s) var(--ease-spring, ease); }
.as-star input:checked + span { background: var(--c-accent); color: #fff; border-color: var(--c-accent); transform: scale(1.08); }
.as-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: end; }
.as-prio { min-width: 160px; }
.as-interv { margin: var(--sp-2) 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
.as-team-card { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; text-decoration: none; color: inherit; border: 1px dashed var(--c-accent); }
.as-team-card b { color: var(--c-accent); margin-left: auto; }
.as-support-pill { background: var(--c-accent-soft); color: var(--c-accent); display: inline-flex; gap: 4px; align-items: center; margin-right: 6px; }
.cside-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--c-danger); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; animation: as-pulse 2s var(--ease-out, ease) infinite; }
.fchip .cside-badge { margin-left: 6px; }
@keyframes as-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes as-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-danger) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .as-entry, .cside-badge { animation: none; } }

/* Rapports */
.rp-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.rp-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.st-kpi-label { margin: 0; color: var(--c-text-muted); font-size: var(--fs-sm); }
.st-kpi-value { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.rp-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 900px) { .rp-grid { grid-template-columns: 1fr 1fr; } }
.rp-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.rp-bar-head { display: flex; justify-content: space-between; gap: var(--sp-2); margin: 0 0 4px; font-size: var(--fs-sm); }
.rp-bar { height: 10px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.rp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c-accent), color-mix(in srgb, var(--c-accent) 55%, #ef8a5b)); transform-origin: left; animation: rp-grow .9s var(--ease-out, ease) both; }
@keyframes rp-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rp-insight { padding: var(--sp-3); border-radius: var(--radius-lg, 16px); border: 1px solid var(--c-border); animation: as-in .3s var(--ease-out, ease) both; }
.rp-insight.rp-act { border-left: 5px solid var(--c-danger); }
.rp-insight.rp-watch { border-left: 5px solid var(--c-warning); }
.rp-sev-act { background: var(--c-danger); color: #fff; }
.rp-sev-watch { background: color-mix(in srgb, var(--c-warning) 25%, transparent); }
.rp-advice { color: var(--c-accent); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .rp-bar i, .rp-insight { animation: none; } }

/* Palettes (docs/19) : pastilles et fond de chaque ambiance */
.preset-camer { background: #ffffff; } .preset-camer i:nth-child(1) { background: #3b4fd9; } .preset-camer i:nth-child(2) { background: #ef8a5b; } .preset-camer i:nth-child(3) { background: #f2cf4a; }
.preset-savane { background: #fdf6e3; } .preset-savane i:nth-child(1) { background: #9a3412; } .preset-savane i:nth-child(2) { background: #ca8a04; } .preset-savane i:nth-child(3) { background: #4d7c0f; }
.preset-foret { background: #f0fdf4; } .preset-foret i:nth-child(1) { background: #166534; } .preset-foret i:nth-child(2) { background: #d97706; } .preset-foret i:nth-child(3) { background: #65a30d; }
.preset-ocean { background: #f0f9ff; } .preset-ocean i:nth-child(1) { background: #075985; } .preset-ocean i:nth-child(2) { background: #ea580c; } .preset-ocean i:nth-child(3) { background: #0891b2; }
.preset-corail { background: #fff1f2; } .preset-corail i:nth-child(1) { background: #be123c; } .preset-corail i:nth-child(2) { background: #f97316; } .preset-corail i:nth-child(3) { background: #f59e0b; }
.preset-royal { background: #faf5ff; } .preset-royal i:nth-child(1) { background: #5b21b6; } .preset-royal i:nth-child(2) { background: #db2777; } .preset-royal i:nth-child(3) { background: #ca8a04; }
.preset-menthe { background: #f0fdfa; } .preset-menthe i:nth-child(1) { background: #0f766e; } .preset-menthe i:nth-child(2) { background: #f59e0b; } .preset-menthe i:nth-child(3) { background: #14b8a6; }
.preset-terre { background: #faf7f2; } .preset-terre i:nth-child(1) { background: #7c2d12; } .preset-terre i:nth-child(2) { background: #a16207; } .preset-terre i:nth-child(3) { background: #57534e; }
.preset-pop { background: #fdf4ff; } .preset-pop i:nth-child(1) { background: #c026d3; } .preset-pop i:nth-child(2) { background: #2563eb; } .preset-pop i:nth-child(3) { background: #eab308; }
.preset-nuit { background: #eef2ff; } .preset-nuit i:nth-child(1) { background: #1e3a8a; } .preset-nuit i:nth-child(2) { background: #e11d48; } .preset-nuit i:nth-child(3) { background: #f59e0b; }
.preset-sobre { background: #ffffff; } .preset-sobre i:nth-child(1) { background: #111827; } .preset-sobre i:nth-child(2) { background: #6b7280; } .preset-sobre i:nth-child(3) { background: #94a3b8; }

/* Apparence : brouillon, publication, contraste, historique (docs/19) */
.ap-draft { display: flex; flex-wrap: wrap; gap: 6px var(--sp-2); align-items: center; padding: 8px 12px; border-radius: 14px;
  background: #fff7e6; border: 1px solid #f5c26b; color: #6b4300; font-size: var(--fs-sm); font-weight: 600; }
.ap-draft > span { flex: 1 1 180px; }
.ap-draft .btn { min-height: 36px; padding-block: 4px; }
.ap-save { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); z-index: 15; display: grid; gap: 6px; padding: var(--sp-2);
  background: color-mix(in srgb, var(--c-surface) 92%, transparent); backdrop-filter: blur(8px); border-radius: 18px; box-shadow: 0 -6px 24px rgb(13 19 48 / .08); }
@media (min-width: 1024px) { .ap-save { bottom: var(--sp-3); } }
form.is-dirty .ap-save .btn { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-accent) 30%, transparent); }
.ap-sync { text-align: center; min-height: 1.2em; }
.contrast-note { display: flex; gap: 6px; align-items: center; margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--c-success); }
.contrast-note.is-low { color: var(--c-danger); font-weight: 600; }
.ap-devices { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.appearance-preview .device { transition: max-width var(--dur-base, .25s) var(--ease-out, ease); }
.appearance-preview .device.device-desktop { max-width: none; width: 100%; aspect-ratio: 16 / 10; }
.ap-version { display: flex; gap: var(--sp-3); align-items: center; }
.ap-version-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; background: var(--c-border); box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 3px var(--c-border); }
.ap-version .row-main { flex: 1; min-width: 0; }
.preset { position: relative; border: 1px solid var(--c-border); transition: transform var(--dur-micro, .12s) var(--ease-spring, ease), box-shadow var(--dur-micro, .12s); }
.preset:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgb(13 19 48 / .1); }
.cp-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: var(--sp-2) 0; border-top: 1px solid var(--c-border); }
.cp-row .row-main { flex: 1 1 240px; min-width: 0; display: grid; }
/* Aperçu en plein écran sur téléphone */
.ap-peek, .ap-peek-close { display: none; }
@media (max-width: 1023px) {
  .ap-peek { display: inline-flex; position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 180px); z-index: 30; border-radius: 999px; box-shadow: 0 12px 30px rgb(13 19 48 / .25); }
  .appearance-preview.is-peek { position: fixed; inset: 0; z-index: 60; background: var(--c-bg, #f6f7fb); padding: 12px 16px; overflow: auto; display: grid; }
  .appearance-preview.is-peek .ap-peek-close { display: inline-flex; justify-self: end; }
  .appearance-preview.is-peek .device { width: min(100%, 420px); }
  html.no-scroll, html.no-scroll body { overflow: hidden; }
}
.rp-table-wrap { overflow-x: auto; }
.rp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 560px; }
.rp-table th, .rp-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.rp-table thead th { color: var(--c-text-muted); font-weight: 600; }
.rp-table tbody th { text-align: left; }
.rp-table tr.rp-bad td, .rp-table tr.rp-bad th { background: color-mix(in srgb, var(--c-danger) 8%, transparent); }

/* Page Apparence : types de page, blocs, galerie */
.pick-types { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.pick-type { align-items: flex-start; gap: .7rem; padding: 1rem; }
.pick-type > span:last-child { display: grid; gap: .25rem; min-width: 0; }
.pick-type small { color: var(--c-text-muted); line-height: 1.4; }
.pick-type-mini { display: grid; gap: 3px; width: 2.4rem; flex: none; }
.pick-type-mini i { display: block; height: 6px; border-radius: 3px; background: var(--c-accent); opacity: .85; }
.pick-type-lancement .pick-type-mini i:first-child { height: 1.4rem; }
.pick-type-conference .pick-type-mini { grid-template-columns: 1fr 1fr; } .pick-type-conference .pick-type-mini i:first-child { height: 1.4rem; grid-row: span 2; }
.pick-type-affiche .pick-type-mini i:first-child { height: 1.4rem; width: 70%; }
.block-rows { display: grid; gap: .8rem; }
.block-rows[hidden] { display: none; }
.block-row { display: grid; gap: .5rem; padding: .9rem; border: 1px solid var(--c-border); border-radius: var(--radius-md, 1rem); }
.block-move { display: flex; gap: .4rem; }
@media (min-width: 52rem) { .block-row { grid-template-columns: 1fr 1fr; } .block-row > .check, .block-row > .block-move { grid-column: auto; } }
.pick-look { text-align: left; cursor: pointer; }
.pick-look-mini { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none; border-radius: .7rem; background: #000; position: relative; }
.pick-look-mini i { position: absolute; left: .45rem; right: .45rem; top: .55rem; height: .35rem; border-radius: 2px; background: #e3173d; }
.pick-look-mini b { position: absolute; left: .45rem; right: 1rem; bottom: .55rem; height: .25rem; border-radius: 2px; background: #fff; opacity: .8; }
