@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-latin-ext.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --color-paper: oklch(97.2% 0.006 230);
  --color-surface: oklch(99.5% 0.002 230);
  --color-sunk: oklch(94.5% 0.008 235);
  --color-line: oklch(89% 0.012 240);
  --color-line-strong: oklch(80% 0.015 245);
  --color-ink: oklch(25% 0.03 255);
  --color-ink-soft: oklch(46% 0.025 250);
  --color-booth: oklch(25.5% 0.022 255);
  --color-booth-2: oklch(32% 0.024 255);
  --color-booth-ink: oklch(78% 0.02 250);
  --color-tape: oklch(83% 0.16 88);
  --color-tape-soft: oklch(95% 0.05 90);
  --color-tape-ink: oklch(30% 0.06 80);
  --color-teal: oklch(52% 0.085 210);
  --color-teal-soft: oklch(94% 0.03 210);
  --color-moss: oklch(52% 0.09 150);
  --color-moss-soft: oklch(94.5% 0.035 150);
  --color-brick: oklch(52% 0.14 35);
  --color-brick-soft: oklch(95% 0.03 35);
  --color-warn-bg: oklch(95.5% 0.05 88);
  --color-ok-bg: oklch(95.5% 0.035 160);
  --color-ok-line: oklch(84% 0.06 160);
  --color-page-bg: oklch(90% 0.01 245);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-panel: 0 1px 2px oklch(25% 0.03 255 / 0.05), 0 6px 20px -10px oklch(25% 0.03 255 / 0.16);
  --shadow-pop: 0 24px 60px -12px oklch(20% 0.03 255 / 0.35), 0 2px 6px oklch(20% 0.03 255 / 0.1);
  --shadow-page: 0 1px 3px oklch(20% 0.02 255 / 0.25), 0 8px 24px -10px oklch(20% 0.02 255 / 0.35);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --rail-w: 76px; --side-w: 236px; --top-h: 52px; --status-h: 28px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; height: 100dvh; display: grid; grid-template-rows: var(--top-h) minmax(0, 1fr) var(--status-h); overflow: hidden;
  background: var(--color-paper); color: var(--color-ink); font: 14.5px/1.5 var(--font-text);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
a { color: var(--color-teal); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--color-teal); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--color-ink); color: #fff; padding: 8px 12px; border-radius: var(--r-sm); z-index: 50; }
.skip:focus { top: 8px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.big { width: 28px; height: 28px; stroke-width: 1.6; }
kbd { font: 600 11px/1 var(--font-text); padding: 3px 6px; border-radius: 4px; border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-ink-soft); }

/* ---------- Barre de titre ---------- */
.titlebar { display: flex; align-items: center; gap: 20px; padding: 0 16px 0 18px; background: var(--color-surface); border-bottom: 1px solid var(--color-line); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-ink); font: 750 20px/1 var(--font-display); width: calc(var(--rail-w) + var(--side-w) - 38px); flex: none; }
/* Logo : mallette anthracite, T clair, ruban jaune ; couleurs inversées sur fond sombre. */
.brand-mark { width: 30px; height: 30px; flex: none; --bm-box: #1E2632; --bm-t: #FFFFFF; }
.brand-mark .bm-box { fill: var(--bm-box); }
.brand-mark .bm-t { fill: var(--bm-t); }
.brand-mark .bm-tape { fill: #F2C230; }
[data-theme="dark"] .brand-mark, .login-side .brand-mark { --bm-box: #F4F6F8; --bm-t: #1E2632; }
.search-btn {
  display: flex; align-items: center; gap: 10px; width: min(440px, 100%); height: 34px; padding: 0 8px 0 12px;
  border: 1px solid var(--color-line); border-radius: 8px; background: var(--color-paper); color: var(--color-ink-soft); cursor: pointer; text-align: left;
  transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out);
}
.search-btn:hover { border-color: var(--color-line-strong); background: var(--color-surface); }
.search-txt { flex: 1; }
.local-chip { display: flex; align-items: center; gap: 6px; margin: 0 0 0 auto; font-size: 13px; color: var(--color-ink-soft); white-space: nowrap; }
.local-chip .i { color: var(--color-moss); width: 16px; height: 16px; }
.theme-btn { flex: none; }

/* ---------- Coquille ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); min-height: 0; }
body[data-module="home"] .shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
body[data-module="home"] .sidebar { display: none; }

.rail { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: var(--color-booth); }
.rail-item {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 2px 8px; border-radius: var(--r-md);
  color: var(--color-booth-ink); text-decoration: none; font-size: 11.5px; font-weight: 600; transition: background-color .15s var(--ease-out), color .15s;
}
.rail-item .i { width: 21px; height: 21px; }
.rail-item:hover { background: var(--color-booth-2); color: #fff; }
.rail-item[aria-current] { background: var(--color-booth-2); color: #fff; }
.rail-item[aria-current]::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--color-tape); }
.rail-item[aria-current] .i { color: var(--color-tape); }

.sidebar { overflow-y: auto; padding: 18px 12px 24px; background: var(--color-surface); border-right: 1px solid var(--color-line); }
.side-title { font-size: 17px; margin: 0 8px 14px; }
.side-group + .side-group { margin-top: 16px; }
.side-group h3 { font: 650 12px/1 var(--font-text); color: var(--color-ink-soft); margin: 0 10px 6px; letter-spacing: 0; }
.side-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--color-ink); text-decoration: none;
  transition: background-color .15s var(--ease-out);
}
.side-item .i { width: 17px; height: 17px; color: var(--color-ink-soft); }
.side-item:hover { background: var(--color-sunk); }
.side-item[aria-current] { background: var(--color-tape-soft); font-weight: 650; }
.side-item[aria-current] .i { color: var(--color-tape-ink); }

.workspace { overflow-y: auto; padding: 24px 28px 40px; min-width: 0; outline: none; }
.chips { display: none; }

.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; background: var(--color-surface); border-top: 1px solid var(--color-line); font-size: 12px; color: var(--color-ink-soft); }
.statusbar nav { display: flex; gap: 16px; }
.statusbar a { color: var(--color-ink-soft); }
.engine-state { display: flex; align-items: center; gap: 8px; }
.engine-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-moss); }
.engine-state.busy::before { background: var(--color-tape); box-shadow: 0 0 0 3px oklch(83% 0.16 88 / .3); }

/* ---------- Accueil ---------- */
.view-home { max-width: 1160px; margin: 0 auto; display: grid; gap: 28px; padding-top: 8px; }
.home-head { display: grid; gap: 14px; }
.home-head h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 760; }
.home-search { position: relative; display: block; max-width: 720px; }
.home-search .i { position: absolute; left: 16px; top: 50%; translate: 0 -50%; color: var(--color-ink-soft); width: 20px; height: 20px; }
.home-search input {
  width: 100%; height: 54px; padding: 0 16px 0 48px; font-size: 16px; border: 1px solid var(--color-line-strong); border-radius: 12px;
  background: var(--color-surface); box-shadow: var(--shadow-panel);
}
.home-search input:focus { outline: none; border-color: var(--color-teal); box-shadow: 0 0 0 4px var(--color-teal-soft); }
.home-start { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.home-drop {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: var(--r-lg);
  background: var(--color-booth); color: oklch(92% 0.01 250);
  outline: 2px dashed oklch(45% 0.02 255); outline-offset: -10px; transition: outline-color .15s, background-color .15s;
}
.home-drop .i.big { color: var(--color-tape); flex: none; }
.home-drop.over { outline-color: var(--color-tape); background: var(--color-booth-2); }
.home-drop-title { margin: 0; font-size: 16px; font-weight: 600; }
.home-drop-sub { margin: 4px 0 0; font-size: 13px; color: oklch(74% 0.015 250); }
.link-strong { color: var(--color-tape); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.home-link { display: grid; align-content: center; gap: 8px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--color-surface); border: 1px solid var(--color-line); }
.home-link label { font-weight: 650; font-size: 14px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface); }

.home-pick { padding: 18px 20px; border-radius: var(--r-lg); background: var(--color-tape-soft); border: 1px solid oklch(86% 0.08 88); display: grid; gap: 12px; justify-items: start; }
.home-pick h2 { font-size: 18px; }
.pick-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pick-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r-sm); border: 1px solid var(--color-line-strong); background: var(--color-surface); cursor: pointer; font-weight: 600; }
.pick-btn:hover { border-color: var(--color-ink); }
.pick-error { margin: 0; color: var(--color-brick); font-weight: 600; }

.home-modules { display: grid; gap: 28px; }
.home-mod h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin-bottom: 10px; }
.home-mod h2 .i { width: 20px; height: 20px; color: var(--color-ink-soft); }
.tool-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 2px 12px; }
.tool-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-md); color: var(--color-ink); text-decoration: none; transition: background-color .15s var(--ease-out); }
.tool-row:hover { background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-line); }
.tool-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; flex: none; background: var(--color-teal-soft); color: var(--color-teal); }
.mod-audio .tool-ico { background: var(--color-moss-soft); color: var(--color-moss); }
.mod-pdf .tool-ico { background: var(--color-brick-soft); color: var(--color-brick); }
.mod-link .tool-ico { background: var(--color-sunk); color: var(--color-ink); }
.mod-record .tool-ico { background: var(--color-tape-soft); color: var(--color-tape-ink); }
.tool-txt { display: grid; min-width: 0; }
.tool-txt strong { font-weight: 650; font-size: 14px; }
.tool-txt small { color: var(--color-ink-soft); font-size: 12.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.empty { color: var(--color-ink-soft); }

/* ---------- Vue outil ---------- */
.view-tool { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; max-width: 1500px; }
.tool-main { min-width: 0; display: grid; gap: 14px; }
.work-head { display: grid; gap: 4px; }
.work-title { display: flex; align-items: center; gap: 12px; }
.work-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--color-booth); color: var(--color-tape); flex: none; }
.work-ico .i { width: 20px; height: 20px; }
.work-head h1 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 750; }
.work-head p { margin: 2px 0 0; color: var(--color-ink-soft); max-width: 70ch; }

