/* ==========================================================================
   INTERFACE (accueil, connexion, régie)
   Thème sombre, une seule couleur d'accent. Tout est piloté par les
   variables ci-dessous : change --accent pour changer la couleur partout.
   ========================================================================== */

:root {
  --bg: #09090b;
  --bg-glow: rgba(214, 255, 61, 0.06);
  --panel: #111113;
  --panel-2: #18181b;
  --panel-3: #202024;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #fafafa;
  --muted: #a1a1aa;
  /* Contraste ≥ 4,5:1 sur tous les fonds de l'interface (WCAG AA) */
  --faint: #8e8e98;
  --accent: #d6ff3d;
  --accent-ink: #0b0d02;
  --accent-soft: var(--accent-soft);
  --accent-line: var(--accent-line);
  --ok: #3ddc84;
  --warn: #ffb547;
  --danger: #ff5f5f;
  --danger-soft: rgba(255, 95, 95, 0.12);
  --radius: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 20px 40px -24px rgba(0,0,0,0.8);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.ui {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--bg-glow), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text);
  font: 600 13px/1 var(--font); letter-spacing: 0.1px; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
  white-space: nowrap; user-select: none;
}
.btn:hover { border-color: rgba(255,255,255,0.28); background: var(--panel-3); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.btn-outline { background: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255,95,95,0.35); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.btn.is-live { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.btn.is-live::after {
  content: "À L'ÉCRAN"; font-size: 9px; letter-spacing: 1px; font-weight: 800;
  padding: 3px 6px; border-radius: 5px; background: var(--accent); color: var(--accent-ink);
}

/* ---------- Champs ---------- */
.input, .select {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
  font: 500 14px var(--font); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 12px; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.row > .input, .row > .select { flex: 1; min-width: 0; }

/* ---------- Pastilles ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel);
  font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(61,220,132,0.18); }
.pill.ko { color: var(--danger); border-color: rgba(255,95,95,0.4); }
.pill.ko .dot { background: var(--danger); animation: blink 1s infinite; }
.pill.accent { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
@keyframes blink { 50% { opacity: 0.3; } }

/* ==========================================================================
   CARTES DE VERSION (tableau de bord)
   ========================================================================== */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.choice {
  position: relative; display: flex; flex-direction: column; gap: 18px;
  padding: 28px; border-radius: 22px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow); transition: border-color .2s, transform .2s;
}
.choice:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.choice-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.choice-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--panel-3); border: 1px solid var(--line-strong); color: var(--accent-text); }
.choice-icon .icon { width: 22px; height: 22px; }
.choice h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.4px; }
.choice p { margin: 0; color: var(--muted); }
.choice ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.choice li { display: flex; gap: 10px; align-items: flex-start; color: #d4d4d8; font-size: 13.5px; }
.choice li .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent-text); stroke-width: 2.6; }
.choice-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }
.choice-actions .btn { flex: 1; height: 44px; }
@media (max-width: 760px) {
  .choice-grid { grid-template-columns: 1fr; }
  .choice { padding: 22px; }
}

/* ==========================================================================
   RÉGIE
   ========================================================================== */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: rgba(9,9,11,0.72); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.appbar-left, .appbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.appbar .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.appbar .brand-mark .icon { width: 19px; height: 19px; }

.admin-main {
  max-width: 1560px; margin: 0 auto; padding: 22px 24px 48px;
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start;
}
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1100px) {
  .admin-main { grid-template-columns: 1fr; padding: 16px; }
  .appbar { padding: 10px 16px; }
}
@media (max-width: 640px) {
  .appbar .hide-sm { display: none; }
}

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: -0.2px; margin: 0; }
.card-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.step-num {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--panel-3); color: var(--muted); border: 1px solid var(--line-strong);
}
.count-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--panel-3); color: var(--muted); }
.count-badge.hot { background: var(--accent); color: var(--accent-ink); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ---------- Buzzer ---------- */
.buzz-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 20px; padding: 22px; }
.buzz-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.live-list { display: flex; flex-direction: column; gap: 8px; }
.live-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-md); background: var(--panel-2); border: 1px solid var(--line);
}
.live-item .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-item .clock { font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-soft); animation: ping 1.6s infinite; flex: 0 0 auto; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 100% { box-shadow: 0 0 0 9px transparent; } }
.live-empty { padding: 18px; border-radius: var(--radius-md); border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; }

