:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --surface-3: #e4e7ec;
  --border: #dde1e7;
  --text: #15181d;
  --muted: #646b77;
  --accent: #1f7cff;
  --accent-hover: #0f68e6;
  --accent-soft: #e5efff;
  --danger: #d93a3a;
  --ok: #18a058;
  --player-bg: #0b0c0f;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414; --surface: #1f1f1f; --surface-2: #2a2a2a; --surface-3: #343434; --border: #333;
    --text: #f1f1f1; --muted: #a3a3a3; --accent: #1f7cff; --accent-hover: #3b8dff; --accent-soft: #19263b;
    --shadow: 0 1px 2px rgba(0,0,0,.5); --shadow-lg: 0 16px 48px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --surface: #1f1f1f; --surface-2: #2a2a2a; --surface-3: #343434; --border: #333;
  --text: #f1f1f1; --muted: #a3a3a3; --accent: #1f7cff; --accent-hover: #3b8dff; --accent-soft: #19263b;
  --shadow: 0 1px 2px rgba(0,0,0,.5); --shadow-lg: 0 16px 48px rgba(0,0,0,.6); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ── En-tête ── */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .inner { padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.brand .logo { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.brand .logo svg { width: 11px; height: 11px; fill: #fff; stroke: none; margin-left: 2px; }
.topbar .spacer { flex: 1; }
.hamburger { display: none; background: none; border: 0; padding: 6px; margin-left: -6px; cursor: pointer; }
.hamburger svg { width: 24px; height: 24px; }
.account { position: relative; }
.account-btn { display: flex; align-items: center; gap: 4px; background: none; border: 0; cursor: pointer; font-weight: 600; padding: 8px; }
.account-btn svg { width: 16px; height: 16px; }
.account-menu { right: 0; top: calc(100% + 6px); min-width: 230px; }

/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.big { height: 42px; padding: 0 20px; font-size: 16px; }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }
.btn.big svg { width: 20px; height: 20px; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { background: none; border: 0; padding: 4px; border-radius: 6px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn svg { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.linkbtn:hover { color: var(--accent); }
.linkbtn svg { width: 13px; height: 13px; }

/* ── Menus déroulants ── */
.menu {
  position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px;
}
.menu-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; }
.menu-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 6px; padding: 8px 10px; cursor: pointer; font-size: 14px;
}
.menu-item.switch-row { justify-content: space-between; }
.menu-item span { display: flex; align-items: center; gap: 10px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 16px; height: 16px; color: var(--muted); }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.card-menu, .label-pop { position: fixed; }
.label-pop { min-width: 180px; }

.switch { display: inline-flex; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch-row { cursor: pointer; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }

/* ── Mise en page tableau de bord ── */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.sidebar { padding: 16px 12px; border-right: 1px solid var(--border); background: var(--bg); position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; font-size: 15px; min-width: 0; flex: 1; }
.side-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item em { font-style: normal; font-size: 12px; color: var(--muted); }
.side-item svg { width: 18px; height: 18px; color: var(--muted); }
.side-item:hover { background: var(--surface-2); }
.side-item.on { background: var(--surface-2); color: var(--accent); font-weight: 600; }
.side-item.on svg { color: var(--accent); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 12px 6px; font-weight: 600; }
.side-label { display: flex; align-items: center; }
.side-label .label-menu { opacity: 0; }
.side-label:hover .label-menu, .side-label .label-menu:focus { opacity: 1; }
.side-empty { color: var(--muted); font-size: 13px; padding: 4px 12px; margin: 0; }
.scrim { display: none; }

main.content { padding: 20px 28px 96px; min-width: 0; max-width: none; margin: 0; width: 100%; }
.uploadbar {
  display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; margin-bottom: 22px;
}
.paste { flex: 1; display: flex; gap: 8px; align-items: center; min-width: 0; }
.paste input { flex: 1; min-width: 0; height: 40px; border: 0; border-bottom: 1px solid var(--border); background: transparent; outline: none; font-size: 14px; padding: 0 4px; }
.paste input:focus { border-bottom-color: var(--accent); }

.listhead { margin-bottom: 16px; }
.listhead h1 { font-size: 20px; margin: 0 0 8px; letter-spacing: -.01em; }
.listhead .count { color: var(--muted); font-weight: 500; }
.listtools { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.search { position: relative; flex: 0 1 320px; }
.search input { width: 100%; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; padding: 0 10px 0 30px; outline: none; font-weight: 600; }
.search input:focus, .search input:not(:placeholder-shown) { border-color: var(--border); background: var(--surface); font-weight: 400; }
.search input::placeholder { color: var(--text); }
.search svg { position: absolute; left: 6px; top: 8px; width: 18px; height: 18px; }
.sort { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.sort svg { width: 16px; height: 16px; }
.sort select { background: transparent; border: 0; color: var(--muted); cursor: pointer; outline: none; font-size: 14px; }
.sort select option { background: var(--surface); color: var(--text); }

/* ── Cartes vidéo ── */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; align-items: start; }
.vcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; }
.vcard:hover { box-shadow: var(--shadow); }
.vcard.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vthumb { position: relative; aspect-ratio: 16 / 9; background: var(--player-bg); overflow: hidden; }
.vthumb a, .vthumb img { position: absolute; inset: 0; width: 100%; height: 100%; }
.vthumb img { object-fit: cover; }
.vthumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; pointer-events: none; }
.vthumb video.playing { opacity: 1; }
.badge {
  position: absolute; background: rgba(0,0,0,.72); color: #fff; font-size: 12px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; pointer-events: none;
}
.badge svg { width: 12px; height: 12px; }
.badge.tr { top: 8px; right: 8px; }
.badge.br { bottom: 8px; right: 8px; }
.badge.bl { bottom: 8px; left: 8px; }
.vcheck { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.vcard:hover .vcheck, .vcard.selected .vcheck, body.selecting .vcheck { opacity: 1; }
.vcheck input { appearance: none; margin: 0; width: 20px; height: 20px; border-radius: 4px; border: 2px solid rgba(255,255,255,.85); background: rgba(0,0,0,.35); cursor: pointer; }
.vcheck input:checked { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--accent); }
.vstate { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; color: #d7dae0; font-size: 14px; padding: 16px; }
.vstate.overlay { background: rgba(0,0,0,.6); }
.vstate.err strong { color: #ff8a8a; }
.vstate.err small { color: #b9bec7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vstate span { margin-top: 6px; }
.vstate .btn { color: var(--text); }
.vbody { padding: 12px 14px 10px; flex: 1; display: grid; gap: 4px; align-content: start; }
.vtitle { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.vtitle a:hover { color: var(--accent); }
.vurl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.vurl > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vlabels { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 4px; }
.vlabels > svg { width: 14px; height: 14px; }
.chip { background: var(--surface-2); color: var(--text); padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.chip:hover { background: var(--accent-soft); color: var(--accent); }
.vjoberr { font-size: 12px; color: var(--danger); }
.vactions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); background: var(--surface-2); }
.vactions button { background: none; border: 0; padding: 10px 6px; cursor: pointer; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.vactions button + button { border-left: 1px solid var(--border); }
.vactions button:hover:not(:disabled) { color: var(--text); background: var(--surface-3); }
.vactions button:disabled { opacity: .45; cursor: default; }
.vactions svg { width: 15px; height: 15px; }

.empty { text-align: center; padding: 72px 16px; color: var(--muted); }
.empty h2 { color: var(--text); margin: 0 0 6px; font-size: 20px; }
.empty .btn { margin-top: 18px; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }

/* ── Barre de sélection ── */
.bulkbar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 35;
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px 10px 8px 16px; width: max-content; max-width: calc(100vw - 32px); flex-wrap: wrap;
}
.bulkbar strong { margin-right: 6px; font-size: 14px; }

/* ── Fenêtres modales ── */
.modal { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 32px); width: 560px; color: var(--text); }
.modal.wide { width: 860px; }
.modal::backdrop { background: rgba(0,0,0,.55); }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 22px; display: grid; gap: 14px; max-height: calc(100vh - 48px); overflow: auto; }
.modal h2 { margin: 0; font-size: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal h2 .iconbtn { margin-right: -6px; }
.modal p.hint { margin: -6px 0 0; color: var(--muted); font-size: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.input, .field textarea {
  width: 100%; min-height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
  padding: 8px 10px; font-size: 14px; outline: none;
}
.input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; resize: vertical; min-height: 84px; }
.copy { display: flex; gap: 8px; }
.copy .input, .copy input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.modal video { width: 100%; max-height: 52vh; background: #000; border-radius: 8px; }
.trim { display: grid; gap: 10px; }
.trim-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.trim-row .input { width: 110px; font-variant-numeric: tabular-nums; }
.trim-track { position: relative; height: 10px; background: var(--surface-3); border-radius: 999px; }
.trim-track i { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 999px; }
.trim-track b { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--text); }
.opt-list { display: grid; gap: 2px; max-height: 300px; overflow: auto; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.opt:hover { background: var(--surface-2); }
.opt input { width: 16px; height: 16px; accent-color: var(--accent); }
.radio-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; align-items: flex-start; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--accent); }
.radio-card strong { display: block; }
.radio-card span { font-size: 13px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; border-bottom: 1px solid var(--border); }
.chart div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.chart div:hover { opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.thumb-now { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.thumb-now img { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: #000; }

/* ── Envois en cours ── */
.uploads {
  position: fixed; right: 20px; bottom: 20px; z-index: 36; width: 380px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.uploads-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.uploads-list { max-height: 50vh; overflow: auto; }
.up { padding: 10px 16px; display: grid; gap: 6px; border-top: 1px solid var(--border); }
.up:first-child { border-top: 0; }
.up .row { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.up .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.up .state { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .2s; }
.bar.indet > i { width: 30%; animation: indet 1.2s infinite ease-in-out; }
.bar.done > i { background: var(--ok); width: 100%; }
.bar.err > i { background: var(--danger); width: 100%; }
@keyframes indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

.dropzone { position: fixed; inset: 0; z-index: 50; background: rgba(31,124,255,.18); backdrop-filter: blur(2px); display: grid; place-items: center; pointer-events: none; }
.dropzone > div { background: var(--surface); border: 2px dashed var(--accent); border-radius: 16px; padding: 36px 48px; font-size: 18px; font-weight: 600; display: grid; justify-items: center; gap: 12px; }
.dropzone svg { width: 36px; height: 36px; color: var(--accent); }

.spinner { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page de lecture ── */
main { max-width: 1320px; margin: 0 auto; padding: 24px 16px 64px; }
.watch { max-width: 1100px; margin: 0 auto; }
.player { background: var(--player-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; justify-content: center; }
.player video { width: 100%; max-height: 75vh; background: var(--player-bg); }
.processing { aspect-ratio: 16/9; display: grid; place-items: center; color: #cfd3da; text-align: center; padding: 24px; width: 100%; }
.watch-head { display: flex; align-items: flex-start; gap: 16px; margin: 18px 0 6px; flex-wrap: wrap; }
.watch-head h1 { flex: 1 1 320px; font-size: 22px; margin: 0; letter-spacing: -.02em; line-height: 1.3; word-break: break-word; }
.watch-head h1[contenteditable="true"] { outline: none; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.watch-head h1[contenteditable="true"]:hover, .watch-head h1[contenteditable="true"]:focus { background: var(--surface-2); }
.watch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.watch-sub { color: var(--muted); font-size: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.share { margin-top: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.share .copy input { height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 12px; }
.admin-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; }
.admin-row .spacer { flex: 1; }

/* ── Connexion ── */
.login { max-width: 380px; margin: 10vh auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login h1 { font-size: 20px; margin: 0 0 4px; }
.login p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.login input[type=password] { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 12px; margin-bottom: 12px; outline: none; }
.login input[type=password]:focus { border-color: var(--accent); }
.login .btn { width: 100%; height: 42px; }
.login .error { color: var(--danger); font-size: 14px; margin-bottom: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: #111; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 60; border: 1px solid #333;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Intégration ── */
body.embed { background: #000; overflow: hidden; }
body.embed video { width: 100vw; height: 100vh; object-fit: contain; max-width: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .hamburger { display: inline-grid; }
  .sidebar { position: fixed; top: 56px; left: 0; bottom: 0; width: 270px; height: auto; z-index: 32; transform: translateX(-100%); transition: transform .2s; background: var(--surface); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .scrim { display: block; position: fixed; inset: 56px 0 0; background: rgba(0,0,0,.4); z-index: 31; }
  .content { padding: 16px 16px 96px; }
}
@media (max-width: 640px) {
  .topbar .inner { padding: 0 16px; }
  .uploadbar { flex-direction: column; align-items: stretch; }
  .uploadbar .btn.big { width: 100%; }
  .vgrid { grid-template-columns: 1fr; }
  .listtools { flex-wrap: wrap; }
  .stats { grid-template-columns: 1fr 1fr; }
  .uploads { right: 16px; bottom: 16px; }
}

/* ── Conteneurs et dossiers ── */
.srchead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.srchead h1 { margin: 0; }
.srchead h1 a:hover { color: var(--accent); }
.srchead .sep { color: var(--muted); margin: 0 6px; font-weight: 400; }
.srcmeta { color: var(--muted); font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.srchead .btn { margin-left: auto; align-self: center; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.folder { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-weight: 600; font-size: 14px; min-width: 0; }
.folder:hover { border-color: var(--accent); color: var(--accent); }
.folder svg { width: 18px; height: 18px; color: var(--accent); }
.folder span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
.vfolder { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.vfolder:hover { color: var(--accent); }
.vfolder svg { width: 14px; height: 14px; }
.vfolder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