.drop {
  display: grid; justify-items: center; gap: 6px; text-align: center; padding: 56px 24px; border-radius: var(--r-lg);
  background: var(--color-booth); color: oklch(90% 0.01 250);
  outline: 2px dashed oklch(45% 0.02 255); outline-offset: -12px; transition: outline-color .15s var(--ease-out), background-color .15s var(--ease-out);
}
.drop.over { outline-color: var(--color-tape); background: var(--color-booth-2); }
.drop-light { background: var(--color-surface); color: var(--color-ink); outline-color: var(--color-line-strong); }
.drop-light.over { background: var(--color-tape-soft); }
.drop-light .drop-formats { color: var(--color-ink-soft); }
.drop-or { margin: 4px 0 0; font-weight: 600; }
.drop-formats { margin: 0; font-size: 13px; color: oklch(72% 0.015 250); max-width: 56ch; }
.drop-note { margin: 8px 0 0; color: var(--color-tape); font-weight: 600; }
.drop-note:empty { display: none; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s var(--ease-out), transform .15s var(--ease-out), border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-tape); color: var(--color-tape-ink); }
.btn-primary:hover { background: oklch(79% 0.16 85); }
.btn-primary:disabled { background: oklch(91% 0.02 88); color: oklch(56% 0.02 80); cursor: not-allowed; transform: none; }
.btn-dark { background: var(--color-booth); color: #fff; }
.btn-dark:hover { background: var(--color-booth-2); }
.btn-ghost { background: var(--color-surface); border-color: var(--color-line-strong); color: var(--color-ink); }
.btn-ghost:hover { border-color: var(--color-ink-soft); }
.btn-big { padding: 12px 20px; font-size: 15.5px; border-radius: var(--r-md); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.drop .btn-big { padding: 15px 26px; font-size: 16.5px; }
.link { background: none; border: 0; padding: 0; color: var(--color-teal); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--color-line); background: var(--color-surface); cursor: pointer; color: var(--color-ink); }
.icon:hover:not(:disabled) { border-color: var(--color-ink-soft); }
.icon:disabled { opacity: .35; cursor: default; }
.icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Éditeur média ---------- */
.editor { display: grid; gap: 10px; }
.file-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 13.5px; }
.file-name { font-weight: 650; overflow-wrap: anywhere; }
.file-meta { color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }
.file-bar .link { margin-left: auto; }
.toolbar .seg-row span { white-space: nowrap; padding-inline: 12px; }
.compose-text { width: 100%; min-height: min(60dvh, 560px); padding: 18px 20px; border: 1px solid var(--color-line-strong); border-radius: var(--r-lg); background: var(--color-surface); font: 14px/1.6 ui-monospace, 'Cascadia Mono', Consolas, monospace; resize: vertical; }
.compose-text:focus-visible { outline: 3px solid var(--color-teal); outline-offset: 1px; }
.frames-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; }
.frames-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--color-booth); }
.redact { gap: 10px; }
.redact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.redact-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--color-sunk); }
.redact-mark { position: absolute; pointer-events: none; outline: 1px solid oklch(50% 0 0 / .5); }
.file-chip { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-width: 0; padding: 6px 6px 6px 8px; border: 1px solid var(--color-line); border-radius: var(--r-md); background: var(--color-surface); box-shadow: 0 1px 2px oklch(25% 0.03 255 / 0.05); }
.fc-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--color-booth); color: var(--color-tape); }
.fc-ico .i { width: 16px; height: 16px; }
.fc-txt { display: grid; min-width: 0; line-height: 1.3; padding-right: 4px; }
.fc-txt strong { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42ch; }
.fc-txt small { font-size: 12px; color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }
.file-chip .btn-sm .i { width: 14px; height: 14px; }
.fc-close { width: 30px; height: 30px; border-color: transparent; background: transparent; color: var(--color-ink-soft); }
.fc-close:hover:not(:disabled) { background: var(--color-brick-soft); color: var(--color-brick); border-color: transparent; }
.file-bar { align-items: center; }
@media (max-width: 520px) { .fc-label { display: none; } .file-chip { width: 100%; } .fc-txt { flex: 1; } }
.stage {
  position: relative; display: grid; place-items: center; overflow: hidden; min-height: 240px; padding: 16px; border-radius: var(--r-lg);
  background: var(--color-booth); background-image: radial-gradient(oklch(31% 0.02 255) 1px, transparent 1px); background-size: 16px 16px;
}
.stage.audio-only { min-height: 140px; }
.media-wrap { position: relative; line-height: 0; transition: transform .25s var(--ease-out); touch-action: none; }
.media-wrap video, .media-wrap img { display: block; max-width: 100%; max-height: min(58vh, 620px); width: auto; height: auto; border-radius: 2px; }
.stage:has(.turned) { min-height: min(58vh, 620px); }
.media-wrap.turned video, .media-wrap.turned img { max-width: min(100%, calc(min(58vh, 620px) - 32px)); }
.big-ico { width: 56px; height: 56px; fill: none; stroke: oklch(55% 0.02 255); stroke-width: 1.5; }

.box { position: absolute; cursor: move; touch-action: none; background-size: 100% 100%; outline: 2px solid var(--color-tape); }
.box-crop { box-shadow: 0 0 0 9999px oklch(15% 0.02 255 / 0.62); }
.box-crop::before, .box-crop::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: 0 solid oklch(83% 0.16 88 / 0.35); }
.box-crop::before { border-width: 0 1px; left: 33.33%; right: 33.33%; }
.box-crop::after { border-width: 1px 0; top: 33.33%; bottom: 33.33%; }
.box-overlay { outline-style: dashed; }
.hd { position: absolute; width: 18px; height: 18px; background: var(--color-tape); border: 2px solid var(--color-booth); border-radius: 3px; z-index: 1; }
.hd::after { content: ""; position: absolute; inset: -10px; }
.nw { left: -9px; top: -9px; cursor: nwse-resize; } .se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.ne { right: -9px; top: -9px; cursor: nesw-resize; } .sw { left: -9px; bottom: -9px; cursor: nesw-resize; }

.timeline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.tl-play { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--color-booth); color: #fff; cursor: pointer; }
.tl-play svg { width: 18px; height: 18px; fill: currentColor; }
.tl-play .i-pause, .tl-play.playing .i-play { display: none; }
.tl-play.playing .i-pause { display: block; }
.tl-track { position: relative; height: 56px; border-radius: var(--r-sm); cursor: pointer; touch-action: none; background: var(--color-sunk); border: 1px solid var(--color-line); }
.tl-wave { position: absolute; inset: 0; width: 100%; height: 100%; color: oklch(70% 0.03 240); pointer-events: none; }
.tl-sel { position: absolute; top: -1px; bottom: -1px; display: none; background: oklch(83% 0.16 88 / 0.28); border: 2px solid var(--color-tape); border-radius: 4px; pointer-events: none; }
.has-range .tl-sel { display: block; }
.tl-h { position: absolute; top: -2px; bottom: -2px; width: 14px; background: var(--color-tape); cursor: ew-resize; pointer-events: auto; border-radius: 3px; }
.tl-h::after { content: ""; position: absolute; inset: 0 -8px; }
.tl-h.start { left: -8px; } .tl-h.end { right: -8px; }
.tl-h::before { content: ""; position: absolute; left: 5px; top: 35%; bottom: 35%; width: 2px; background: var(--color-tape-ink); border-radius: 1px; }
.tl-head { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--color-brick); pointer-events: none; }
.tl-clock { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--color-ink-soft); min-width: 13ch; text-align: right; }
.tl-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13.5px; }
.tl-fields label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.tl-fields input { width: 10ch; padding: 6px 8px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface); font-variant-numeric: tabular-nums; }
.tl-len { margin-left: auto; color: var(--color-ink-soft); }
.tl-len strong { color: var(--color-ink); font-variant-numeric: tabular-nums; }

.multi { display: grid; gap: 10px; justify-items: start; }
.multi-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; }
.multi-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; }
.multi-name { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; padding: 6px 10px; border: 1px solid var(--color-line); border-radius: var(--r-sm); background: var(--color-surface); cursor: pointer; }
.multi-name span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.multi-name small { color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }
.multi-n { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; background: var(--color-booth); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.multi-list li.on .multi-name { border-color: var(--color-tape); box-shadow: inset 0 0 0 1px var(--color-tape); }

/* ---------- Panneau de réglages ---------- */
.panel {
  position: sticky; top: 0; display: grid; gap: 16px; padding: 18px; max-height: calc(100dvh - var(--top-h) - var(--status-h) - 48px); overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--r-lg); box-shadow: var(--shadow-panel);
}
.panel > * { min-width: 0; }
.panel-title { font-size: 16px; }
.options { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field legend, .field .label, .label-row label { font-size: 13px; font-weight: 650; padding: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row output { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--color-ink-soft); }
.field select, .field input[type=number], .field input[type=text], .field input[type=password], .field input[type=email], .field textarea, .sig input[type=text] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface);
}
.field textarea { resize: vertical; min-height: 64px; }
.field input[type=range] { width: 100%; accent-color: var(--color-teal); }
.field.check { grid-template-columns: auto 1fr; align-items: start; gap: 8px; font-size: 14px; cursor: pointer; }
.field.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--color-teal); }
.field.color { grid-template-columns: 1fr auto; align-items: center; }
.field.color input { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface); }
.seg-row { display: flex; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg-row label { flex: 1; position: relative; }
.seg-row input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-row span { display: block; padding: 7px 6px; text-align: center; font-size: 13px; transition: background-color .15s; }
.seg-row label + label span { border-left: 1px solid var(--color-line-strong); }
.seg-row input:checked + span { background: var(--color-booth); color: #fff; font-weight: 650; }
.seg-row input:disabled + span { opacity: .4; }
.seg-row input:focus-visible + span { outline: 3px solid var(--color-teal); outline-offset: -3px; }
.box-nums .nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mini { display: grid; gap: 2px; font-size: 11px; color: var(--color-ink-soft); }
.mini input { width: 100%; padding: 6px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); font-variant-numeric: tabular-nums; background: var(--color-surface); }
.extra { grid-template-columns: auto 1fr; align-items: center; }
.extra .label { grid-column: 1 / -1; }
.extra-name { font-size: 13px; color: var(--color-ink-soft); overflow-wrap: anywhere; }
.help { margin: 0; font-size: 12.5px; color: var(--color-ink-soft); }
.help.ok { color: var(--color-moss); font-weight: 600; }

.actions { display: grid; gap: 6px; }
.hint { margin: 0; font-size: 13px; color: var(--color-ink-soft); }
.hint:empty { display: none; }
.status:empty { display: none; }
.status p { margin: 0; }
.status.wait, .status.warn { padding: 10px 12px; border-radius: var(--r-sm); background: var(--color-warn-bg); font-size: 13.5px; }
.status.error { padding: 10px 12px; border-radius: var(--r-sm); background: var(--color-brick-soft); color: oklch(40% 0.13 35); font-size: 13.5px; }
.status.work { display: grid; gap: 8px; }
.status pre { white-space: pre-wrap; font-size: 11px; max-height: 220px; overflow: auto; background: var(--color-surface); padding: 8px; border-radius: 4px; color: var(--color-ink); }
.progress-row { display: grid; gap: 4px; }
progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 5px; background: var(--color-sunk); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--color-sunk); }
progress::-webkit-progress-value { background: var(--color-tape); transition: width .2s; }
progress::-moz-progress-bar { background: var(--color-tape); }
.pct { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--color-ink-soft); }