.buzzer-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 220px; border: none; border-radius: 22px; cursor: pointer;
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--accent), white 45%) 0%, var(--accent) 45%, color-mix(in srgb, var(--accent), black 22%) 100%);
  color: var(--accent-ink); font: 900 38px/1 var(--font); letter-spacing: 4px;
  box-shadow: 0 0 0 1px var(--accent-line), 0 24px 60px -20px var(--accent-line), inset 0 -6px 0 rgba(0,0,0,0.12);
  transition: transform .08s, box-shadow .2s, filter .2s;
}
.buzzer-btn:hover { filter: brightness(1.04); }
.buzzer-btn:active, .buzzer-btn.pressed { transform: scale(0.965); box-shadow: 0 0 0 1px var(--accent-line), 0 10px 30px -14px var(--accent-line), inset 0 -2px 0 rgba(0,0,0,0.12); }
.buzzer-btn .icon { width: 34px; height: 34px; stroke-width: 2.6; }
.buzzer-btn small { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; opacity: 0.6; }
.buzzer-btn:disabled { filter: grayscale(1) brightness(0.45); cursor: not-allowed; box-shadow: none; }
.kbd { display: inline-block; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.buzz-hint { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.outbox-warn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255,181,71,0.12); color: var(--warn); font-size: 13px; font-weight: 600; }
@media (max-width: 760px) {
  .buzz-card { grid-template-columns: 1fr; }
  .buzzer-btn { min-height: 160px; order: -1; }
}

