:root { --bg:#0e0e0f; --card:#18181a; --line:#2a2a2d; --txt:#f2f2f2; --mut:#9a9a9f; --red:#b3121f; --ok:#3fb950; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--txt); font:16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.wrap { max-width:960px; margin:0 auto; padding:24px 16px 64px; }
h1 { font-size:clamp(28px, 6vw, 44px); line-height:1.05; margin:0 0 6px; letter-spacing:-.5px; text-transform:uppercase; }
h1 span { color:var(--red); }

input[type=search] { width:100%; padding:14px 16px; font-size:17px; border-radius:10px; border:1px solid var(--line); background:var(--card); color:var(--txt); }
input[type=search]:focus { outline:2px solid var(--red); border-color:transparent; }

.tab { padding:6px 14px; border-radius:999px; border:1px solid var(--line); background:none; color:var(--txt); cursor:pointer; font:inherit; font-size:14px; }
.tab[aria-pressed=true] { background:var(--red); border-color:var(--red); }

.az { display:flex; flex-wrap:wrap; gap:4px; margin:16px 0 8px; }
.az a { color:var(--mut); text-decoration:none; padding:2px 7px; border-radius:4px; font-size:14px; }
.az a:hover { color:var(--txt); background:var(--card); }

.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:10px; }
.card h2 { margin:0 0 8px; font-size:18px; }
.card h2 small { color:var(--mut); font-weight:400; font-size:14px; }
.card:has(> .chips[hidden]) h2, .card h2:only-child { margin-bottom:0; }

table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
td, th { text-align:left; padding:9px 8px; border-bottom:1px solid var(--line); font-size:15px; }
th { color:var(--mut); font-weight:500; font-size:13px; }
td a { color:var(--txt); }

.empty { color:var(--mut); padding:32px 0; text-align:center; }
footer { color:var(--mut); font-size:13px; margin-top:40px; }
footer a { color:var(--mut); }
.inherit { color:inherit; }

