/*
 * 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: 0; 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 ---------- */
  .navbar-progress { position: fixed; z-index: 100; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
  .navbar-progress::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--c-accent), var(--c-accent-2), var(--c-accent-3), var(--c-accent));
    background-size: 200% 100%; transform-origin: left; transform: scaleX(0); }
  html.is-navigating .navbar-progress { opacity: 1; transition-delay: 0.12s; }
  html.is-navigating .navbar-progress::before { animation: nav-progress 8s cubic-bezier(0.1, 0.7, 0.2, 1) both, shimmer-x 1.4s linear infinite; }
  .btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
  .btn.is-busy > * { opacity: 0; }
  .btn.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
    border: 2.5px solid color-mix(in srgb, currentColor 0%, white 35%); border-top-color: white; animation: spin 0.7s linear infinite; }
  .btn-ghost.is-busy::after, .btn-quiet.is-busy::after, .btn-outline-danger.is-busy::after { border-color: var(--c-border); border-top-color: var(--c-accent); }
  [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; }

  .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 .eyebrow { display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
  .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-head .eyebrow { margin: 0; }
  .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; }
}