/* ---------- File d'arrivées ---------- */
.queue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.queue-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border-radius: var(--radius-md); background: var(--panel-2); border: 1px solid var(--line-strong);
  animation: pop .22s ease-out;
}
.queue-card.manual { border-style: dashed; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.queue-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.queue-meta b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.queue-inputs { display: flex; gap: 8px; }
.queue-inputs .input { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; }
.queue-preview { min-height: 54px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.queue-preview .hint { font-size: 12.5px; color: var(--faint); }
.queue-preview .grp { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.queue-preview .tm { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.queue-preview .nm { font-size: 13px; color: var(--text); font-weight: 600; }
.queue-newgroup { display: flex; flex-direction: column; gap: 8px; }
.queue-btns { display: flex; gap: 8px; }
.queue-btns .btn { flex: 1; }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; text-align: center;
  border-radius: var(--radius-md); border: 1px dashed var(--line-strong); color: var(--faint); font-size: 13px;
}
.empty .icon { width: 22px; height: 22px; color: var(--faint); }

/* ---------- Import CSV ---------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 22px 16px; border-radius: var(--radius-md); border: 1.5px dashed var(--line-strong);
  background: var(--bg); color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone .icon { width: 24px; height: 24px; color: var(--accent-text); }
.dropzone strong { color: var(--text); font-size: 13.5px; }
.dropzone small { font-size: 12px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.csv-help { font-size: 12px; color: var(--faint); margin-top: 10px; }
.csv-help code { font-family: var(--font-mono); color: var(--muted); background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.feedback { font-size: 13px; margin-top: 10px; color: var(--ok); }
.feedback.err { color: var(--danger); }

/* ---------- Groupes ---------- */
.wave-list { display: flex; flex-direction: column; gap: 8px; }
.wave-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px;
  border-radius: var(--radius-md); background: var(--panel-2); border: 1px solid var(--line);
}
.wave-row.running { border-color: var(--accent-line); }
.wave-status { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.wave-row.running .wave-status { background: var(--accent); animation: ping 1.6s infinite; }
.wave-row.stopped .wave-status { background: var(--muted); }
.wave-info { flex: 1; min-width: 0; }
.wave-info .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wave-info .m { font-size: 12px; color: var(--muted); }
.wave-clock { font-family: var(--font-mono); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.wave-row.stopped .wave-clock { color: var(--muted); }
.wave-del { color: var(--faint); }
.wave-del:hover { color: var(--danger); }

/* ---------- Affichage TV ---------- */
.tv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tv-grid .btn { height: 44px; }
.tv-grid .btn.span-2 { grid-column: span 2; }
.tv-section + .tv-section { margin-top: 16px; }
.tv-section .label { display: block; margin-bottom: 8px; }
.tv-section .select { margin-bottom: 8px; }

/* ---------- Tableau participants ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { padding: 12px 14px; border-radius: var(--radius-md); background: var(--panel-2); border: 1px solid var(--line); }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); }
.stat.hot .v { color: var(--accent-text); }
.table-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.table-tools .input { flex: 1; }
.search { position: relative; flex: 1; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.search .input { padding-left: 36px; }
.table-wrap { max-height: 460px; overflow: auto; border-radius: var(--radius-md); border: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #3a3a40 transparent; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap th, .table-wrap td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap td.name { white-space: normal; font-weight: 600; }
.table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; }
.table-wrap tbody tr:hover { background: rgba(255,255,255,0.025); }
.table-wrap tbody tr:last-child td { border-bottom: none; }
.rank { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; font-weight: 800; font-size: 12px; background: var(--panel-3); color: var(--muted); }
.rank.r1 { background: var(--accent); color: var(--accent-ink); }
.rank.r2, .rank.r3 { background: var(--accent-soft); color: var(--accent-text); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; background: var(--panel-3); color: var(--muted); }
.status-run { color: var(--faint); font-style: italic; }
.table-empty { padding: 24px; text-align: center; color: var(--faint); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--panel-3); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7);
  font-size: 13.5px; animation: pop .2s ease-out;
}
.toast .icon { width: 18px; height: 18px; margin-top: 1px; }
.toast.ok .icon { color: var(--ok); }
.toast.err { border-color: rgba(255,95,95,0.45); }
.toast.err .icon { color: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }

/* Éléments propres à une seule version */
body.mode-complet [data-only]:not([data-only~="complet"]),
body.mode-simple [data-only]:not([data-only~="simple"]),
body.mode-officiel [data-only]:not([data-only~="officiel"]) { display: none !important; }

/* Ajustements petits écrans */
.tv-grid .btn { min-width: 0; }
.wave-info .m { white-space: nowrap; }
@media (max-width: 480px) {
  .tv-grid { grid-template-columns: 1fr; }
  .tv-grid .btn.span-2 { grid-column: auto; }
}

/* ==========================================================================
   ÉLÉMENTS COMMUNS
   ========================================================================== */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; flex: 0 0 auto; overflow: hidden;
  box-shadow: 0 8px 24px -8px var(--accent-line);
}
.brand-mark .icon { width: 22px; height: 22px; stroke-width: 2.4; }
.brand-mark.has-logo { background: #fff; box-shadow: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hint { font-weight: 500; color: var(--faint); margin-left: 4px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }
.btn-lg { height: 46px; font-size: 14px; }
.select-sm { height: 32px; font-size: 12.5px; padding-right: 30px; width: auto; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.danger-text { color: var(--danger) !important; }
.pill.ok-pill { color: var(--ok); border-color: rgba(61,220,132,0.35); }
.pill.ko-pill { color: var(--danger); border-color: rgba(255,95,95,0.4); }
body.is-tv #adminView { display: none; }

/* ==========================================================================
   CONNEXION / INSCRIPTION
   ========================================================================== */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-aside {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 52px; border-right: 1px solid var(--line); overflow: hidden;
  background:
    radial-gradient(600px 400px at 20% 110%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, #0d0d10, #09090b);
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 30% 60%, #000 10%, transparent 70%);
}
.auth-pitch { position: relative; z-index: 1; max-width: 520px; }
.auth-pitch h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.05; letter-spacing: -1.4px; margin: 0 0 28px; }
.auth-pitch h1 em { font-style: normal; color: var(--accent-text); }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.auth-pitch li { display: flex; align-items: center; gap: 12px; color: #d4d4d8; font-size: 15px; }
.auth-pitch li .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--accent-text); }
.auth-foot { position: relative; z-index: 1; color: var(--faint); font-size: 12.5px; letter-spacing: 0.5px; }
.auth-main { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; letter-spacing: -0.6px; margin: 0 0 6px; }
.auth-card > form > p.muted { margin: 0 0 26px; }
.auth-card .field + .field { margin-top: 14px; }
.auth-card .btn-lg { width: 100%; margin-top: 20px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 18px; }
.auth-switch a { color: var(--accent-text); text-decoration: none; font-weight: 600; }
.auth-mobile-brand { display: none; margin-bottom: 28px; }
.first-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12.5px; font-weight: 700; margin-bottom: 16px; }
.first-badge .icon { width: 15px; height: 15px; }
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: inline-flex; }
}

/* ==========================================================================
   ESPACE CLIENT
   ========================================================================== */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px;
  padding: 22px 16px; border-right: 1px solid var(--line); background: rgba(13,13,16,0.6);
}
.sidebar > .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--panel-3); border: 1px solid var(--line-strong); font-weight: 800; color: var(--accent-text); }
.me-text { min-width: 0; }
.me-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-mail { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 36px 40px 64px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; letter-spacing: -0.8px; margin: 0 0 6px; }
.page-head p { margin: 0; max-width: 640px; }
.stack { display: flex; flex-direction: column; gap: 20px; max-width: 860px; }
.card .card-title { margin-bottom: 16px; }