.result-card { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--color-ok-bg); border: 1px solid var(--color-ok-line); }
.result-card h3 { font-size: 16px; }
.result-card video, .result-card img { width: 100%; max-height: 260px; object-fit: contain; background: var(--color-booth); border-radius: var(--r-sm); }
.result-card audio { width: 100%; }
.result-meta { margin: 0; font-size: 12px; color: var(--color-ink-soft); overflow-wrap: anywhere; }
.result-note { margin: 0; font-size: 13px; font-weight: 600; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-actions .btn { white-space: normal; text-align: left; }
.result-actions select { padding: 8px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface); }
.result-text { width: 100%; font: 12px/1.45 ui-monospace, Consolas, monospace; padding: 8px; border: 1px solid var(--color-line); border-radius: var(--r-sm); resize: vertical; }
.result-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow-y: auto; font-size: 13px; }
.result-files li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.result-files span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-files small { color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- Enregistreur ---------- */
.recorder { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
body[data-module="record"] .view-tool { grid-template-columns: minmax(0, 1fr); }
.rec-stage { min-height: 320px; flex-direction: column; }
.rec-live { max-width: 100%; max-height: 60vh; border-radius: 2px; }
.rec-voice { width: 100%; height: 160px; }
.rec-meter { width: 100%; height: 100%; color: var(--color-tape); }
.rec-clock { position: absolute; left: 16px; top: 12px; margin: 0; padding: 4px 10px; border-radius: 4px; background: oklch(15% 0.02 255 / .7); color: #fff; font-variant-numeric: tabular-nums; font-weight: 650; }
.rec-btn.recording { background: var(--color-brick); color: #fff; }

/* ---------- PDF ---------- */
.pdf-work { display: grid; gap: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 34px; }
.toolbar .hint { flex: 1; min-width: 200px; }
.sel-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-left: 6px; }
.sel-input { width: 13ch; padding: 5px 8px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface); }
.sel-input.bad { border-color: var(--color-brick); }
.sel-count { font-size: 13px; color: var(--color-ink-soft); margin-left: auto; }
.page-num { display: flex; align-items: center; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.page-num input { width: 6ch; padding: 4px 6px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); text-align: center; }

.pdf-canvas { min-width: 0; }
.page-grid { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 16px; border-radius: var(--r-lg); background: var(--color-page-bg); }
.page-tile { position: relative; display: grid; gap: 6px; justify-items: center; padding: 10px 8px 8px; border-radius: var(--r-md); cursor: grab; transition: background-color .15s var(--ease-out); }
.page-tile:hover { background: oklch(86% 0.012 245); }
.page-tile.static { cursor: default; }
.page-tile.dragging { opacity: .4; }
.page-tile.drop-target { box-shadow: inset 3px 0 0 var(--color-tape); }
.selectable .page-tile { cursor: pointer; }
.pt-frame { display: grid; place-items: center; width: 100%; height: 190px; transition: transform .25s var(--ease-out), opacity .15s; }
.rot { display: grid; place-items: center; transition: transform .25s var(--ease-out); }
.thumb-canvas { display: block; max-width: 136px; max-height: 186px; background: #fff; box-shadow: var(--shadow-page); }
.thumb-canvas:not([width]) { width: 120px; height: 170px; }
.pt-label { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pt-orig { position: absolute; top: 10px; left: 10px; font-size: 11px; color: var(--color-ink-soft); background: var(--color-surface); padding: 1px 5px; border-radius: 4px; }
.pt-check { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--color-surface); border: 1px solid var(--color-line-strong); color: transparent; }
.pt-check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.page-tile[aria-pressed="true"] { background: var(--color-tape-soft); box-shadow: inset 0 0 0 2px var(--color-tape); }
.page-tile[aria-pressed="true"] .pt-check { background: var(--color-tape); border-color: var(--color-tape); color: var(--color-tape-ink); }
.sel-delete .page-tile[aria-pressed="true"] { background: var(--color-brick-soft); box-shadow: inset 0 0 0 2px var(--color-brick); }
.sel-delete .page-tile[aria-pressed="true"] .pt-check { background: var(--color-brick); border-color: var(--color-brick); color: #fff; }
.sel-delete .page-tile[aria-pressed="true"] .pt-frame { opacity: .4; }
.pt-tools { position: absolute; left: 6px; right: 6px; bottom: 30px; display: flex; justify-content: center; gap: 4px; opacity: 0; transition: opacity .15s; }
.page-tile:hover .pt-tools, .page-tile:focus-within .pt-tools { opacity: 1; }
.pt-tools .icon { width: 28px; height: 28px; box-shadow: 0 1px 3px oklch(20% 0.02 255 / .2); }
@media (hover: none) { .pt-tools { opacity: 1; position: static; flex-wrap: wrap; } }

.page-stage { display: grid; place-items: center; padding: 24px 16px; border-radius: var(--r-lg); background: var(--color-page-bg); min-height: 300px; }
.page-wrap { position: relative; line-height: 0; touch-action: none; }
.page-canvas { display: block; background: #fff; box-shadow: var(--shadow-page); }
.pbox { position: absolute; cursor: move; touch-action: none; outline: 2px dashed var(--color-tape-ink); outline-offset: 0; background: oklch(83% 0.16 88 / .12) no-repeat center / 100% 100%; }
.pbox.empty { background-color: oklch(83% 0.16 88 / .3); }
.pbox.empty::after { content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; padding: 4px; text-align: center; font: 600 12px/1.25 var(--font-text); color: var(--color-tape-ink); }

.file-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.file-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); background: var(--color-surface); border: 1px solid var(--color-line); }
.fl-thumb { width: 64px; height: 76px; display: grid; place-items: center; background: var(--color-page-bg); border-radius: 4px; overflow: hidden; }
.fl-thumb .thumb-canvas { max-width: 56px; max-height: 70px; }
.fl-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fl-name { display: grid; min-width: 0; }
.fl-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.fl-name small { color: var(--color-ink-soft); }
.fl-actions { display: flex; gap: 4px; }

.pw-card { max-width: 420px; margin: 24px auto; display: grid; gap: 10px; padding: 24px; border-radius: var(--r-lg); background: var(--color-surface); border: 1px solid var(--color-line); box-shadow: var(--shadow-panel); }
.pw-card .pw-ico { width: 30px; height: 30px; color: var(--color-teal); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-card h2 { font-size: 20px; }
.pw-card p { margin: 0; color: var(--color-ink-soft); }
.pw-card .pw-wrong { color: var(--color-brick); font-weight: 600; }
.pw-card label { font-weight: 650; font-size: 13px; margin-top: 6px; }
.pw-card input { padding: 10px 12px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); }

.sig { display: grid; gap: 10px; }
.sig-pad { width: 100%; height: 140px; background: #fff; border: 1px dashed var(--color-line-strong); border-radius: var(--r-sm); touch-action: none; cursor: crosshair; }
.ink select { padding: 5px 8px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface); font-size: 13px; }

/* ---------- Téléchargement par lien ---------- */
.view-download { max-width: 920px; display: grid; gap: 18px; }
.dl-form { display: flex; flex-wrap: wrap; gap: 10px; }
.dl-form input { flex: 1 1 320px; min-width: 0; height: 50px; padding: 0 14px; font-size: 15.5px; border: 1px solid var(--color-line-strong); border-radius: var(--r-md); background: var(--color-surface); box-shadow: var(--shadow-panel); }
.dl-form input[type=password] { flex: 0 1 180px; }
.dl-form input:focus { outline: none; border-color: var(--color-teal); box-shadow: 0 0 0 4px var(--color-teal-soft); }
.dl-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--r-lg); background: var(--color-surface); border: 1px solid var(--color-line); box-shadow: var(--shadow-panel); }
.dl-card p { margin: 0; }
.dl-card > .i { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.dl-off { background: var(--color-warn-bg); border-color: oklch(86% 0.08 88); }
.dl-off h2 { font-size: 17px; margin-bottom: 4px; }
.dl-error { background: var(--color-brick-soft); border-color: oklch(85% 0.06 35); color: oklch(40% 0.13 35); }
.dl-wait { align-items: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--color-line); border-top-color: var(--color-teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dl-info { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
.dl-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); background: var(--color-booth); }
.dl-thumb-empty { display: grid; place-items: center; color: var(--color-booth-ink); }
.dl-body { display: grid; gap: 10px; align-content: start; min-width: 0; }
.dl-site { font-size: 12.5px; font-weight: 650; color: var(--color-teal); }
.dl-title { font-size: 19px; overflow-wrap: anywhere; }
.dl-meta { color: var(--color-ink-soft); font-size: 13px; }
.dl-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.dl-choices .seg-row { min-width: 240px; }
.dl-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; }
.dl-opt select { padding: 7px 10px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface); font-weight: 400; }
.dl-body > .btn-big { justify-self: start; }
.dl-job:empty { display: none; }
.dl-errline { margin: 0; color: var(--color-brick); font-weight: 600; }
.dl-legal { margin: 0; font-size: 12.5px; color: var(--color-ink-soft); max-width: 75ch; }

