/*
  Fyles — feuille de style de l'application (LOT-01).
  Reprise telle quelle de la maquette validée (docs/maquettes/fyles-app.html),
  sans la barre de navigation de la maquette. Ajouts en fin de fichier.
*/
/* Police Inter 4.1 (https://github.com/rsms/inter, SIL Open Font License 1.1 :
   assets/fonts/LICENSE.txt), hébergée par le site : plus rien n'est chargé chez Google.
   Fichier variable officiel, toutes les graisses (100 à 900) en un seul fichier. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/InterVariable.woff2') format('woff2');
}
:root {
  --ink: #121110;
  --bg: #121110;
  --surface: #1b1917;
  --surface-2: #24211e;
  --line: #2f2b27;
  --text: #f5f2ea;
  --muted: #a39d93;
  --faint: #6f6a62;
  --orange: #ff9e5e;
  --orange-soft: rgba(255, 158, 94, 0.14);
  --on-orange: #121110;
  --green: #8fd5a6;
  --green-soft: rgba(143, 213, 166, 0.14);
  --amber: #f2d48a;
  --amber-soft: rgba(242, 212, 138, 0.14);
  --red: #f29b92;
  --red-soft: rgba(242, 155, 146, 0.14);
  --wa: #25d366;
  --on-wa: #0b1f12;
  --qr-bg: #ffffff;
  --qr-ink: #121110;
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 28px; height: 28px; }
.num { font-variant-numeric: tabular-nums; }

/* ─── Éléments communs (mêmes classes que app.css) ─── */
.wrap { max-width: 560px; margin: 0 auto; padding-inline: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px; }
.logo { height: 24px; width: auto; display: block; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 800; text-wrap: balance; }
h2 { font-size: 20px; letter-spacing: -0.01em; margin: 0; font-weight: 700; }
h3 { font-size: 16px; margin: 0; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--orange); color: var(--on-orange); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; transition: transform .08s ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible, .icon-btn:focus-visible, .tab:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.btn-big { min-height: 58px; font-size: 17px; width: 100%; border-radius: 14px; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; font-weight: 600; }
.btn-wa { background: var(--wa); color: var(--on-wa); }
.btn-tg { background: #229ED9; color: #fff; }
.btn-plain { background: transparent; color: var(--muted); border: 0; padding: 0 8px; }
.btn-danger { background: transparent; border-color: var(--line); color: var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=date], input[type=time], textarea, select.field {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); outline: none;
}
input:focus, textarea:focus, select.field:focus { border-color: var(--orange); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }

.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }
.progress.done > i { background: var(--green); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--green-soft); border-color: var(--green); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + i { opacity: .5; }
.switch input:checked + i::after { transform: translateX(18px); background: var(--green); }
.switch input:focus-visible + i { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ─── Zone de dépôt ─── */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: 300px; padding: 28px 18px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 22px; background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--orange); background: var(--orange-soft); }
.drop .plus { width: 72px; height: 72px; border-radius: 22px; background: var(--orange); color: var(--on-orange); display: grid; place-items: center; }
.drop .plus .ico { width: 34px; height: 34px; stroke-width: 2.2; }
.drop .hint { color: var(--faint); font-size: 14px; }
@media (hover: none) { .drop .hint { display: none; } .drop { min-height: 240px; } }