.tv-link-box .label { display: block; margin-bottom: 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); }
.copy-row .btn-icon { width: 40px; height: 40px; }

.promo {
  display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 18px 20px; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); text-decoration: none; color: inherit; transition: border-color .15s, background .15s;
}
.promo:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.promo-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: 0 0 auto; }
.promo .chevron { margin-left: auto; color: var(--faint); }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(9,9,11,0.85); border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar > .brand .brand-name, .me-text { display: none; }
  .sidebar > .brand { padding: 0; }
  .brand-mark { width: 34px; height: 34px; }
  .nav { flex-direction: row; gap: 2px; overflow-x: auto; flex: 1; }
  .nav a { height: 36px; padding: 0 10px; white-space: nowrap; font-size: 13px; }
  .sidebar-foot { margin: 0; padding: 0; border: none; }
  .me { display: none; }
  .content { padding: 22px 16px 48px; }
}
@media (max-width: 560px) {
  .nav a span { display: none; }
}

/* ---------- Personnalisation ---------- */
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 520px); gap: 24px; align-items: start; }
.brand-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.grid-2 .field + .field, .grid-3 .field + .field { margin-top: 0; }
.span-2 { grid-column: span 2; }
.color-row { display: flex; gap: 8px; }
.color-row input[type="color"] { width: 46px; height: 40px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; flex: 0 0 auto; }
.color-row .input { flex: 1; min-width: 0; }
.switch { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; cursor: pointer; line-height: 1.4; }
.switch { position: relative; }
.switch input { position: absolute; left: 0; top: 0; width: 42px; height: 24px; margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.switch-ui { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-strong); flex: 0 0 auto; transition: background .15s; margin-top: 1px; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .switch-ui { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

.upload-grid { display: grid; gap: 10px; margin-top: 16px; }
.upload { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius-md); background: var(--panel-2); border: 1px solid var(--line); }
.upload.is-custom { border-color: var(--accent-line); }
.upload.busy { opacity: 0.6; pointer-events: none; }
.upload-thumb {
  width: 56px; height: 56px; border-radius: 10px; flex: 0 0 auto; border: 1px solid var(--line-strong);
  background: #000 center / contain no-repeat;
  background-image: none;
}
.upload-thumb.wide { width: 96px; height: 54px; background-size: cover; }
.upload-thumb.empty { background-image: repeating-linear-gradient(45deg, var(--panel-3) 0 6px, var(--panel-2) 6px 12px) !important; }
.upload-thumb.font-thumb { display: grid; place-items: center; font-size: 24px; font-weight: 800; background: var(--bg); }
.upload-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upload-text small { color: var(--faint); font-size: 12px; }
.upload-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.savebar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px 12px 18px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: rgba(17,17,19,0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.8);
}
.savebar.dirty { border-color: var(--accent-line); }
.savebar.dirty #saveStatus { color: var(--accent-text); }

.preview { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.preview-frame { position: relative; width: 100%; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line-strong); background: #000; box-shadow: 0 30px 60px -30px rgba(0,0,0,0.9); }
.preview-frame iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }

@media (max-width: 1180px) {
  .brand-layout { grid-template-columns: 1fr; }
  .preview { position: static; order: -1; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .upload { flex-wrap: wrap; }
}

/* ---------- Administration ---------- */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .btn { height: 30px; padding: 0 8px; font-size: 12px; }
.table-wrap td .muted.small { font-weight: 400; }

/* ---------- Fenêtre ---------- */
.modal {
  width: min(460px, calc(100vw - 32px)); padding: 24px; border-radius: 20px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.9);
}
.modal::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal h2 { font-size: 19px; margin: 0 0 18px; letter-spacing: -0.3px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }


