/* Brothers Life Médias : langage « plan technique ». Trait pointillé, trame de points, un seul accent cyan. */
@font-face { font-family: "Geist"; src: url("./fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("./fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #050606; --ink: #f9fdfe; --muted: #9ba1a3; --faint: #57666a; --border: #27292a;
  --bp-line: #333637; --bp-dot: #333637;
  --accent: #0cc0df; --on-accent: #000e12;
  --btn-bg: linear-gradient(160deg, #0b8ea6 0%, #0a7d92 60%, #08697b 100%);
  --danger: #ff6b5e; --danger-dot: #ff6b5e; --well: #0b0d0e; --panel: #0a0c0d;
  --r: 4px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
}
/* Sombre par défaut, comme la référence ; le clair ne s'active que par data-theme="light" sur <html>. */
@media all {
  :root[data-theme="light"] {
    --bg: #f4f7f8; --ink: #111d20; --muted: #57666a; --faint: #57666a; --border: #d0d7d9;
    --bp-line: #c1c9cb; --bp-dot: #b8bfc1; --accent: #0a7d92; --danger: #b3261e; --danger-dot: #c9362b;
    --well: #e6ecee; --panel: #ffffff;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
p { margin: 0.4em 0; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
code, pre, .mono, .tick, .tile-meta, .hash, .count, dt { font-family: var(--mono); }
code { font-size: 0.85em; color: var(--ink); background: var(--well); padding: 1px 5px; border-radius: var(--r); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.02em; }
.pad { padding: 2rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r); }
.noscript { padding: 2rem; }

/* ---- motifs ---- */
.dots { background-image: radial-gradient(var(--bp-dot) 1px, transparent 1.2px); background-size: 14px 14px; }
.dash-x { height: 1px; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; }
.corner { position: absolute; width: 7px; height: 7px; border: 1px solid var(--bp-line); background: var(--bg); }
.corner.tl { left: -4px; top: -4px; } .corner.tr { right: -4px; top: -4px; }
.corner.bl { left: -4px; bottom: -4px; } .corner.br { right: -4px; bottom: -4px; }

/* ---- barre haute ---- */
.topbar { position: sticky; top: 0; z-index: 20; height: 56px; background: var(--bg); background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.topbar-in { height: 100%; width: min(72rem, 100% - 3rem); margin: 0 auto; display: flex; align-items: stretch; gap: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; padding-right: 20px; white-space: nowrap; }
.mark { width: 12px; height: 12px; border: 1px solid var(--accent); position: relative; }
.mark::after { content: ""; position: absolute; inset: 3px; background: var(--accent); }
.topbar-links, .topnav-links { display: flex; align-items: stretch; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.navcell { display: flex; align-items: center; padding: 0 16px; text-decoration: none; color: var(--muted); font-size: 0.9rem; white-space: nowrap; position: relative;
  background-image: linear-gradient(to bottom, var(--bp-line) 50%, transparent 50%); background-size: 1px 8px; background-repeat: repeat-y; background-position: left; }
.navcell:last-child { background-image: linear-gradient(to bottom, var(--bp-line) 50%, transparent 50%), linear-gradient(to bottom, var(--bp-line) 50%, transparent 50%); background-position: left, right; background-size: 1px 8px; background-repeat: repeat-y; }
.navcell:hover { color: var(--ink); }
.navcell[aria-current="page"] { color: var(--accent); }
.navcell[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; padding-left: 16px; }
.who-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 0.85rem; }
.avatar { width: 28px; height: 28px; border-radius: var(--r); object-fit: cover; flex: none; }
.avatar.fallback { display: grid; place-items: center; background: var(--well); border: 1px solid var(--bp-line); font-weight: 600; }

.main { width: min(72rem, 100% - 3rem); margin: 0 auto; padding: 2rem 0 5rem; }
.page { display: block; }
.page.narrow { max-width: 52rem; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-end; padding: 0 0 1.25rem; margin-bottom: 1.25rem; position: relative;
  background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.page > h2, .block + h2 { margin: 2.5rem 0 1rem; }
.page > h2 { font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- boutons et champs ---- */
.btn { font: 500 0.9rem var(--sans); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--bp-line); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; min-height: 36px; }
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn.primary { background: var(--btn-bg); border-color: #0a7d92; color: #fff; }
.btn.primary:hover { border-color: var(--accent); color: #fff; filter: brightness(1.1); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--bg); border-color: var(--danger); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--bp-line); }
.btn.danger-text:hover { color: var(--danger); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.link { background: none; border: 0; padding: 2px 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--accent); }
.icon-btn { width: 34px; height: 34px; border-radius: var(--r); border: 1px solid var(--bp-line); background: var(--bg); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); }
input[type="text"], input[type="search"], input[type="url"], input[type="number"], select, textarea {
  font: 400 0.92rem var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--bp-line); border-radius: var(--r); padding: 7px 10px; min-height: 36px; min-width: 0; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[readonly] { color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin: 2px 0 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; flex-wrap: wrap; }
.field.inline label { min-width: 11rem; }
.field label, legend { font-weight: 500; font-size: 0.88rem; }
legend { padding: 0; margin-bottom: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input[type="text"] { flex: 1; min-width: 12rem; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.hint { color: var(--muted); font-size: 0.82rem; margin: 0; }
.field-error { color: var(--danger); font-size: 0.85rem; margin: 0; min-height: 0; }
.field-error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check > span { display: flex; flex-direction: column; }
.check.scope { padding: 10px 0; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.warning { border: 1px dashed var(--danger); padding: 10px 12px; border-radius: var(--r); color: var(--ink); }
.empty { padding: 3rem 1.5rem; text-align: center; border: 1px dashed var(--bp-line); border-radius: var(--r); background-image: radial-gradient(var(--bp-dot) 1px, transparent 1.2px); background-size: 14px 14px; }
.empty h2 { margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* ---- fichiers ---- */
.crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0 0 8px; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--ink); }
.folders { margin-bottom: 1.25rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0 2rem; }
.folder-row { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 2px; text-decoration: none; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.folder-row:hover .folder-name { color: var(--accent); }
.folder-row .muted { font-family: var(--mono); font-size: 0.72rem; }
.folder-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { color: var(--faint); flex: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 1rem; }
.toolbar input[type="search"] { flex: 1 1 16rem; max-width: 24rem; }
.count { font-size: 0.75rem; margin-left: auto; }
.selbar { position: sticky; top: 64px; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 12px; margin-bottom: 12px; background: var(--panel); border: 1px dashed var(--accent); border-radius: var(--r); }
.selbar[hidden] { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 18px 10px; }
.tile { min-width: 0; }
.tile-media { position: relative; aspect-ratio: 4 / 3; background: var(--well); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.tile-open { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; display: block; color: var(--ink); }
.tile-open img, .tile-open video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-open:focus-visible { outline-offset: -3px; }
.thumb-video { position: relative; width: 100%; height: 100%; }
.play { position: absolute; left: 8px; bottom: 8px; font-size: 0.7rem; background: rgba(5, 6, 6, 0.75); color: #f9fdfe; padding: 2px 6px; border-radius: var(--r); }
.thumb-icon { height: 100%; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; color: var(--muted); font-family: var(--mono); font-size: 0.75rem; background-image: radial-gradient(var(--bp-dot) 1px, transparent 1.2px); background-size: 14px 14px; }
.tile-check { position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; margin: 0; opacity: 0; z-index: 2; }
.tile-media:hover .tile-check, .tile-check:focus-visible, .grid.selecting .tile-check, .tile-check:checked { opacity: 1; }
.tile.selected .tile-media { outline: 2px solid var(--accent); outline-offset: 1px; }
.tile audio { width: 100%; height: 34px; margin-top: 6px; }
.tile-cap { display: flex; justify-content: space-between; gap: 8px; padding-top: 6px; font-size: 0.82rem; }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tile-meta { color: var(--muted); font-size: 0.7rem; flex: none; padding-top: 2px; }
.grid-status { margin: 1.5rem 0; text-align: center; }
.sentinel { height: 1px; }
.dropveil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(5, 6, 6, 0.8); background-image: radial-gradient(var(--bp-dot) 1px, transparent 1.2px); background-size: 14px 14px; border: 2px dashed var(--accent); margin: 10px; font-size: 1.3rem; pointer-events: none; }
.dropveil[hidden] { display: none; }
.dropveil p { color: #f9fdfe; }

/* ---- barres : trame de points ---- */
.bar { height: 10px; border: 1px solid var(--bp-line); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.bar i { display: block; height: 100%; width: 0; background-image: radial-gradient(var(--accent) 1px, transparent 1.3px); background-size: 5px 5px; }
.bar.thin { height: 6px; }
.gauge.warn .bar i { background-image: radial-gradient(#e0a020 1px, transparent 1.3px); }
.gauge.crit .bar i { background-image: radial-gradient(var(--danger-dot) 1px, transparent 1.3px); }
.upload.ko .bar i { background-image: radial-gradient(var(--danger-dot) 1px, transparent 1.3px); }
.upload:not(.ok):not(.ko) .bar i { animation: crawl 1s linear infinite; }
@keyframes crawl { to { background-position: 5px 0; } }
.uploads { display: flex; flex-direction: column; margin-bottom: 1rem; }
.uploads:empty { display: none; }
.upload { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(6rem, 12rem) minmax(5rem, auto) auto; gap: 12px; align-items: center; padding: 8px 0; font-size: 0.85rem; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload .muted, .upload .field-error { font-family: var(--mono); font-size: 0.72rem; }

/* ---- état ---- */
.gauge-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.gauge-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.gauge-head strong { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--accent); }
.gauge-note { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }
.status-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem; }
.status-cols h3 { margin-bottom: 10px; color: var(--muted); font-weight: 500; font-size: 0.88rem; }
.service { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; margin: 0; font-size: 0.9rem; }
p.service { grid-template-columns: 1fr auto; }
.service .dot { width: 7px; height: 7px; border: 1px solid var(--bp-line); background: var(--faint); }
.service.ok .dot { background: var(--accent); border-color: var(--accent); }
.service.ko .dot { background: var(--danger); border-color: var(--danger); }
.service strong { font-weight: 500; }
.service .muted { font-family: var(--mono); font-size: 0.72rem; }
.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; margin: 0; }
.figures div { display: flex; flex-direction: column-reverse; }
.figures dd { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.figures dt { font-size: 0.7rem; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr)); gap: 2rem; }
.chart-box { margin: 0; }
.chart-box figcaption { font-weight: 500; margin-bottom: 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--bp-line); stroke-dasharray: 3 4; }
.chart .axis { stroke: var(--faint); }
.chart .tick { fill: var(--muted); font-size: 10.5px; }
.chart .bar-mark { fill: var(--accent); }
.chart .guide { fill: var(--bp-dot); opacity: 0.45; }
.chart .hit { fill: transparent; }
.chart-read { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin: 4px 0 0; min-height: 1.5em; }
.split-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 2rem; margin-top: 1rem; }
.split-cols h3 { margin-bottom: 8px; }
.split-row { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 14px; padding: 8px 0 10px; }
.split-row .muted { font-family: var(--mono); font-size: 0.72rem; align-self: center; }
.split-row strong { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; }
.split-row .bar { grid-column: 1 / -1; margin-top: 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 8px; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.tab { font: 500 0.88rem var(--sans); background: none; border: 0; color: var(--muted); padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.rank-row { display: grid; grid-template-columns: 2rem 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 8px 4px; border: 0; color: var(--ink); font: inherit; cursor: pointer; background-color: transparent; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.rank-row:hover { background-color: var(--panel); }
.rank-row img, .rank-icon { width: 56px; height: 42px; object-fit: cover; border-radius: var(--r); background: var(--well); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); }
.rank-n { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }
.rank-name { display: flex; flex-direction: column; min-width: 0; }
.rank-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rank-name .muted, .rank-metric { font-family: var(--mono); font-size: 0.72rem; }
.rank-metric { color: var(--accent); text-align: right; }

/* ---- clés, équipe, journal ---- */
.keys, .team { display: flex; flex-direction: column; }
.key, .member { display: grid; gap: 12px 24px; padding: 16px 0; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.key { grid-template-columns: 1fr auto; }
.key.revoked { opacity: 0.55; }
.key h2 { font-size: 1.05rem; margin-bottom: 2px; }
.key p { margin: 2px 0; font-size: 0.9rem; }
.key .muted { font-family: var(--mono); font-size: 0.75rem; }
.key-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.member { grid-template-columns: 36px 1fr auto auto auto; align-items: center; }
.member .avatar { width: 36px; height: 36px; }
.member-id { display: flex; flex-direction: column; min-width: 0; }
.member-id strong { overflow-wrap: anywhere; }
.member-id .muted, .member > .muted { font-family: var(--mono); font-size: 0.72rem; }
.add-admin { margin-top: 2.5rem; padding-top: 1.5rem; }
.add-admin .row { align-items: flex-end; margin-top: 10px; }
.role-help { margin: 2rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; }
.role-help dt { color: var(--ink); font-size: 0.78rem; }
.role-help dd { margin: 0; color: var(--muted); }
.settings-group { border: 0; padding: 0 0 20px; margin: 0; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; display: flex; flex-direction: column; gap: 10px; }
.settings-group .field.inline input { width: 9rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.78rem; padding: 8px 12px 8px 0; }
.table td { padding: 10px 12px 10px 0; vertical-align: top; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: top; }
.table td.wrap { overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.75rem; }
.table summary { cursor: pointer; color: var(--accent); }
.table pre { max-width: 24rem; overflow: auto; }

/* ---- documentation ---- */
.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 1.5rem; }
.doc section { margin-bottom: 2.5rem; }
.doc h2 { margin-bottom: 10px; }
.doc h3 { margin: 1.4rem 0 6px; color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.pre-wrap { position: relative; margin: 8px 0; }
pre { margin: 0; padding: 14px 16px; background: var(--well); border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; font-size: 0.8rem; line-height: 1.55; }
.pre-wrap .copy { position: absolute; right: 6px; top: 6px; background: var(--well); }

/* ---- fenêtres ---- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(5, 6, 6, 0.78); }
.modal { border: 1px solid var(--bp-line); border-radius: var(--r); background: var(--panel); padding: 0; width: min(36rem, calc(100% - 2rem)); max-height: calc(100vh - 3rem); }
.modal.small { width: min(28rem, calc(100% - 2rem)); }
.modal[open] { display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.modal-head h2 { font-size: 1.05rem; }
.modal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.picker-path { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); font-size: 0.78rem; }
.picker-path .sep { color: var(--faint); }
.picker-list { display: flex; flex-direction: column; max-height: 16rem; overflow-y: auto; }
.picker-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 4px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: bottom; }
.picker-row:hover { color: var(--accent); }
.picker-row .muted { font-family: var(--mono); font-size: 0.72rem; }

/* ---- visionneuse ---- */
dialog.viewer { border: 1px solid var(--bp-line); border-radius: var(--r); padding: 0; background: var(--panel); width: min(92rem, 98vw); height: min(56rem, 94vh); max-width: none; max-height: none; }
dialog.viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; }
.viewer-close { position: absolute; right: 10px; top: 10px; z-index: 5; }
.viewer-main { position: relative; background: var(--well); display: flex; min-width: 0; min-height: 0; background-image: radial-gradient(var(--bp-dot) 1px, transparent 1.2px); background-size: 14px 14px; }
.viewer-stage { flex: 1; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 14px; }
.viewer-img, .viewer-video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r); background: #000; }
.viewer-audio-box { display: flex; flex-direction: column; align-items: center; gap: 18px; color: var(--muted); width: min(30rem, 90%); }
.viewer-audio { width: 100%; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 64px; border: 1px solid var(--bp-line); background: var(--bg); color: var(--ink); font-size: 1.8rem; border-radius: var(--r); cursor: pointer; z-index: 3; }
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn[hidden] { display: none; }
.nav-btn.prev { left: 10px; } .nav-btn.next { right: 10px; }
.viewer-side { padding: 20px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background-image: linear-gradient(to bottom, var(--bp-line) 50%, transparent 50%); background-size: 1px 8px; background-repeat: repeat-y; background-position: left; }
.viewer-title { font-size: 1.05rem; overflow-wrap: anywhere; padding-right: 40px; }
.fiche { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 0.85rem; }
.fiche dt { color: var(--muted); font-size: 0.72rem; padding-top: 2px; }
.fiche dd { margin: 0; overflow-wrap: anywhere; }
.fiche .hash { font-size: 0.68rem; color: var(--muted); }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }

/* ---- connexion ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background-image: radial-gradient(var(--bp-dot) 1px, transparent 1.2px); background-size: 14px 14px; }
.login-panel { position: relative; width: min(28rem, 100%); background: var(--bg); border: 1px solid var(--bp-line); padding: 2rem; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.login-panel h1 { font-size: 1.7rem; }

/* ---- messages ---- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(26rem, calc(100% - 32px)); }
.toast { background: var(--panel); border: 1px solid var(--bp-line); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 10px 14px; font-size: 0.88rem; }
.toast.error { border-left-color: var(--danger); }

/* ---- petits écrans ---- */
@media (max-width: 900px) {
  .topbar { height: auto; }
  .topbar-in { flex-wrap: wrap; }
  .brand { height: 52px; }
  .who { margin-left: auto; height: 52px; }
  .who-text { display: none; }
  .topnav-links { order: 3; flex-basis: 100%; height: 44px; background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-repeat: repeat-x; background-position: top; }
  html { scroll-padding-top: 110px; }
  .selbar { top: 100px; }
  dialog.viewer { width: 100vw; height: 100vh; border-radius: 0; }
  dialog.viewer[open] { grid-template-columns: 1fr; grid-template-rows: minmax(14rem, 45vh) 1fr; }
  .viewer-side { background-image: linear-gradient(to right, var(--bp-line) 50%, transparent 50%); background-size: 8px 1px; background-position: top; background-repeat: repeat-x; }
  .member { grid-template-columns: 36px 1fr; }
  .key { grid-template-columns: 1fr; }
  .key-side { align-items: flex-start; text-align: left; }
  .upload { grid-template-columns: 1fr auto; }
  .upload .bar { grid-column: 1 / -1; order: 3; }
  .charts { grid-template-columns: 1fr; }
  .field.inline label { min-width: 0; flex-basis: 100%; }
}
@media (max-width: 480px) {
  .main, .topbar-in { width: calc(100% - 2rem); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