.btn { padding:8px 14px; border-radius:8px; border:0; background:var(--red); color:#fff; font:inherit; cursor:pointer; }
.qui { color:var(--mut); font-size:13px; margin-top:6px; }
.qui button { background:none; border:0; color:var(--txt); text-decoration:underline; cursor:pointer; font:inherit; }
#toast { position:fixed; left:50%; bottom:20px; transform:translateX(-50%); background:#222226; border:1px solid var(--line); padding:10px 16px; border-radius:10px; opacity:0; transition:opacity .2s; pointer-events:none; max-width:calc(100% - 32px); }
#toast.on { opacity:1; }
#toast.err { border-color:var(--red); }
dialog { background:var(--card); color:var(--txt); border:1px solid var(--line); border-radius:12px; max-width:420px; width:calc(100% - 32px); }
dialog label { display:block; margin:10px 0 4px; color:var(--mut); font-size:14px; }
dialog input, dialog select { width:100%; padding:8px 10px; background:var(--bg); color:var(--txt); border:1px solid var(--line); border-radius:8px; font:inherit; }
dialog .pied { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }
dialog .pied .pied-gauche { margin-right:auto; }

.carte-video { background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden; display:flex; flex-direction:column; }

.dlg-titre { margin-top:0; font-size:18px; }
.nowrap { white-space:nowrap; }
.mode { display:inline-flex; border:1.5px solid var(--red); border-radius:10px; overflow:hidden; margin:0 0 16px; }
.mode[hidden] { display:none; }
.mode button { display:inline-flex; align-items:center; gap:8px; padding:9px 18px; border:0; background:transparent; color:var(--red); font:inherit; font-size:14px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; cursor:pointer; }
.mode button + button { border-left:1.5px solid var(--red); }
.mode button[aria-pressed=true] { background:var(--red); color:#fff; }
.mode button:not([aria-pressed=true]):hover { background:#221416; }
.mode button:focus-visible { outline:2px solid var(--txt); outline-offset:-4px; }
.mode svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

.profil { position:relative; }
.profil[hidden] { display:none; }
.btn-profil { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--card); color:var(--txt); cursor:pointer; }
.btn-profil:hover, .btn-profil[aria-expanded=true] { border-color:var(--red); color:var(--red); }
.btn-profil:focus-visible { outline:2px solid var(--txt); outline-offset:2px; }
.btn-profil svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.menu-profil { position:absolute; right:0; top:calc(100% + 6px); z-index:20; min-width:220px; padding:6px; background:var(--card); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.4); }
.menu-profil[hidden] { display:none; }
.menu-profil-tete { display:flex; flex-direction:column; gap:2px; padding:8px 10px 10px; margin-bottom:4px; border-bottom:1px solid var(--line); }
.menu-profil-tete span { color:var(--mut); font-size:12px; }
.menu-profil button { display:block; width:100%; padding:9px 10px; border:0; border-radius:6px; background:none; color:var(--txt); font:inherit; font-size:14px; text-align:left; cursor:pointer; }
.menu-profil button:hover, .menu-profil button:focus-visible { background:var(--bg); outline:none; }
.lien-fiche { color:inherit; text-decoration:none; border-bottom:1px solid var(--line); }
.lien-fiche:hover { color:var(--red); border-bottom-color:var(--red); }
.retour { color:var(--mut); text-decoration:none; font-size:14px; }
.retour:hover { color:var(--txt); }

.card h3 { margin:0 0 8px; font-size:16px; }
.poignee { cursor:grab; color:var(--mut); user-select:none; width:1.5em; text-align:center; }
.poignee:hover { color:var(--txt); }
tr.glisse { opacity:.4; }
tr.cible td { background:#221416; box-shadow:inset 0 2px 0 var(--red), inset 0 -2px 0 var(--red); }

tr.src-ia td { color:var(--mut); }
tr.src-ia td:nth-child(n+2):not(:last-child) { font-style:italic; }
tr.src-ia a, tr.src-ia .lien-fiche { color:var(--mut); }

/* En-tête */
.entete { position:sticky; top:0; z-index:3; background:rgba(14,14,15,.94); backdrop-filter:blur(8px); border-bottom:1px solid var(--line); }
.entete-in { max-width:1100px; margin:0 auto; padding:20px 20px 0; display:flex; flex-wrap:wrap; align-items:center; gap:0 28px; }
.logo { flex:none; display:inline-flex; align-items:center; flex-wrap:wrap; gap:4px 10px; color:var(--txt); text-decoration:none; line-height:1; }

.logo-sous { font-weight:600; font-size:14px; color:var(--mut); white-space:nowrap; }

.officiel { display:inline-flex; align-items:center; gap:4px; color:var(--mut); text-decoration:none; font-size:13px; white-space:nowrap; }
.officiel:hover { color:var(--txt); }
.officiel svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:2; }

.menu { display:flex; gap:28px; min-width:0; overflow-x:auto; scrollbar-width:none; }
.actions { justify-self:end; }
.actions .btn { padding:7px 14px; font-size:13px; white-space:nowrap; }
.menu::-webkit-scrollbar { display:none; }

.menu .tab { flex:none; background:none; border:0; border-radius:0; padding:10px 0 12px; color:var(--mut); font:inherit; font-size:13px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; cursor:pointer; border-bottom:2px solid transparent; }
.menu .tab:hover { color:var(--txt); }
.menu .tab[aria-pressed=true] { background:none; color:var(--txt); border-bottom-color:var(--red); }
.outils { display:flex; align-items:center; gap:12px; flex:none; margin-left:auto; }
.entete input[type=search] { width:220px; padding:9px 12px; font-size:14px; border-radius:8px; transition:width .2s; }
.entete input[type=search]:focus { width:300px; }
.entete .mode { margin:0; border-width:1px; border-radius:8px; }
.entete .mode button { padding:8px 13px; font-size:12px; gap:6px; }
.entete .mode button + button { border-left-width:1px; }
.entete .mode svg { width:15px; height:15px; }
.entete .qui { max-width:1100px; margin:0 auto; padding:0 20px 8px; }
.entete .qui:empty { display:none; }
.wrap { max-width:1100px; padding:20px 20px 64px; }

@media (max-width:560px) {
  .logo-sous { font-size:12px; }

  .entete-in { padding:14px 16px 0; gap:12px 16px; }
  .outils { flex-basis:100%; order:2; margin-left:0; }
  /* stretch et non start : avec start, le menu prend la largeur de ses onglets
     et passe sous le bouton « + Ajouter un passage » (mesure : 323 px contre 208).
     Les onglets restent alignes a gauche, le menu defile horizontalement. */
  .menu { justify-self:stretch; }
  .entete input[type=search], .entete input[type=search]:focus { width:0; flex:1; min-width:0; }
  .entete .mode button { padding:8px 10px; }
  .menu { gap:18px; }
}

.card { position:relative; }

.filtres { display:flex; align-items:center; gap:10px; margin:4px 0 12px; }
.filtres label { color:var(--mut); font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; }
.filtres select { background:var(--card); color:var(--txt); border:1px solid var(--line); border-radius:8px; padding:7px 10px; font:inherit; font-size:14px; }
.filtres select:focus { outline:2px solid var(--red); border-color:transparent; }
.filtres select:disabled { opacity:.5; cursor:not-allowed; }

.etiquette { display:inline-block; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:2px 7px; border-radius:5px; margin-right:8px; vertical-align:1px; }
.etiquette.ajout { background:rgba(63,185,80,.15); color:var(--ok); }
.etiquette.modification { background:rgba(88,166,255,.15); color:#58a6ff; }
.etiquette.suppression { background:rgba(179,18,31,.2); color:#ff6b6b; }
.etiquette.restauration { background:rgba(210,153,34,.18); color:#e3b341; }
.etiquette.annulation { background:rgba(154,154,159,.18); color:var(--mut); }
.qui a { color:var(--mut); }
.qui a:hover { color:var(--txt); }
.qui time { cursor:help; }

@media (min-width:561px) and (max-width:900px) {
  .logo-sous { font-size:13px; }
  .entete input[type=search], .entete input[type=search]:focus { width:150px; }
}
/* Lecteur intégré (fenêtre par-dessus la page, 26-09-2026) */
dialog.lecteur { max-width:760px; width:calc(100% - 32px); padding:0; overflow:hidden; }
dialog.lecteur::backdrop { background:color-mix(in srgb, var(--bg) 80%, transparent); }

.lecteur-erreur { margin:0; padding:10px 12px; color:var(--txt); border-top:1px solid var(--red); }

@media (max-width:700px) {
  dialog.lecteur { width:100%; max-width:none; height:100%; max-height:none; margin:0; border:0; border-radius:0; display:flex; flex-direction:column; justify-content:center; justify-content:safe center; overflow-y:auto; }
  dialog.lecteur:not([open]) { display:none; }
  dialog.lecteur > * { flex-shrink:0; }
}
dialog label[hidden], dialog select[hidden] { display:none; }

/* Sommaire en panneau flottant (29-09, demande d'Alice : la consultation ne doit pas déformer la
   page). La carte laisse déborder le panneau ; son en-tête garde les coins arrondis. */
.carte-video { overflow:visible; }

/* Lecteur sur un écran peu haut (29-09, retour d'Alice : boutons sous la vidéo inaccessibles).
   La vidéo rétrécit (16/9 gardé) pour que tout tienne ; en Édition, il y a plus de boutons
   dessous. En dernier recours, la fenêtre défile au lieu de couper. */
@media (min-width:701px) {
  dialog.lecteur { overflow-y:auto; }
}