/* ─── Listes de fichiers ─── */
.files { display: flex; flex-direction: column; }
.file { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.file:first-child { border-top: 0; }
.thumb { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); overflow: hidden; position: relative; }
.thumb.ph { background: linear-gradient(135deg, #3b2f27, #1e2a2a); }
.thumb.ph2 { background: linear-gradient(160deg, #2c3a2f, #2a2130); }
.thumb.ph3 { background: linear-gradient(120deg, #473426, #22262e); }
.thumb.vid::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 0; height: 0; border-left: 7px solid var(--text); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; opacity: .9; }
.fname { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file .progress { margin-top: 6px; }

/* ─── Lien ─── */
.linkbox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.linkbox span { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.done-mark .ico { width: 30px; height: 30px; stroke-width: 2.4; }

/* ─── Envoi en cours ─── */
.bigpct { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.progress.big { height: 10px; }

/* ─── Destinataire ─── */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gallery .tile { aspect-ratio: 1; border-radius: 10px; position: relative; overflow: hidden; }
.gallery .tile.vid::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-40%, -50%); border-left: 14px solid var(--text); border-top: 9px solid transparent; border-bottom: 9px solid transparent; opacity: .9; }
.gallery .tile .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 17, 16, .55); font-weight: 800; font-size: 20px; }

/* ─── Connexion ─── */
.auth { max-width: 400px; margin: 0 auto; padding: 32px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
/* Lien discret vers /confidentialite, en bas des pages publiques. */
.legal { text-align: center; padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px)); font-size: 13px; }
.legal a { color: var(--faint); text-decoration: none; }
.auth .logo { height: 30px; margin: 8px 0 18px; }
.btn-google { background: var(--text); color: var(--ink); }
.code-boxes { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.code-boxes input { min-height: 52px; padding: 0; text-align: center; font-size: 20px; font-weight: 700; text-transform: uppercase; }

/* ─── Espace connecté ─── */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.main { min-width: 0; padding: 0 16px calc(88px + env(safe-area-inset-bottom, 0px)); }
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px; }
.main-head .logo { height: 22px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar a.on { color: var(--orange); }
@media (min-width: 900px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; }
  .side .logo { height: 24px; margin: 4px 10px 20px; }
  .side .btn { margin-bottom: 14px; }
  .nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-item.on { background: var(--surface-2); color: var(--text); }
  .nav-item.on .ico { color: var(--orange); }
  .side .usage { margin-top: auto; padding: 12px; font-size: 13px; color: var(--muted); }
  .main { padding: 8px 32px 48px; }
  .main-head { display: none; }
  .tabbar { display: none; }
}

/* Mes fichiers */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.crumbs b { color: var(--text); }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.folder { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; cursor: pointer; }
.folder .ico { color: var(--orange); }
.folder div { min-width: 0; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 22px 0 8px; }
.table-files .file { grid-template-columns: 44px minmax(0, 1fr) auto auto; }
.col-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .col-date { display: none; } .table-files .file { grid-template-columns: 44px minmax(0, 1fr) auto; } }

/* Menu contextuel */
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 42px; z-index: 10; min-width: 190px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; font-size: 14px; cursor: pointer; text-align: left; }
.menu-pop button:hover { background: var(--line); }
.menu-pop .danger { color: var(--red); }

/* Fenêtre (partage, invitation) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(8, 8, 7, .72); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 600px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 20px; padding: 22px; } }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }

/* Transferts */
.tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.tr:first-child { border-top: 0; }

/* Événements */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.event-card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.event-card:hover { border-color: var(--faint); }
.event-card .img { aspect-ratio: 16 / 6; max-width: 100%; }
.event-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.event-card .stats { display: flex; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.cover-a { background: linear-gradient(120deg, #5a3a26 0%, #2a2330 60%, #1d2b2b 100%); }
.cover-b { background: linear-gradient(140deg, #22343a 0%, #3c2c22 100%); }
.cover-up { display: grid; place-items: center; aspect-ratio: 16 / 6; max-width: 100%; border-radius: 14px; border: 1.5px dashed var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; }

.ev-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 1000px) { .ev-cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
@media (max-width: 480px) { .stat b { font-size: 19px; } .stat { padding: 10px 12px; } }
.stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.qr { background: var(--qr-bg); border-radius: 14px; padding: 12px; width: 100%; max-width: 200px; margin: 0 auto; }
.qr canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 0; cursor: pointer; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tab.on { background: var(--orange); color: var(--on-orange); }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.search input { border: 0; background: transparent; min-height: 46px; padding: 0; flex: 1; min-width: 0; outline: none; }
.person-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 16px 0 2px; }

/* Frise */
.timeline { overflow-x: auto; }
.tl-inner { position: relative; min-width: 560px; }
.tl-axis { position: relative; height: 22px; border-bottom: 1px solid var(--line); margin-left: 110px; }
.tl-axis span { position: absolute; top: 2px; font-size: 11px; color: var(--faint); transform: translateX(-50%); }
.tl-row { display: flex; align-items: center; height: 32px; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-name { width: 110px; flex: none; font-size: 13px; font-weight: 600; padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lane { position: relative; flex: 1; height: 100%; }
.tl-clip { position: absolute; top: 8px; height: 16px; border-radius: 5px; background: var(--orange); }
.tl-dot { position: absolute; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }

/* Page publique d’un événement */
.cover { width: 100%; aspect-ratio: 16 / 7; max-width: 100%; border-radius: var(--radius); }
.cal { flex: none; width: 52px; text-align: center; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.cal b { display: block; background: var(--orange); color: var(--on-orange); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 3px 0; }
.cal span { display: block; font-size: 22px; font-weight: 800; padding: 3px 0 5px; }
.sticky-send { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 70%, transparent); }

/* QR plein écran */
.qr-full { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; position: relative; }
.qr-full .qr { max-width: min(70vh, 420px); padding: 20px; }
.qr-full .icon-btn { position: absolute; top: 12px; right: 12px; }

/* Compte */
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--orange-soft); color: var(--orange); flex: none; }
.avatar.b { background: var(--green-soft); color: var(--green); }
.avatar.c { background: var(--amber-soft); color: var(--amber); }
.gbadge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--text); flex: none; }

.center-page { max-width: 420px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }

/* ─── Éditeur d’affiche QR ─── */
.ed { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.ed-top h2 { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* L'écran ne défile pas : l'affiche prend toute la place restante, entière, et les réglages défilent dessous (retour n° 30) */
.ed-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ed-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 14px 16px; background: var(--ink); container-type: size; }
.ed-panel { flex: none; max-height: 44%; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 900px) {
  .ed-body { flex-direction: row-reverse; }
  .ed-stage { flex: 1; padding: 28px; }
  .ed-panel { width: 340px; max-height: none; border-top: 0; border-right: 1px solid var(--line); padding: 18px; }
}
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); overflow-x: auto; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 8px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--line); }
.models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 320px; }
.model { border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.model.on { border-color: var(--orange); color: var(--text); }
.model .mini { width: 100%; aspect-ratio: 210 / 297; max-width: 100%; border-radius: 4px; background: var(--text); position: relative; overflow: hidden; }
.model .mini i { position: absolute; background: var(--ink); border-radius: 1px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }
input[type=range] { width: 100%; accent-color: var(--orange); }
.logo-drop { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1.5px dashed var(--line); cursor: pointer; }
.logo-drop .prev { width: 48px; height: 48px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-drop .prev img { width: 100%; height: 100%; object-fit: contain; }

/* Page A4 : tout est en % et en cqw pour suivre la taille d’affichage (le PDF reprend les mêmes proportions) */
.a4 {
  --page: #121110; --page-ink: #f5f2ea;
  width: min(100cqw, 100cqh * 210 / 297); aspect-ratio: 210 / 297; flex: none;
  position: relative; overflow: hidden; container-type: inline-size;
  background: var(--page) center / cover no-repeat; color: var(--page-ink); border-radius: 4px; box-shadow: 0 0 0 1px rgba(245, 242, 234, .14), 0 20px 60px rgba(0, 0, 0, .5);
  font-family: var(--font); user-select: none; touch-action: none;
}
.el { position: absolute; transform: translateX(-50%); cursor: grab; outline: 1px dashed transparent; outline-offset: 4px; border-radius: 4px; }
.el:hover { outline-color: rgba(18, 17, 16, .35); }
.el.sel { outline: 2px solid #3b82f6; }
.el.dragging { cursor: grabbing; }
.el-title { width: 84%; text-align: center; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; font-size: 7cqw; text-wrap: balance; }
.el-date { width: 84%; text-align: center; font-weight: 600; font-size: 3.2cqw; opacity: .8; }
.el-phrase { width: 84%; text-align: center; font-weight: 800; font-size: 4.6cqw; line-height: 1.15; text-wrap: balance; }
.el-qr { width: 56%; background: #fff; border-radius: 3cqw; padding: 3.2cqw; }
.el-qr canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.el-logo { width: 18%; aspect-ratio: 1; display: grid; place-items: center; }
.el-logo img { width: 100%; height: 100%; object-fit: contain; }
.el-logo .ph { width: 100%; height: 100%; border-radius: 50%; border: .5cqw dashed currentColor; opacity: .45; display: grid; place-items: center; font-size: 2.4cqw; font-weight: 800; letter-spacing: .08em; }
.a4-foot { position: absolute; left: 0; right: 0; bottom: 3.5%; display: flex; flex-direction: column; align-items: center; gap: 1.4cqw; pointer-events: none; }
.a4-foot .lnk { font-size: 2.1cqw; font-weight: 600; opacity: .7; }
.a4-foot svg { height: 6.5cqw; width: auto; }
/* Planche de 6 */
.sheet6 { position: absolute; inset: 4%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
.cut { border: .25cqw dashed color-mix(in srgb, currentColor 35%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4cqw; padding: 2cqw; text-align: center; min-width: 0; }
.cut .t { font-weight: 800; font-size: 2.8cqw; line-height: 1.1; }
.cut .q { width: 52%; background: #fff; border-radius: 1.4cqw; padding: 1.4cqw; }
.cut .q canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.cut .p { font-weight: 700; font-size: 1.9cqw; line-height: 1.2; }
.cut .brand { height: 2.8cqw; width: auto; flex: none; }
/* Fond libre : couleur au choix ou photo (retour n° 29) */
.swatch.pick { position: relative; background: conic-gradient(#ff6b6b, #ffd93d, #6bcb77, #4d96ff, #b86bff, #ff6b6b); display: grid; place-items: center; overflow: hidden; }
.swatch.pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatch.photo { background: var(--surface-2) center / cover no-repeat; color: var(--muted); display: grid; place-items: center; }
.swatch.photo .ico { width: 18px; height: 18px; }
/* Heure tapée au clavier (retour n° 28) */
.time-in { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
/* Téléchargement : états bien visibles (retour n° 27) */
.btn.dl-busy, .icon-btn.dl-busy { pointer-events: none; opacity: .9; }
.btn.dl-done { background: var(--green-soft); color: var(--green); pointer-events: none; }
.dl-spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: dlspin .8s linear infinite; flex: none; }
.icon-btn .dl-spin { width: 18px; height: 18px; }
.icon-btn.dl-done { color: var(--green); }
@keyframes dlspin { to { transform: rotate(360deg); } }
.dl-pop { animation: dlpop .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes dlpop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dl-note { text-align: center; font-size: 14px; color: var(--muted); margin-top: -6px; }
.cut img { height: 5cqw; width: auto; }
/* QR seul */
.qr-only { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; }
.qr-only canvas { width: 70%; height: auto; image-rendering: pixelated; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.45); max-width: calc(100% - 32px); }
.toast .ico { color: var(--green); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ─── Ajouts pour le câblage (hors maquette) ─── */
.screen-page { min-height: 100vh; min-height: 100dvh; }
.thumb img, .thumb video, .gallery .tile img, .gallery .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .tile { background: var(--surface-2); width: auto; height: auto; }
.search input[type=search] { -webkit-appearance: none; appearance: none; }
.cover { object-fit: cover; background: var(--surface-2); display: block; }
.event-card .img { background: var(--surface-2) center / cover no-repeat; }
.error { color: var(--red); font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.copied { background: var(--green); color: var(--on-orange); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--orange); animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.drop-page.over::after { content: ""; position: fixed; inset: 8px; border: 2px dashed var(--orange); border-radius: 22px; background: var(--orange-soft); pointer-events: none; z-index: 90; }
.file.clickable { cursor: pointer; }
.fmeta .spinner { width: 10px; height: 10px; border-width: 2px; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
input[type=password] { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); outline: none; }
.overlay { position: fixed; inset: 0; background: rgba(8, 8, 7, .97); z-index: 70; display: grid; place-items: center; padding: 24px 16px; overflow: auto; }
.overlay > .icon-btn { position: absolute; top: 12px; right: 12px; }
.player { width: min(960px, 100%); }
.player video, .player img { width: 100%; max-height: 62vh; border-radius: 12px; background: #000; display: block; }
.player .transcript { max-height: 30vh; overflow: auto; margin-top: 12px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.player .transcript span { cursor: pointer; border-radius: 4px; }
.player .transcript span.on { color: var(--text); background: var(--orange-soft); }
.plan { padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.plan.on { background: var(--orange-soft); color: var(--text); }
.seq { margin-bottom: 12px; }
.seq-head { font-family: 'Courier New', ui-monospace, monospace; font-weight: 700; color: var(--text); cursor: pointer; }
.scenario { white-space: pre-wrap; font-family: 'Courier New', ui-monospace, monospace; font-size: 14px; color: var(--text); }
.results { display: flex; flex-direction: column; gap: 6px; }
.result { all: unset; cursor: pointer; display: grid; grid-template-columns: auto auto minmax(0, 160px) 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.result .rt { font-weight: 700; font-variant-numeric: tabular-nums; }
.result .rf, .result .rx { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .result { grid-template-columns: auto auto 1fr; } .result .rx { grid-column: 1 / -1; white-space: normal; } }
.tl-clip { border: 0; padding: 0; cursor: pointer; min-width: 4px; }
.tl-clip.horloge { background: #7a746b; }
.tl-clip.aucune { background: transparent; border: 1px dashed var(--faint); }
.tl-dot { border: 0; padding: 0; cursor: pointer; }
.tl-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.tl-legend i { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin-right: 6px; }
/* Affiche : même police que le PDF (Inter, embarquée dans le PDF), retour à la ligne
   simple comme jsPDF, pour que l'aperçu soit fidèle à l'impression. */
.a4 { font-family: 'Inter', sans-serif; }
.a4 .el-title, .a4 .el-date, .a4 .el-phrase, .a4 .cut .t, .a4 .cut .p { font-weight: 700; text-wrap: wrap; }
.a4 .cut { overflow: hidden; }

/* Input de fichier masqué mais accessible (pas display:none, pour l'activation native
   du <label for>) : le sélecteur s'ouvre sans .click() simulé. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