/* ==========================================================================
   ACCESSIBILITÉ
   ========================================================================== */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-btn:focus-within, .dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 13.5px; line-height: 1.45; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }
.check a, .privacy-note a, .legal a, .legal-footer a, .muted a { color: var(--accent-text); }
.privacy-note { margin-top: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.link-btn { background: none; border: none; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   PAGES LÉGALES ET PIED DE PAGE
   ========================================================================== */
.legal-footer { padding: 24px 16px 32px; text-align: center; }
.legal-footer ul, .sidebar-legal ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.legal-footer a, .sidebar-legal a { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.legal-footer a:hover, .sidebar-legal a:hover, .legal-footer a[aria-current="page"] { color: var(--text); text-decoration: underline; }
.sidebar-legal { padding: 4px 8px 0; }
.sidebar-legal ul { justify-content: flex-start; gap: 4px 12px; }
.sidebar-legal a { font-size: 11.5px; }
.auth-layout:has(+ .legal-footer) { min-height: calc(100vh - 76px); }
@media (max-width: 960px) { .sidebar-legal { display: none; } }

.legal-page { min-height: 100vh; }
.legal-header { max-width: 860px; margin: 0 auto; padding: 24px 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.legal { max-width: 860px; margin: 0 auto; padding: 32px 24px 24px; line-height: 1.65; font-size: 15px; }
.legal h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -1px; margin: 0 0 8px; line-height: 1.15; }
.legal h2 { font-size: 19px; letter-spacing: -0.3px; margin: 36px 0 10px; }
.legal p, .legal li { color: #d4d4d8; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal-meta { color: var(--muted) !important; font-size: 13.5px; }
.legal-dl { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 8px 20px; margin: 0; }
.legal-dl > div { display: contents; }
.legal-dl dt { color: var(--muted); font-size: 14px; }
.legal-dl dd { margin: 0; }
.legal-dl [hidden] { display: none; }
.legal-table { margin: 12px 0; max-height: none; }
.legal-table td { white-space: normal; vertical-align: top; font-size: 13.5px; line-height: 1.5; }
.legal-box { margin: 16px 0; padding: 16px 20px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--panel); }
mark.todo { background: rgba(255,181,71,0.16); color: var(--warn); padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }
@media (max-width: 640px) {
  .legal-dl { grid-template-columns: 1fr; gap: 2px; }
  .legal-dl dd { margin-bottom: 10px; }
}

/* Acceptation des CGU */
.auth-title { font-size: 26px; letter-spacing: -0.6px; margin: 28px 0 6px; }
.terms-form .muted { margin: 0 0 16px; }
.terms-links { padding-left: 20px; margin: 0 0 4px; line-height: 1.8; }
.terms-links a { color: var(--accent-text); }

/* Espace client */
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px 16px; margin: 16px 0 0; min-width: 0; }
.fieldset legend { padding: 0 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.warn-box { border-color: rgba(255,181,71,0.45); border-style: solid; margin: 0 0 18px; }
.warn-box .promo-icon { background: var(--warn); color: #1a1000; }
.form-actions.row { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   UTILISATEURS ET DROITS (administrateurs)
   ========================================================================== */
.nav-group { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.nav-group[hidden] { display: none; }
.nav-label { padding: 0 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
@media (max-width: 960px) {
  .nav-group { flex-direction: row; gap: 2px; margin: 0; }
  .nav-label { display: none; }
}
.stats-4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
@media (max-width: 640px) { .stats-4 { grid-template-columns: repeat(2, 1fr); } }
.select-filter { width: auto; min-width: 190px; }
.page-head + .stats, .stats + .card { margin-top: 0; }
[data-page="utilisateurs"] .card + .card { margin-top: 20px; }
.row-actions .btn span { margin-left: 2px; }

.rights-table { max-height: none; }
.rights-table th[scope="row"] { font-weight: 500; color: var(--text); white-space: normal; text-transform: none; letter-spacing: 0; font-size: 13.5px; background: none; position: static; }
.rights-table td { text-align: center; width: 130px; }
.rights-table thead th:not(:first-child) { text-align: center; }
.right-yes .icon { color: var(--ok); }
.right-no .icon { color: var(--faint); }
.rights-notes { margin: 14px 0 0; padding-left: 18px; line-height: 1.6; }

.role-chooser { border: 0; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.role-chooser legend { margin-bottom: 8px; padding: 0; }
.role-option { position: relative; display: block; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; inset: 0; z-index: 1; margin: 0; cursor: pointer; }
.role-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 12px 40px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--panel-2); transition: border-color .15s, background .15s; position: relative; }
.role-card::before { content: ""; position: absolute; left: 14px; top: 15px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.role-card strong { font-size: 14px; }
.role-card span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.role-option input:checked + .role-card { border-color: var(--accent); background: var(--accent-soft); }
.role-option input:checked + .role-card::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 3px, transparent 4px); }
.role-option input:focus-visible + .role-card { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-option input:disabled + .role-card { opacity: 0.55; cursor: not-allowed; }

.credentials { margin: 14px 0; padding: 14px; border-radius: var(--radius-md); background: var(--bg); border: 1px solid var(--line-strong); font: 13px/1.6 var(--font-mono); white-space: pre-wrap; word-break: break-all; color: var(--text); }
.modal { max-height: calc(100vh - 32px); overflow-y: auto; }

/* ==========================================================================
   AIDE ET TUTORIELS
   ========================================================================== */
.help-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: rgba(9,9,11,0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.help-bar .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.help-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 40px; max-width: 1280px; margin: 0 auto; padding: 28px 24px 40px; align-items: start; }
.help-toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 6px; scrollbar-width: thin; }
.help-toc #helpCount { margin: 0 2px; }
.toc-group { margin-top: 8px; }
.toc-group[hidden], .help-toc li[hidden] { display: none; }
.toc-title { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 4px 8px; }
.toc-title:hover { color: var(--text); }
.help-toc ul { list-style: none; margin: 2px 0 0; padding: 0; }
.help-toc li a { display: block; padding: 6px 8px 6px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13.5px; line-height: 1.35; }
.help-toc li a:hover { color: var(--text); border-left-color: var(--line-strong); }
.help-toc li a[aria-current] { color: var(--accent-text); border-left-color: var(--accent); background: var(--accent-soft); }

.help-content { min-width: 0; max-width: 860px; }
.help-hero h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -1.2px; margin: 0 0 10px; line-height: 1.1; }
.help-hero p { font-size: 15.5px; max-width: 680px; margin: 0; }
.quick-path { list-style: none; padding: 0; margin: 22px 0 8px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.quick-path a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; line-height: 1.3; transition: border-color .15s; }
.quick-path a:hover { border-color: var(--accent); }
.quick-path strong { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
@media (max-width: 760px) { .quick-path { grid-template-columns: 1fr 1fr; } }

.help-section { margin-top: 44px; }
.help-section[hidden] { display: none; }
.help-section-title { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent-text); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tuto { scroll-margin-top: 84px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; line-height: 1.65; }
.tuto[hidden] { display: none; }
.tuto h3 { font-size: 19px; letter-spacing: -0.3px; margin: 0 0 10px; line-height: 1.3; }
.tuto p, .tuto li { color: #d4d4d8; }
.tuto ul { padding-left: 20px; }
.tuto li + li { margin-top: 6px; }
.tuto code, .tuto kbd { font-family: var(--font-mono); font-size: 0.88em; padding: 1px 6px; border-radius: 6px; background: var(--panel-3); border: 1px solid var(--line-strong); color: var(--text); }
.tuto kbd { border-bottom-width: 2px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 12px 0; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; min-height: 28px; }
.steps li + li { margin-top: 10px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: 13px; }
.shot { margin: 16px 0 6px; }
.shot img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: #000; }
.shot a { display: block; border-radius: var(--radius-md); }
.shot figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.shot-medium { max-width: 560px; }
.shot-narrow { max-width: 420px; }
.shot-small { max-width: 320px; }
.tv-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.tv-gallery .shot { margin: 0; }
@media (max-width: 640px) { .tv-gallery { grid-template-columns: 1fr; } }
.tip { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border-left: 3px solid var(--accent); font-size: 14px; }
.tip.warn { background: rgba(255,181,71,0.1); border-left-color: var(--warn); }
.tip a { color: var(--accent-text); }
.help-table { max-height: none; margin: 12px 0; }
.help-table th[scope="row"] { position: static; background: none; color: var(--text); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 13.5px; white-space: normal; }
.help-table td { white-space: normal; }
.faq details.tuto { padding: 0; }
.faq summary { cursor: pointer; padding: 16px 22px; font-weight: 600; list-style-position: inside; }
.faq summary:hover { color: var(--accent-text); }
.faq details p { margin: 0; padding: 0 22px 18px; }
.help-empty { padding: 40px 0; text-align: center; color: var(--muted); }
@media (max-width: 960px) {
  .help-layout { grid-template-columns: 1fr; gap: 20px; padding: 18px 16px 32px; }
  .help-toc { position: static; max-height: none; }
  .help-toc nav { display: none; }
  .help-bar { padding: 10px 16px; }
  .tuto { padding: 18px; }
}
/* Les captures sont encadrées pour ne pas se confondre avec la vraie interface */
.shot img { padding: 10px; background: #26262b; border-color: #3a3a42; box-shadow: 0 12px 30px -18px rgba(0,0,0,0.9); }
.shot a:hover img { border-color: var(--accent); }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* Bouton Aide en haut de chaque page de l'espace client, version de l'appli */
.content-top { display: flex; justify-content: flex-end; margin: -12px 0 8px; }
.app-version { padding: 6px 8px 0; font-size: 11px; color: var(--faint); }
@media (max-width: 960px) {
  .content-top { margin: 0 0 12px; }
  .app-version { display: none; }
}

/* ==========================================================================
   PERSONNALISATION PAR VERSION
   ========================================================================== */
.version-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.version-switch label { position: relative; cursor: pointer; }
.version-switch input { position: absolute; inset: 0; opacity: 0; z-index: 1; margin: 0; cursor: pointer; }
.version-switch span { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--panel); transition: border-color .15s, background .15s; }
.version-switch strong { font-size: 15px; }
.version-switch small { color: var(--muted); font-size: 12.5px; }
.version-switch input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.version-switch input:checked + span strong { color: var(--accent-text); }
.version-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px; border-radius: var(--radius-md); background: var(--panel); border: 1px solid var(--line); }
.brand-toolbar .select { width: auto; min-width: 200px; }
.row.wrap { flex-wrap: wrap; }
.brand-group > summary { cursor: pointer; list-style: none; margin: 0; display: flex; align-items: center; gap: 10px; }
.brand-group > summary::-webkit-details-marker { display: none; }
.brand-group > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.brand-group[open] > summary { margin-bottom: 16px; }
.brand-group[open] > summary::after { transform: rotate(-135deg); }
.brand-group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.field-help { display: block; color: var(--faint); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.field-switch { margin-top: 14px; }
.alert-box { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid var(--line-strong); background: var(--panel); }
.alert-box.danger { border-color: rgba(255,95,95,0.5); background: var(--danger-soft); }
.alert-box .icon { width: 22px; height: 22px; color: var(--danger); flex: 0 0 auto; margin-top: 2px; }
.alert-box p { margin: 4px 0 0; }
.attest-card .muted { margin: 0 0 10px; }
.attest-list { margin: 0 0 6px; padding-left: 20px; line-height: 1.6; color: #d4d4d8; font-size: 14px; }
@media (max-width: 640px) { .version-switch { grid-template-columns: 1fr; } .brand-toolbar .select { min-width: 0; flex: 1; } }

/* Formulaire de signalement */
.report-form { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.report-form .field + .field { margin-top: 0; }
.textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical; font-family: var(--font); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.report-done { margin-top: 20px; }
.report-done:focus { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Signalements (administration) */
.filter-tabs { margin-bottom: 16px; gap: 8px; }
.filter-tabs label { position: relative; cursor: pointer; }
.filter-tabs input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.filter-tabs span { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); font-weight: 600; font-size: 13px; }
.filter-tabs input:checked + span { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.filter-tabs input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.reports-list { display: flex; flex-direction: column; gap: 14px; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.report-dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; margin: 0 0 14px; font-size: 14px; }
.report-dl dt { color: var(--muted); }
.report-dl dd { margin: 0; overflow-wrap: anywhere; }
.report-desc { white-space: pre-wrap; }
.report-dl a { color: var(--accent-text); }
.report-actions { margin-top: 10px; gap: 8px; }
.nav a .count-badge { margin-left: auto; }
@media (max-width: 640px) { .report-dl { grid-template-columns: 1fr; } .report-dl dd { margin-bottom: 8px; } }
.legal h3 { font-size: 16px; margin: 22px 0 6px; color: var(--text); }

/* ---------- Page « lien TV invalide » ---------- */
body.tv-invalid { background: #000; color: #999; display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 16px; text-align: center; }
.mb-12 { margin-bottom: 12px; }
.min-w-0 { min-width: 0; }

/* ---------- Connexion : passkey et double authentification ---------- */
.or-sep { display: flex; align-items: center; gap: 12px; color: var(--muted, #a1a1aa); font-size: 13px; margin: 14px 0 10px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line, rgba(255,255,255,.12)); }
.btn-block { width: 100%; justify-content: center; }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text, inherit); text-decoration: underline; cursor: pointer; font: inherit; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Sécurité du compte ---------- */
.global-alert { margin: 0 0 18px; }
.alert-box.warn { border-color: rgba(255,181,71,0.5); background: rgba(255,181,71,0.08); }
.alert-box.warn .icon { color: var(--warn); }
.alert-box.ok { border-color: rgba(61,220,132,0.45); background: rgba(61,220,132,0.08); }
.alert-box.ok .icon { color: var(--ok); }
.alert-box a { color: var(--accent-text); }
.sec-block { padding: 16px 0; border-top: 1px solid var(--line); }
.sec-block:first-of-type { border-top: 0; padding-top: 4px; }
.sec-block h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.sec-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2, rgba(255,255,255,0.02)); }
.sec-list li .icon { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.sec-list li .grow { flex: 1; min-width: 0; }
.sec-list li .grow > div:first-child { overflow-wrap: anywhere; }
.qr-box { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 12px; width: 220px; height: 220px; margin: 6px auto 12px; }
.qr-box img { width: 196px; height: 196px; image-rendering: pixelated; }
.secret-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; background: var(--panel-3); padding: 8px 10px; border-radius: 8px; user-select: all; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; background: var(--panel-3); padding: 12px 14px; border-radius: 10px; margin: 10px 0; list-style: none; }
.sec-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.audit-table td { vertical-align: top; }
.audit-table .details { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.audit-table td.nowrap { white-space: nowrap; }
.steps-list { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 4px; }
.sec-block .btn { white-space: normal; max-width: 100%; text-align: left; }
.sec-list li .grow { flex: 1 1 0; }
@media (max-width: 560px) { .sec-list li { flex-wrap: wrap; } }

/* ---------- Régie, version officielle : pointage des passages ---------- */
.checkpoint-card .live-list { margin-bottom: 14px; }
.cp-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.cp-row .field { margin: 0; }
.cp-post { flex: 1 1 220px; }
.cp-bib { flex: 1 1 180px; }
.cp-input { font-size: 26px; height: 56px; font-weight: 800; letter-spacing: 2px; }
.cp-btn { height: 56px; }
.cp-preview { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; min-height: 28px; margin: 12px 0 4px; }
.cp-preview .nm { font-weight: 800; }
.cp-preview .cp-next { font-weight: 800; color: var(--accent-text); }
.cp-preview .hint { color: var(--muted); font-size: 13px; }
.cp-preview .hint.warn { color: var(--warn); }
.cp-feed-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin: 18px 0 8px; }
.cp-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cp-feed li { display: grid; grid-template-columns: 72px 56px minmax(0, 1fr) minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.cp-feed li.empty-line { display: block; color: var(--muted); }
.cp-feed .cp-clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-feed .cp-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-feed .cp-seg { color: var(--accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-feed small { color: var(--muted); }
@media (max-width: 720px) { .cp-feed li { grid-template-columns: 1fr auto; } .cp-feed .cp-clock, .cp-feed .cp-bibcell { display: none; } }
.step-cell { font-weight: 600; }
.modal-wide { width: min(860px, calc(100vw - 32px)); }
.splits-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; margin: 12px 0; }
.splits-grid .field { margin: 0; }
.splits-grid .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .splits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