/* ---------- Palette de recherche ---------- */
.palette { width: min(580px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--color-line); border-radius: 14px; box-shadow: var(--shadow-pop); background: var(--color-surface); color: var(--color-ink); }
.palette::backdrop { background: oklch(20% 0.03 255 / 0.35); }
.palette-inner { display: grid; }
.palette input { height: 54px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--color-line); font-size: 16px; background: transparent; }
.palette input:focus { outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.pal-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.pal-item .i { color: var(--color-ink-soft); }
.pal-item small { color: var(--color-ink-soft); font-size: 12px; }
.pal-item[aria-selected="true"] { background: var(--color-tape-soft); }
.pal-item[aria-selected="true"] .i { color: var(--color-tape-ink); }
.pal-empty { padding: 14px 12px; color: var(--color-ink-soft); }
.palette-foot { margin: 0; padding: 8px 14px; border-top: 1px solid var(--color-line); font-size: 12px; color: var(--color-ink-soft); display: flex; gap: 6px; align-items: center; }
.palette-foot kbd + kbd { margin-left: -2px; }
.palette-foot kbd:not(:first-child) { margin-left: 8px; }

/* ---------- Photo ---------- */
.mod-photo .tool-ico { background: oklch(95% 0.035 65); color: oklch(50% 0.11 60); }
.ph-work { display: grid; gap: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.ph-tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--color-sunk); }
.ph-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--color-ink-soft); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s; }
.ph-tab .i { width: 16px; height: 16px; }
.ph-tab:hover { color: var(--color-ink); }
.ph-tab[aria-pressed="true"] { background: var(--color-booth); color: #fff; }
.ph-tab[aria-pressed="true"] .i { color: var(--color-tape); }
.ph-tools { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.ph-tools .btn { user-select: none; touch-action: none; }
.ph-stage {
  position: relative; display: grid; place-items: center; overflow: hidden; height: clamp(320px, calc(100dvh - 330px), 820px); padding: 20px; border-radius: var(--r-lg);
  background: var(--color-booth); background-image: radial-gradient(oklch(31% 0.02 255) 1px, transparent 1px); background-size: 16px 16px;
}
.view-photo[data-mode="batch"] .ph-stage, #view-photo[data-mode="batch"] .ph-stage { height: auto; min-height: 0; display: block; padding: 0; background: none; }
.ph-wrap { position: relative; line-height: 0; }
.ph-view { display: block; width: 100%; height: 100%; box-shadow: 0 18px 40px -18px oklch(10% 0.02 255 / 0.8); }
.ph-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.ph-overlay.active { pointer-events: auto; cursor: none; }
.ph-cursor { position: absolute; pointer-events: none; transform: translate(-50%, -50%); border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px oklch(15% 0.02 255 / 0.7); }
.ph-crop { position: absolute; cursor: move; touch-action: none; outline: 2px solid var(--color-tape); box-shadow: 0 0 0 9999px oklch(15% 0.02 255 / 0.62);
  background-image: linear-gradient(oklch(100% 0 0 / .35), oklch(100% 0 0 / .35)), linear-gradient(oklch(100% 0 0 / .35), oklch(100% 0 0 / .35)), linear-gradient(90deg, oklch(100% 0 0 / .35), oklch(100% 0 0 / .35)), linear-gradient(90deg, oklch(100% 0 0 / .35), oklch(100% 0 0 / .35));
  background-size: 100% 1px, 100% 1px, 1px 100%, 1px 100%; background-position: 0 33.33%, 0 66.66%, 33.33% 0, 66.66% 0; background-repeat: no-repeat; }
.ph-crop .hd { position: absolute; width: 18px; height: 18px; background: var(--color-tape); border-radius: 3px; }
.ph-crop .nw { left: -9px; top: -9px; cursor: nwse-resize; } .ph-crop .ne { right: -9px; top: -9px; cursor: nesw-resize; }
.ph-crop .sw { left: -9px; bottom: -9px; cursor: nesw-resize; } .ph-crop .se { right: -9px; bottom: -9px; cursor: nwse-resize; }

.ph-hist { width: 100%; height: 60px; border-radius: var(--r-sm); background: var(--color-sunk); display: block; }
.ph-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ph-sec { border-top: 1px solid var(--color-line); padding-top: 10px; }
.ph-sec summary { cursor: pointer; font: 650 14.5px/1.3 var(--font-display); list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 2px 0; }
.ph-sec summary::-webkit-details-marker { display: none; }
.ph-sec summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--color-ink-soft); border-bottom: 2px solid var(--color-ink-soft); transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease-out); }
.ph-sec[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.ph-sec-body { display: grid; gap: 10px; padding: 10px 0 4px; }
.ph-slider { gap: 2px; }
.ph-slider input[type=range] { margin: 0; }
.track-temp { accent-color: oklch(70% 0.14 70) !important; }
.track-tint { accent-color: oklch(60% 0.15 340) !important; }
.track-hue { accent-color: var(--color-ink) !important; }
.ph-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.ph-preset { display: grid; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--color-ink); text-align: center; }
.ph-preset img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); outline: 1px solid var(--color-line); transition: outline-color .15s; }
.ph-preset:hover img, .ph-preset:focus-visible img { outline: 2px solid var(--color-tape); }
.ph-bands { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-band { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--color-surface); background: hsl(var(--h) 75% 52%); box-shadow: 0 0 0 1px var(--color-line-strong); cursor: pointer; padding: 0; }
.ph-band[aria-checked="true"] { box-shadow: 0 0 0 2px var(--color-ink); }
.ph-mixer { display: grid; gap: 8px; }
.sig-layout { position: absolute; inset: 16px; display: grid; grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; }
.sig-src, .sig-out { position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; }
.sig-out > * { min-width: 0; min-height: 0; }
.sig-wrap { position: relative; line-height: 0; background: #fff; box-shadow: 0 12px 30px -16px oklch(10% 0.02 255 / 0.8); }
.sig-wrap { cursor: crosshair; touch-action: none; user-select: none; }
.sig-wrap canvas { width: 100%; height: 100%; }
.sig-box[hidden] { display: none; }
.sig-box { position: absolute; padding: 0; border: 0; border-radius: 4px; outline: 2px dashed var(--color-tape); background: oklch(83% 0.16 88 / .1); cursor: pointer; }
.sig-box.on { outline: 3px solid var(--color-tape); background: oklch(83% 0.16 88 / .18); }
.sig-box.custom { pointer-events: none; outline-color: var(--color-teal); background: oklch(52% 0.085 210 / .12); }
.sig-box span { position: absolute; left: -2px; top: -2px; min-width: 22px; padding: 2px 6px; border-radius: 4px 0 6px 0; background: var(--color-tape); color: var(--color-tape-ink); font: 700 12px/1.3 var(--font-text); }
.sig-box:focus-visible { outline-color: var(--color-teal); }
.ph-pick select { max-width: min(60vw, 360px); padding: 6px 10px; border: 1px solid var(--color-line-strong); border-radius: var(--r-sm); background: var(--color-surface); font-weight: 600; }
.ph-curve-box { display: grid; gap: 8px; }
.ph-curve { width: 100%; aspect-ratio: 1; border-radius: var(--r-sm); background: var(--color-sunk); touch-action: none; cursor: crosshair; }
.ph-preview-wrap { position: absolute; inset: 20px; display: grid; place-items: center; }
.ph-preview-wrap > * { min-width: 0; min-height: 0; }
.ph-preview { max-width: 100%; max-height: 100%; display: block; box-shadow: 0 18px 40px -18px oklch(10% 0.02 255 / 0.8); background: repeating-conic-gradient(oklch(88% 0.005 250) 0 25%, oklch(97% 0.003 250) 0 50%) 0 0 / 16px 16px; }
.ph-empty { color: var(--color-booth-ink); margin: 0; }
.ph-swatches { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ph-swatches li { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center; font-size: 13.5px; }
.ph-swatch { width: 28px; height: 28px; border-radius: 6px; box-shadow: inset 0 0 0 1px oklch(0% 0 0 / .12); }
.ph-swatches small { color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- Studio de montage ---------- */
.view-studio { display: grid; gap: 12px; }
.view-studio.over .st-stage-box { outline: 3px dashed var(--color-tape); outline-offset: -6px; }
.st-head { display: grid; gap: 4px; }
.st-head p { margin: 0; color: var(--color-ink-soft); max-width: 70ch; }
.st-app { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 12px; height: clamp(380px, calc(100dvh - 500px), 640px); }
.st-bin { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 10px; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--r-lg); min-height: 0; }
.st-bin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-bin-head h2 { font-size: 15px; }
.st-bin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; overflow-y: auto; }
.st-media { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.st-thumb { width: 44px; height: 30px; border-radius: 5px; overflow: hidden; display: grid; place-items: center; background: var(--color-booth); color: var(--color-booth-ink); }
.st-thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-thumb .i { width: 16px; height: 16px; }
.st-media-txt { display: grid; min-width: 0; }
.st-media-txt strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-media-txt small { font-size: 11.5px; color: var(--color-ink-soft); }
.st-center { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; min-height: 0; min-width: 0; }
.st-stage-box { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 12px; border-radius: var(--r-lg); background: var(--color-booth); background-image: radial-gradient(oklch(31% 0.02 255) 1px, transparent 1px); background-size: 16px 16px; }
.st-stage { position: relative; overflow: hidden; background: #000; box-shadow: 0 18px 40px -18px oklch(10% 0.02 255 / 0.8); touch-action: none; }
.st-stage video, .st-stage img { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-texts, .st-texts canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.st-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 16px; background: var(--color-booth); color: var(--color-booth-ink); }
.st-empty p { margin: 0; font-size: 13.5px; }
.st-transport { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-play { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--color-tape); color: var(--color-tape-ink); cursor: pointer; }
.st-play svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.st-play:focus-visible { outline: 3px solid var(--color-teal); outline-offset: 2px; }
.st-clock { font: 600 14px/1 var(--font-text); font-variant-numeric: tabular-nums; margin-left: 4px; }
.st-format { margin-left: auto; font-size: 12.5px; color: var(--color-ink-soft); }
.st-panel { position: static; max-height: none; height: 100%; overflow-y: auto; align-content: start; }
.st-name { overflow-wrap: anywhere; }
.st-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.st-sub { font-size: 13.5px; margin-top: 6px; }
.st-export { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--color-line); }
.st-layer { position: absolute; inset: 0; overflow: hidden; }
.st-layer video, .st-layer img { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-vig { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, oklch(0% 0 0 / .85) 100%); }
.st-overs { position: absolute; inset: 0; }
.st-ov { position: absolute; cursor: move; touch-action: none; }
.st-ov img, .st-ov video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.st-ov.sel { outline: 2px solid var(--color-tape); outline-offset: 1px; }
.st-ov.keyed::after { content: "fond vert"; position: absolute; left: 4px; top: 4px; padding: 1px 6px; border-radius: 4px; background: oklch(55% 0.15 150); color: #fff; font: 600 10px/1.4 var(--font-text); }
.st-ov-h { display: none; position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 3px; background: var(--color-tape); cursor: nwse-resize; }
.st-ov.sel .st-ov-h { display: block; }
.st-block.st-over { background: oklch(48% 0.09 200); }
.st-media-act { display: flex; gap: 4px; }

/* Bibliothèque du studio : onglets et vignettes à glisser */
.st-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--color-sunk); }
.st-tab { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 5px; border: 0; border-radius: 7px; background: transparent; color: var(--color-ink-soft); font-size: 11px; font-weight: 600; cursor: pointer; }
.st-tab .i { width: 16px; height: 16px; }
.st-tab:hover { color: var(--color-ink); background: oklch(100% 0 0 / .6); }
.st-tab[aria-selected="true"] { background: var(--color-booth); color: #fff; }
.st-tab[aria-selected="true"] .i { color: var(--color-tape); }
.st-tab:focus-visible { outline: 2px solid var(--color-teal); outline-offset: 1px; }
.st-lib { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 8px; padding-right: 2px; }
.st-lib-hint { margin: 0; font-size: 12px; color: var(--color-ink-soft); }
.st-lib-sub { font-size: 12.5px; margin-top: 4px; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.st-tile { position: relative; display: grid; gap: 4px; padding: 0; border: 0; background: none; text-align: left; cursor: grab; color: var(--color-ink); }
.st-tile:active { cursor: grabbing; }
.st-tile-label { font-size: 12px; font-weight: 600; line-height: 1.25; }
.st-tile-vis { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; background: var(--color-booth); box-shadow: inset 0 0 0 1px oklch(0% 0 0 / .08); transition: box-shadow .15s; }
.st-tile:hover .st-tile-vis, .st-tile:focus-visible .st-tile-vis { box-shadow: 0 0 0 2px var(--color-tape); }
.st-tile:focus-visible { outline: none; }
.st-tile-vis img, .st-tile-sample { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-tile-sample { background: linear-gradient(160deg, oklch(70% 0.12 60), oklch(55% 0.1 210) 55%, oklch(32% 0.05 260)); }
.fxv-zoom-in img, .fxv-zoom-in .st-tile-sample { transform: scale(1.25); }
.fxv-shake img, .fxv-shake .st-tile-sample { transform: scale(1.08) translate(2%, -2%) rotate(-1.5deg); }
.fxv-vignette::after, .fxv-oldfilm::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, oklch(0% 0 0 / .8)); }
.fxv-rgb img, .fxv-rgb .st-tile-sample { filter: drop-shadow(3px 0 0 oklch(60% 0.25 25 / .8)) drop-shadow(-3px 0 0 oklch(65% 0.2 230 / .8)); }
.fxv-grain::after { content: ""; position: absolute; inset: 0; opacity: .35; background: repeating-radial-gradient(circle at 30% 40%, #000 0 1px, transparent 1px 3px); }
.st-text-vis { background: linear-gradient(160deg, oklch(45% 0.06 230), oklch(28% 0.04 260)); padding: 6px; }
.st-tv { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.2; padding: 2px 6px; border-radius: 4px; }
.st-tv-dark { background: oklch(15% 0.02 255 / .65); }
.st-tv-light { background: oklch(100% 0 0 / .8); }
.st-tv-none { text-shadow: 0 0 2px #000, 0 0 2px #000; }
.st-sndv { color: var(--color-tape); gap: 2px; }
.st-sndv .i { width: 22px; height: 22px; }
.st-sndv small { color: var(--color-booth-ink); font-size: 11px; }
.st-tile-play { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--color-tape); color: var(--color-tape-ink); cursor: pointer; }
.st-tile-play svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
/* Mini démonstrations au survol : A (bleu) devient B (jaune). */
.st-trv .tr-a, .st-trv .tr-b, .st-anv .an-box { position: absolute; }
.st-trv .tr-a { inset: 0; background: linear-gradient(160deg, oklch(55% 0.1 210), oklch(35% 0.06 240)); }
.st-trv .tr-b { inset: 0; background: linear-gradient(160deg, oklch(85% 0.15 88), oklch(65% 0.14 50)); opacity: 0; }
.st-tile:hover .tr-b, .st-tile:focus-visible .tr-b { animation: tr-fade 1.2s ease-in-out infinite alternate; }
.st-tile:hover .tr-wipeleft .tr-b, .st-tile:hover .tr-wiperight .tr-b { opacity: 1; animation-name: tr-wipe; }
.st-tile:hover .tr-wiperight .tr-b { animation-name: tr-wipe-r; }
.st-tile:hover .tr-slideleft .tr-b { opacity: 1; animation-name: tr-slide; }
.st-tile:hover .tr-slideup .tr-b { opacity: 1; animation-name: tr-slide-up; }
.st-tile:hover .tr-circleopen .tr-b, .st-tile:hover .tr-radial .tr-b { opacity: 1; animation-name: tr-circle; }
.st-tile:hover .tr-circleclose .tr-b { opacity: 1; animation-name: tr-circle-close; }
.st-tile:hover .tr-fadeblack .tr-a, .st-tile:hover .tr-fadewhite .tr-a { animation: tr-dip 1.2s ease-in-out infinite alternate; }
.tr-fadewhite { background: #fff; }
@keyframes tr-fade { to { opacity: 1; } }
@keyframes tr-wipe { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }
@keyframes tr-wipe-r { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes tr-slide { from { transform: translateX(100%); } to { transform: none; } }
@keyframes tr-slide-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes tr-circle { from { clip-path: circle(0 at 50% 50%); } to { clip-path: circle(75% at 50% 50%); } }
@keyframes tr-circle-close { from { clip-path: circle(75% at 50% 50%); opacity: 0; } to { clip-path: circle(75% at 50% 50%); opacity: 1; } }
@keyframes tr-dip { to { opacity: 0; } }
.st-anv { background: oklch(30% 0.03 255); }
.st-anv .an-box { width: 44%; height: 50%; border-radius: 4px; background: linear-gradient(160deg, oklch(85% 0.15 88), oklch(65% 0.14 50)); }
.st-tile:hover .an-box { animation: 1.3s cubic-bezier(.2, .7, .2, 1) infinite; }
.st-tile:hover .an-in-fade .an-box { animation-name: an-fade; }
.st-tile:hover .an-in-zoom .an-box { animation-name: an-zoom; }
.st-tile:hover .an-in-slide-l .an-box { animation-name: an-from-l; }
.st-tile:hover .an-in-slide-r .an-box { animation-name: an-from-r; }
.st-tile:hover .an-in-slide-u .an-box { animation-name: an-from-b; }
.st-tile:hover .an-in-slide-d .an-box { animation-name: an-from-t; }
.st-tile:hover .an-in-spin .an-box { animation-name: an-spin; }
.st-tile:hover [class*="an-out-"] .an-box { animation-direction: reverse; }
.st-tile:hover .an-out-fade .an-box { animation-name: an-fade; }
.st-tile:hover .an-out-zoom .an-box { animation-name: an-zoom; }
.st-tile:hover .an-out-slide-l .an-box { animation-name: an-from-l; }
.st-tile:hover .an-out-slide-r .an-box { animation-name: an-from-r; }
.st-tile:hover .an-out-slide-u .an-box { animation-name: an-from-t; }
.st-tile:hover .an-out-slide-d .an-box { animation-name: an-from-b; }
.st-tile:hover .an-out-spin .an-box { animation-name: an-spin; }
@keyframes an-fade { from { opacity: 0; } }
@keyframes an-zoom { from { transform: scale(1.6); opacity: .4; } }
@keyframes an-from-l { from { transform: translateX(-160%); } }
@keyframes an-from-r { from { transform: translateX(160%); } }
@keyframes an-from-b { from { transform: translateY(160%); } }
@keyframes an-from-t { from { transform: translateY(-160%); } }
@keyframes an-spin { from { transform: rotate(-360deg) scale(.3); } }
.st-block.drop-on { box-shadow: 0 0 0 3px var(--color-teal), inset 0 0 0 999px oklch(52% 0.085 210 / .25); }
.st-lane.drop-on { background: oklch(52% 0.085 210 / .14); }
.st-dragging .st-stage-box { outline: 2px dashed oklch(83% 0.16 88 / .6); outline-offset: -6px; }
.st-media[draggable="true"] { cursor: grab; }
.st-result-video { width: 100%; border-radius: var(--r-sm); background: #000; }

.st-timeline { display: grid; gap: 8px; padding: 10px 12px 12px; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--r-lg); min-width: 0; }
.st-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-tools .btn .i { width: 15px; height: 15px; }
.st-sep { width: 1px; height: 22px; background: var(--color-line); margin: 0 4px; }
.st-grow { flex: 1; }
.st-zoom { width: 120px; accent-color: var(--color-teal); }
.st-scroll { overflow-x: auto; overflow-y: hidden; border-radius: var(--r-sm); background: var(--color-sunk); }
.st-tl { position: relative; min-width: 100%; padding-bottom: 6px; }
.st-ruler { position: relative; height: 24px; margin-left: 30px; border-bottom: 1px solid var(--color-line-strong); cursor: ew-resize; }
.st-tick { position: absolute; top: 0; bottom: 0; padding: 4px 0 0 4px; border-left: 1px solid var(--color-line-strong); font-size: 11px; color: var(--color-ink-soft); font-variant-numeric: tabular-nums; pointer-events: none; }
.st-lane { position: relative; height: 54px; border-bottom: 1px solid var(--color-line); }
.st-lane[data-lane="clip"] { height: 66px; }
.st-lane-label { position: sticky; left: 0; z-index: 7; display: grid; place-items: center; width: 30px; height: 100%; background: var(--color-sunk); color: var(--color-ink-soft); border-right: 1px solid var(--color-line); }
.st-lane-label .i { width: 15px; height: 15px; }
.st-block { position: absolute; top: 5px; bottom: 5px; display: flex; align-items: center; gap: 8px; overflow: hidden; padding: 0 10px; margin-left: 30px; border-radius: 7px; cursor: grab; user-select: none; touch-action: none; color: #fff; box-shadow: inset 0 0 0 1px oklch(100% 0 0 / .12); }
.st-block.dragging { opacity: .75; z-index: 5; cursor: grabbing; }
.st-block.on { box-shadow: 0 0 0 2px var(--color-tape), inset 0 0 0 1px oklch(100% 0 0 / .2); z-index: 4; }
.st-block:focus-visible { outline: 3px solid var(--color-teal); outline-offset: 1px; }
.st-clip { background: var(--color-booth-2); }
.st-block.st-text { background: oklch(80% 0.13 85); color: var(--color-tape-ink); }
.st-audio { background: var(--color-moss); }
.st-block-thumb { position: absolute; inset: 0; background-size: auto 100%; background-repeat: repeat-x; opacity: .45; }
.st-block-txt { position: relative; display: grid; min-width: 0; }
.st-block-txt strong { font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-block-txt small { font-size: 11px; opacity: .85; white-space: nowrap; }
.st-trim { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 2; }
.st-trim.l { left: 0; } .st-trim.r { right: 0; }
.st-block.on .st-trim { background: oklch(83% 0.16 88 / .55); }
.st-trans { position: absolute; right: 0; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, oklch(83% 0.16 88 / .6) 0 6px, transparent 6px 12px); pointer-events: none; }
.st-playhead { position: absolute; top: 0; bottom: 0; left: 30px; width: 2px; background: var(--color-brick); pointer-events: none; z-index: 6; }
.st-playhead::before { content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--color-brick); }

/* ---------- Montage photo (calques) ---------- */
.view-montage { height: calc(100dvh - var(--top-h) - var(--status-h) - 64px); min-height: 540px; }
.mt-root {
  --mt-bg: oklch(22% 0.02 255); --mt-bar: oklch(26% 0.022 255); --mt-line: oklch(34% 0.02 255); --mt-field: oklch(30% 0.022 255); --mt-ink: oklch(88% 0.012 250); --mt-soft: oklch(68% 0.018 250);
  height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; border-radius: var(--r-lg); overflow: hidden;
  background: var(--mt-bg); color: var(--mt-ink); border: 1px solid oklch(18% 0.02 255); font-size: 13px;
}
.mt-menubar { display: flex; align-items: center; gap: 2px; padding: 4px 8px; background: var(--mt-bar); border-bottom: 1px solid var(--mt-line); position: relative; z-index: 20; }
.mt-menu-wrap { position: relative; }
.mt-menu { padding: 5px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--mt-ink); cursor: pointer; font-size: 13px; }
.mt-menu:hover, .mt-menu-wrap.open .mt-menu { background: var(--mt-line); }
.mt-pop { display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 250px; padding: 5px; border-radius: 8px; background: oklch(28% 0.022 255); border: 1px solid var(--mt-line); box-shadow: 0 16px 40px -12px oklch(5% 0.02 255 / 0.8); }
.mt-menu-wrap.open .mt-pop { display: grid; }
.mt-item { display: flex; justify-content: space-between; gap: 24px; padding: 7px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--mt-ink); font-size: 13px; text-align: left; cursor: pointer; }
.mt-item:hover:not(:disabled), .mt-item:focus-visible { background: var(--color-teal); color: #fff; outline: none; }
.mt-item:disabled { opacity: .4; cursor: default; }
.mt-item kbd { font: 11px var(--font-text); color: var(--mt-soft); background: none; border: 0; padding: 0; }
.mt-pop hr { border: 0; border-top: 1px solid var(--mt-line); margin: 4px 2px; }
.mt-docname { margin-left: auto; margin-right: 8px; color: var(--mt-soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 42px; padding: 6px 12px; background: var(--mt-bar); border-bottom: 1px solid var(--mt-line); }
.mt-opt-title { font-weight: 650; }
.mt-opt { display: inline-flex; align-items: center; gap: 8px; color: var(--mt-soft); }
.mt-opt input[type=range] { width: 110px; accent-color: var(--color-tape); }
.mt-opt output { min-width: 44px; color: var(--mt-ink); font-variant-numeric: tabular-nums; }
.mt-opt input[type=number] { width: 64px; padding: 4px 6px; border: 1px solid var(--mt-line); border-radius: 5px; background: var(--mt-field); color: var(--mt-ink); }
.mt-hint { color: var(--mt-soft); }
.mt-grow { flex: 1; }
.mt-seg { min-width: 200px; border-color: var(--mt-line); }
.mt-seg span { color: var(--mt-ink); }
.mt-body { display: grid; grid-template-columns: 50px minmax(0, 1fr) 290px; min-height: 0; }
.mt-tools { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; overflow-x: hidden; background: var(--mt-bar); border-right: 1px solid var(--mt-line); overflow-y: auto; }
.mt-tool { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--mt-ink); cursor: pointer; flex: none; }
.mt-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mt-tool:hover { background: var(--mt-line); }
.mt-tool[aria-pressed="true"] { background: var(--color-tape); color: var(--color-tape-ink); }
.mt-tool:focus-visible, .mt-menu:focus-visible { outline: 2px solid var(--color-tape); outline-offset: 1px; }
.mt-tool.more { position: relative; }
.mt-tool.more::after { content: ""; position: absolute; right: 3px; bottom: 3px; border: 3px solid transparent; border-right-color: currentColor; border-bottom-color: currentColor; opacity: .6; }
.mt-ctx { position: fixed; z-index: 100; min-width: 230px; max-width: 320px; padding: 5px; display: grid; border-radius: 8px; background: oklch(28% 0.022 255); color: oklch(88% 0.012 250); border: 1px solid oklch(36% 0.02 255); box-shadow: 0 18px 44px -12px oklch(5% 0.02 255 / 0.8); font-size: 13px; }
.mt-ctx .mt-item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 0; border-radius: 5px; background: transparent; color: inherit; text-align: left; cursor: pointer; font-size: 13px; }
.mt-ctx .mt-item:hover:not(:disabled), .mt-ctx .mt-item:focus-visible { background: var(--color-teal); color: #fff; outline: none; }
.mt-ctx .mt-item:disabled { opacity: .4; cursor: default; }
.mt-ctx .mt-item kbd { font: 11px var(--font-text); color: oklch(68% 0.018 250); background: none; border: 0; padding: 0; }
.mt-ctx .mt-item:hover kbd, .mt-ctx .mt-item:focus-visible kbd { color: oklch(92% 0.02 210); }
.mt-ctx-ico { display: grid; place-items: center; }
.mt-ctx-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mt-ctx hr { border: 0; border-top: 1px solid oklch(36% 0.02 255); margin: 4px 2px; }
.mt-bp { gap: 10px; padding: 12px 14px; min-width: 240px; }
.mt-bp-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 12.5px; color: oklch(68% 0.018 250); }
.mt-bp-row output { color: oklch(88% 0.012 250); font-variant-numeric: tabular-nums; }
.mt-bp-row input { grid-column: 1 / -1; accent-color: var(--color-tape); }
.mt-colors { position: relative; width: 40px; height: 46px; margin-top: 10px; flex: none; }
.mt-swatch { position: absolute; width: 26px; height: 26px; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 2px var(--mt-bar), 0 0 0 3px var(--mt-line); cursor: pointer; }
.mt-swatch input { width: 40px; height: 40px; margin: -7px; border: 0; padding: 0; cursor: pointer; }
.mt-swatch.fg { left: 0; top: 0; z-index: 2; } .mt-swatch.bg { left: 13px; top: 14px; }
.mt-swap { position: absolute; right: -6px; top: -4px; width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--mt-soft); cursor: pointer; }
.mt-swap svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.mt-stage { position: relative; overflow: hidden; background: oklch(17% 0.018 255); background-image: radial-gradient(oklch(24% 0.02 255) 1px, transparent 1px); background-size: 18px 18px; }
.mt-view { position: absolute; inset: 0; touch-action: none; cursor: default; }
.mt-view[data-tool="brush"], .mt-view[data-tool="eraser"], .mt-view[data-tool="heal"] { cursor: none; }
.mt-view[data-tool="hand"] { cursor: grab; }
.mt-view[data-tool="text"] { cursor: text; }
.mt-view[data-tool="picker"], .mt-view[data-tool="bucket"], .mt-view[data-tool="select"], .mt-view[data-tool="eselect"], .mt-view[data-tool="crop"], .mt-view[data-tool="shape"] { cursor: crosshair; }
.mt-side { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; background: var(--mt-bar); border-left: 1px solid var(--mt-line); }
.mt-panel { padding: 10px 12px 12px; border-bottom: 1px solid var(--mt-line); }
.mt-panel h2 { font: 650 13px/1.3 var(--font-text); letter-spacing: 0; margin-bottom: 8px; color: var(--mt-ink); }
.mt-layers-panel { flex: 1 0 auto; }
.mt-props { display: grid; gap: 10px; }
.mt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.mt-root .field > label, .mt-root .field legend, .mt-root .label-row label { color: var(--mt-soft); font-weight: 600; font-size: 12px; }
.mt-root .label-row output { color: var(--mt-ink); font-size: 12px; }
.mt-root .field select, .mt-root .field input[type=number], .mt-root .field input[type=text], .mt-root .field textarea { background: var(--mt-field); border-color: var(--mt-line); color: var(--mt-ink); padding: 6px 8px; font-size: 13px; }
.mt-root .field.check { font-size: 13px; color: var(--mt-ink); }
.mt-root .field.color input { background: var(--mt-field); border-color: var(--mt-line); width: 40px; height: 28px; }
.mt-root .field input[type=range] { accent-color: var(--color-tape); }
.mt-root .seg-row { border-color: var(--mt-line); }
.mt-root .seg-row label + label span { border-color: var(--mt-line); }
.mt-root .seg-row span { padding: 5px 4px; font-size: 12px; }
.mt-root .seg-row input:checked + span { background: var(--color-teal); }
.mt-root .icon { background: var(--mt-field); border-color: var(--mt-line); color: var(--mt-ink); }
.mt-root .link { color: oklch(78% 0.09 210); }
.mt-sec { border-top: 1px solid var(--mt-line); padding-top: 8px; }
.mt-sec summary { cursor: pointer; font-weight: 600; padding: 2px 0 6px; }
.mt-sec[open] { display: grid; gap: 8px; }
.mt-xform { grid-template-columns: 1fr; color: var(--mt-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.mt-layers { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; max-height: 300px; overflow-y: auto; }
.mt-layer { display: grid; grid-template-columns: 28px 46px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 4px 6px 4px 2px; border-radius: 6px; cursor: pointer; }
.mt-layer:hover { background: var(--mt-field); }
.mt-layer.on { background: oklch(40% 0.07 210); }
.mt-eye { width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: none; color: var(--mt-soft); cursor: pointer; padding: 0; }
.mt-eye svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.mt-eye[aria-pressed="false"] { opacity: .5; }
.mt-thumb { width: 46px; height: 34px; display: grid; place-items: center; border-radius: 3px; background: repeating-conic-gradient(oklch(80% 0 0) 0 25%, oklch(95% 0 0) 0 50%) 0 0 / 8px 8px; overflow: hidden; }
.mt-lname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-layer small { color: var(--mt-soft); font-weight: 700; }
.mt-layer-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.mt-layer-actions .icon { width: 30px; height: 30px; }
.mt-history { margin: 0; padding: 0 0 0 18px; display: grid; gap: 2px; color: var(--mt-soft); font-size: 12px; max-height: 160px; overflow-y: auto; }
.mt-history li.on { color: var(--mt-ink); font-weight: 650; }
.mt-status { padding: 4px 12px; background: var(--mt-bar); border-top: 1px solid var(--mt-line); color: var(--mt-soft); font-size: 12px; font-variant-numeric: tabular-nums; min-height: 24px; }
.mt-status.flash { color: var(--color-tape); }
.mt-welcome { grid-row: 1 / -1; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 32px; text-align: center; }
.mt-welcome h2 { font-size: 26px; color: #fff; }
.mt-welcome p { margin: 0; max-width: 52ch; color: var(--mt-soft); }
.mt-welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mt-welcome .btn-ghost { background: transparent; color: var(--mt-ink); border-color: var(--mt-line); }
.mt-dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
.mt-dialog::backdrop { background: oklch(15% 0.02 255 / .55); }
.mt-dialog form { display: grid; gap: 12px; padding: 20px; }
.mt-dialog h2 { font-size: 18px; }
.mt-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- Réseau ---------- */
.view-net { display: grid; gap: 16px; }
.net-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.net-form { position: sticky; top: 0; }
.net-out { display: grid; gap: 12px; min-width: 0; }
.net-card { display: grid; gap: 12px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--color-surface); border: 1px solid var(--color-line); box-shadow: var(--shadow-panel); min-width: 0; }
.net-card > p { margin: 0; }
.net-h { font-size: 15px; margin-top: 4px; }
.net-big { margin: 0; font: 700 clamp(26px, 4vw, 40px)/1.1 var(--font-display); overflow-wrap: anywhere; }
.net-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.net-badge.ok { background: var(--color-ok-bg); color: oklch(38% 0.09 160); }
.net-badge.bad { background: var(--color-brick-soft); color: oklch(42% 0.13 35); }
.net-badge.warn { background: var(--color-warn-bg); color: var(--color-tape-ink); }
.net-badge.off { background: var(--color-sunk); color: var(--color-ink-soft); }
.net-badge.type { background: var(--color-booth); color: #fff; font-family: ui-monospace, Consolas, monospace; }
.net-scroll { overflow-x: auto; }
.net-table, .net-kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.net-table th, .net-table td, .net-kv th, .net-kv td { padding: 7px 10px; border-bottom: 1px solid var(--color-line); text-align: left; vertical-align: top; }
.net-table thead th { font-size: 12px; color: var(--color-ink-soft); font-weight: 650; }
.net-kv th { width: 34%; color: var(--color-ink-soft); font-weight: 600; }
.net-kv td, .net-table td { overflow-wrap: anywhere; }
.net-table code, .net-kv code { font-size: 12.5px; overflow-wrap: anywhere; }
.net-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.net-stats div { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-md); background: var(--color-sunk); }
.net-stats small { color: var(--color-ink-soft); font-size: 12px; }
.net-stats strong { font: 700 18px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.net-pre { margin: 0; max-height: 420px; overflow: auto; padding: 12px; border-radius: var(--r-md); background: var(--color-booth); color: oklch(90% 0.01 250); font: 12.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.net-details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.net-san { margin: 0; font: 12.5px/1.6 ui-monospace, Consolas, monospace; color: var(--color-ink-soft); overflow-wrap: anywhere; }
.net-actions { display: flex; gap: 8px; }
.net-legal { margin: 0; font-size: 12.5px; color: var(--color-ink-soft); }
.mod-net .tool-ico { background: oklch(94% 0.03 260); color: oklch(45% 0.1 260); }

/* ---------- Petits outils ---------- */
.view-util { display: grid; gap: 16px; }
.util-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.util-out { display: grid; gap: 12px; min-width: 0; }
.util-form textarea.big { min-height: 160px; resize: vertical; }
.util-form .mono, .util-text.mono { font: 13px/1.5 ui-monospace, Consolas, monospace; }
.util-text { width: 100%; padding: 10px 12px; border: 1px solid var(--color-line); border-radius: var(--r-md); background: var(--color-sunk); resize: vertical; white-space: pre-wrap; }
.util-drop { display: grid; justify-items: center; gap: 4px; padding: 18px 12px; border: 1.5px dashed var(--color-line-strong); border-radius: var(--r-md); text-align: center; cursor: pointer; transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out); }
.util-drop:hover, .util-drop.over { background: var(--color-tape-soft); border-color: var(--color-tape); }
.util-drop small { color: var(--color-ink-soft); }
.util-files { display: grid; gap: 6px; }
.util-card .result-files { max-height: none; gap: 8px; }
.util-card .result-files li { grid-template-columns: auto minmax(0, 1fr) auto; }
.util-fname { display: grid; min-width: 0; }
.util-fname strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.util-thumb { width: 64px; height: 64px; object-fit: contain; border-radius: var(--r-sm); border: 1px solid var(--color-line); background: var(--color-sunk); }
.util-thumb.checker { background: repeating-conic-gradient(oklch(88% 0.005 250) 0 25%, oklch(97% 0.003 250) 0 50%) 0 0 / 14px 14px; }
.util-swatch { height: 96px; border-radius: var(--r-md); border: 1px solid var(--color-line); }
.util-picker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-ink-soft); }
.util-picker input { width: 44px; height: 30px; padding: 0; border: 1px solid var(--color-line); border-radius: var(--r-sm); background: none; cursor: pointer; }
.util-contrast { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--r-md); }
.util-contrast strong { font: 700 24px/1.2 var(--font-display); }
.util-gradient { height: 180px; border-radius: var(--r-md); }
.util-diff, .util-hl { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; max-height: 560px; overflow: auto; padding: 12px; border-radius: var(--r-md); background: var(--color-sunk); }
.util-diff ins { background: var(--color-ok-bg); color: oklch(36% 0.1 155); text-decoration: none; border-radius: 3px; box-shadow: inset 0 -2px 0 var(--color-moss); }
.util-diff del { background: var(--color-brick-soft); color: var(--color-brick); border-radius: 3px; }
.util-hl mark { background: var(--color-tape); color: var(--color-tape-ink); border-radius: 3px; padding: 0 1px; }
.util-cron { font-size: clamp(20px, 2.6vw, 28px); }
.util-pw { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.util-pw li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: var(--r-md); background: var(--color-sunk); }
.util-pw code { flex: 1; font-size: 15px; overflow-wrap: anywhere; }
.util-cam { display: grid; gap: 8px; }
.util-cam video { width: 100%; border-radius: var(--r-md); background: #000; }
.mod-util .tool-ico { background: oklch(94% 0.03 300); color: oklch(45% 0.1 300); }
.mod-mine .tool-ico { background: var(--color-tape-soft); color: var(--color-tape-ink); }

.next-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--color-line); font-size: 13.5px; }
.next-tool select { min-width: 0; flex: 1 1 180px; padding: 6px 8px; border: 1px solid var(--color-line); border-radius: var(--r-sm); background: var(--color-surface); }
.batch-meta { color: var(--color-teal); font-weight: 600; }

.st-restore { display: grid; gap: 10px; justify-items: center; margin-top: 18px; padding: 14px 16px; border-radius: var(--r-md); background: oklch(100% 0 0 / .08); max-width: 460px; }
.st-restore p { margin: 0; }
.st-restore .btn-ghost { color: var(--color-booth-ink); border-color: oklch(100% 0 0 / .2); }
.st-restore-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Favoris */
.tool-li { position: relative; }
.tool-li .tool-row { padding-right: 40px; }
.fav-btn { position: absolute; top: 6px; right: 4px; opacity: 0; transition: opacity .15s var(--ease-out); color: var(--color-ink-soft); }
.tool-li:hover .fav-btn, .fav-btn:focus-visible, .fav-btn.on { opacity: 1; }
.fav-btn.on { color: oklch(68% 0.16 80); }
.fav-btn.on .i { fill: currentColor; }
@media (hover: none) { .fav-btn { opacity: 0.6; } }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .view-tool { grid-template-columns: minmax(0, 1fr); }
  /* Petit écran : aperçu, timeline, réglages, puis médias. */
  .st-app { display: contents; }
  .st-head { order: 0; } .st-center { order: 1; height: min(60dvh, 560px); } .st-timeline { order: 2; }
  .st-panel { order: 3; height: auto; } .st-bin { order: 4; max-height: 240px; }
  .panel { position: static; max-height: none; }
  .recorder { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  :root { --side-w: 200px; }
  .net-layout, .util-layout { grid-template-columns: minmax(0, 1fr); }
  .net-form { position: static; }
  .net-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view-montage { height: auto; min-height: 0; }
  .mt-root { height: auto; }
  .mt-body { grid-template-columns: 46px minmax(0, 1fr); }
  .mt-stage { height: 62dvh; }
  .mt-side { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--mt-line); }
  .mt-menubar { flex-wrap: wrap; }
  .mt-docname { display: none; }
  .brand { width: auto; }
  .home-start { grid-template-columns: minmax(0, 1fr); }
  .dl-info { grid-template-columns: minmax(0, 1fr); }
  .dl-thumb { max-width: 420px; }
}
@media (max-width: 820px) {
  body { grid-template-rows: var(--top-h) minmax(0, 1fr); }
  .statusbar { display: none; }
  .titlebar { gap: 10px; padding: 0 12px; }
  .local-chip { display: none; }
  .search-btn { width: auto; margin-left: auto; padding: 0 10px; }
  .search-txt, .search-btn kbd { display: none; }
  .shell, body[data-module="home"] .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .rail-item { flex: 1; padding: 6px 0; font-size: 10.5px; }
  .rail-item[aria-current]::before { left: 25%; right: 25%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .workspace { padding: 0 16px calc(84px + env(safe-area-inset-bottom)); }
  .chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 10px 16px; position: sticky; top: 0; z-index: 4; background: var(--color-paper); border-bottom: 1px solid var(--color-line); scrollbar-width: none; }
  .chips[hidden] { display: none !important; }
  .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--color-line-strong); background: var(--color-surface); color: var(--color-ink); text-decoration: none; font-size: 13px; white-space: nowrap; }
  .chip .i { width: 15px; height: 15px; }
  .chip[aria-current] { background: var(--color-booth); border-color: var(--color-booth); color: #fff; }
  .chip[aria-current] .i { color: var(--color-tape); }
  .view-home { padding-top: 16px; }
  .drop { padding: 44px 16px; }
  .timeline { grid-template-columns: auto minmax(0, 1fr); }
  .tl-clock { grid-column: 1 / -1; text-align: left; }
  .stage { padding: 10px; }
  .ph-stage { height: min(56dvh, 520px); padding: 10px; }
  .ph-tools { margin-left: 0; }
  .ph-tab span { display: none; }
  .page-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 10px; }
  .pt-frame { height: 160px; }
  .thumb-canvas { max-width: 116px; max-height: 156px; }
  .home-drop { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .st-tile:hover .an-box, .st-tile:hover .tr-a, .st-tile:hover .tr-b { animation: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Thème sombre ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-paper: oklch(19.5% 0.014 255);
  --color-surface: oklch(23.5% 0.016 255);
  --color-sunk: oklch(17% 0.013 255);
  --color-line: oklch(31% 0.018 255);
  --color-line-strong: oklch(40% 0.02 255);
  --color-ink: oklch(93% 0.008 250);
  --color-ink-soft: oklch(73% 0.016 250);
  --color-booth: oklch(14.5% 0.014 255);
  --color-booth-2: oklch(21% 0.016 255);
  --color-tape-soft: oklch(30% 0.045 88);
  --color-teal: oklch(74% 0.09 210);
  --color-teal-soft: oklch(29% 0.04 210);
  --color-moss: oklch(74% 0.1 150);
  --color-moss-soft: oklch(28% 0.04 150);
  --color-brick: oklch(72% 0.13 35);
  --color-brick-soft: oklch(29% 0.05 35);
  --color-warn-bg: oklch(30% 0.05 88);
  --color-ok-bg: oklch(28% 0.045 160);
  --color-ok-line: oklch(40% 0.06 160);
  --color-page-bg: oklch(15% 0.012 255);
  --shadow-panel: 0 1px 2px oklch(0% 0 0 / 0.3), 0 6px 20px -10px oklch(0% 0 0 / 0.5);
}
/* Textes sombres posés sur un fond pâle en thème clair : éclaircis en thème sombre. */
[data-theme="dark"] .side-item[aria-current] .i, [data-theme="dark"] .mod-record .tool-ico, [data-theme="dark"] .mod-mine .tool-ico, [data-theme="dark"] .pal-item[aria-selected="true"] .i, [data-theme="dark"] .net-badge.warn { color: oklch(88% 0.11 88); }
[data-theme="dark"] .net-badge.ok, [data-theme="dark"] .util-diff ins { color: oklch(85% 0.1 160); }
[data-theme="dark"] .net-badge.bad, [data-theme="dark"] .status.error, [data-theme="dark"] .dl-error { color: oklch(84% 0.09 35); }
[data-theme="dark"] .home-pick, [data-theme="dark"] .dl-off { border-color: oklch(42% 0.07 88); }
[data-theme="dark"] .dl-error { border-color: oklch(42% 0.07 35); }
[data-theme="dark"] .btn-primary:disabled { background: oklch(32% 0.03 88); color: oklch(62% 0.03 88); }
[data-theme="dark"] .page-tile:hover { background: oklch(28% 0.016 255); }
[data-theme="dark"] .mod-photo .tool-ico { background: oklch(30% 0.05 65); color: oklch(84% 0.1 65); }
[data-theme="dark"] .mod-net .tool-ico { background: oklch(29% 0.05 260); color: oklch(82% 0.09 260); }
[data-theme="dark"] .mod-util .tool-ico { background: oklch(29% 0.05 300); color: oklch(82% 0.09 300); }
[data-theme="dark"] .util-thumb.checker, [data-theme="dark"] .ph-preview { background-color: oklch(30% 0.01 250); }

/* ---------- Comparaison de PDF ---------- */
.cmp-changes { margin: 0; padding-left: 22px; display: grid; gap: 4px; max-height: 260px; overflow: auto; font-size: 13.5px; }
.cmp-changes del, .cmp-changes ins { padding: 0 3px; border-radius: 3px; text-decoration: none; }
.cmp-changes del { background: oklch(62% 0.2 28 / .22); text-decoration: line-through; }
.cmp-changes ins { background: oklch(66% 0.16 150 / .3); }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; }
.cmp-key::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.cmp-key.old::before { background: rgba(220, 50, 40, 0.5); }
.cmp-key.new::before { background: rgba(34, 160, 90, 0.55); }
.cmp-rows { display: grid; gap: 18px; }
.cmp-rows.only-changed .cmp-row:not(.changed) { display: none; }
.cmp-h { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.cmp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-page { width: 100%; height: auto; aspect-ratio: auto 1 / 1.414; background: #fff; border-radius: var(--r-sm); box-shadow: var(--shadow-page); }
.cmp-missing { display: grid; place-items: center; min-height: 200px; border: 1.5px dashed var(--color-line-strong); border-radius: var(--r-sm); color: var(--color-ink-soft); }
@media (max-width: 640px) { .cmp-pair { grid-template-columns: 1fr; } }

/* ---------- Compte ---------- */
.account-btn { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 36px; padding: 3px 8px 3px 3px; border-radius: 999px; color: var(--color-ink); text-decoration: none; font-size: 13.5px; font-weight: 600; border: 1px solid var(--color-line); background: var(--color-surface); }
.account-btn:hover { background: var(--color-sunk); }
.account-btn > .i { width: 15px; height: 15px; color: var(--color-ink-soft); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--color-tape); color: var(--color-tape-ink); font: 750 13px/1 var(--font-display); }
.avatar:empty::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: oklch(100% 0 0 / .5); }
.avatar.big { width: 44px; height: 44px; font-size: 19px; }
.acc-id { display: flex; align-items: center; gap: 12px; }
.acc-id > div { display: grid; min-width: 0; }
.acc-id strong { overflow-wrap: anywhere; }
@media (max-width: 760px) { .account-btn .acc-label, .account-btn > .i { display: none; } .account-btn { padding: 3px; } }
.view-account { display: grid; gap: 16px; }
.acc-body { display: grid; gap: 16px; min-width: 0; }
.acc-card { max-width: 520px; display: grid; gap: 14px; }
.acc-card h2 { font-size: 20px; }
.acc-form { display: grid; gap: 12px; }
.acc-form input:not([type=checkbox]) { width: 100%; }
.acc-tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--color-sunk); }
.acc-tab { flex: 1; padding: 8px 6px; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--color-ink-soft); }
.acc-tab[aria-selected="true"] { background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-panel); }
.acc-code { margin: 0; padding: 14px; border-radius: var(--r-md); background: var(--color-booth); color: #fff; font: 700 clamp(17px, 3vw, 22px)/1.3 ui-monospace, Consolas, monospace; letter-spacing: 0.06em; text-align: center; overflow-wrap: anywhere; user-select: all; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.acc-sec { display: grid; gap: 10px; }
.acc-danger { border-color: var(--color-brick-soft); }
.acc-danger .btn-primary { background: var(--color-brick); color: #fff; }
.acc-usage { display: grid; gap: 4px; }
.acc-bar { height: 8px; border-radius: 99px; background: var(--color-sunk); overflow: hidden; }
.acc-bar span { display: block; height: 100%; background: var(--color-teal); }
.acc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.acc-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--color-line); font-size: 13.5px; }
.acc-list small { color: var(--color-ink-soft); }
.acc-qr { width: 220px; max-width: 100%; border-radius: var(--r-sm); }
.acc-empty { padding: 32px 16px; text-align: center; border: 1.5px dashed var(--color-line-strong); border-radius: var(--r-lg); }
.acc-empty p { margin: 4px 0; }
.lib-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.lib-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-filters .chip[aria-pressed="true"] { background: var(--color-booth); color: #fff; border-color: var(--color-booth); }
.lib-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lib-card { display: grid; grid-template-rows: auto auto auto; gap: 8px; padding: 10px; border-radius: var(--r-lg); background: var(--color-surface); border: 1px solid var(--color-line); min-width: 0; }
.lib-thumb { display: grid; place-items: center; height: 120px; border-radius: var(--r-md); background: var(--color-sunk); color: var(--color-ink-soft); overflow: hidden; }
.lib-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lib-thumb.checker { background: repeating-conic-gradient(oklch(88% 0.005 250) 0 25%, oklch(97% 0.003 250) 0 50%) 0 0 / 14px 14px; }
.lib-thumb .i { width: 34px; height: 34px; }
.lib-txt { display: grid; min-width: 0; }
.lib-txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-txt small { color: var(--color-ink-soft); }
.lib-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.lib-actions .icon:first-of-type { margin-left: auto; }
.hist { display: grid; gap: 14px; }
.hist-time { font-variant-numeric: tabular-nums; color: var(--color-ink-soft); }
.sig-lib { display: flex; flex-wrap: wrap; gap: 6px; }
.sig-lib button { width: 96px; height: 54px; padding: 4px; border: 1px solid var(--color-line); border-radius: var(--r-sm); background: #fff; cursor: pointer; }
.sig-lib button img { max-width: 100%; max-height: 100%; }
.util-file-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.lib-save[disabled] { opacity: .7; }

/* ---------- Page de connexion ---------- */
.login-page { display: block; height: auto; min-height: 100dvh; overflow: auto; background: var(--color-paper); }
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr); }
.login-side { position: relative; display: flex; flex-direction: column; gap: 28px; padding: 40px clamp(28px, 5vw, 64px); background: var(--color-booth); color: var(--color-booth-ink); overflow: hidden; }
.login-side::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(oklch(34% 0.02 255) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(160deg, transparent 35%, #000); pointer-events: none; }
.login-side > * { position: relative; z-index: 1; }
.login-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font: 750 24px/1 var(--font-display); }
.login-brand .brand-mark { width: 44px; height: 44px; }
.login-pitch { margin-top: auto; color: #fff; font: 750 clamp(30px, 3.6vw, 46px)/1.08 var(--font-display); letter-spacing: -0.02em; }
.login-facts { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 16px; max-width: 420px; }
.login-facts li { display: grid; gap: 2px; padding-left: 16px; border-left: 3px solid var(--color-tape); }
.login-facts strong { color: #fff; font-weight: 650; }
.login-facts span { font-size: 14px; }
.login-main { display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 40px 20px 20px; }
.login-box { align-self: center; width: min(400px, 100%); display: grid; gap: 14px; }
.login-title { font-size: 28px; letter-spacing: -0.015em; }
.login-sub { margin: 0; color: var(--color-ink-soft); }
.login-form { display: grid; gap: 14px; margin-top: 6px; }
.login-form .field input { padding: 11px 12px; font-size: 15px; border-radius: var(--r-md); }
.login-form .field input:focus-visible { outline: 2px solid var(--color-tape); outline-offset: 1px; border-color: var(--color-tape); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: none; color: var(--color-ink-soft); cursor: pointer; }
.pw-eye:hover { color: var(--color-ink); background: var(--color-sunk); }
.login-go { width: 100%; margin-top: 2px; }
.login-msg:empty { display: none; }
.login-links { display: grid; gap: 6px; justify-items: start; padding-top: 14px; border-top: 1px solid var(--color-line); font-size: 14px; }
.login-links p { margin: 0; }
.login-done { display: grid; gap: 10px; justify-items: start; }
.login-done > .i { width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: var(--color-ok-bg); color: var(--color-moss); }
.login-legal { display: flex; gap: 16px; font-size: 12.5px; }
.login-legal a { color: var(--color-ink-soft); }
.status.info { padding: 10px 12px; border-radius: var(--r-sm); background: var(--color-teal-soft); font-size: 13.5px; }
.status.ok { padding: 10px 12px; border-radius: var(--r-sm); background: var(--color-ok-bg); font-size: 13.5px; }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-side { gap: 14px; padding: 22px 20px; }
  .login-pitch { margin-top: 6px; font-size: 26px; }
  .login-facts { display: none; }
  .login-main { padding: 28px 20px 16px; }
}

/* ---------- Administration ---------- */
.adm-tabs { max-width: 520px; }
.adm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adm-temp { display: grid; gap: 8px; border-color: var(--color-tape); }
.adm-temp p { margin: 0; }
.adm-pending { display: grid; gap: 8px; border-color: oklch(80% 0.1 88); }
.adm-add summary { cursor: pointer; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.adm-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: end; margin-top: 12px; }
.adm-search { width: min(360px, 100%); padding: 8px 12px; border: 1px solid var(--color-line-strong); border-radius: var(--r-md); background: var(--color-surface); }
.adm-table td { vertical-align: middle; }
.adm-table tr.off td { opacity: .6; }
.adm-who { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.adm-who strong { overflow-wrap: anywhere; }
.adm-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.adm-settings { max-width: 620px; }
.adm-radio { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--color-line); border-radius: var(--r-md); cursor: pointer; }
.adm-radio:has(input:checked) { border-color: var(--color-tape); background: var(--color-tape-soft); }
.adm-radio input { margin-top: 3px; accent-color: var(--color-teal); }
.adm-radio span { display: grid; gap: 2px; }
.adm-radio small { color: var(--color-ink-soft); }
.btn-danger { background: var(--color-brick); color: #fff; }
@media (max-width: 640px) { .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .adm-add-form { grid-template-columns: 1fr; } }
.adm-mail { display: grid; gap: 10px; padding-top: 6px; border-top: 1px solid var(--color-line) !important; }
