/* Atelier — identité visuelle : encre profonde + ambre brûlé, typographie Inter (OFL). */
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }

/* =====================================================================================================
   Design tokens (docs/DESIGN.md). Dark areas share one navy family (--ink…): header, sidebar and the dark panels
   of the pages. Orange = the one main action; violet = selection / keyboard focus inside dark areas; teal = done.
   ===================================================================================================== */
:root {
  /* dark areas: one navy family (header darkest, sidebar, then panels and thumbnails) */
  --ink: #141b2d;
  --ink-2: #1c2440;
  --ink-3: #283153;
  --header-bg: #0c1120;
  --sidebar-bg: #111829;
  --on-ink: #f3efe9;         /* text on dark areas */
  --on-ink-muted: #a3a8b8;   /* 6.6:1 on --sidebar-bg */
  --on-ink-line: rgba(255, 255, 255, .09);
  /* light areas */
  --paper: #f6f4f0;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --line: #e4ded5;
  --line-strong: #cfc7bb;
  --text: #1c1e24;
  --muted: #5d6270;
  /* semantic colours */
  --accent: #b9410f;        /* 5.3:1 on white */
  --accent-hover: #9c3509;
  --accent-soft: #fbe9df;
  --accent-bright: #f08a4b; /* marks on dark areas (crop marks, current step, active nav bar) */
  --violet: #4f46e5;        /* selection, secondary active states (6.3:1 with white text) */
  --violet-soft: #e8e6fb;
  --teal: #0f7c70;
  --teal-soft: #dff3ef;
  --teal-bright: #2aa294;   /* done steps on dark areas */
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  /* surfaces and marks that used to be hard-coded (light values unchanged); the dark theme redefines them */
  --accent-text: var(--accent);        /* orange used as a TEXT colour (links, labels): brighter in the dark theme */
  --accent-text-hover: var(--accent-hover);
  --on-accent: #fff;                   /* text on an orange fill */
  --field-bg: #fff;                    /* text fields */
  --surface-sunk: #faf8f5;             /* recessed blocks: code, notes, table heads */
  --surface-hover: #f3efe9;
  --code-bg: #f3f0eb;
  --track: #ece7df;                    /* progress tracks */
  --track-2: #eeeae4;
  --thumb-bg: #e9e4dc;                 /* empty thumbnails */
  --thumb-bg-2: #efeae2;
  --surface-selected: #fffaf7;
  --violet-faint: #ece8fb;
  --teal-faint: #eef7f5;
  --info-bg: #eef4fb; --info-line: #c8daf0; --info-text: #1d3f66;
  --warn-text: #5c3d00; --warn-line: #f0d68a; --danger-text: #7a1a12; --danger-line: #f0b4ae; --ok-text: #0b5249; --ok-line: #a8dcd3;
  --badge-text: #444;
  /* spacing scale 4 / 8 / 12 / 16 / 24 / 32 / 48 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px; --sp-12: 48px;
  /* radii, shadows, motion, layers */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  /* type scale 1.25: metadata .85 / body 1 / h3 1 / h2 1.17 / h1 clamp(1.85, 2.4) rem */
  --fs-h2: 1.17rem;
  --fs-meta: .85rem;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 4px 16px rgba(20, 20, 30, .06);
  --shadow-pop: 0 6px 24px rgba(12, 17, 32, .18), 0 1px 3px rgba(12, 17, 32, .12);
  --focus: 0 0 0 3px rgba(185, 65, 15, .35);
  --focus-on-ink: 0 0 0 3px var(--accent-bright);
  --t-fast: .15s;
  --t-base: .2s;
  --z-sidebar: 40;
  --z-header: 45;
  --z-dropdown: 48;
  --z-modal: 50;
  --z-toast: 60;
  /* shell geometry */
  --header-h: 60px;
  --sidebar-w: 240px;
  --sidebar-rail-w: 68px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.02em; }
h2 { font-size: var(--fs-h2); margin: 0 0 .75rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* =====================================================================================================
   Shell (ui/shell.tsx): one permanent header, one permanent sidebar, one scrolling content area (the window).
   Header and sidebar are sticky; the page itself scrolls, so there is never a second scrollbar.
   ===================================================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: var(--header-h) 1fr; grid-template-areas: "header header" "sidebar main"; min-height: 100vh; background: linear-gradient(to right, var(--sidebar-bg) var(--sidebar-w), var(--paper) var(--sidebar-w)); } /* the sidebar column stays dark however tall the page is */

/* ---------- header */
.app-header { grid-area: header; position: sticky; top: 0; z-index: var(--z-header); height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 16px 0 12px; background: var(--header-bg); color: var(--on-ink); border-bottom: 1px solid var(--on-ink-line); }
.app-header > * { min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; color: #fff; text-decoration: none; border-radius: 8px; flex: none; width: calc(var(--sidebar-w) - 20px); }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--on-ink-muted); letter-spacing: .02em; white-space: nowrap; }
.brand:focus-visible { box-shadow: var(--focus-on-ink); }
img.logo { display: block; flex: none; object-fit: contain; }
.hero-brand { gap: 14px; align-items: center; }
.hero-brand b { font-size: 1.9rem; letter-spacing: -.02em; color: #fff; }
.hdr-spacer { flex: 1; }
.hdr-tools { display: flex; align-items: center; gap: 6px; flex: none; }

/* workspace switcher (which space am I in) — in the header on desktop, in the drawer on phones */
.ws-switch { position: relative; display: inline-flex; align-items: center; flex: none; max-width: 240px; }
.ws-switch select { appearance: none; width: 100%; background: transparent; color: var(--on-ink); border: 1px solid var(--on-ink-line); border-radius: 8px; padding: 6px 28px 6px 10px; min-height: 34px; font-size: .86rem; font-weight: 500; cursor: pointer; text-overflow: ellipsis; transition: border-color var(--t-fast), background-color var(--t-fast); }
.ws-switch select:hover { border-color: var(--on-ink-muted); background: var(--ink-2); }
.ws-switch select:focus-visible { box-shadow: var(--focus-on-ink); }
.ws-switch svg { position: absolute; right: 10px; pointer-events: none; color: var(--on-ink-muted); }
.sidebar .ws-switch { display: none; }

/* global search field (opens the palette, Ctrl+K) */
.hdr-search { display: flex; align-items: center; gap: 10px; flex: 0 1 420px; min-height: 38px; padding: 0 10px 0 12px; background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 10px; color: var(--on-ink-muted); cursor: text; text-align: left; font: inherit; font-size: .9rem; transition: border-color var(--t-fast); }
.hdr-search:hover { border-color: var(--on-ink-muted); color: #fff; }
.hdr-search:focus-visible { box-shadow: var(--focus-on-ink); border-radius: 10px; }
.hdr-search svg { flex: none; }
.hdr-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--ink-3); background: rgba(255, 255, 255, .04); font-size: .74rem; font-weight: 600; color: var(--on-ink-muted); white-space: nowrap; font-family: inherit; }

/* icon buttons of the header (bell, burger, search on phones) */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--on-ink); cursor: pointer; position: relative; padding: 0; transition: background-color var(--t-fast); }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--ink-2); }
.icon-btn:focus-visible { box-shadow: var(--focus-on-ink); border-radius: 10px; }
.icon-btn .count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-bright); color: var(--header-bg); font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--header-bg); font-variant-numeric: tabular-nums; }

/* user menu trigger: initials, name, role */
.hdr-user { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--on-ink); cursor: pointer; font: inherit; text-align: left; max-width: 260px; transition: background-color var(--t-fast); }
.hdr-user:hover, .hdr-user[aria-expanded="true"] { background: var(--ink-2); }
.hdr-user:focus-visible { box-shadow: var(--focus-on-ink); border-radius: 10px; }
.hdr-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.hdr-user-text b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-user-text span { font-size: .74rem; color: var(--on-ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-user > svg:last-child { color: var(--on-ink-muted); flex: none; }
.initials { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--violet); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .02em; overflow: hidden; }
.initials img { width: 100%; height: 100%; object-fit: cover; display: block; }
.initials.sm { width: 24px; height: 24px; font-size: .62rem; }
.initials.lg { width: 40px; height: 40px; font-size: .9rem; }
.initials.xl { width: 72px; height: 72px; font-size: 1.5rem; }

/* ---------- dropdowns (ui/components.tsx Dropdown): click outside / Escape close them, arrows move inside */
.dd { position: relative; display: inline-flex; }
.dd-panel { position: absolute; top: calc(100% + 6px); right: 0; min-width: 240px; max-width: min(360px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: var(--z-dropdown); animation: dd-in var(--t-fast) ease-out; }
.dd-panel.left { right: auto; left: 0; }
.dd-panel.wide { width: 360px; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 6px; }
.dd-head b { font-size: .95rem; }
.dd-sep { height: 1px; background: var(--line); margin: 4px 0; }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font: inherit; font-size: .9rem; text-align: left; text-decoration: none; cursor: pointer; }
.dd-item:hover, .dd-item:focus-visible { background: var(--surface-2); box-shadow: none; }
.dd-item:focus-visible { box-shadow: inset 0 0 0 2px var(--violet); }
.dd-item.danger { color: var(--danger); }
.dd-item svg { flex: none; color: var(--muted); }
.dd-item.danger svg { color: inherit; }
.dd-meta { padding: 6px 10px 8px; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; line-height: 1.4; }
.dd-meta b { display: block; color: var(--text); font-size: .9rem; }
.dd-list { max-height: min(420px, 60vh); overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.dd-empty { padding: 14px 10px 16px; color: var(--muted); font-size: .88rem; text-align: center; }

/* notifications */
.ntf { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; }
.ntf:hover, .ntf:focus-visible { background: var(--surface-2); box-shadow: none; }
.ntf:focus-visible { box-shadow: inset 0 0 0 2px var(--violet); }
.ntf-icon { flex: none; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); }
.ntf.ok .ntf-icon { background: var(--teal-soft); color: var(--teal); }
.ntf.warn .ntf-icon { background: var(--warn-soft); color: var(--warn); }
.ntf.err .ntf-icon { background: var(--danger-soft); color: var(--danger); }
.ntf.info .ntf-icon { background: var(--violet-soft); color: var(--violet); }
.ntf-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ntf-text b { font-size: .88rem; overflow-wrap: anywhere; }
.ntf-text span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.ntf-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); margin-top: 6px; }
.ntf.read { opacity: .72; }
.ntf.read .ntf-dot { visibility: hidden; }

/* ---------- sidebar */
.sidebar { grid-area: sidebar; background: var(--sidebar-bg); color: #e8e6e1; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--on-ink-line); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #cfd0d6; text-decoration: none; font-size: .93rem; position: relative; transition: background-color var(--t-fast), color var(--t-fast); }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: var(--ink-3); color: #fff; font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-bright); }
.nav a:focus-visible { box-shadow: var(--focus-on-ink); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .nav-sep { height: 1px; background: var(--on-ink-line); margin: 8px 6px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .spacer { flex: 1; }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding: 8px 2px 2px; }
.rail-toggle { display: none; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--on-ink-muted); font: inherit; font-size: .85rem; cursor: pointer; }
.rail-toggle:hover { background: var(--ink-2); color: #fff; }
.rail-toggle:focus-visible { box-shadow: var(--focus-on-ink); }
.sidebar-backdrop { display: none; }

.only-phone { display: none; }
.dialog:focus-visible { box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog.bare { padding: 0; }

/* ---------- content */
/* The content fills the whole main column, from the sidebar edge to the normal right margin (the padding), whatever
   the screen: no max-width here nor on the page containers (.dash, .hub, .wz, .sv, .bib, .cr, .st…). Only what has its
   own format keeps a bound — a 9:16 preview, a dialog, a form field, a line of text (62ch). It used to be capped at
   1320 px and left-aligned, which left an empty band on the right of every page on screens wider than ~1600 px. */
main.content { grid-area: main; padding: 28px 32px 80px; width: 100%; min-width: 0; display: flex; flex-direction: column; } /* grid item: never widen past the viewport */
/* shared footer (ui/components.tsx AppFooter): pushed to the bottom of the content when the page is short, in the flow otherwise */
.app-foot { margin-top: auto; padding-top: 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; color: var(--muted); font-size: .85rem; }
.app-foot::before { content: ''; flex-basis: 100%; border-top: 1px solid var(--line); margin-bottom: 10px; }
main.content > .app-foot { margin-bottom: -56px; } /* takes the place of the bottom padding, which stays for pages without a footer */
.auth > .app-foot { grid-column: 1 / -1; margin: 0; padding: 12px 32px 16px; }
.auth > .app-foot::before { display: none; }
.auth > .app-foot { border-top: 1px solid var(--line); }
.auth { grid-template-rows: 1fr auto; }
.app-foot.dark { align-self: stretch; justify-content: center; text-align: center; padding-top: 8px; color: #a7a9b2; font-size: .84rem; }
.app-foot.dark::before { display: none; }
/* a table wider than its card scrolls inside it, never the whole page */
.table-scroll { overflow-x: auto; max-width: 100%; }

/* ---------- page header (ui/components.tsx PageHeader): title, one lead sentence, actions on the right */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 420px; min-width: 0; }
.page-head h1 { font-size: clamp(1.85rem, 1.4rem + 1.2vw, 2.4rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 8px; text-wrap: balance; overflow-wrap: anywhere; }
.page-head p.lead { margin: 0; max-width: 62ch; font-size: 1rem; color: var(--muted); }
/* actions may shrink and wrap: on a phone two long buttons must not push past the right edge */
.page-head > .page-head-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.page-head > .page-head-actions > .row { min-width: 0; max-width: 100%; }
.page-head > .page-head-actions .btn { max-width: 100%; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 10px; padding: 0; list-style: none; font-size: .86rem; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.crumbs a:hover { color: var(--accent-text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }

/* ---------- loading placeholders (no white flash) */
.skeleton { display: block; background: linear-gradient(90deg, #ece7df 25%, #f4f1ec 50%, #ece7df 75%); background-size: 200% 100%; border-radius: 6px; animation: skeleton 1.2s linear infinite; min-height: 1em; }
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .dd-panel { animation: none; } }

/* ---------- search palette (ui/search.tsx) */
.palette-backdrop { align-items: flex-start; padding-top: min(12vh, 110px); }
.palette-backdrop .dialog { width: min(640px, 100%); padding: 0; overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input[type=search] { appearance: none; -webkit-appearance: none; border: 0; border-radius: 0; min-height: 46px; padding: 0; font-size: 1.05rem; background: transparent; }
.palette-input input[type=search]:focus-visible { box-shadow: none; }
.palette-input input::-webkit-search-cancel-button { -webkit-appearance: none; }
.palette-list { max-height: min(60vh, 460px); overflow: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.palette-item.on, .palette-item:hover { background: var(--violet-soft); }
.palette-item svg { flex: none; color: var(--muted); }
.palette-item.on svg { color: var(--violet); }
.palette-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.palette-item-text b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item-text span { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.palette-foot .kbd { border-color: var(--line-strong); color: var(--muted); background: var(--surface-2); }

/* ---------- primitives */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--text); min-height: 38px; white-space: nowrap; transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.btn.icon { padding: 0; width: 34px; min-height: 34px; border-color: transparent; background: transparent; color: var(--muted); }
.btn.icon:hover, .btn.icon[aria-expanded="true"] { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: .82rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .85rem; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=tel], select, textarea {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: var(--field-bg); min-height: 38px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input[type=range] { accent-color: var(--accent); width: 100%; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--track-2); color: var(--badge-text); }
.badge.ok { background: var(--teal-soft); color: var(--teal); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.notice { border-radius: 8px; padding: 10px 14px; font-size: .88rem; border: 1px solid; }
.notice.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-text); }
.notice.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
.notice.err { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-text); }
.notice.ok { background: var(--teal-soft); border-color: var(--ok-line); color: var(--ok-text); }
.notice.dash-error, .notice.bib-error { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.empty { text-align: center; padding: 40px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,.5); }
.empty h3 { color: var(--text); }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.table th, table.table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.table th { font-weight: 600; color: var(--muted); font-size: .82rem; }   /* sentence case: no all-caps labels (design rules, docs/DESIGN.md) */
.thumb { aspect-ratio: 16/9; background: var(--thumb-bg) center/cover no-repeat; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.stock-search { margin-top: 16px; }
.api-keys { margin-top: 16px; }
.media-card { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.media-card .name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.steps { counter-reset: s; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.steps .step { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: .86rem; position: relative; }
.steps .step::before { counter-increment: s; content: counter(s); display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .75rem; align-items: center; justify-content: center; margin-right: 6px; }
.steps .step.done::before { background: var(--teal); content: '✓'; }

/* ---------- overlays */
.backdrop { position: fixed; inset: 0; background: rgba(12, 17, 32, .55); display: flex; align-items: center; justify-content: center; z-index: var(--z-modal); padding: 16px; }
.dialog { background: var(--surface); border-radius: 14px; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog.wide { width: min(980px, 100%); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: var(--z-toast); max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; border-left: 4px solid var(--teal); }
.toast.error { border-left-color: #ff7a6b; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); background: #fff; cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .hero { background: radial-gradient(circle at 20% 20%, #3a2a24 0, var(--ink) 55%); color: #f3efe9; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .hero h1 { font-size: 2.3rem; line-height: 1.15; max-width: 460px; color: #fff; }
.auth .hero p { color: #c9c4bc; max-width: 460px; }
.auth .panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }

/* ---------- scenes */
.scene { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.scene .num { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diff pre { white-space: pre-wrap; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-family: inherit; font-size: .88rem; margin: 0; max-height: 300px; overflow: auto; }

/* ---------- editor (dark) */
.editor { background: #111318; color: #e7e8ec; border-radius: 14px; padding: 12px; display: grid; gap: 10px; grid-template-columns: 1fr 300px; grid-template-areas: "stage inspector" "toolbar toolbar" "timeline timeline"; }
.editor .btn { background: #222630; border-color: #353a46; color: #e7e8ec; }
.editor .btn:hover { border-color: #6b7180; }
.editor .btn.primary { background: var(--accent); border-color: var(--accent); }
.editor input, .editor select, .editor textarea { background: #1a1d24; border-color: #353a46; color: #e7e8ec; }
.editor .muted { color: #9aa0ad; }
.stage-wrap { grid-area: stage; display: flex; align-items: center; justify-content: center; background: #0a0b0e; border-radius: 10px; min-height: 280px; padding: 10px; }
.stage { position: relative; overflow: hidden; background: #000; max-width: 100%; max-height: 52vh; user-select: none; }
.stage .layer { position: absolute; pointer-events: none; }
.stage video.layer, .stage img.layer { object-fit: fill; }
.stage .txt { position: absolute; transform: translate(-50%, -50%); white-space: pre; text-align: center; font-family: 'Inter'; line-height: 1.2109; pointer-events: none; }
.stage .cap { position: absolute; left: 50%; transform: translate(-50%, -100%); white-space: pre; text-align: center; font-family: 'Inter'; line-height: 1.2109; pointer-events: none; }
.stage .cap .cap-w { display: inline-block; transform-origin: 50% 60%; }
.stage .safe-zone { position: absolute; background: rgba(240, 138, 75, .16); box-shadow: inset 0 0 0 1px rgba(240, 138, 75, .7); pointer-events: none; z-index: 1000; }
.stage .sel { position: absolute; border: 2px solid #f08a4b; box-shadow: 0 0 0 9999px rgba(0,0,0,.0); cursor: move; pointer-events: auto; }
.stage .sel .rs { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #f08a4b; border-radius: 3px; cursor: nwse-resize; }
.inspector { grid-area: inspector; background: #181b21; border-radius: 10px; padding: 12px; overflow: auto; max-height: 60vh; font-size: .86rem; display: flex; flex-direction: column; gap: 10px; }
.inspector h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #9aa0ad; margin: 4px 0 0; }
.toolbar { grid-area: toolbar; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timecode { font-variant-numeric: tabular-nums; font-size: .95rem; background: #0a0b0e; padding: 6px 10px; border-radius: 6px; min-width: 150px; text-align: center; }
.timeline { grid-area: timeline; background: #15181e; border-radius: 10px; overflow: hidden; display: grid; grid-template-columns: 150px 1fr; }
.timeline .heads { border-right: 1px solid #2a2f3a; }
.timeline .head { height: 54px; border-bottom: 1px solid #23272f; padding: 6px 8px; display: flex; flex-direction: column; justify-content: center; gap: 4px; font-size: .78rem; }
.timeline .head .row { gap: 4px; }
.timeline .head button { background: none; border: 1px solid #353a46; color: #cfd2da; border-radius: 4px; font-size: .7rem; padding: 1px 5px; cursor: pointer; }
.timeline .head button.on { background: #3a3f4c; color: #fff; }
.timeline .ruler-head { height: 26px; border-bottom: 1px solid #2a2f3a; }
.timeline .scroller { overflow-x: auto; overflow-y: hidden; position: relative; }
.timeline .ruler { height: 26px; border-bottom: 1px solid #2a2f3a; position: relative; cursor: pointer; background: #1a1d24; }
.timeline .tick { position: absolute; top: 0; height: 100%; border-left: 1px solid #353a46; font-size: .68rem; color: #8b91a0; padding-left: 3px; }
.timeline .lane { height: 54px; border-bottom: 1px solid #23272f; position: relative; }
.timeline .lane.drop { background: rgba(240, 138, 75, .08); }
.clip { position: absolute; top: 5px; height: 44px; border-radius: 6px; overflow: hidden; font-size: .72rem; padding: 3px 8px; cursor: grab; border: 1px solid rgba(255,255,255,.18); color: #fff; touch-action: none; }
.clip.video { background: linear-gradient(180deg, #3d5a80, #2d4463); }
.clip.image { background: linear-gradient(180deg, #5b4b8a, #44386a); }
.clip.audio { background: linear-gradient(180deg, #1f7a6c, #165c51); }
.clip.text { background: linear-gradient(180deg, #a1522a, #7d3d1d); }
.clip.selected { outline: 2px solid #f6c177; outline-offset: 1px; z-index: 2; }
.clip.ghost { opacity: .55; }
.clip .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 1; }
.clip .wave { position: absolute; left: 0; bottom: 0; width: 100%; height: 28px; opacity: .55; }
.clip .h { position: absolute; top: 0; width: 8px; height: 100%; cursor: ew-resize; z-index: 3; }
.clip .h.l { left: 0; } .clip .h.r { right: 0; }
.clip .h:hover { background: rgba(255,255,255,.25); }
.clip .fade { position: absolute; top: 0; height: 100%; background: linear-gradient(90deg, rgba(0,0,0,.45), transparent); pointer-events: none; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #ff6b5b; z-index: 5; pointer-events: none; }
.playhead::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: #ff6b5b; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.library button { background: #1f232b; border: 1px solid #353a46; border-radius: 8px; padding: 6px; cursor: pointer; color: #e7e8ec; text-align: left; font-size: .72rem; }
.library .thumb { aspect-ratio: 16/9; background: #2a2f39; margin-bottom: 4px; color: #aaa; font-size: .7rem; }
.cues { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow: auto; }
.cue { display: grid; grid-template-columns: 82px 82px 1fr auto; gap: 6px; align-items: center; }
.cue input { min-height: 30px; padding: 4px 6px; font-size: .8rem; }

/* ---------- responsive */
/* icon rail (ui/shell.tsx sets .rail): tablets by default, computers on demand — the toggle at the foot of the sidebar
   switches between the rail and the labelled menu on both; the content takes back the freed width */
@media (min-width: 901px) {
  .rail-toggle { display: flex; }
  .shell.rail { --sidebar-w: var(--sidebar-rail-w); }
  .shell.rail .brand { width: auto; }
  .shell.rail .sidebar { padding-inline: 10px; }
  .shell.rail .nav a { justify-content: center; padding: 10px 0; }
  .shell.rail .nav-label, .shell.rail .rail-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .shell.rail .rail-toggle { justify-content: center; }
  .shell.rail .rail-toggle svg { transform: rotate(180deg); }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .brand { width: auto; }
  main.content { padding: 24px 24px 80px; }
}
/* phones and small tablets: simplified header, sidebar as a drawer */
@media (max-width: 900px) {
  :root { --header-h: 56px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "header" "main"; align-content: start; background: var(--paper); }
  .app-header { padding: 0 8px 0 6px; gap: 4px; }
  .brand { width: auto; padding: 4px 6px; gap: 8px; }
  .brand small { display: none; }
  .hdr-search, .app-header .ws-switch, .hdr-user-text, .hdr-user > svg:last-child { display: none; }
  .hdr-user { padding: 4px; }
  .sidebar { position: fixed; z-index: var(--z-sidebar); left: 0; top: var(--header-h); height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); width: min(300px, 86vw); padding-top: 12px; transform: translateX(-100%); transition: transform var(--t-base); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-pop); }
  .sidebar .ws-switch { display: flex; max-width: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: var(--header-h) 0 0 0; z-index: calc(var(--z-sidebar) - 1); background: rgba(12, 17, 32, .55); border: 0; padding: 0; opacity: 0; pointer-events: none; transition: opacity var(--t-base); }
  .sidebar.open + .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .only-phone { display: inline-flex; }
  body.drawer-open { overflow: hidden; }
  .nav a { min-height: 44px; }
  .dd-panel { position: fixed; top: calc(var(--header-h) + 4px); left: 8px; right: 8px; max-width: none; }
  .palette-backdrop { padding: 8px; }
  main.content { padding: 18px 14px 80px; }
  .auth { grid-template-columns: 1fr; grid-template-rows: none; }
  .auth .hero { padding: 28px; }
  .hero-brand img.logo { width: 60px; height: 48px; }
  .hero-brand b { font-size: 1.5rem; }
  .auth .hero h1 { font-size: 1.6rem; }
  .editor { grid-template-columns: 1fr; grid-template-areas: "stage" "toolbar" "inspector" "timeline"; }
  .inspector { max-height: none; }
  .diff { grid-template-columns: 1fr; }
}
.row select, .row input[type=number], .row input[type=color] { width: auto; }
.row input[type=text].grow, .row input[type=search].grow { flex: 1; min-width: 160px; }
.thumb { background-color: var(--thumb-bg); background-image: linear-gradient(45deg, #ddd6cc 25%, transparent 25%), linear-gradient(-45deg, #ddd6cc 25%, transparent 25%); background-size: 16px 16px; }
.thumb img { object-fit: contain; }
.thumb video { object-fit: cover; }
.thumb[style*="background-image"] { background-size: cover; background-position: center; }
input[type=color] { width: 44px !important; height: 32px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--field-bg); cursor: pointer; }

/* lot 3: credit packs, connected accounts, stock media */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.pack-credits { font-size: 22px; font-weight: 700; }
.pack-price { color: var(--muted); }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stock-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.stock-item img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--paper); }
.stock-item .meta { padding: 6px 8px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.hero .btn.ghost { color: #f6f4f0; border: 1px solid rgba(255,255,255,.35); }

/* AI configuration centre */
.table.integrations td:last-child, .table.integrations th:last-child { text-align: right; white-space: nowrap; }

/* Phase 1 — creation studio (hub + wizard). Same tokens as the rest of the design system. */
.tabs button.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); font-weight: 600; cursor: pointer; font: inherit; white-space: nowrap; }
.tabs button.tab.active { color: var(--text); border-bottom-color: var(--accent); }
/* ---------- « Créer » hub (pages/create.tsx CreateHub). Type scale 1.25 : 13.5 / 15 / 18.75 / 23.4 / 36 px */
.hub { display: grid; gap: 20px 32px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "resume" "main" "services"; }
.hub-head { grid-area: head; }
.hub-head h1 { font-size: 2.4rem; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 10px; text-wrap: balance; }
.hub-head p { max-width: 62ch; margin: 0; font-size: 1rem; }
.hub h2 { font-size: var(--fs-h2); letter-spacing: -.01em; margin: 0 0 10px; }
.hub-main { grid-area: main; min-width: 0; }
.hub-resume { grid-area: resume; }
.hub-services { grid-area: services; }
.panel-quiet { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }

/* the two formats: viewfinders at their real ratio */
.format-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.format-card, .start-row { touch-action: manipulation; }
.format-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.format-card:hover { border-color: var(--line-strong); }
.format-card:hover .vf-frame { border-color: rgba(255, 255, 255, .75); }
.format-card:focus-visible { box-shadow: var(--shadow), var(--focus); border-radius: 14px; }
.viewfinder { display: grid; place-items: center; height: 210px; background: var(--ink); padding: 22px; }
.vf-frame { position: relative; height: 100%; border: 1.5px solid rgba(255, 255, 255, .42); border-radius: 3px; transition: border-color .15s; }
.r9x16 .vf-frame { aspect-ratio: 9 / 16; }
.r16x9 .vf-frame { aspect-ratio: 16 / 9; height: auto; width: min(100%, calc((210px - 44px) * 16 / 9)); }
/* crop marks in the brand amber, like a camera safe-area */
.vf-frame::before, .vf-frame::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid #f08a4b; }
.vf-frame::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.vf-frame::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.vf-clock { position: absolute; top: 8px; right: 9px; color: #fff; font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.vf-ratio { position: absolute; bottom: 8px; left: 9px; color: #c9cbd2; font-size: .8rem; font-variant-numeric: tabular-nums; }
.format-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.format-title { font-size: 1.17rem; letter-spacing: -.01em; }
.format-body .muted { max-width: 46ch; line-height: 1.5; }
.format-action { align-self: flex-start; margin-top: auto; }
.format-body .small.muted { margin-bottom: 10px; }
.hub-voice { display: flex; align-items: center; gap: 8px; margin: 12px 2px 0; }
.hub-voice svg { flex: none; color: var(--muted); }
.hub-voice.on svg { color: var(--teal); }

/* other starting points: one panel, rows (not a grid of identical cards) */
.hub-subtitle { margin-top: 28px !important; }
.start-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.start-list li + li { border-top: 1px solid var(--line); }
.start-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 18px; color: inherit; text-decoration: none; }
.start-row:hover { background: var(--surface-2); }
.start-row:hover b { color: var(--accent-text); }
.start-list li:first-child .start-row { border-radius: 12px 12px 0 0; }
.start-list li:last-child .start-row { border-radius: 0 0 12px 12px; }
.start-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; }
.start-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.start-text .muted { line-height: 1.45; }
.start-need { justify-self: end; text-align: right; }
.need-free { color: var(--teal); font-weight: 600; white-space: nowrap; }

/* resume + services */
.resume-list, .svc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.resume-list li { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.resume-list li + li, .svc-list li + li { border-top: 1px solid var(--line); }
.resume-list a { font-weight: 700; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.resume-list a:hover { color: var(--accent-text); text-decoration: underline; }
.resume-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-track { display: inline-flex; gap: 3px; }
.step-track i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.step-track i.done { background: var(--teal); }
.step-track i.now { background: var(--accent); }
.svc-list { margin: 4px 0 12px; }
.svc-list li { display: flex; flex-direction: column; gap: 3px; padding: 9px 0; }
.svc-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.svc-line .badge, .start-need .badge { white-space: nowrap; flex: none; }
.svc-line a { color: var(--text); font-weight: 600; text-decoration: none; }
.svc-line a:hover { color: var(--accent-text); text-decoration: underline; }
.hub-services > p { margin: 0 0 4px; }

@media (min-width: 1100px) {
  .hub { grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: auto auto 1fr; grid-template-areas: "head head" "main resume" "main services"; align-items: start; }
}
@media (min-width: 700px) and (max-width: 1099px) {
  .hub { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "head head" "resume resume" "main main" "services services"; }
  .svc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .svc-list li + li { border-top: 0; }
  .svc-list li { border-bottom: 1px solid var(--line); }
}
@media (max-width: 699px) {
  .hub-head h1 { font-size: 1.85rem; }
  .format-pair { gap: 10px; }
  .viewfinder { height: 150px; padding: 16px; }
  .r16x9 .vf-frame { width: min(100%, calc((150px - 32px) * 16 / 9)); }
  .format-body { padding: 12px 12px 14px; }
  .format-body .small.muted { display: none; }                /* the viewfinder says vertical / horizontal */
  .format-action { white-space: normal; text-align: center; align-self: stretch; padding: 8px 10px; font-size: .85rem; }
  .start-row { grid-template-columns: 36px minmax(0, 1fr); padding: 12px 14px; }
  .start-icon { width: 36px; height: 36px; }
  .start-need { grid-column: 2; justify-self: start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .vf-frame { transition: none; } }
.wstep { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: .86rem; color: var(--muted); cursor: pointer; text-align: left; min-width: 0; }
.wstep:disabled { cursor: default; }
.wstep .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; }
.wstep .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wstep.done .n { background: var(--teal); color: #fff; }
.wstep.current { border-color: var(--accent); color: var(--text); font-weight: 600; box-shadow: 0 0 0 2px var(--accent-soft); }
.wstep.current .n { background: var(--accent); color: var(--on-accent); }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.voice-row > * { min-width: 0; }
.type-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px; cursor: pointer; }
.type-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.plan-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.storyboard { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.sb-thumb { width: 100%; max-height: 300px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--thumb-bg-2); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; padding: 0; color: var(--muted); font: inherit; }
.sb-thumb .thumb { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.voice-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.prompter { font-size: 1.25rem; line-height: 1.6; background: var(--ink); color: #f3efe9; border-radius: 10px; padding: 18px; max-height: 40vh; overflow: auto; white-space: pre-wrap; }
/* live recorder (ui/recorder.tsx) */
.recorder.video .prompter { font-size: 1.05rem; max-height: 22vh; margin-top: 10px; }
.prompter-edit { min-height: 110px; font-size: 1rem; line-height: 1.5; }
.rec-stage { position: relative; aspect-ratio: 16 / 9; width: min(100%, calc(48vh * 16 / 9)); margin-inline: auto; background: #0d0e12; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.rec-stage video { width: 100%; height: 100%; object-fit: contain; background: #0d0e12; }
.rec-stage .rec-live { transform: scaleX(-1); }          /* mirror, like a mirror: the recording itself is NOT mirrored */
.rec-placeholder { color: #a7a9b2; padding: 24px; text-align: center; max-width: 420px; }
.rec-badge { position: absolute; top: 12px; left: 12px; background: rgba(200, 30, 30, .92); color: #fff; font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.rec-meter { margin-top: 10px; height: 10px; border-radius: 999px; background: var(--line, #e4e0da); overflow: hidden; }
.rec-meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: #2f9e44; transition: width 60ms linear; }
.rec-meter > span[data-hot="low"] { background: #9aa0a6; }
.rec-meter > span[data-hot="1"] { background: #d9480f; }
.rec-progress { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.rec-track { position: relative; height: 6px; border-radius: 999px; background: var(--line, #e4e0da); }
.rec-track > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent); }
.rec-track > span.ok { background: #2f9e44; }
.rec-track > i { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--ink); }
@media (max-width: 640px) { .rec-stage { aspect-ratio: 3 / 4; width: min(100%, calc(46vh * 3 / 4)); } }
.chapters { white-space: pre-wrap; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 0; font-size: .85rem; }
.warn-text { color: var(--warn); }
@media (max-width: 900px) {
  .wstep { justify-content: center; padding: 8px 0; }
  .wstep .l { display: none; }
  .wstep.current .l { display: none; }
  .wizard-nav .btn { flex: 1; justify-content: center; }
}
.media-pick { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: 360px; overflow: auto; }
.media-pick .media-card { cursor: pointer; text-align: left; font: inherit; }
.media-pick .media-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* =====================================================================================================
   « Mes voix » (pages/voices.tsx) — every selector is scoped .vx / .vx-*. Hierarchy: the recording booth
   (free path, main action) → the user's voices → the text-reading services with their real state.
   ===================================================================================================== */
.vx { --vx-gap: clamp(16px, 2.4vw, 28px); }
.vx-head { margin-bottom: var(--vx-gap); }

/* booth: the one dark, bold element of the page (echoes the recorder's prompter) */
.vx-booth { background: var(--ink); color: #f3efe9; border-radius: 18px; padding: clamp(20px, 3vw, 36px); display: grid; gap: clamp(20px, 3vw, 40px); grid-template-columns: minmax(0, 1fr); margin-bottom: var(--vx-gap); }
.vx-booth h2 { color: #fff; font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); letter-spacing: -.02em; margin: 0 0 8px; text-wrap: balance; }
.vx-booth-lead { margin: 0; color: #d6d2cb; max-width: 52ch; font-size: .98rem; line-height: 1.55; }
.vx-booth-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 22px 0 18px; }
.vx-rec { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 24px 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 1rem; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: rgba(185, 65, 15, .25); transition: background-color .15s; }
.vx-rec:active { background: #84300a; }
.vx-rec:hover { background: var(--accent-hover); }
.vx-rec:focus-visible, .vx-booth .vx-import:focus-visible { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #f6c3a5; border-radius: 999px; }
.rec-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .28); }
.rec-dot.sm { width: 9px; height: 9px; background: var(--accent); box-shadow: none; }
.vx-booth .vx-import { background: transparent; color: #f3efe9; border-color: rgba(243, 239, 233, .4); min-height: 44px; border-radius: 999px; padding: 0 18px; touch-action: manipulation; }
.vx-booth .vx-import:hover { border-color: #f3efe9; }
.vx-booth-note { margin: 8px 0 0; color: #a9a59e; font-size: .86rem; line-height: 1.5; max-width: 60ch; }
.vx-prompt { margin: 0; align-self: center; border-left: 2px solid rgba(243, 239, 233, .22); padding: 2px 0 2px clamp(16px, 2vw, 24px); }
.vx-prompt figcaption { color: #a9a59e; font-size: .84rem; margin-bottom: 8px; }
.vx-prompt blockquote { margin: 0; font-size: clamp(1.1rem, 1rem + .5vw, 1.4rem); line-height: 1.55; color: #f6f4f0; max-width: 34ch; text-wrap: pretty; }

/* below the booth: voices (main) + services (aside) */
.vx-layout { display: grid; gap: var(--vx-gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
.vx-layout > * { min-width: 0; }
.vx-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.vx-section-head h2, .vx-services h2 { font-size: var(--fs-h2); margin: 0; }
.vx-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }

table.vx-table { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: .92rem; }
table.vx-table th { text-transform: none; letter-spacing: 0; font-size: .82rem; background: var(--surface-sunk); padding: 10px 14px; }
table.vx-table td { padding: 14px; vertical-align: middle; }
table.vx-table tbody tr:last-child td { border-bottom: 0; }
.vx-name b { display: block; overflow-wrap: anywhere; }
.vx-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.vx-type { min-width: 170px; }
.vx-kind { display: inline-block; font-weight: 600; font-size: .84rem; padding-left: 10px; border-left: 3px solid var(--line-strong); }
.vx-kind.recording { border-left-color: var(--accent); }
.vx-kind.catalog { border-left-color: var(--teal); }
.vx-kind.cloned { border-left-color: #5b4b8a; }
.vx-cap { display: block; color: var(--muted); font-size: .8rem; padding-left: 13px; margin-top: 2px; }
.vx-play { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 132px; min-height: 40px; padding: 8px 18px; border-radius: 10px;
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-text); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background .15s, color .15s; }
.vx-play svg { fill: currentColor; stroke: none; }
.vx-play:hover { background: #f8dccb; color: var(--accent-text-hover); }
.vx-play.on { background: var(--accent); color: var(--on-accent); }
.vx-play.on:hover { background: var(--accent-hover); }
.vx-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vx-nopreview { white-space: nowrap; }
.vx-error { color: var(--danger); margin-top: 4px; overflow-wrap: anywhere; }
table.vx-table td.vx-actions { text-align: right; white-space: nowrap; }
.vx-revoked td { color: var(--muted); }
.vx-revoked .vx-name b { text-decoration: line-through; text-decoration-color: var(--line-strong); }

.vx-services { display: flex; flex-direction: column; gap: 12px; }
.vx-svc-intro { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.vx-svc-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.vx-svc { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.vx-svc + .vx-svc { border-top: 1px solid var(--line); }
.vx-svc p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.vx-svc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.vx-state { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.vx-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.vx-state.off .vx-dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.vx-state.ok { color: var(--teal); }
.vx-state.warn { color: var(--warn); }
.vx-state.err { color: var(--danger); }
.vx-offer { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding-top: 12px; border-top: 1px dashed var(--line); margin-top: 4px; }
.vx-offer b { font-size: .9rem; }
.vx-offer .btn { margin-top: 6px; white-space: normal; text-align: left; }
.vx-svc p.vx-why { padding: 10px 12px; background: var(--surface-sunk); border-radius: 8px; color: var(--text); }
.vx-link { font-weight: 600; font-size: .88rem; align-self: flex-start; }

/* accents (Publicité produit, lot 5): finder of shared voices + guided cloning */
.vx-accent { display: inline-flex; align-items: center; gap: 2px; font-size: .78rem; font-weight: 600; color: var(--ink); background: #f1ece4; border-radius: 999px; padding: 1px 9px; }
.vx-accent.cote_ivoire { background: #fde3cf; color: #7a3410; }
.vx-accent.autre { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }
.vx-accent-raw { font-weight: 400; color: var(--muted); }
.vx-mine-filter { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.vx-local { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .84rem; }
.vx-local li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vx-more { display: grid; gap: var(--vx-gap); grid-template-columns: minmax(0, 1fr); margin-top: var(--vx-gap); align-items: start; }
.vx-more > * { min-width: 0; }
.vx-find, .vx-clone { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 2vw, 22px); }
.vx-clone h2 { font-size: var(--fs-h2); margin: 0 0 6px; }
.vx-find-lead { margin: 0 0 12px; color: var(--muted); font-size: .88rem; line-height: 1.5; max-width: 70ch; }
.vx-find-form { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; margin-bottom: 12px; }
.vx-find-form .btn { min-height: 40px; }
.vx-find-list { list-style: none; margin: 0 0 10px; padding: 0; }
.vx-find-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.vx-find-main b { display: block; overflow-wrap: anywhere; }
.vx-find-main p { margin: 4px 0 0; }
.vx-licence { color: var(--warn); }
.vx-steps { margin: 0 0 14px; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; line-height: 1.5; }
@media (max-width: 640px) { .vx-find-item { grid-template-columns: minmax(0, 1fr); } }

@media (min-width: 760px) { .vx-booth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
@media (min-width: 1100px) { .vx-more { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (min-width: 1100px) { .vx-layout { grid-template-columns: minmax(0, 1fr) 340px; } }

/* phone: each voice becomes a stacked block (the table keeps its semantics) */
@media (max-width: 640px) {
  .vx-booth-actions > * { flex: 1 1 100%; justify-content: center; }
  table.vx-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.vx-table, table.vx-table tbody, table.vx-table tr, table.vx-table td { display: block; width: 100%; }
  table.vx-table tr { padding: 14px; border-bottom: 1px solid var(--line); }
  table.vx-table tbody tr:last-child { border-bottom: 0; }
  table.vx-table td { padding: 0; border: 0; }
  table.vx-table td + td { margin-top: 10px; }
  .vx-type { min-width: 0; }
  .vx-listen audio { width: 100%; }
  table.vx-table td.vx-actions { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .vx-rec { transition: none; } }
.dd-meta.dd-me { display: flex; align-items: center; gap: 10px; }
.dd-meta.dd-me > span { min-width: 0; }

/* Pages « accueil » — redesign section owned by one agent; appended after styles.css at build time. */

/* =============================================================================================== dashboard */
/* Two columns on a computer: the work (resume, recent projects, background work) and the studio (short videos +
   calendar, credits, services). Both follow the width of the content area; the right column grows a little with it. */
.dash { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-head { margin-bottom: 0; }
.dash-head .dash-new { min-height: 44px; padding: 10px 18px; font-size: .95rem; touch-action: manipulation; }
.dash h2 { font-size: var(--fs-h2); letter-spacing: -.01em; margin: 0 0 10px; }
.dash-grid { display: grid; gap: 20px 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* the next thing to do: dark panel, project frame at its real ratio (or the exported video), labelled seven-step track */
.dash-next { background: var(--ink); color: var(--on-ink); border-radius: var(--radius-xl); padding: var(--sp-6) 28px; display: grid; gap: var(--sp-6); align-items: center; }
.dash-next.has-frame { grid-template-columns: 132px minmax(0, 1fr); }
.dash-next-body { min-width: 0; }
.dash-next-series { display: block; color: var(--on-ink-muted); font-size: .86rem; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash .dash-next h2 { color: #fff; font-size: 1.56rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 6px; text-wrap: balance; overflow-wrap: anywhere; }
.dash-next-lead { color: #c9c4bc; margin: 0; max-width: 72ch; line-height: 1.5; display: flex; flex-wrap: wrap; gap: 0 14px; }
.dash-next-date { color: var(--on-ink-muted); }
/* fixed 168px row: without it the auto row grows to the image's natural height and max-height:100% no longer caps it */
.dash-vf { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; height: 168px; overflow: hidden; }
/* explicit pixel bounds: a percentage max-height does not resolve here and a 9:16 thumbnail spilled out of the banner */
.dash-vf-img { display: block; width: auto; height: auto; max-height: 168px; max-width: 132px; min-height: 0; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.dash-vf-frame { position: relative; display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, .42); border-radius: 3px; color: rgba(255, 255, 255, .5); }
.dash-vf-frame.p { height: 100%; }
.dash-vf-frame.l { width: 100%; }
.dash-vf-frame::before, .dash-vf-frame::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--accent-bright); }
.dash-vf-frame::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.dash-vf-frame::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.dash-vf-ratio { position: absolute; bottom: 7px; left: 8px; color: #c9cbd2; font-size: .8rem; font-variant-numeric: tabular-nums; }

.dash-steps { list-style: none; margin: var(--sp-4) 0 var(--sp-4); padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 760px; }
.dash-steps li { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.dash-step-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .16); }
.dash-steps li.done .dash-step-bar { background: var(--teal-bright); }
.dash-steps li.now .dash-step-bar { background: var(--accent-bright); }
.dash-step-label { font-size: .8rem; color: #9da1ab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-steps li.done .dash-step-label { color: #c9c4bc; }
.dash-steps li.now .dash-step-label { color: #fff; font-weight: 700; }

.dash-next-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.dash-cta { min-height: 44px; padding: 10px 18px; font-size: .95rem; touch-action: manipulation; }
.dash-next-link { color: #f3efe9; font-weight: 600; text-underline-offset: 3px; }
.dash-next-link:hover { color: #fff; }
.dash-next a:focus-visible { box-shadow: var(--focus-on-ink); }

/* recent projects: rows (thumbnail, title, step / format / date, actions) — two columns of cards on very wide screens */
.dash-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dash .dash-section-head h2 { margin: 0; font-size: 1.3rem; }
.dash-more { font-size: .9rem; font-weight: 600; text-underline-offset: 3px; }
.dash-projects { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.dash-projects li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; transition: background-color var(--t-fast); }
.dash-projects li > .dd { margin-right: 12px; }
.dash-projects li + li { border-top: 1px solid var(--line); }
.dash-project { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 16px; padding: 12px 18px; color: inherit; text-decoration: none; touch-action: manipulation; min-width: 0; }
.dash-projects li:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.dash-projects li:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.dash-projects li:only-child { border-radius: var(--radius-lg); }
.dash-projects li:hover { background: var(--surface-2); }
.dash-project:hover b { color: var(--accent-text); }
.dash-thumb { width: 72px; height: 52px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; padding: 8px; overflow: hidden; }
.dash-thumb.has-img { padding: 0; }
.dash-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-thumb span { display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 2px; color: rgba(255, 255, 255, .6); }
.dash-thumb span.p { height: 100%; }
.dash-thumb span.l { width: 100%; }
.dash-project-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dash-project-series { color: var(--muted); font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-project-text b { font-size: 1.02rem; overflow-wrap: anywhere; }
.dash-project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; color: var(--muted); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.dash-project-meta .badge { font-size: .74rem; }
.dash-empty { padding: 32px 20px; }
.dash-empty p { max-width: 52ch; margin-left: auto; margin-right: auto; }

/* background work: one bar, the list on demand, each item linked to the page that follows it */
.dash-jobs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.dash-jobs summary { display: flex; align-items: center; gap: 12px; padding: 12px 18px; cursor: pointer; list-style: none; border-radius: var(--radius-lg); }
.dash-jobs summary::-webkit-details-marker { display: none; }
.dash-jobs summary:hover { background: var(--surface-2); }
.dash-jobs-icon { display: inline-flex; color: var(--accent-text); }
.dash-jobs summary b { font-size: 1rem; }
.dash-jobs-more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 600; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }
.dash-jobs-more svg { transform: rotate(-90deg); transition: transform var(--t-fast); }
.dash-jobs[open] .dash-jobs-more svg { transform: none; }
.dash-jobs-list { list-style: none; margin: 0; padding: 0 18px 8px; border-top: 1px solid var(--line); }
.dash-jobs-list li + li { border-top: 1px solid var(--line); }
.dash-jobs-list a, .dash-job-static { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; color: inherit; text-decoration: none; font-size: .92rem; }
.dash-jobs-list a:hover .dash-job-what { color: var(--accent-text); }
.dash-job-what { min-width: 0; overflow-wrap: anywhere; }
.dash-jobs-list .badge { flex: none; white-space: nowrap; }
.dash-jobs-admin { display: inline-block; margin: 0 18px 14px; }

/* right column: one card per subject, icon tile + title, content, one link at the foot */
.dash-side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.dash .dash-card h2 { display: flex; align-items: center; margin: 0; font-size: 1.2rem; line-height: 1.25; }
.dash-h2-text { min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.dash-h2-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); margin-right: 12px; flex: none; }
.dash-card > p { margin: 0; line-height: 1.5; }
.dash-card-cta { align-self: stretch; justify-content: center; min-height: 44px; font-size: .95rem; touch-action: manipulation; }
.dash-card-note { margin: 0; }
.dash-card-link { align-self: flex-start; font-size: .9rem; font-weight: 600; text-underline-offset: 3px; }
.dash-card-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.dash-card-error { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: .9rem; }
.dash-skel { height: 1.2em; width: 70%; }
.dash-alert { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; color: var(--danger); }
.dash-cal { display: flex; align-items: flex-start; gap: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.dash-cal-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dash-cal-title { color: var(--text); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.dash-cal-title:hover { color: var(--accent-text); text-decoration: underline; }
.dash-cal-next { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; color: var(--text); text-decoration: none; font-size: .92rem; }
.dash-cal-next:hover .dash-cal-what { color: var(--accent-text); text-decoration: underline; }
.dash-cal-what { overflow-wrap: anywhere; }
.dash-credits .dash-counts { margin: 0; }
/* four figures: icon, number, label — one tile each, same height whatever the wording */
.dash-counts { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dash-stat { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "icon n" "icon l"; column-gap: 8px; align-items: center; padding: 8px 8px; border-radius: 8px; color: var(--text); text-decoration: none; min-height: 52px; transition: background-color var(--t-fast); }
.dash-stat:hover { background: var(--surface-2); }
.dash-stat:hover span:last-child { color: var(--accent-text); }
.dash-stat-icon { grid-area: icon; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: var(--surface-2); color: var(--muted); }
.dash-stat b { grid-area: n; font-size: 1.15rem; line-height: 1.15; letter-spacing: -.01em; }
.dash-stat span:last-child { grid-area: l; font-size: .8rem; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-svc-sum { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; font-size: 1rem; }
.dash-svc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dash-svc-sum.ok .dash-svc-dot { background: var(--teal); }
.dash-svc-sum.warn .dash-svc-dot { background: var(--warn); }
.dash-svc-list { list-style: none; margin: 0; padding: 0; }
.dash-svc-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: .92rem; }
.dash-svc-list li + li { border-top: 1px solid var(--line); }
.dash-svc-list a { color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.dash-svc-list a:hover { color: var(--accent-text); text-decoration: underline; }
.dash-svc-list .badge { white-space: nowrap; flex: none; }
.dash-svc-attention { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dash-svc-all summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--muted); }
.dash-svc-all summary:hover { color: var(--text); }
.dash-svc-all[open] summary { margin-bottom: 4px; }


@media (min-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) clamp(330px, 26%, 440px); }
}
/* very wide screens: the recent projects become two columns of cards instead of very long rows */
@media (min-width: 1700px) {
  .dash-projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: none; border: 0; border-radius: 0; }
  .dash-projects li, .dash-projects li:first-child, .dash-projects li:last-child { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
  .dash-projects li + li { border-top: 1px solid var(--line); }
  .dash-projects li:hover { background: var(--surface-2); }
}
@media (min-width: 700px) and (max-width: 1099px) {
  .dash-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 699px) {
  .dash-head h1 { font-size: 1.85rem; }
  .dash-next { padding: 20px 18px; }
  .dash-next.has-frame { grid-template-columns: minmax(0, 1fr); }
  .dash-vf { display: none; }                                   /* the lead sentence carries the step; space goes to the action */
  .dash .dash-next h2 { font-size: 1.3rem; }
  .dash-step-label { display: none; }
  .dash-steps { margin: 14px 0 18px; }
  .dash-cta { width: 100%; white-space: normal; text-align: center; justify-content: center; }
  .dash-project { padding: 12px 14px; gap: 12px; grid-template-columns: 56px minmax(0, 1fr); }
  .dash-thumb { width: 56px; height: 44px; }
  .dash-jobs summary { flex-wrap: wrap; }
  .dash-jobs-more { margin-left: 30px; }
}

/* =============================================================================================== auth */
.auth-page .hero { background: var(--ink); gap: 40px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.auth-lang { display: inline-flex; padding: 3px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; }
.auth-lang-btn { border: 0; background: transparent; color: #c9c4bc; font-size: .85rem; font-weight: 600; padding: 6px 14px; min-height: 32px; border-radius: 999px; cursor: pointer; touch-action: manipulation; }
.auth-lang-btn:hover { color: #fff; }
.auth-lang-btn.on { background: var(--surface-hover); color: var(--ink); }
.auth-lang-btn:focus-visible { box-shadow: 0 0 0 3px #f08a4b; }

/* the headline framed by the studio's viewfinder crop marks (same amber as the « Créer » hub) */
.auth-pitch { position: relative; max-width: 520px; padding: 28px 30px; }
.auth-pitch::before, .auth-pitch::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid #f08a4b; }
.auth-pitch::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.auth-pitch::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.auth-page .hero h1 { font-size: 2.4rem; line-height: 1.12; letter-spacing: -.03em; margin-bottom: 16px; text-wrap: balance; }
.auth-page .hero .auth-pitch p { margin: 0; line-height: 1.55; max-width: 52ch; }
.auth-page .hero .auth-pitch p + p { margin-top: 12px; }
.auth-page .hero .auth-free { color: #f3efe9; }
.auth-page .hero .auth-privacy { margin: 0; color: #9da1ab; }

.auth-page .panel { padding: 40px 32px; }
.auth-page form { gap: 16px; }
.auth-form-head h1 { font-size: 1.85rem; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-form-head p { margin: 0; line-height: 1.5; }
.auth-submit { min-height: 44px; font-size: .95rem; touch-action: manipulation; }
.auth-sso { gap: 8px; }
.auth-or { display: flex; align-items: center; gap: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-links { justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.auth-links a { text-underline-offset: 3px; }

@media (max-width: 900px) {
  .auth-page { grid-template-rows: auto 1fr; }
  .auth-page .hero { gap: 22px; padding: 22px 24px 26px; justify-content: flex-start; }
  .auth-pitch { padding: 18px 20px; }
  .auth-page .hero h1 { font-size: 1.6rem; margin-bottom: 10px; }
  .auth-page .hero .auth-privacy { display: none; }
  .auth-page .panel { padding: 28px 24px 40px; align-items: flex-start; }
}
@media (max-width: 699px) {
  .auth-page .hero .auth-pitch p:not(.auth-free) { display: none; }   /* keep the login form close to the top */
  .auth-page .hero .auth-pitch p + p { margin-top: 0; }
  .auth-page .hero h1 { font-size: 1.45rem; }
  .auth-form-head h1 { font-size: 1.6rem; }
}

/* Pages « admin » — redesign section owned by one agent; appended after styles.css at build time.
   Console #/admin, keys #/admin/cles, AI service page #/parametres/ia/:id. Every selector is scoped .adm / .adm-*.
   A tool, not a showcase: quiet panels holding real tables, one accent action per page, and one structural device —
   the commissioning chain of each AI service (key → model → test → activation), where a simulated test is drawn in
   the warning colour with hatching, never in the teal of a real success. */

.adm { --adm-gap: clamp(18px, 2.4vw, 28px); min-width: 0; }
.adm-head { margin-bottom: 18px; }
.adm h2 { font-size: var(--fs-h2); letter-spacing: -.01em; margin: 0; }
.adm h3 { font-size: 1rem; margin: 0 0 10px; }
.adm-meta { display: block; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.adm-small { display: block; font-size: .86rem; }
.adm-wrap { overflow-wrap: anywhere; }
.adm-note { margin: 12px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.5; max-width: 80ch; }
.adm-quiet { margin: 0; padding: 14px 0 2px; color: var(--muted); font-size: .88rem; }
.adm-gap { margin-bottom: 16px; }
.adm-gap-top { margin-top: 12px; }
.adm-self-start { align-self: flex-start; }
.adm-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }

/* back link (breadcrumb): chevron drawn in CSS, decorative */
.adm-back { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; margin-bottom: 10px; min-height: 28px; }
.adm-back::before { content: ""; width: 7px; height: 7px; border-left: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg); }
.adm-back:hover { color: var(--accent-text); }

/* key figures: one quiet strip, not a grid of stat cards */
.adm-figures { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.adm-figures > div { padding: 12px 16px; min-width: 0; }
.adm-figures > div + div { border-left: 1px solid var(--line); }
.adm-figures dt { color: var(--muted); font-size: .82rem; }
.adm-figures dd { margin: 2px 0 0; font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.adm-figures > div.bad dd { color: var(--danger); }
.adm-figures.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 12px; background: var(--surface-sunk); }

/* in-page index (hash routing: buttons that scroll) */
.adm-index { margin: 0 0 var(--adm-gap); }
.adm-index ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.adm-index button { font: inherit; font-size: .86rem; font-weight: 600; color: var(--text); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; min-height: 34px; cursor: pointer; touch-action: manipulation; }
.adm-index button:hover { border-color: var(--ink); }
.adm-index button:focus-visible { border-radius: 999px; }

/* sections and panels */
.adm-section { margin-bottom: calc(var(--adm-gap) + 8px); scroll-margin-top: 16px; }
.adm-section:focus { outline: none; }
.adm-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.adm-section-action { margin-left: auto; }
.adm-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.adm-lead { margin: 0 0 12px; color: var(--muted); font-size: .9rem; max-width: 80ch; line-height: 1.5; }
.adm-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.adm-panel + .adm-panel, .adm-pair + .adm-panel, .adm-panel + .adm-pair { margin-top: 14px; }
.adm-panel.flush { padding: 4px 6px; }
.adm-panel h2 { margin-bottom: 10px; }
.adm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.adm-panel-head h3 { margin: 0; }
.adm-pair { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.adm-pair > .adm-panel { margin-top: 0; }
.adm-month { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.adm-month input { border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; min-height: 36px; background: var(--field-bg); font: inherit; color: var(--text); }

/* tables: real <table>, stacked rows on phones */
table.adm-table { font-size: .88rem; }
table.adm-table th { white-space: nowrap; }
table.adm-table td { vertical-align: top; }
table.adm-table tbody tr:last-child td { border-bottom: 0; }
table.adm-table .num { text-align: right; }
table.adm-table td.adm-actions { text-align: right; white-space: nowrap; width: 1%; }
table.adm-table td b { display: block; }
/* a wide table (GPU inventory, offers, sessions) scrolls inside its panel on tablets instead of widening the page */
.adm-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.adm-meta-cell { color: var(--muted); font-size: .84rem; white-space: nowrap; }
.adm-details summary { cursor: pointer; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.adm-details pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 6px 0 0; max-height: 260px; overflow: auto; }

/* state: dot + label (same vocabulary as « Mes voix ») */
.adm-state { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.adm-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.adm-state.off .adm-dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.adm-state.ok { color: var(--teal); }
.adm-state.warn { color: var(--warn); }
.adm-state.err { color: var(--danger); }
.adm-test { display: block; font-weight: 600; font-size: .86rem; }
.adm-test.ok { color: var(--teal); }
.adm-test.warn { color: var(--warn); }
.adm-test.err { color: var(--danger); }

/* the commissioning chain — compact (console rows) */
.adm-track { display: inline-flex; gap: 3px; flex: none; }
.adm-track i { width: 18px; height: 6px; border-radius: 3px; background: var(--line); }
.adm-track i.done { background: var(--teal); }
.adm-track i.now { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.adm-track i.sim { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, #e9c46a 3px 6px); }
.adm-track i.err { background: var(--danger); }
.adm-svc-state { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.adm-next { display: block; margin-top: 4px; font-size: .86rem; color: var(--text); }
.adm-svc-table td:first-child { min-width: 150px; }
.adm-svc-name b { font-size: .95rem; }

/* the commissioning chain — labelled (service page) */
.adm-progress { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.adm-progress.ok { border-left-color: var(--teal); }
.adm-progress.warn { border-left-color: var(--warn); }
.adm-progress.err { border-left-color: var(--danger); }
.adm-chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 4px; counter-reset: adm-step; }
.adm-chain li { position: relative; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: .86rem; font-weight: 600; line-height: 1.35; counter-increment: adm-step; padding-right: 10px; }
.adm-chain-mark { display: block; height: 6px; border-radius: 3px; background: var(--line); }
.adm-chain-label::before { content: counter(adm-step) ". "; font-variant-numeric: tabular-nums; }
.adm-chain li.done { color: var(--teal); }
.adm-chain li.done .adm-chain-mark { background: var(--teal); }
.adm-chain li.now { color: var(--text); }
.adm-chain li.now .adm-chain-mark { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.adm-chain li.sim { color: var(--warn); }
.adm-chain li.sim .adm-chain-mark { background: repeating-linear-gradient(135deg, var(--warn) 0 4px, #e9c46a 4px 8px); }
.adm-chain li.err { color: var(--danger); }
.adm-chain li.err .adm-chain-mark { background: var(--danger); }
.adm-progress-next { margin: 14px 0 0; font-size: .95rem; line-height: 1.5; max-width: 80ch; }

/* AI service page */
.adm-tabs { margin-top: 2px; }
.adm-svc-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adm-svc-title .badge { font-size: .8rem; letter-spacing: 0; }
.adm-svc-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: 16px; }
.adm-svc-layout > * { min-width: 0; }
.adm-svc-aside { display: flex; flex-direction: column; gap: 14px; }
.adm-svc-aside .adm-panel + .adm-panel { margin-top: 0; }
.adm-facts { margin: 0; display: flex; flex-direction: column; }
.adm-facts > div { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 4px 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.adm-facts > div:first-child { border-top: 0; padding-top: 0; }
.adm-facts dt { color: var(--muted); font-size: .86rem; }
.adm-facts dd { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: .9rem; min-width: 0; }
.adm-uses { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.adm-config h2 { margin-bottom: 12px; }
.adm-config-block { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.adm-config > h2 + .adm-config-block, .adm-config > .notice + .adm-config-block { border-top: 0; margin-top: 0; padding-top: 0; }
.adm-config-block h3 { margin-bottom: 6px; }
.adm-verify-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; }
.adm-verify-actions .btn { white-space: normal; text-align: left; line-height: 1.25; max-width: 100%; min-width: 0; }
.adm-verify-result { margin: 0 0 8px; }
.adm-verify-result .badge { white-space: normal; line-height: 1.4; padding: 4px 10px; border-radius: 8px; }
.adm-verify .adm-meta + .adm-meta { margin-top: 6px; }
.adm-model { display: flex; flex-direction: column; gap: 8px; }
.adm-costs h3 { margin: 18px 0 4px; }

/* one setting (keys page, service page) */
.adm-setting { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; }
.adm-setting + .adm-setting { border-top: 1px solid var(--line); }
.adm-setting-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.adm-setting-label { font-weight: 700; font-size: .92rem; }
.adm-setting-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-setting-form input, .adm-setting-form select { flex: 1 1 260px; min-width: 0; width: auto; }
.adm-voice-note { flex-basis: 100%; }
.adm-setting-test { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-setting-test .badge { white-space: normal; }

/* keys page */
.adm-keys-svcs { margin-bottom: 16px; }
.adm-keys-svcs h2 { margin-bottom: 4px; }
.adm-svc-links { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0 24px; }
.adm-svc-links li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.adm-svc-links a { font-weight: 600; text-decoration: none; color: var(--text); }
.adm-svc-links a:hover { color: var(--accent-text); text-decoration: underline; }
.adm-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 28px; padding: 18px 0; border-top: 1px solid var(--line-strong); scroll-margin-top: 16px; }
.adm-group:focus { outline: none; }
.adm-group h2 { font-size: 1.02rem; padding-top: 12px; text-wrap: balance; }
.adm-group-body { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px 18px; min-width: 0; }

/* forms in panels (offers, rates) */
.adm-form-title { font-size: .95rem; margin: 18px 0 8px; }
.adm-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px 14px; }
.adm-form-grid input[type=date] { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: var(--field-bg); min-height: 38px; width: 100%; font: inherit; color: var(--text); }
.adm-check { margin-top: 10px; }
.adm-form-actions { display: flex; gap: 10px; margin-top: 12px; }
.adm-integ { margin-top: 14px; }
.adm-integ h3 { margin-bottom: 4px; }
.adm-integ-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 24px; }
.adm-integ-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .88rem; min-width: 0; }
.adm-integ-list li > span:first-child { overflow-wrap: anywhere; min-width: 0; }

@media (min-width: 1000px) {
  .adm-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .adm-svc-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .adm-group { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 999px) {
  .adm-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adm-figures > div:nth-child(4) { border-left: 0; }
  .adm-figures > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .adm-figures.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-figures.compact > div:nth-child(3) { border-left: 0; }
  .adm-figures.compact > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .adm-figures.compact > div:nth-child(4) { border-left: 1px solid var(--line); }
}

/* phones: every table row becomes a stacked block, with the column name before each value */
@media (max-width: 699px) {
  .adm-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-figures > div:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .adm-figures > div:nth-child(-n+2) { border-top: 0; }
  .adm-figures > div:nth-child(2n) { border-left: 1px solid var(--line); }
  .adm-index ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .adm-index li { flex: none; }
  .adm-panel { padding: 14px; }
  .adm-panel.flush { padding: 0 14px; }
  .adm-group-body { padding: 2px 14px; }
  table.adm-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.adm-table, table.adm-table tbody, table.adm-table tr, table.adm-table td { display: block; width: 100%; }
  table.adm-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.adm-table tbody tr:last-child { border-bottom: 0; }
  table.adm-table td { padding: 0; border: 0; text-align: left; }
  table.adm-table td + td { margin-top: 6px; }
  table.adm-table td[data-label] { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr); gap: 0 10px; align-items: baseline; justify-items: start; }
  table.adm-table td[data-label]::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 8; color: var(--muted); font-size: .8rem; font-weight: 600; }
  table.adm-table td[data-label] > * { grid-column: 2; min-width: 0; max-width: 100%; }
  table.adm-table td[data-label] > * + * { margin-top: 3px; }
  table.adm-table .num, table.adm-table td.adm-actions { text-align: left; width: 100%; }
  table.adm-table td.adm-actions { margin-top: 10px; }
  table.adm-table td.adm-actions .btn { width: 100%; }
  .adm-meta-cell { white-space: normal; }
  .adm-svc-table td:first-child { min-width: 0; }
  .adm-facts > div { grid-template-columns: minmax(0, 1fr); }
  .adm-chain { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .adm-chain li { flex-direction: row; align-items: center; gap: 10px; padding: 6px 0; }
  .adm-chain-mark { width: 22px; height: 6px; flex: none; }
  .adm-verify-actions .btn { flex: 1 1 100%; }
  .adm-setting-form .btn { flex: 1 1 auto; }
  .adm-section-head { flex-wrap: wrap; }
}

/* GPU à la demande (pages/gpu-admin.tsx) */
.gx-gpu-grid { display: grid; gap: 12px 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .gx-gpu-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.gx-gpu-budget { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.gx-gpu-budget-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.gx-gpu-bar { height: 8px; border-radius: 999px; background: var(--track-2); overflow: hidden; }
.gx-gpu-bar-fill { height: 100%; background: var(--teal); border-radius: 999px; transition: width .3s; }
.gx-gpu-bar-fill.warn { background: var(--warn); }
.gx-cost { margin-left: 4px; font-size: .68rem; }
.gx-gpu-table td, .gx-gpu-table th { vertical-align: top; }
.gx-mach-form { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.gx-mach-field { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; min-width: 0; }
.gx-mach-field > span { color: var(--muted); }
.gx-mach-field input, .gx-mach-field select { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: var(--field-bg); min-height: 38px; width: 100%; font: inherit; color: var(--text); min-width: 0; }
.gx-mach-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-mach-actions .btn { white-space: normal; text-align: left; }
.gx-gpu-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.gx-gpu-events li { padding: 6px 10px; border-left: 3px solid var(--line-strong); background: var(--surface); border-radius: 6px; }
.gx-gpu-events li.warn { border-left-color: var(--warn); }
.gx-gpu-events li.critical { border-left-color: var(--danger); }

/* Calcul distribué — AGDE (pages/gpu-agde.tsx) */
.gx-agde-h3 { margin: 22px 0 8px; font-size: 1.05rem; }
.gx-agde-h4 { margin: 18px 0 8px; font-size: .95rem; }
.gx-agde-detail .adm-panel-head .gx-agde-h3 { margin: 0; }
.gx-agde-detail { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); min-width: 0; }
.gx-agde-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.gx-agde-measured { margin-top: 2px; }
.gx-agde-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); min-width: 0; }
.gx-agde-card { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; }
.gx-agde-card[data-state=disabled], .gx-agde-card[data-state=lost] { background: var(--danger-soft); }
.gx-agde-card[data-state=maintenance], .gx-agde-card[data-state=quarantine], .gx-agde-card[data-state=draining] { background: var(--warn-soft); }
.gx-agde-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
table.adm-table .gx-agde-card-head b { display: inline; }
.gx-agde-work { font-size: .84rem; font-weight: 600; color: var(--accent-text); overflow-wrap: anywhere; }
.gx-agde-card-state { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: .8rem; color: var(--muted); }
.gx-agde-card-state select, .gx-agde-lanes input { border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 6px; min-height: 30px; font: inherit; font-size: .84rem; background: var(--field-bg); color: var(--text); max-width: 100%; }
.gx-agde-lanes { display: flex; gap: 6px; align-items: center; }
.gx-agde-lanes input { width: 5.5em; }
.gx-agde-table td { overflow-wrap: anywhere; }
.gx-agde-progress { min-width: 90px; margin: 4px 0; }
.gx-agde-progress-cell { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
tr.gx-agde-selected td { background: var(--accent-soft); }
tr.gx-agde-rec td:first-child { box-shadow: inset 3px 0 0 var(--teal); padding-left: 12px; }
.gx-agde-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
.gx-agde-critical { margin-top: 4px; width: fit-content; }
.gx-agde-demo { margin-top: 16px; }
.gx-agde-fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 14px 0 0; min-width: 0; }
.gx-agde-fieldset legend { padding: 0 6px; font-weight: 600; font-size: .9rem; }
.gx-agde-counts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.gx-agde-check { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; min-height: 32px; touch-action: manipulation; }
.gx-agde-sim .adm-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.gx-agde-sim-out { margin-top: 14px; }
.gx-agde-notes { margin: 10px 0 0; padding-left: 1.2em; font-size: .88rem; line-height: 1.5; }
.gx-agde-assumptions { margin-top: 10px; font-size: .86rem; color: var(--muted); }
.gx-agde-assumptions summary { cursor: pointer; font-weight: 600; color: var(--text); }
.gx-agde-assumptions ul { margin: 6px 0 0; padding-left: 1.2em; line-height: 1.5; }
/* Gantt: one row per card; bars positioned in % of the project span */
.gx-agde-gantt-scroll { overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
.gx-agde-gantt { min-width: 560px; display: flex; flex-direction: column; gap: 6px; }
.gx-agde-gantt-axis, .gx-agde-gantt-row { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 10px; align-items: center; }
.gx-agde-gantt-scale { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--muted); }
.gx-agde-gantt-label { display: flex; flex-direction: column; min-width: 0; font-size: .84rem; line-height: 1.25; }
.gx-agde-gantt-machine { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-agde-gantt-track { position: relative; height: 30px; border-radius: 6px; background: repeating-linear-gradient(90deg, #eeeae4 0 1px, transparent 1px 10%), var(--surface); border: 1px solid var(--line); }
.gx-agde-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; overflow: hidden; display: flex; align-items: center; padding: 0 4px; color: #fff; font-size: .72rem; font-weight: 600; min-width: 4px; box-shadow: inset -1px 0 0 rgba(255, 255, 255, .6); }
.gx-agde-bar.ok { background: var(--teal); }
.gx-agde-bar.run { background: var(--accent); }
.gx-agde-bar.err { background: var(--danger); }
.gx-agde-bar.warn { background: var(--warn); }
.gx-agde-bar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-agde-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.gx-agde-key { display: inline-block; width: 12px; height: 10px; border-radius: 3px; margin-left: 8px; }
.gx-agde-key:first-child { margin-left: 0; }
.gx-agde-key.ok { background: var(--teal); } .gx-agde-key.run { background: var(--accent); } .gx-agde-key.err { background: var(--danger); } .gx-agde-key.warn { background: var(--warn); }
@media (max-width: 699px) {
  .gx-agde-detail { padding: 12px; }
  .gx-agde-gantt-axis, .gx-agde-gantt-row { grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr); }
  .gx-agde-lanes input { width: 100%; }
  .gx-agde-sim .adm-form-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .gx-agde .gx-gpu-bar-fill { transition: none; } }
/* three links in the console header (music, assistant, keys): they wrap on a phone instead of overflowing */
.page-head.adm-head > .page-head-actions { flex: 0 1 auto; min-width: 0; max-width: 100%; }

/* Référentiel GPU (#/admin/referentiel-gpu): the three-step path first, then the sections */
.gr-version { margin: 0 0 8px; }
.gr-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
.gr-step h2 { display: flex; align-items: center; gap: 10px; }
.gr-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent, #4f46e5); color: #fff; font-size: .9rem; flex: none; }
.gr-row, .gr-grid { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin: 8px 0; }
.gr-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.gr-field { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; min-width: 0; }
.gr-field > span:first-child { color: var(--muted, #6b7280); }
.gr-field input, .gr-field select, .gr-field textarea { width: 100%; min-width: 0; }
.gr-wide { grid-column: 1 / -1; }
.gr-fieldset { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 10px 14px; margin: 10px 0; min-width: 0; }
.gr-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.gr-check { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; }
.gr-key { margin: 6px 0 12px; }
.gr-gaps { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; font-size: .9rem; }
.gr-profiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 12px; }
.gr-profile { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 10px 14px; min-width: 0; }
.gr-profile.gr-rec { border-color: var(--accent, #4f46e5); }
.gr-profile h3 { font-size: .95rem; margin: 0 0 6px; }
.gr-preview { width: 100%; font-family: ui-monospace, monospace; font-size: .8rem; margin-top: 10px; }
.gr-tabs { margin-top: 8px; }
.gr-between { justify-content: space-between; align-items: end; flex-wrap: wrap; }
.gr-prov { color: var(--muted, #6b7280); font-size: .78rem; }
.gr table.adm-table td > .adm-small, .gr table.adm-table td > .adm-meta { display: block; }
.gr-cands { list-style: none; padding: 0; display: grid; gap: 8px; }
@media (max-width: 640px) { .gr-row { grid-template-columns: 1fr; } }
.gr-sm { font-size: .86rem; }
/* Référentiel GPU — every control of a row on the same line: the label takes the free height, the control sits at the
   bottom with one common height (text, number, date, list); a checkbox cell is aligned on the same line */
.gr-row, .gr-grid { align-items: stretch; }
.gr-field { justify-content: space-between; }
.gr-field > span:first-child { line-height: 1.3; }
.gr-field input:not([type=checkbox]), .gr-field select { height: 42px; min-height: 42px; box-sizing: border-box; }
.gr-field input[type=date], .gr-field input[type=datetime-local] { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: var(--field-bg); font: inherit; color: inherit; }
.gr-grid > .gr-check { align-self: end; min-height: 42px; }
.gr-between > .gr-grid { flex: 1 1 640px; min-width: 0; }

/* Commerce et croissance (Publicité produit lot 6) */
.adm-price { display: block; white-space: nowrap; }
.adm-price del { color: var(--muted); }
.adm-subpanel { margin: 12px 0; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.adm-gallery { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.adm-gallery-item { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr); gap: 12px 16px; align-items: start; padding-top: 12px; border-top: 1px solid var(--line); }
.adm-gallery-item:first-child { border-top: 0; padding-top: 0; }
.adm-gallery-item video, .adm-gallery-item img { width: 100%; max-height: 200px; object-fit: contain; background: #111; border-radius: 8px; }
.adm-gallery-body { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.adm-gallery-body p { margin: 0; }
@media (max-width: 560px) { .adm-gallery-item { grid-template-columns: minmax(0, 1fr); } }

/* GPU task errors (ANO-UX-008): readable sentence, advice, raw output folded */
.gx-gpu-error { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; max-width: 46ch; }
.gx-gpu-error-sum { font-size: .85rem; }
.gx-gpu-error-detail pre { max-height: 14em; overflow: auto; font-size: .75rem; white-space: pre-wrap; word-break: break-word; }
/* Centre de calcul (AUCE, #/admin/calcul): reuses the Référentiel GPU layout (.gr) */
.cc-kpis { margin: 4px 0 14px; }
.cc-list { margin: 0 0 4px; padding-left: 16px; }
.cc-limits { margin-top: 12px; padding-left: 18px; }
.cc table.adm-table td > .badge + .adm-meta { display: block; margin-top: 2px; }

/* Pages « assistant » — redesign section owned by one agent; appended after styles.css at build time.
   Creation wizard (pages/create.tsx: CreateNew, CreateWizard and its steps). Every selector is scoped to .wz.
   Continuation of the « Créer » hub: same viewfinder (the project's frame and target duration, in the slate), same
   progress track (here at full size, one segment per step). Panels are quiet; the accent marks the current step and
   the one main action of the step. Type scale 1.25: 13.5 / 15 / 18.75 / 23.4 / 36 px. */

.wz { --wz-gap: clamp(16px, 2.2vw, 24px); display: flex; flex-direction: column; }
.wz h3 { font-size: 1.05rem; letter-spacing: -.01em; margin: 0; }
.wz .wz-time { font-variant-numeric: tabular-nums; }
.wz .wz-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; min-width: 0; }
.wz .wz-note { margin: 0; }
.wz .wz-left { justify-content: flex-start; }
.wz .wz-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wz .wz-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; line-height: 1.4; }
.wz .wz-check input { flex: none; margin-top: 1px; }
.wz .wz-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.wz .actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------------------------------------------------------- header: back link + slate */
.wz-head { margin-bottom: var(--wz-gap); }
.wz-back { display: inline-block; margin-bottom: 10px; font-weight: 600; text-decoration: none; }
.wz-back:hover { text-decoration: underline; }
.wz-head > h1 { font-size: 2.4rem; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 10px; text-wrap: balance; }
.wz-lead { margin: 0; max-width: 62ch; font-size: 1rem; }
.wz-slate { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.wz-slate h1 { font-size: clamp(1.6rem, 1.2rem + 1.1vw, 2.15rem); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 8px; text-wrap: balance; overflow-wrap: anywhere; }
.wz-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wz-facts li { padding: 2px 9px; border-radius: 6px; background: var(--track); color: var(--ink-3); line-height: 1.35; }
.wz-editor { align-self: center; }

/* the hub's viewfinder, small, showing this project's real frame and target duration */
.wz-slate .viewfinder { width: 150px; height: 112px; padding: 14px; border-radius: 10px; }
.wz .viewfinder .vf-frame { height: 100%; width: auto; }
.wz .viewfinder.r16x9 .vf-frame { width: 100%; height: auto; }
.wz .viewfinder.r1x1 .vf-frame { aspect-ratio: 1 / 1; }
.wz .viewfinder.r4x5 .vf-frame { aspect-ratio: 4 / 5; }
.wz-slate .vf-clock { font-size: .76rem; top: 5px; right: 6px; }
.wz-slate .vf-ratio { display: none; }
.wz-slate .vf-frame::before, .wz-slate .vf-frame::after { width: 9px; height: 9px; }

/* ---------------------------------------------------------------- the seven-step rail */
.wz-steps { margin-bottom: var(--wz-gap); }
.wz-steps-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0 0 10px; }
.wz-steps-caption b { font-size: .95rem; }
.wz-rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wz .wstep { position: relative; width: 100%; min-height: 48px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 1px;
  padding: 12px 4px 4px; background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--muted); font: inherit; font-size: .86rem; text-align: left; touch-action: manipulation; }
.wz .wstep::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 3px; background: var(--line); }
.wz .wstep .n { width: auto; height: auto; background: none; border-radius: 0; color: inherit; font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; display: block; }
.wz .wstep .l { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; font-weight: 600; }
.wz .wstep.done { color: var(--text); }
.wz .wstep.done::before { background: var(--teal); }
.wz .wstep.done .n { color: var(--teal); background: none; }
.wz .wstep.current { color: var(--text); box-shadow: none; border: 0; }
.wz .wstep.current::before { background: var(--accent); }
.wz .wstep.current .n { color: var(--accent-text); background: none; }
.wz .wstep:not(:disabled) { cursor: pointer; }
.wz .wstep:not(:disabled):not(.current):hover::before { background: var(--line-strong); }
.wz .wstep.done:not(:disabled):hover::before { background: #0b6359; }
.wz .wstep:not(:disabled):hover .l { text-decoration: underline; text-underline-offset: 3px; }
.wz .wstep:focus-visible { box-shadow: var(--focus); border-radius: 6px; }

/* ---------------------------------------------------------------- step head and body */
.wz-step-head { margin-bottom: 16px; }
.wz-step-head h2 { font-size: 1.46rem; letter-spacing: -.02em; margin: 0 0 4px; text-wrap: balance; }
.wz-step-head p { margin: 0; max-width: 62ch; }
.wz-body { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.wz-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }

/* step navigation, at the end of the step's work (the rail above also moves between steps) */
.wz .wz-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.wz .wz-nav .btn { flex: none; touch-action: manipulation; }

/* ---------------------------------------------------------------- format */
.wz-format { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.wz-format-fields { display: flex; flex-direction: column; gap: 16px; }
.wz-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wz-fieldset legend { font-weight: 700; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.wz-types, .wz-presets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.wz .type-card { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; box-shadow: none; touch-action: manipulation; }
.wz .type-card:hover { border-color: var(--line-strong); }
.wz .wstep, .wz .type-card, .wz-chip, .wz .sb-thumb { -webkit-tap-highlight-color: rgba(185, 65, 15, .15); }
.wz .type-card.selected { border-color: var(--accent); background: var(--surface-selected); box-shadow: inset 0 0 0 1px var(--accent); }
.wz .type-card input { flex: none; margin-top: 4px; accent-color: var(--accent); }
.wz .type-card.off { cursor: not-allowed; background: var(--surface-sunk); }
.wz .type-card.off .wz-type-text, .wz .type-card.off .wz-ratio { opacity: .6; }
.wz-type-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.4; }
.wz-type-text b { font-size: .93rem; }
/* a frame glyph at the real ratio (the hub's viewfinder, in miniature) */
.wz-ratio { flex: none; width: 30px; height: 26px; display: grid; place-items: center; color: var(--muted); }
.wz-ratio::before { content: ""; box-sizing: border-box; border: 1.5px solid currentColor; border-radius: 2px; }
.wz-ratio.r9x16::before { width: 14px; height: 24px; }
.wz-ratio.r16x9::before { width: 28px; height: 16px; }
.wz-ratio.r1x1::before { width: 20px; height: 20px; }
.wz-ratio.r4x5::before { width: 18px; height: 22px; }
.wz .type-card.selected .wz-ratio { color: var(--accent-text); }

.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-chip, .wz-chip-off { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: .86rem; cursor: pointer; touch-action: manipulation; }
.wz-chip:hover { border-color: var(--muted); }
.wz-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: #6e2808; }
.wz-chip-off { opacity: .5; cursor: not-allowed; border-style: dashed; }
.wz-avatar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 4px; }
.wz-avatar .wz-check { font-size: .9rem; flex: 1 1 260px; }
.wz-avatar-state { display: inline-flex; align-items: center; gap: 8px; }
.wz-avatar > .wz-note { flex-basis: 100%; }

.wz-preview-slate { display: flex; flex-direction: column; gap: 14px; padding: 0; overflow: hidden; }
.wz-preview-slate .viewfinder { height: 210px; border-radius: 0; }
.wz .wz-preview-slate .viewfinder.r16x9 .vf-frame { width: min(100%, calc((210px - 44px) * 16 / 9)); }
.wz-slate-body { display: flex; flex-direction: column; gap: 4px; padding: 0 18px; }
.wz-slate-title { font-size: 1.1rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.wz-submit { margin: 4px 18px 18px; align-self: stretch; min-height: 44px; touch-action: manipulation; }

/* ---------------------------------------------------------------- idea */
.wz-modes { margin-bottom: 4px; }
.wz-import { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-import input[type=url] { flex: 1 1 220px; width: auto; min-width: 0; }
.wz-media { padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.wz-media p { margin: 0; }
.wz-plan h3 { margin-bottom: 4px; }
.wz .plan-list { list-style: none; padding: 0; margin: 0; counter-reset: plan; gap: 0; }
.wz .plan-list li { counter-increment: plan; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 8px; row-gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.wz .plan-list li::before { content: counter(plan); grid-row: span 2; color: var(--accent-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.wz .plan-list li > * { grid-column: 2; }
.wz-plan-line { display: flex; justify-content: space-between; gap: 10px; }
.wz-plan-line .wz-time { color: var(--muted); font-size: .85rem; flex: none; }

/* ---------------------------------------------------------------- scenario */
.wz-budget { display: flex; flex-direction: column; gap: 10px; }
.wz-budget p { margin: 0; }
.wz-budget-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.wz-budget-fig b { font-size: 1.46rem; letter-spacing: -.02em; }
.wz-budget-count { display: flex; gap: 14px; }
.wz-meter { display: block; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.wz-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.wz-meter.over > span { background: var(--warn); }
.wz-scenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wz .wz-scene { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; }
.wz-scene-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wz-scene-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wz .wz-scene-title { flex: 1 1 200px; width: auto; min-width: 0; font-weight: 700; }
.wz-scene-top select { width: auto; max-width: 100%; }
.wz-scene-tools { display: inline-flex; gap: 2px; }
.wz .wz-del { color: var(--danger); }
.wz-scene-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.wz-inline { display: inline-flex; align-items: center; gap: 6px; }
.wz-inline input { width: 76px; min-height: 32px; padding: 4px 8px; }
.wz-add { justify-content: flex-start; }

/* ---------------------------------------------------------------- storyboard */
.wz-status { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: 10px; font-size: .9rem; }
.wz-status.warn { background: var(--warn-soft); color: var(--warn-text); }
.wz-status.ok { background: var(--teal-soft); color: var(--ok-text); }
.wz .wz-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.wz .wz-shot { padding: 12px; gap: 8px; }
.wz .sb-thumb { border-radius: 8px; background: var(--thumb-bg-2); color: var(--muted); touch-action: manipulation; }
.wz .sb-thumb.has { border: 1px solid var(--line); }
.wz .sb-thumb:hover { border-color: var(--accent); color: var(--accent-text); }
.wz-pick { display: inline-flex; align-items: center; gap: 6px; padding: 8px; font-weight: 600; text-align: center; }
.wz .wz-shot .name { display: flex; align-items: center; gap: 8px; white-space: normal; font-size: .93rem; }
.wz-shot-n { flex: none; display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 6px; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wz-shot-script { margin: 0; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.wz-shot-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* ---------------------------------------------------------------- voice: microphone first, then the local voice */
.wz-voice-ways { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.wz-way { display: flex; flex-direction: column; gap: 10px; align-self: start; }
.wz-way p { margin: 0; line-height: 1.5; }
.wz-way h3 { display: flex; align-items: center; gap: 8px; }
.wz-premium { grid-column: 1 / -1; }
.wz-premium audio { width: 100%; max-width: 360px; height: 36px; }
.wz-premium-quote p { margin: 0 0 8px; }
/* voice engine choice (ElevenLabs / Voicebox): two radio options shaped as a segmented control */
.wz-engine { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 12px; }
.wz-engine legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.wz-engine-opt { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; font-size: .92rem; }
.wz-engine-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.wz-engine-opt input { accent-color: var(--accent); margin: 0; }
.wz-engine-opt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.wz-library { border-top: 1px solid var(--line, #e5e1d8); padding-top: 10px; }
.wz-library > summary { cursor: pointer; font-weight: 600; }
.wz-library-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 10px 0; }
.wz-library-form .field { flex: 1 1 200px; margin: 0; }
.wz-library-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.wz-library-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--line, #e5e1d8); }
.wz-library-list p { margin: 2px 0 0; }
@media (max-width: 640px) { .wz-library-list li { grid-template-columns: minmax(0, 1fr); } }
.wz-way-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.wz-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.wz-progress-line { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: .92rem; }
.wz-progress-line b { font-size: 1.05rem; }
.wz-voice-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.wz-voice-list > li + li { border-top: 1px solid var(--line); }
.wz .wz-voice { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px 14px; align-items: start; padding: 14px 18px; }
.wz-voice-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wz-voice-script { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.wz-voice-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.wz-voice-main audio { display: block; width: 100%; max-width: 380px; height: 36px; }
.wz-voice-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 440px; }
.wz .wz-rec { gap: 7px; }
.wz .wz-rec:disabled .wz-dot { background: var(--line-strong); }

/* ---------------------------------------------------------------- montage: settings + the dark screen */
.wz-settings { gap: 22px; }
.wz-settings > section { gap: 10px; }
.wz-settings p { margin: 0; }
.wz-music { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wz-music-name { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.wz-warnings { margin: 0; padding-left: 18px; }
.wz-screen { background: var(--ink); color: #f3efe9; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wz-screen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wz-screen h3 { color: #fff; }
.wz-screen-dur { font-weight: 700; color: #fff; background: var(--ink-3); border-radius: 6px; padding: 2px 8px; font-size: .9rem; }
.wz-screen .stage-wrap { min-height: 220px; border-radius: 10px; }
.wz-player { gap: 10px; }
.wz-player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.wz-player-bar .small { color: #b9b5ae; flex: 1 1 220px; line-height: 1.45; }
.wz-screen-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0 18px; }
.wz-screen-empty .viewfinder { background: transparent; height: 180px; width: 100%; padding: 12px; }
.wz-screen-empty p { margin: 0; color: #b9b5ae; }

/* ---------------------------------------------------------------- export */
.wz-row-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.wz-exports { gap: 10px; }
.wz-empty-line { margin: 0; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.wz-export-item { display: flex; flex-direction: column; gap: 6px; }
.wz-export-top { display: flex; align-items: center; gap: 10px; }
.wz-export-top b { overflow-wrap: anywhere; }
.wz-export-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.wz-package { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- layouts */
@media (min-width: 700px) {
  .wz-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wz-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wz-voice-ways { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
}
@media (min-width: 1000px) {
  .wz-format { grid-template-columns: minmax(0, 1fr) 300px; }
  .wz-preview-slate { position: sticky; top: 20px; }
  .wz-split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .wz-montage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .wz-montage .wz-screen { position: sticky; top: 20px; }
  .wz-export { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
@media (min-width: 700px) and (max-width: 999px) {
  .wz-preview-slate { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 0 18px; }
  .wz-preview-slate .viewfinder { grid-row: 1 / span 2; height: 100%; min-height: 180px; }
  .wz-slate-body { padding: 18px 18px 0 0; }
  .wz-submit { margin: 14px 18px 18px 0; justify-self: start; align-self: end; }
}
@media (max-width: 899px) {
  .wz .wstep .l { display: block; }
  .wz .wstep { padding-inline: 2px; }
}
@media (max-width: 699px) {
  .wz-head > h1 { font-size: 1.85rem; }
  .wz-slate { grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: start; }
  .wz-slate .viewfinder { width: 84px; height: 84px; padding: 10px; }
  .wz-slate .vf-clock { font-size: .66rem; top: 3px; right: 4px; }
  .wz-slate h1 { font-size: 1.45rem; }
  .wz-editor { grid-column: 1 / -1; justify-self: stretch; }
  .wz .wstep { align-items: center; padding: 12px 0 2px; }
  .wz .wstep .l { display: none; }
  .wz .wstep .n { font-size: .85rem; }
  .wz-step-head h2 { font-size: 1.3rem; }
  .wz .wz-panel { padding: 14px; }
  .wz .wz-pair { grid-template-columns: minmax(0, 1fr); }
  .wz .wz-scene { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .wz .wz-scene .num { width: 26px; height: 26px; }
  .wz-scene-top select { flex: 1 1 100%; }
  .wz .wz-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wz .wz-shot { padding: 8px; }
  .wz .wz-voice { grid-template-columns: 24px minmax(0, 1fr); padding: 12px 14px; }
  .wz-voice-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .wz .wz-nav .btn { flex: 1 1 0; white-space: normal; text-align: center; line-height: 1.25; }
  .wz-preview-slate .viewfinder { height: 150px; }
  .wz .wz-preview-slate .viewfinder.r16x9 .vf-frame { width: min(100%, calc((150px - 44px) * 16 / 9)); }
}
@media (prefers-reduced-motion: reduce) { .wz * { transition: none !important; } }

/* =====================================================================================================
   « Mes avatars » (pages/avatars.tsx) — every selector is scoped .av / .av-*. Hierarchy: the filming studio
   (free path, main action) → the user's avatars → the paid engine with its real state and the consent rule.
   Dialogs render outside .av: their classes are av-* prefixed instead.
   ===================================================================================================== */
.av { --av-gap: clamp(16px, 2.4vw, 28px); }
.av-head { margin-bottom: var(--av-gap); }


/* ---------- filming studio (dark panel, the page's one memorable element: the framing guide) */
.av-studio { background: var(--ink); color: #f3efe9; border-radius: 18px; padding: clamp(20px, 3vw, 36px); display: grid; gap: clamp(20px, 3vw, 40px); grid-template-columns: minmax(0, 1fr); margin-bottom: var(--av-gap); }
.av-studio h2 { color: #fff; font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); letter-spacing: -.02em; margin: 0 0 8px; text-wrap: balance; }
.av-studio-lead { margin: 0; color: #d6d2cb; max-width: 54ch; font-size: .98rem; line-height: 1.55; }
.av-tips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; color: #f3efe9; font-size: .88rem; }
.av-tips li { display: inline-flex; align-items: center; gap: 8px; }
.av-tips li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f08a4b; flex: none; }
.av-studio-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 22px 0 16px; }
.av-rec { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 24px 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 1rem; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: rgba(185, 65, 15, .25); transition: background-color .15s; }
.av-rec:hover { background: var(--accent-hover); }
.av-rec:active { background: #84300a; }
.av-rec:focus-visible, .av-studio .av-ghost:focus-visible { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #f6c3a5; border-radius: 999px; }
.av-studio .av-ghost { background: transparent; color: #f3efe9; border-color: rgba(243, 239, 233, .4); min-height: 44px; border-radius: 999px; padding: 0 18px; touch-action: manipulation; white-space: normal; text-align: center; }
.av-studio .av-ghost:hover { border-color: #f3efe9; }
.av-studio-note { margin: 6px 0 0; color: #a9a59e; font-size: .86rem; line-height: 1.5; max-width: 62ch; }

/* framing guide: a 16:9 shot, head-and-shoulders outline, eye line on the upper third, then the length ruler */
.av-frame { margin: 0; align-self: center; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.av-frame-shot { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; background: radial-gradient(ellipse at 50% 45%, #262a34 0, #191c23 70%); border: 1px solid rgba(243, 239, 233, .16); overflow: hidden; }
.av-guide-head { position: absolute; left: 50%; top: 13%; width: 22%; aspect-ratio: 4 / 5; transform: translateX(-50%); border: 1.5px dashed rgba(243, 239, 233, .55); border-radius: 50% 50% 46% 46%; }
.av-guide-shoulders { position: absolute; left: 50%; bottom: -12%; width: 60%; height: 36%; transform: translateX(-50%); border: 1.5px dashed rgba(243, 239, 233, .55); border-bottom: 0; border-radius: 50% 50% 0 0 / 70% 70% 0 0; }
.av-eyeline { position: absolute; left: 0; right: 0; top: 33.3%; border-top: 1px solid #f08a4b; }
.av-eyeline span { position: absolute; right: 10px; top: -22px; color: #f6c3a5; font-size: .74rem; letter-spacing: .01em; }
.av-ruler { position: relative; display: block; padding-bottom: 34px; }
.av-ruler-track { position: relative; display: block; height: 6px; border-radius: 999px; background: rgba(243, 239, 233, .16); }
.av-ruler-track i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; }
.av-ruler-track i.min { background: var(--accent); }
.av-ruler-track i.ideal { background: #4fb3a6; border-radius: 0 999px 999px 0; }
.av-ruler-mark { position: absolute; top: 12px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; color: #a9a59e; font-size: .74rem; line-height: 1.25; white-space: nowrap; }
.av-ruler-mark::before { content: ""; position: absolute; top: -12px; width: 1px; height: 8px; background: rgba(243, 239, 233, .5); }
.av-ruler-mark b { color: #f3efe9; font-variant-numeric: tabular-nums; font-size: .82rem; }
.av-ruler-mark.end { transform: translateX(-100%); align-items: flex-end; }
.av-ruler-mark.end::before { right: 0; }

/* ---------- two columns: avatars, engine */
.av-layout { display: grid; gap: var(--av-gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
.av-layout > * { min-width: 0; }
.av-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.av-section-head h2, .av-engine h2, .av-consent h2 { font-size: var(--fs-h2); margin: 0; }
.av-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.av-intro { margin: 0 0 10px; color: var(--muted); font-size: .88rem; line-height: 1.5; max-width: 62ch; }

.av-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.av-list li + li { border-top: 1px solid var(--line); }
.av-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 16px; color: inherit; text-decoration: none; touch-action: manipulation; }
.av-row:hover { background: var(--surface-2); }
.av-row:hover b { color: var(--accent-text); }
.av-row:focus-visible { border-radius: 12px; }
.av-list li:first-child .av-row { border-radius: 12px 12px 0 0; }
.av-list li:last-child .av-row { border-radius: 0 0 12px 12px; }
.av-list li:only-child .av-row { border-radius: 12px; }
.av-thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--thumb-bg); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.av-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.av-row-text b { overflow-wrap: anywhere; }
.av-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: .84rem; }
.av-row-state { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.av-row-state .badge { white-space: nowrap; }
.av-row.archived .av-thumb { opacity: .55; }
.av-row.archived b { color: var(--muted); }

.av-engine, .av-side { display: flex; flex-direction: column; gap: 12px; }
.av-engine .av-intro { margin: 0; }
.av-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.av-engine-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.av-why { margin: 0; padding: 10px 12px; background: var(--surface-sunk); border-radius: 8px; font-size: .86rem; line-height: 1.5; }
.av-offers { list-style: none; margin: 0; padding: 0; }
.av-offers li { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 12px 0; border-top: 1px dashed var(--line); }
.av-offers li:last-child { padding-bottom: 4px; }
.av-offers b { font-size: .9rem; }
.av-offers p, .av-cost { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.av-offers .btn { margin-top: 6px; white-space: normal; text-align: left; }
.av-cost { padding-top: 10px; border-top: 1px solid var(--line); }
.av-consent-rule { padding: 2px 0 2px 14px; border-left: 3px solid var(--teal); }
.av-consent-rule h3, .av-consent h2 { display: flex; align-items: center; gap: 8px; }
.av-consent-rule h3 { font-size: .92rem; margin: 0 0 4px; }
.av-consent-rule h3 svg, .av-consent h2 svg { color: var(--teal); flex: none; }
.av-consent-rule p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.5; max-width: 62ch; }
.av-link { font-weight: 600; font-size: .88rem; align-self: flex-start; }

/* ---------- detail */
.av-back { display: inline-block; margin-bottom: 8px; }
.av-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); }
.av-desc { margin-top: 6px !important; }
.av-head-actions .btn { white-space: normal; }
.av-pending { margin-bottom: 14px; }
.av-pending a { font-weight: 600; }
.av-main { display: flex; flex-direction: column; gap: var(--av-gap); min-width: 0; }
table.av-table { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.av-table th, table.av-table td { padding: 10px 14px; }
table.av-table tbody tr:last-child td { border-bottom: 0; }
.av-v { white-space: nowrap; }
.av-v .badge { margin-left: 8px; }
.av-ref { overflow-wrap: anywhere; margin-top: 2px; }
.av-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.av-error { color: var(--danger); margin-top: 4px; overflow-wrap: anywhere; }
.av-caps { margin: 8px 0 0; }
.av-usage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.av-usage h3 { font-size: .95rem; }
.av-projects { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
table.av-gen td { padding: 6px 8px 6px 0; }
.av-consent { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 12px; }
.av-consent figure { margin: 0; }
.av-consent blockquote { margin: 0; font-size: 1.05rem; line-height: 1.55; text-wrap: pretty; overflow-wrap: anywhere; }
.av-consent figcaption { margin-top: 8px; color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.av-consent p { margin: 0; }
.av-consent-wait { color: var(--warn); }
.av-id { overflow-wrap: anywhere; }
.av-id code { display: block; margin-top: 2px; font-size: .8rem; }

/* ---------- dialogs */
.av-consent-fields { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 4px 0 0; display: flex; flex-direction: column; gap: 10px; }
.av-consent-fields legend { font-weight: 700; font-size: .88rem; padding: 0 6px; }
.av-agree { align-items: flex-start; flex-wrap: nowrap; }
.av-agree input { flex: none; margin-top: 2px; }
.av-pick-thumb { width: 120px; }
table.av-catalog td { vertical-align: middle; }
.av-catalog-act { text-align: right; width: 1%; white-space: nowrap; }

@media (min-width: 760px) {
  .av-studio { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .av-usage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1099px) { .av-detail .av-side { order: -1; } }
@media (min-width: 700px) and (max-width: 1099px) {
  .av-offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 20px; }
  .av-offers li:last-child { padding-bottom: 12px; }
  .av-offers .btn { margin-top: auto; }
}
@media (min-width: 1100px) {
  .av-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* phone: stacked rows, the table keeps its semantics */
@media (max-width: 640px) {
  .av-studio-actions > * { flex: 1 1 100%; justify-content: center; }
  .av-row { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .av-thumb { width: 72px; }
  .av-row-state { grid-column: 2; justify-content: flex-start; }
  .av-head-actions { width: 100%; }
  .av-head-actions .btn { flex: 1 1 auto; }
  table.av-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.av-table, table.av-table tbody, table.av-table tr, table.av-table td { display: block; width: 100%; }
  table.av-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.av-table tbody tr:last-child { border-bottom: 0; }
  table.av-table td { padding: 0; border: 0; }
  table.av-table td + td { margin-top: 6px; }
  .av-catalog-act { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .av-rec { transition: none; } }

/* =====================================================================================================
   Pages « bibliotheque » — Mes projets, Modèles (pages/projects.tsx), Médiathèque (pages/media.tsx).
   Every selector is scoped .bib / .bib-* (and .bib-new for the new-project dialog). Appended after styles.css.
   Memorable element: the small dark frames drawn at each project's real format, with the hub's amber crop marks.
   ===================================================================================================== */
.bib { --bib-gap: clamp(16px, 2.4vw, 28px); }
.bib-head { margin-bottom: var(--bib-gap); }
.bib-head > div { flex: 1 1 420px; min-width: 0; }
.bib-section + .bib-section { margin-top: calc(var(--bib-gap) * 1.4); }
.bib-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.bib-section-head h2 { font-size: var(--fs-h2); margin: 0; }
.bib-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.bib-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.bib-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

/* ---------- format frame (projects, templates, new-project dialog) */
.bib-slot { display: grid; place-items: center; width: 112px; height: 72px; background: var(--ink); border-radius: 10px; flex: none; }
.bib-frame { position: relative; display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, .42); border-radius: 2px; overflow: hidden; height: 52px; }
.bib-frame.r16x9 { height: auto; width: 88px; aspect-ratio: 16 / 9; }
.bib-frame.r9x16 { aspect-ratio: 9 / 16; }
.bib-frame.r1x1 { aspect-ratio: 1; }
.bib-frame.r4x5 { aspect-ratio: 4 / 5; }
.bib-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bib-frame-ratio { color: #c9cbd2; font-size: .72rem; font-variant-numeric: tabular-nums; }
.bib-frame.r9x16 .bib-frame-ratio, .bib-frame.r4x5 .bib-frame-ratio { font-size: .6rem; }
/* crop marks in the brand amber, as on the « Créer » viewfinders */
.bib-slot { position: relative; }
.bib-slot::before, .bib-slot::after { content: ""; position: absolute; width: 8px; height: 8px; border: 1.5px solid #f08a4b; opacity: 0; transition: opacity .15s; }
.bib-slot::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.bib-slot::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.bib-row:hover .bib-slot::before, .bib-row:hover .bib-slot::after, .bib-row:focus-within .bib-slot::before, .bib-row:focus-within .bib-slot::after { opacity: 1; }

/* ---------- rows (projects, own templates, built-in templates) */
.bib-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.bib-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto auto; grid-template-areas: "frame main state actions"; align-items: center; gap: 8px 18px; padding: 12px 16px 12px 12px; }
.bib-row + .bib-row { border-top: 1px solid var(--line); }
.bib-row { transition: background-color var(--t-fast); }
.bib-row:hover { background: var(--surface-2); }
.bib-list > .bib-row:first-child { border-radius: 12px 12px 0 0; }
.bib-list > .bib-row:last-child { border-radius: 0 0 12px 12px; }
.bib-list > .bib-row:only-child { border-radius: 12px; }
.bib-row-frame { grid-area: frame; display: block; border-radius: 10px; text-decoration: none; }
.bib-row-main { grid-area: main; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bib-row-series { color: var(--muted); font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: -2px; }
.bib-row-title { font-weight: 700; font-size: 1rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; margin: 0; letter-spacing: -.005em; }
a.bib-row-title:hover { color: var(--accent-text); text-decoration: underline; }
.bib-row-state { grid-area: state; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.bib-row-state .badge { white-space: nowrap; }
.bib-resume { font-size: .84rem; font-weight: 600; }
.bib-row-actions { grid-area: actions; display: flex; gap: 8px; justify-content: flex-end; }
.bib-row-actions .btn { touch-action: manipulation; }

/* ---------- find: search + format chips */
.bib-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.bib-search { flex: 1 1 260px; max-width: 420px; }
.bib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bib-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: .84rem; cursor: pointer; font-variant-numeric: tabular-nums; touch-action: manipulation; }
.bib-chip:hover { border-color: var(--muted); }
.bib-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.bib-chip-n { color: var(--muted); font-weight: 600; }
.bib-chip[aria-pressed="true"] .bib-chip-n { color: #c9cbd2; }
.bib-tools .bib-count { margin-left: auto; }

/* ---------- templates: numbered scene strip (a real sequence) */
.bib-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 6px; font-size: .86rem; color: var(--muted); }
.bib-note { gap: 6px 22px; }
.bib-key-item { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.bib-key { width: 14px; height: 4px; border-radius: 2px; background: var(--teal); flex: none; }
.bib-key.avatar { background: #5b4b8a; }
.bib-fallback { margin: 0 0 12px; max-width: 70ch; }
.bib-tpl { align-items: start; padding-top: 16px; padding-bottom: 16px; grid-template-columns: 112px minmax(0, 1fr) auto; grid-template-areas: "frame main actions"; }
.bib-tpl .bib-row-actions { align-self: center; }
.bib-tpl-desc { color: var(--muted); font-size: .9rem; line-height: 1.5; max-width: 70ch; }
.bib-structure { list-style: none; counter-reset: sc; margin: 8px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bib-structure li { counter-increment: sc; flex: 1 1 120px; max-width: 220px; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 7px 10px 8px; background: var(--surface-sunk); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: 6px; font-size: .82rem; }
.bib-structure li.avatar { border-top-color: #5b4b8a; }
.bib-structure b { font-weight: 600; overflow-wrap: anywhere; }
.bib-structure b::before { content: counter(sc) ". "; color: var(--muted); font-variant-numeric: tabular-nums; }
.bib-structure span { color: var(--muted); font-size: .76rem; }

/* ---------- new-project dialog: formats drawn at their ratio */
.bib-formats { border: 0; padding: 0; margin: 0; min-width: 0; }
.bib-formats legend { font-weight: 600; font-size: .86rem; margin-bottom: 6px; padding: 0; }
.bib-format-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bib-format { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; text-align: center; position: relative; touch-action: manipulation; }
.bib-format:hover { border-color: var(--muted); }
.bib-format:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.bib-format input { position: absolute; top: 8px; left: 8px; margin: 0; accent-color: var(--accent); }
.bib-format-shape { display: grid; place-items: center; width: 100%; height: 64px; }
.bib-format .bib-frame { border-color: var(--ink-3); background: var(--thumb-bg-2); height: 56px; }
.bib-format .bib-frame.r16x9 { height: auto; width: min(92px, 100%); }
.bib-format:has(input:checked) .bib-frame { border-color: var(--accent); background: var(--accent-soft); }
.bib-format-text { display: flex; flex-direction: column; gap: 1px; font-size: .86rem; }

/* ---------- médiathèque: import panel */
.bib-import { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px 28px; margin-bottom: 14px; }
.bib-import-drop .dropzone { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 22px; font-size: 1rem; color: var(--text); background: #fcfbf9; touch-action: manipulation; }
.bib-import-drop .dropzone svg { width: 26px; height: 26px; color: var(--accent-text); }
.bib-import-drop .dropzone .small { color: var(--muted); }
.bib-import-drop .dropzone:hover { border-color: var(--accent); }
.bib-import-drop > div { height: 100%; display: flex; flex-direction: column; }
.bib-import-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bib-url-row { display: flex; gap: 8px; }
.bib-url-row input { flex: 1; min-width: 0; }
.bib-import .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
/* free stock banks (shared StockSearch): quiet, part of the import flow */
.bib-stock { margin-bottom: var(--bib-gap); }
.bib-stock .card { margin-top: 0; box-shadow: none; border-radius: 12px; padding: 14px 20px; }
.bib-stock .card h3 { font-size: .95rem; margin-bottom: 4px; }
.bib-stock .card > p.small { margin: 6px 0 0; }

/* ---------- médiathèque: contact sheet */
.bib-lib-head { justify-content: space-between; }
.bib-sheet { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.bib-media .bib-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 10px; gap: 4px; min-width: 0; box-shadow: none; }
.bib-tile-view { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; margin-bottom: 4px; touch-action: manipulation; }
.bib-tile-view .thumb { width: 100%; }
.bib-tile-view:hover .thumb { filter: brightness(.94); }
.bib-tc { position: absolute; right: 6px; bottom: 6px; padding: 2px 7px; border-radius: 5px; background: rgba(21, 23, 29, .82); color: #fff; font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bib-play { position: absolute; left: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(21, 23, 29, .82); color: #fff; }
.bib-play svg { width: 12px; height: 12px; fill: currentColor; }
.bib-tile .name { padding: 0 4px; font-size: .9rem; }
.bib-tile .bib-meta { padding: 0 4px; font-size: .8rem; }
.bib-rights { display: block; padding: 0 4px; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bib-rights.todo { color: var(--warn); }
.bib-del { align-self: flex-start; margin-top: auto; color: var(--danger); padding-inline: 6px; }
.bib-del:hover { background: var(--danger-soft); }

/* preview dialog */
.bib-preview { display: grid; place-items: center; background: #0d0e12; border-radius: 10px; overflow: hidden; }
.bib-preview img, .bib-preview video { display: block; max-width: 100%; max-height: 62vh; object-fit: contain; }
.bib-preview img { width: auto; height: auto; }
.bib-preview video { width: 100%; height: auto; }
.bib-preview audio { width: calc(100% - 32px); margin: 28px 16px; }
.bib-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; margin: 14px 0 0; }
.bib-facts div { min-width: 0; }
.bib-facts dt { color: var(--muted); font-size: .8rem; }
.bib-facts dd { margin: 2px 0 0; font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }

/* ---------- responsive */
@media (max-width: 1099px) {
  .bib-row { grid-template-columns: 112px minmax(0, 1fr) auto; grid-template-areas: "frame main state" "frame main actions"; }
  .bib-tpl { grid-template-areas: "frame main actions"; }
}
@media (max-width: 860px) {
  .bib-tpl { grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "frame main" "frame actions"; }
  .bib-tpl .bib-row-actions { justify-content: flex-start; }
  .bib-import { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  .bib-slot { width: 76px; height: 60px; }
  .bib-slot .bib-frame { height: 44px; }
  .bib-slot .bib-frame.r16x9 { height: auto; width: 62px; }
  .bib-row, .bib-tpl { grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "frame main" "state state" "actions actions"; gap: 10px 12px; padding: 12px; }
  .bib-tpl { grid-template-areas: "frame main" "actions actions"; }
  .bib-row-state { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; text-align: left; }
  .bib-row-state:empty { display: none; }
  .bib-row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .bib-tpl .bib-row-actions .btn { flex: 1; }
  .bib-structure li { flex-basis: calc(50% - 3px); max-width: none; }
  .bib-tools .bib-count { margin-left: 0; }
  .bib-search { max-width: none; flex-basis: 100%; }
  .bib-format-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bib-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bib-media .bib-tile { padding: 6px 6px 8px; }
  .bib-url-row { flex-wrap: wrap; }
  .bib-url-row input { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .bib-slot::before, .bib-slot::after { transition: none; } }

/* Acteurs IA (pages/casting.tsx) — appended after styles.css at build time. Every selector is scoped to .ac.
   Bold element: the reference pack, a grid of nine framed slots that fills up with the official portraits.
   Everything else stays quiet (white panels, 1 px lines, accent on the one main action). Reuses the cinema layout
   primitives (.cn-story-head, .cn-panel, .cn-pair, .cn-scene-grid, .cn-gen) for one consistent production look. */

.ac { --cn-gap: clamp(14px, 2vw, 22px); min-width: 0; display: flex; flex-direction: column; gap: var(--cn-gap); }
.ac > * { min-width: 0; }
.ac h2 { font-size: var(--fs-h2); letter-spacing: -.012em; margin: 0; }
.ac h3 { font-size: 1rem; margin: 0; }
.ac .cn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ac .cn-panel { padding: 18px 20px; }
.ac .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ac .hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.ac-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .78em; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-right: 4px; }
.ac-form .ac-methods { display: block; line-height: 1.45; padding-top: 6px; }
.ac-details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }
.ac-details summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.ac-details > div { margin-top: 10px; }

/* ------------------------------------------------------------------ portraits */
.ac-portrait { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: var(--ink); overflow: hidden; flex: none; }
.ac-portrait.lg { width: 118px; height: 118px; border-radius: 16px; }
.ac-portrait .thumb, .ac-portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.ac-initial { color: #fff; font-weight: 700; font-size: 1.5rem; }
.ac-portrait.lg .ac-initial { font-size: 2.4rem; }

/* ------------------------------------------------------------------ list */
.ac-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ac-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.ac-row:first-child { border-top: 0; }
.ac-row-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ac-row-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.ac-row-title:hover { text-decoration: underline; }
.ac-desc { max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ detail */
.ac-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: var(--cn-gap); align-items: start; }
.ac-pack { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.ac-slot { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ac-slot-img { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; background: var(--paper); border: 1.5px dashed var(--line); display: grid; place-items: center; overflow: hidden; }
.ac-slot.on .ac-slot-img { border: 1.5px solid var(--ink); }
.ac-slot-img .thumb, .ac-slot-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.ac-slot-empty { color: var(--muted); display: grid; place-items: center; text-align: center; padding: 6px; }
.ac-slot-label { color: var(--muted); text-align: center; }
.ac-slot-actions { display: flex; gap: 4px; }
.ac-gen { border-top: 1px solid var(--line); padding-top: 14px; gap: 12px; }
.ac-proposals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ac-proposal { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.ac-proposal.official .ac-slot-img { border: 2px solid var(--accent); }
.ac-proposal .err { color: var(--danger, #b42318); }
.ac-roles, .ac-versions { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.ac-versions li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (max-width: 900px) {
  .ac-grid { grid-template-columns: minmax(0, 1fr); }
  .ac .cn-pair { grid-template-columns: minmax(0, 1fr); }
  .ac-row { grid-template-columns: auto minmax(0, 1fr); }
  .ac-row .cn-row-state { grid-column: 2; }
}

/* Pages « cinéma » (Films et séries) — appended after styles.css at build time. Every selector is scoped to .cn.
   Bold element: the clapper slate (frame at the real ratio, target duration, format) and, in a part, the strip of
   shots of each scene. Everything else stays quiet: white panels, 1 px lines, accent on the one main action.
   Type scale 1.25: 13.5 / 15 / 18.75 / 23.4 / 36 px. */

.cn { --cn-gap: clamp(14px, 2vw, 22px); min-width: 0; display: flex; flex-direction: column; gap: var(--cn-gap); }
.cn > * { min-width: 0; }
.cn h2 { font-size: var(--fs-h2); letter-spacing: -.012em; margin: 0; }
.cn h3 { font-size: 1rem; margin: 0; }
.cn .cn-num { font-variant-numeric: tabular-nums; }
.cn .cn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cn .cn-panel { padding: 18px 20px; }
.cn .cn-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; line-height: 1.4; }
.cn .cn-check input { flex: none; margin-top: 1px; }
.cn .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cn .hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.cn-back { align-self: flex-start; font-size: .88rem; font-weight: 600; text-decoration: none; }
.cn-back:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ slate */
.cn-slate { flex: none; display: grid; place-items: center; gap: 4px; width: 118px; height: 96px; background: var(--ink); border-radius: 12px; text-decoration: none; }
.cn-slate-frame { position: relative; display: grid; place-items: center; height: 44px; aspect-ratio: 16 / 9; border: 1.5px solid rgba(255, 255, 255, .42); border-radius: 3px; }
.cn-slate.r9x16 .cn-slate-frame { height: 54px; aspect-ratio: 9 / 16; }
.cn-slate.r1x1 .cn-slate-frame { height: 48px; aspect-ratio: 1; }
.cn-slate.r4x5 .cn-slate-frame { height: 52px; aspect-ratio: 4 / 5; }
.cn-slate-frame::before, .cn-slate-frame::after { content: ""; position: absolute; width: 8px; height: 8px; border: 2px solid #f08a4b; }
.cn-slate-frame::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.cn-slate-frame::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.cn-slate-clock { color: #fff; font-size: .72rem; font-variant-numeric: tabular-nums; }
.cn-slate.r9x16 .cn-slate-clock, .cn-slate.r4x5 .cn-slate-clock { font-size: .62rem; }
.cn-slate-fmt { color: #c9cbd2; font-size: .66rem; letter-spacing: .02em; }

/* ------------------------------------------------------------------ list */

.cn-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.cn-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cn-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.cn-row:first-child { border-top: 0; }
.cn-row-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cn-row-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.cn-row-title:hover { text-decoration: underline; }
.cn-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .85rem; color: var(--muted); }
.cn-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cn-progress-bar { width: 120px; height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; flex: none; }
.cn-progress-bar > span { display: block; height: 100%; background: var(--teal); }

/* ------------------------------------------------------------------ story page */
.cn-story-head { display: flex; flex-direction: column; gap: 12px; }
.cn-story-main { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cn-story-text { min-width: 0; flex: 1 1 320px; }
.cn-story-text h1 { font-size: clamp(1.6rem, 1.25rem + 1.1vw, 2.2rem); line-height: 1.12; letter-spacing: -.028em; margin: 0 0 8px; text-wrap: balance; overflow-wrap: anywhere; }
.cn-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: .88rem; }
.cn-facts > div { display: flex; align-items: baseline; gap: 6px; }
.cn-facts dt { color: var(--muted); }
.cn-facts dd { margin: 0; font-weight: 600; }
.cn-story-actions { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.cn-tabs { margin-bottom: 0; }
.cn-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: var(--cn-gap); align-items: start; }
.cn-side { gap: var(--cn-gap); }
.cn-screenplay { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86rem; line-height: 1.5; min-height: 320px; }
.cn-proposal { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: .84rem; max-height: 50vh; overflow: auto; background: var(--paper); padding: 12px; border-radius: 8px; }
.cn-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.cn-limits { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.cn-svc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.cn-bar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cn-bar-text p { margin: 4px 0 0; max-width: 70ch; color: var(--muted); font-size: .92rem; }

/* ------------------------------------------------------------------ bible */
.cn-bible { display: flex; flex-direction: column; gap: var(--cn-gap); }
.cn-bible-group h3 { margin-bottom: 8px; color: var(--ink-3); font-size: .95rem; text-transform: none; }
.cn-entities { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cn-entity { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--line); }
.cn-entity:first-child { border-top: 0; }
.cn-entity-refs { display: flex; gap: 4px; }
.cn-entity-refs .thumb, .cn-entity-refs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.cn-entity-noref { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 700; font-size: 1.3rem; }
.cn-entity-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cn-entity-main p { margin: 0; }
.cn-entity-main .badge { margin-left: 8px; }
.cn-entity-changes { margin: 2px 0 0; padding-left: 16px; }
.cn-entity-actions { display: flex; gap: 6px; }
.cn-ref-list { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cn-ref { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.cn-ref .thumb, .cn-ref img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.cn-refs, .cn-changes, .cn-formats { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; }
.cn-change input { min-width: 0; }
.cn-formats { display: grid; gap: 8px; }
.cn-format { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.cn-format.on { border-color: var(--accent); background: var(--accent-soft); }
.cn-format input { margin-top: 3px; }
.cn-format span { display: flex; flex-direction: column; gap: 2px; }
.cn-parts-n input { max-width: 120px; }

/* ------------------------------------------------------------------ parts */
.cn-part-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; counter-reset: part; }
.cn-part { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--line); }
.cn-part:first-child { border-top: 0; }
.cn-part-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.cn-part-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cn-part-main p { margin: 0; }
.cn-part-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cn-scene-states { display: flex; gap: 10px; flex-wrap: wrap; }
.cn-part-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 320px; }

/* ------------------------------------------------------------------ film */
.cn-film-facts { gap: 8px 26px; }
.cn-film-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cn-chapters { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }

/* ------------------------------------------------------------------ part production */
.cn-part-strip { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.cn-part-strip .notice { flex: 1 1 100%; }
.cn-scenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cn-scene { padding: 0; }
.cn-scene-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.cn-scene-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; flex: none; }
.cn-scene-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.cn-scene-title b { overflow-wrap: anywhere; }
.cn-scene-body { border-top: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cn-scene-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.cn-scene-grid .cn-field textarea { min-height: 64px; }
.cn-scene-entities, .cn-scene-media { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.cn-chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .82rem; cursor: pointer; }
.cn-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cn-chip.rejected { text-decoration: line-through; opacity: .7; }
.cn-chip[disabled] { cursor: default; }
.cn-shots-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cn-shots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cn-shot { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.cn-shot[data-status="accepted"] { border-color: var(--teal); }
.cn-shot[data-status="review"] { border-color: var(--warn); }
.cn-shot[data-status="failed"] { border-color: var(--danger); }
.cn-shot-media { display: grid; place-items: center; background: var(--ink); border-radius: 8px; min-height: 112px; overflow: hidden; }
.cn-shot-media video, .cn-shot-media img, .cn-shot-media .thumb { width: 100%; height: 100%; max-height: 180px; object-fit: contain; display: block; }
.cn-shot-empty { color: #c9cbd2; padding: 10px; text-align: center; }
.cn-shot-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cn-shot-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cn-shot-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 110px; }
.cn-shot-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cn-takes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cn-gen { border-top: 1px dashed var(--line-strong); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.cn-gen-actions { gap: 12px; }
.cn-cost { display: inline-flex; gap: 6px; align-items: baseline; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 899px) {
  .cn-split { grid-template-columns: 1fr; }
  .cn-shot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 699px) {
  .cn .cn-pair { grid-template-columns: 1fr; }
  .cn-row, .cn-entity, .cn-part { grid-template-columns: auto minmax(0, 1fr); }
  .cn-row-state, .cn-entity-actions, .cn-part-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .cn-shot { grid-template-columns: 1fr; }
  .cn-shot-media { min-height: 140px; }
  .cn-story-actions { width: 100%; }
}

/* ------------------------------------------------------------------ budget */
.cn-budget { display: flex; flex-direction: column; gap: var(--cn-gap); }
.cn-budget-form .actions { margin-top: 12px; }
.cn-budget-table th, .cn-budget-table td { text-align: right; }
.cn-budget-table th:first-child, .cn-budget-table td:first-child { text-align: left; }
.cn-budget-table tfoot th, .cn-budget-table tfoot td { border-top: 2px solid var(--line-strong); font-weight: 700; }
.cn-budget-facts { gap: 8px 26px; }

/* ------------------------------------------------------------------ casting (docs/STUDIO-COHERENCE.md) */
.cn-casting { display: flex; flex-direction: column; gap: var(--cn-gap); }
.cn-cast-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.cn-cast-who > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cn-cast-who .thumb, .cn-cast-who img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
.cn-cast-who .cn-entity-noref { width: 44px; height: 44px; font-size: 1.1rem; flex: none; }
.cn-cast-desc { max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-cast-select { max-width: 260px; }
.cn-cast-table .cn-entity-actions { justify-content: flex-end; flex-wrap: wrap; }
.cn-detect { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.cn-detect .cn-check > span { display: flex; flex-direction: column; gap: 1px; }

/* ------------------------------------------------------------------ bible: statuses, plan of a place, outfits */
.cn-entity-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cn-entity-top .badge { margin-left: 0; }
.cn-plan { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.cn-plan-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.cn-plan-row input, .cn-plan-row select { min-width: 0; }
.cn-sketch { display: grid; gap: 4px; min-width: 220px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; font-size: .78rem; text-align: center; background: var(--paper); }
.cn-sketch-mid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.cn-sketch-mid > span, .cn-sketch-back, .cn-sketch-front { padding: 6px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow-wrap: anywhere; }
.cn-sketch-cam { color: var(--muted); }
.cn-scene-outfits { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.cn-outfit { display: inline-flex; align-items: center; gap: 6px; }
.cn-outfit select, .cn-outfit input { max-width: 220px; }
.cn-cast-table .cn-cast-actions { white-space: nowrap; }
.cn-cast-table .cn-cast-actions .cn-entity-actions { justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 699px) {
  /* casting table stacked as cards: one row per character, labelled cells, actions below */
  .cn-cast-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cn-cast-table, .cn-cast-table tbody, .cn-cast-table tr, .cn-cast-table td { display: block; width: 100%; min-width: 0; }
  .cn-cast-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .cn-cast-table td { border: 0; padding: 4px 0; }
  .cn-cast-table td[data-label] { display: grid; grid-template-columns: minmax(0, 6em) minmax(0, 1fr); gap: 0 10px; align-items: baseline; }
  .cn-cast-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
  .cn-cast-table td[data-label] > * { grid-column: 2; min-width: 0; max-width: 100%; }
  .cn-cast-table .cn-cast-actions { white-space: normal; }
  .cn-cast-table .cn-cast-actions .cn-entity-actions { justify-content: flex-start; }
  .cn-cast-select { max-width: 100%; }
}

/* ------------------------------------------------------------------ storyboard (docs/STUDIO-COHERENCE.md) */
.cn-sb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cn-sb-thumb { display: inline-grid; place-items: center; width: 48px; height: 36px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; flex: none; }
.cn-sb-thumb .thumb, .cn-sb-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.cn-sb-empty { color: var(--muted); display: grid; place-items: center; }
.cn-sb.accepted .cn-sb-thumb { border-color: var(--teal, #1f8a7a); }
.cn-sb-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.cn-sb-gen { margin-top: 6px; }
.cn-sb-tools { gap: 16px; flex-wrap: wrap; }
.cn-sb-list { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; }
.cn-sb-list li { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; opacity: .7; }
.cn-sb-list li.on { opacity: 1; border-color: var(--line-strong, #c9c3b8); }
.cn-sb-list .cn-check > span { display: flex; flex-direction: column; gap: 2px; }
.cn-sb-line { font-style: italic; }
.cn-prod-settings { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }

/* ------------------------------------------------------------------ continuity engine (docs/STUDIO-COHERENCE.md) */
.cn-keep { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cn-keep legend { font-size: .82rem; font-weight: 600; color: var(--muted); }
.cn-warnings { margin: 0; padding-left: 18px; }
.cn-sections { margin: 0; }
.cn-insp { display: flex; flex-direction: column; gap: 10px; }
.cn-insp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cn-insp-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cn-insp-alerts li { display: flex; gap: 6px; align-items: baseline; }
.cn-insp-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cn-insp-scene ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cn-insp-scene li.warn { color: var(--danger, #b42318); }
.cn-insp-scene li.info { color: var(--muted); }

/* ------------------------------------------------------------------ dialogue with several voices */
.cn-dialogue { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.cn-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cn-line { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) minmax(100px, 130px) auto; gap: 6px; align-items: center; }
.cn-line:has(.cn-line-name) { grid-template-columns: minmax(120px, 160px) minmax(100px, 140px) minmax(0, 1fr) minmax(100px, 130px) auto; }
.cn-line input, .cn-line select { min-width: 0; }
.cn-line-actions { display: flex; gap: 2px; }
.cn-line-voice { grid-column: 1 / -1; order: 1; display: flex; align-items: center; gap: 4px; margin-top: -2px; }
.cn-line-voice-missing { color: var(--warn); font-weight: 600; }
.cn-cast-voice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.cn-dlg-voices { display: flex; flex-direction: column; gap: 8px; }
.cn-dlg-timeline { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.cn-dlg-timeline .cn-num { font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 699px) {
  .cn-line, .cn-line:has(.cn-line-name) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cn-line .cn-line-text { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ model router: simple modes, fallbacks */
.cn-simple-mode { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.cn-simple-mode .cn-warnings { margin-top: 4px; }
.cn-hidden { display: none !important; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; cursor: pointer; font: inherit; }
.cn-fallbacks { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 6px; }

/* ------------------------------------------------------------------ production tab */
.cn-production { display: flex; flex-direction: column; gap: var(--cn-gap); }
.cn-prod-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.cn-prod-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.cn-prod-stat dt { color: var(--muted); font-size: .8rem; }
.cn-prod-stat dd { margin: 0; font-size: 1.3rem; font-weight: 700; }
.cn-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cn-queue li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cn-queue .err { color: var(--danger, #b42318); }
@media (max-width: 699px) {
  .cn-prod-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cn-prod-table, .cn-prod-table tbody, .cn-prod-table tr, .cn-prod-table td { display: block; width: 100%; min-width: 0; }
  .cn-prod-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .cn-prod-table td { border: 0; padding: 4px 0; }
  .cn-prod-table td[data-label] { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr); gap: 0 10px; align-items: baseline; }
  .cn-prod-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
  .cn-prod-table td[data-label] > * { grid-column: 2; }
}

/* ------------------------------------------------------------------ structured shot details (on demand) */
.cn-shot-details { display: flex; flex-direction: column; gap: 8px; }
.cn-shot-details-body { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); gap: 10px; }

/* line-by-line control of a dialogue voice (CVL-360): alerts to confirm by ear, never blocking */
.cn-voice-qa { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--radius-sm); background: var(--surface-2); padding: 8px 12px; overflow-wrap: anywhere; }
.cn-voice-qa ul { margin: 4px 0; padding-left: 18px; }
.cn-voice-qa p { margin: 4px 0 0; }
.cn-voice-qa > b, .cn-voice-qa-none, .cn-voice-qa p span, .cn-voice-qa-tr { display: block; }

/* Pages « compte » — redesign section owned by one agent; appended after styles.css at build time. */
/* Shared head for both pages (same scale as the hub and « Mes voix »). */
.cr-head, .st-head { margin-bottom: 22px; }
.cr, .st { min-width: 0; }
.cr *, .st * { min-width: 0; }

/* ======================================================================== credits */
.cr h2 { font-size: var(--fs-h2); letter-spacing: -.01em; margin: 0 0 10px; }
.cr-balance { display: grid; gap: 14px; margin-bottom: 32px; padding: 22px 24px; }
.cr-balance-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0; }
.cr-amount { font-size: 2.25rem; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cr-balance-line span { font-size: 1.05rem; color: var(--text); }
/* the meter: available (teal) vs reserved by running generations (warn) */
.cr-meter { display: flex; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; max-width: 560px; }
.cr-meter-free { background: var(--teal); }
.cr-meter-held { background: #d9a43a; }
.cr-figures { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; }
.cr-figures div { display: flex; align-items: baseline; gap: 8px; }
.cr-figures dt { color: var(--muted); font-size: .88rem; }
.cr-figures dd { margin: 0; font-weight: 700; }
.cr-figures div:first-child dt::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: #d9a43a; margin-right: 7px; }
.cr-zero { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-sunk); max-width: 70ch; }
.cr-rule { margin: 0; max-width: 72ch; line-height: 1.5; }

.cr-uses { margin-bottom: 32px; }
.cr-uses-grid { display: grid; gap: 18px 28px; grid-template-columns: minmax(0, 1fr); }
.cr-list { list-style: none; margin: 0; padding: 0; }
.cr-list.panel-quiet { padding: 0 20px; }
.cr-list li { padding: 13px 0; display: flex; flex-direction: column; gap: 3px; }
.cr-list li + li { border-top: 1px solid var(--line); }
.cr-list p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.cr-item-top { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.cr-item-top .badge { white-space: nowrap; }
.cr-free-title { font-size: 1rem; margin: 0 0 2px; color: var(--teal); }
.cr-free li { padding: 11px 0; }
.cr-free-tag { color: var(--teal); font-weight: 600; font-size: .8rem; white-space: nowrap; }

.cr-section { margin-bottom: 32px; }
.cr-section-intro { margin: -4px 0 10px; }
.cr-nopay { margin: 0; color: var(--muted); max-width: 70ch; line-height: 1.5; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.cr-packs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cr-pack { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 18px; }
.cr-pack + .cr-pack { border-top: 1px solid var(--line); }
.cr-pack-text { display: flex; flex-direction: column; gap: 2px; }
.cr-pack-text > span { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.cr-pack-credits { font-weight: 700; font-size: 1.1rem; }
.cr-pack-pay { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-orders-title { margin: 22px 0 8px; }

table.cr-table { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.cr-table th { background: var(--surface-sunk); padding: 10px 14px; }
table.cr-table td { padding: 11px 14px; vertical-align: middle; }
table.cr-table tbody tr:last-child td { border-bottom: 0; }
.cr-table .cr-num { text-align: right; white-space: nowrap; }
.cr-table td.cr-num { font-weight: 700; }
.cr-table td.cr-num.plus { color: var(--teal); }
.cr-table .cr-date { white-space: nowrap; color: var(--muted); }
.cr-note, .cr-op { overflow-wrap: anywhere; }

@media (min-width: 900px) { .cr-uses-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }

/* ======================================================================== settings */
.st-oauth { margin-bottom: 16px; }
.st-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.st-main { display: flex; flex-direction: column; gap: 34px; }
.st-index ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.st-index button { font: inherit; font-size: .88rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; touch-action: manipulation; }
.st-index button:hover { border-color: var(--line-strong); color: var(--accent-text); }
.st-group { scroll-margin-top: 72px; }
.st-group > h2 { font-size: var(--fs-h2); letter-spacing: -.01em; margin: 0 0 6px; }
.st-group-intro { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }
.st-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

.st-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 32px; padding: 20px; }
.st-row + .st-row { border-top: 1px solid var(--line); }
.st-row-label h3, .st-sub h3 { font-size: 1rem; margin: 0 0 3px; }
.st-row-label p, .st-sub p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; max-width: 60ch; }
.st-row-body { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.st-row-full { display: block; }
.st-sub { margin-bottom: 10px; }
.st-sub + table, table + .st-sub { margin-top: 0; }
table + .st-sub { margin-top: 22px; }

.st-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.st-inline.st-tight { gap: 6px; }
.st-grow { flex: 1 1 200px; }
.st input[type=text], .st input[type=email], .st input[type=password], .st input[type=number], .st select { max-width: 100%; }
.st-narrow { max-width: 360px; }
.st-start { align-self: flex-start; }
.st-code-input { width: 10ch !important; flex: none; letter-spacing: .08em; }
.st-check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.45; cursor: pointer; max-width: 60ch; }
.st-check input { flex: none; margin-top: 2px; }
.st-state { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; }
.st-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.st-secret { display: block; font-size: 1.05rem; margin: 6px 0; overflow-wrap: anywhere; word-break: break-all; }
.st-codes { background: var(--surface-sunk); padding: 12px 14px; border-radius: 8px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-off { margin: 0; }

.st-storage { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.st-storage p { margin: 0; }
.st-meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.st-meter span { display: block; height: 100%; background: var(--teal); min-width: 2px; }

.st-lines { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.st-lines li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
.st-lines li + li { border-top: 1px solid var(--line); }
.st-who { overflow-wrap: anywhere; }
.st-who > * { display: block; }
.st-row-body p { margin: 0; }

.st-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 520px; }
.st-slot { display: flex; flex-direction: column; gap: 6px; }
.st-slot-thumb { width: 100%; }
.st-slot-empty { aspect-ratio: 16 / 9; border: 1px dashed var(--line-strong); border-radius: 8px; display: grid; place-items: center; }
.st-colors { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.st-color { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }

.st-invite { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.st-invite h4 { margin: 0; font-size: .92rem; }

table.st-table { border: 1px solid var(--line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.st-table th { background: var(--surface-sunk); padding: 9px 12px; }
table.st-table td { padding: 10px 12px; vertical-align: middle; }
table.st-table tbody tr:last-child td { border-bottom: 0; }
.st-table td.st-act { text-align: right; white-space: nowrap; }
.st-svc-name > * { display: block; }
.st-svc-name > * + * { margin-top: 2px; }
.st-svc-name a { font-weight: 600; }
.st-svc-name .small { max-width: 52ch; line-height: 1.4; }
.st-svc-state .badge { white-space: nowrap; }
.st-date { white-space: nowrap; color: var(--muted); }
.st-code { font-size: .84rem; overflow-wrap: anywhere; }
.st-wrap { overflow-wrap: anywhere; }
.st-note { margin: 14px 0 0; max-width: 72ch; }

/* API keys card (pages/collab.tsx) placed as a row: drop its card chrome, keep its content */
.st-apikeys .api-keys { margin-top: 0; }
.st-apikeys .api-keys h3 { font-size: 1rem; margin: 0; }
.st-apikeys .row input[type=text] { flex: 1 1 200px !important; min-width: 0; }
.st-apikeys code { overflow-wrap: anywhere; }

.st-invitation { padding-top: 20px; }

@media (min-width: 760px) {
  .st-row:not(.st-row-full) { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); }
}
@media (min-width: 1180px) {
  .st-layout { grid-template-columns: 12.5rem minmax(0, 1fr); gap: 36px; }
  .st-index { position: sticky; top: 24px; align-self: start; }
  .st-index ul { flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
  .st-index button { border: 0; background: none; border-radius: 0 6px 6px 0; padding: 7px 12px; text-align: left; width: 100%; color: var(--muted); margin-left: -1px; border-left: 2px solid transparent; }
  .st-index button:hover { color: var(--text); border-left-color: var(--accent); }
}

/* phones: tables become stacked rows (semantics kept, no horizontal overflow) */
@media (max-width: 699px) {
  .cr-balance { padding: 18px; }
  .cr-amount { font-size: 2rem; }
  .cr-list.panel-quiet { padding: 0 16px; }
  .st-row { padding: 16px; }
  .cr-table thead, .st-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cr-table, .cr-table tbody, .cr-table tr, table.st-table, .st-table tbody, .st-table tr { display: block; width: 100%; }
  .cr-table tr, .st-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .cr-table tbody tr:last-child, .st-table tbody tr:last-child { border-bottom: 0; }
  table.cr-table td, table.st-table td { display: block; padding: 0; border: 0; }
  /* credits history / holds: date on top, operation + detail, amount on the right */
  .cr-table td.cr-date { grid-column: 1; font-size: .82rem; }
  .cr-table td.cr-num { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1rem; }
  .cr-table td.cr-op, .cr-table td.cr-note, .cr-table td.cr-state, .cr-orders td { grid-column: 1; }
  .cr-table td.cr-note { color: var(--muted); font-size: .86rem; }
  /* services, members, invitations: name left, state/action right */
  .st-svc td.st-svc-name, .st-members td.st-who, .st-invites td.st-who { grid-column: 1; }
  .st-svc td.st-svc-provider { grid-column: 1; font-size: .84rem; color: var(--muted); }
  .st-svc td.st-svc-state { grid-column: 1; }
  .st-svc td.st-act { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .st-members td:nth-child(2) { grid-column: 1; }
  .st-members td.st-act, .st-invites td.st-act { grid-column: 2; grid-row: 1 / span 2; }
  .st-audit td { grid-column: 1 / -1; }
  .st-audit td.st-code { font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) { .st-index button { transition: none; } }
.st-form { display: flex; flex-direction: column; gap: 12px; }

/* profile photo (settings → Profil): the chip at large size, the file button and the removal next to it */
.st-photo { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.st-photo-actions { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-photo-actions .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.st-photo label.btn { position: relative; cursor: pointer; }
.st-photo label.btn:focus-within { box-shadow: var(--focus); }
.st-photo label.btn.busy { opacity: .6; cursor: progress; }

/* Commerce et croissance (Publicité produit lot 6): currencies, promotions, equivalences, tariffs, trial, referral */
.cr-currency { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border: 0; padding: 0; margin: 0 0 12px; }
.cr-currency legend { float: left; margin-right: 6px; color: var(--muted); font-size: .88rem; }
.cr-currency-opt { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: .9rem; }
.cr-currency-opt.on { border-color: var(--teal); background: var(--teal-faint); font-weight: 600; }
.cr-currency-opt input { margin: 0; }
.cr-currency-opt:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.cr-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cr-promo-price { color: var(--teal); }
.cr-promo { font-weight: 600; }
.cr-equiv { margin-top: 4px; font-size: .88rem; }
.cr-equiv summary { cursor: pointer; color: var(--teal); width: fit-content; }
.cr-equiv ul { margin: 6px 0 4px; padding-left: 18px; display: grid; gap: 2px; }
.cr-equiv p { margin: 0; }
.cr-tariff-detail { display: block; color: var(--muted); font-size: .82rem; font-weight: 400; }
.cr-trial { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--teal-faint); max-width: 72ch; }
.cr-referral { padding: 18px 20px; display: grid; gap: 10px; }
.cr-referral h2 { margin: 0; }
.cr-referral p { margin: 0; max-width: 75ch; }
.cr-ref-link { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.cr-ref-link .field { flex: 1 1 280px; min-width: 0; margin: 0; }
.cr-ref-link input { width: 100%; font-family: var(--mono, monospace); font-size: .85rem; }
.gal-consent { align-items: flex-start; gap: 8px; line-height: 1.45; }
.gal-consent input { margin-top: 3px; flex: none; }

/* Sécurité de l'authentification (docs/securite/AUTHENTIFICATION.md): administrator gate, e-mail confirmation page,
   step-up dialog, shell banners, « Mes sessions » — theme tokens only (light and dark) */
.sec-gate { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; padding: 24px 16px 0; background: var(--surface-2); }
.sec-gate-card { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.sec-gate-card h1 { margin: 0; font-size: 1.5rem; line-height: 1.25; }
.sec-gate-card > p { margin: 0; max-width: 62ch; line-height: 1.5; }
.sec-gate-brand { gap: 10px; align-items: center; font-size: 1.1rem; }
.sec-gate-foot { flex-wrap: wrap; gap: 8px 14px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.sec-gate-foot .small { flex: 1 1 240px; }
.sec-gate > .app-foot { width: 100%; }
.sec-enroll { gap: 12px; }
.sec-start { align-self: flex-start; }
.sec-qr { width: 168px; max-width: 100%; margin: 8px 0 4px; padding: 8px; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.sec-qr svg { display: block; width: 100%; height: auto; }
.sec-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 12px; }
.sec-banner > span { flex: 1 1 280px; min-width: 0; }
.sec-stepup-form { gap: 12px; }
.sec-stepup-form p { margin: 0; }
table.sec-sessions td { vertical-align: middle; }
@media (max-width: 560px) { .sec-gate-card { padding: 20px 16px; } }

/* Données personnelles (docs/conformite): legal pages, sign-up acceptance, re-acceptance banner, admin console */
.app-foot-legal { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.app-foot-legal a { color: inherit; text-underline-offset: 3px; }
.app-foot.dark .app-foot-legal { justify-content: center; flex-basis: 100%; }

.legal-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--text); padding: 0 16px 16px; }
.legal-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; max-width: 880px; width: 100%; margin: 0 auto; padding: 20px 0 12px; border-bottom: 1px solid var(--line); }
.legal-brand { gap: 10px; color: var(--text); text-decoration: none; font-size: 1.15rem; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.legal-nav a { text-underline-offset: 3px; }
.legal-nav a[aria-current=page] { color: var(--text); font-weight: 600; text-decoration: none; }
.legal-main { max-width: 760px; width: 100%; margin: 0 auto; padding: 28px 0 40px; line-height: 1.6; }
.legal-main h1 { margin: 0 0 4px; font-size: clamp(1.5rem, 4vw, 2rem); }
.legal-md h2 { margin: 28px 0 8px; font-size: 1.15rem; }
.legal-md h3 { margin: 20px 0 6px; font-size: 1rem; }
.legal-md p, .legal-md ul { margin: 0 0 12px; max-width: 72ch; }
.legal-md ul { padding-left: 22px; }
.legal-md li { margin-bottom: 4px; }
.legal-md code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.legal-draft { margin: 16px 0 20px; }
.legal-table { overflow-x: auto; margin: 0 0 16px; }
.legal-table table { min-width: 520px; font-size: .9rem; }

.legal-accept { margin: 4px 0 8px; font-size: .86rem; }
.legal-accept a { text-underline-offset: 2px; }

/* in the page flow, at the top of the content: it never covers the page (audit B, A5) */
.legal-banner { position: static; margin: 0 0 16px; display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; justify-content: space-between;
  padding: 14px 16px; background: var(--surface); color: var(--text); border: 1px solid var(--warn-line); border-left: 4px solid var(--warn); border-radius: var(--radius); font-size: .9rem; line-height: 1.45; }
.legal-banner > div { flex: 1 1 320px; }
.legal-banner-docs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }

.privacy-admin .adm-table-wrap { overflow-x: auto; }
.privacy-admin td.row { gap: 6px; flex-wrap: wrap; }

/* =====================================================================================================
   Assistant IA (copilot) — panel, conversation, « Mes tâches IA », mémoire, administration.
   Every selector is prefixed .cop- ; tokens come from styles.css (none added here).
   ===================================================================================================== */

/* ---------------------------------------------------------------------------------- side panel (drawer) */
.cop-layer { position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1); background: rgba(12, 17, 32, .35); display: flex; justify-content: flex-end; }
.cop-panel { width: min(460px, 100%); height: 100%; background: var(--paper); display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: cop-in var(--t-base) ease-out; min-width: 0; }
.cop-panel:focus-visible { box-shadow: var(--shadow-pop); border-radius: 0; }
@keyframes cop-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.cop-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.cop-panel-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.cop-panel-head h2 svg { color: var(--accent-text); }
.cop-panel-tools { display: flex; align-items: center; gap: 2px; }
.cop-panel-tools .btn.icon[aria-pressed="true"] { background: var(--violet-soft); color: var(--violet); }
.cop-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.cop-panel-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; font-size: .88rem; }

/* ---------------------------------------------------------------------------------- conversation */
.cop-chat { display: flex; flex-direction: column; min-width: 0; }
.cop-chat.panel { flex: 1; min-height: 0; }
.cop-chat.panel .cop-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.cop-chat.panel .cop-foot { flex: none; padding: 10px 14px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.cop-chat.page .cop-scroll { min-height: 38vh; padding-bottom: 8px; }
.cop-chat.page .cop-foot { position: sticky; bottom: 0; background: var(--paper); padding: 10px 0 14px; border-top: 1px solid var(--line); }
.cop-end { display: block; height: 1px; }

.cop-context { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; font-size: .82rem; color: var(--muted); }
.cop-context svg { flex: none; }
.cop-block { display: block; margin: 2px 0; }

.cop-welcome { margin: 4px 0 16px; }
.cop-welcome h3 { font-size: 1.1rem; margin: 0 0 4px; }
.cop-welcome p { margin: 0 0 12px; font-size: .9rem; }
.cop-suggestions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cop-suggestion { width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: .9rem; touch-action: manipulation; transition: border-color var(--t-fast); }
.cop-suggestion:hover { border-color: var(--muted); }
.cop-suggestion[disabled] { opacity: .5; cursor: not-allowed; }

.cop-messages { display: flex; flex-direction: column; }
.cop-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 14px; min-width: 0; }
.cop-msg.user { align-items: flex-end; }
.cop-msg.cards { align-items: stretch; }
.cop-bubble { max-width: min(92%, 72ch); padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: .93rem; line-height: 1.5; }
.cop-msg.user .cop-bubble { background: var(--ink-2); border-color: var(--ink-2); color: var(--on-ink); white-space: pre-wrap; border-bottom-right-radius: 4px; }
.cop-msg.assistant .cop-bubble { border-bottom-left-radius: 4px; }
.cop-md p, .cop-md ul, .cop-md ol, .cop-md pre { margin: 0 0 8px; }
.cop-md > :last-child { margin-bottom: 0; }
.cop-md ul, .cop-md ol { padding-left: 20px; }
.cop-md li + li { margin-top: 2px; }
.cop-md code { background: var(--code-bg); border-radius: 4px; padding: 1px 5px; font-size: .86em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cop-md .cop-md-h { font-weight: 700; }
.cop-code { background: var(--ink); color: var(--on-ink); border-radius: 8px; padding: 10px 12px; font-size: .82rem; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.cop-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .86rem; color: var(--muted); max-width: 100%; }
.cop-action { display: flex; align-items: flex-start; gap: 8px; overflow-wrap: anywhere; }
.cop-action svg { flex: none; margin-top: 3px; }
.cop-action b { color: var(--text); font-weight: 600; }
.cop-action.ok svg { color: var(--teal); }
.cop-action.err, .cop-action.err svg { color: var(--danger); }
.cop-action.wait svg { color: var(--warn); }

.cop-feedback { display: flex; gap: 2px; }
.cop-feedback .btn.icon { width: 30px; min-height: 30px; }
.cop-feedback .btn.icon[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }

.cop-event { margin: 0 0 14px; padding: 6px 10px; border-left: 3px solid var(--teal); font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.cop-event.err { border-left-color: var(--danger); }
.cop-event.warn { border-left-color: var(--warn); }

.cop-working { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: .88rem; color: var(--muted); }
.cop-dots { display: inline-flex; gap: 4px; flex: none; }
.cop-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: cop-dot 1.2s infinite ease-in-out; }
.cop-dots i:nth-child(2) { animation-delay: .15s; }
.cop-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cop-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* approval card: nothing sensitive happens before this decision */
.cop-approval { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.cop-approval.reinforced { border-left-color: var(--danger); }
.cop-approval-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .88rem; }
.cop-approval-sum { margin: 8px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.cop-approval-word { margin-top: 10px; }
.cop-approval-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cop-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-bottom: 12px; }

.cop-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 8px 0 0; }
.cop-facts > div { display: flex; flex-direction: column; min-width: 0; }
.cop-facts dt { color: var(--muted); font-size: .8rem; }
.cop-facts dd { margin: 0; font-weight: 600; font-size: .9rem; }

/* mode, mandate, temporary conversation */
.cop-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; }
.cop-opt { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; min-width: 0; }
.cop-opt select { width: auto; max-width: 100%; min-height: 32px; padding: 4px 8px; font-weight: 400; }
.cop-opt-note { font-size: .84rem; color: var(--muted); }
.cop-check { display: inline-flex; align-items: flex-start; gap: 8px; font-size: .88rem; cursor: pointer; min-width: 0; }
.cop-check input { flex: none; margin-top: 2px; }
.cop-check small { color: var(--muted); font-size: .8rem; }
.cop-mode-hint { flex-basis: 100%; margin: 0; font-size: .8rem; color: var(--muted); }
.cop-note { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }

/* composer */
.cop-composer { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 6px 8px 8px; }
.cop-composer:focus-within { box-shadow: var(--focus); border-color: var(--accent); }
.cop-composer textarea { display: block; border: 0; background: transparent; min-height: 52px; max-height: 200px; padding: 6px; resize: none; }
.cop-composer textarea:focus-visible { box-shadow: none; }
.cop-composer-bar { display: flex; align-items: center; gap: 4px; }
.cop-composer-hint { flex: 1; min-width: 0; font-size: .78rem; color: var(--muted); padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cop-composer .btn.icon.on { background: var(--accent-soft); color: var(--accent-text); }

/* history */
.cop-history input[type=search] { margin-bottom: 8px; }
.cop-conv-list { list-style: none; margin: 0; padding: 0; }
.cop-conv-list li { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); border-radius: 8px; }
.cop-conv-list li.active { background: var(--violet-soft); }
.cop-conv { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 8px; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
.cop-conv b { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cop-conv span { font-size: .8rem; color: var(--muted); }

/* ---------------------------------------------------------------------------------- full-screen page */
.cop-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.cop-side { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; min-width: 0; padding: 2px; }
.cop-new { width: 100%; margin-bottom: 12px; }
.cop-main { min-width: 0; }
.cop-back { display: none; align-items: center; gap: 6px; margin-bottom: 12px; font-size: .88rem; font-weight: 600; color: var(--muted); text-decoration: none; min-height: 32px; }

/* ---------------------------------------------------------------------------------- sections, rows, forms */
.cop-section { margin-bottom: 28px; min-width: 0; }
.cop-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cop-section-head h2 { margin: 0; }
.cop-section-action { margin-left: auto; }
.cop-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.cop-lead { margin: 0 0 12px; color: var(--muted); font-size: .9rem; max-width: 80ch; line-height: 1.5; }
.cop-quiet { margin: 8px 0; color: var(--muted); font-size: .88rem; }
.cop-err { color: var(--danger); }
.cop-wrap { overflow-wrap: anywhere; }
span.cop-meta { display: block; color: var(--muted); font-size: .84rem; font-weight: 400; }
p.cop-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 6px 0 0; color: var(--muted); font-size: .84rem; }

.cop-tasks { list-style: none; margin: 0 0 12px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cop-task { padding: 14px 16px; min-width: 0; }
.cop-task + .cop-task { border-top: 1px solid var(--line); }
.cop-task-main { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.cop-task-title { font-size: .98rem; overflow-wrap: anywhere; }
.cop-task-obj, .cop-mem-text { margin: 4px 0 0; font-size: .9rem; overflow-wrap: anywhere; white-space: pre-line; }
.cop-task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.cop-steps { margin: 12px 0 0; padding: 10px 0 0 20px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.cop-step-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

.cop-form { display: flex; flex-direction: column; gap: 14px; margin: 12px 0 16px; }
.cop-form h2, .cop-form h3 { margin: 0; }
.cop-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px 16px; align-items: end; }
.cop-fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px 12px; margin: 0; min-width: 0; }
.cop-fieldset legend { font-size: .86rem; font-weight: 600; padding: 0 4px; }
.cop-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px 16px; max-height: 280px; overflow-y: auto; padding: 4px 2px; margin: 8px 0; }

.cop-switch { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; cursor: pointer; }
.cop-switch > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cop-switch b { font-size: .93rem; }
.cop-switch small { color: var(--muted); font-size: .84rem; max-width: 72ch; }
.cop-page input[role=switch] { appearance: none; -webkit-appearance: none; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background-color var(--t-fast); margin: 1px 0 0; }
.cop-page input[role=switch]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--field-bg); box-shadow: 0 1px 2px rgba(20, 20, 30, .3); transition: transform var(--t-fast); }
.cop-page input[role=switch]:checked { background: var(--teal); }
.cop-page input[role=switch]:checked::after { transform: translateX(16px); }
.cop-page input[role=switch]:focus-visible { border-radius: 999px; }
.cop-page input[role=switch][disabled] { opacity: .5; cursor: not-allowed; }

.cop-prefs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); gap: 12px 24px; align-items: start; }
.cop-upload { margin-bottom: 12px; }
.cop-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 16px 0 12px; }
.cop-search .field { flex: 1 1 240px; }
.cop-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 14px; }

/* tables: real <table> on wide screens, stacked rows below 900 px */
table.cop-table td, table.cop-table th { overflow-wrap: anywhere; }
table.cop-table td.cop-cell-actions { text-align: right; }
table.cop-table td.cop-cell-actions .btn { margin: 0 0 4px 4px; }
table.cop-table + .btn { margin-top: 12px; }

/* ---------------------------------------------------------------------------------- administration */
.cop-block-panel { margin-bottom: 16px; min-width: 0; }
.cop-block-panel > h2 { margin: 0 0 6px; }
.cop-block-panel > .btn { margin-top: 4px; }
.cop-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; margin: 0 0 16px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cop-figures > div { padding: 12px 16px; min-width: 0; background: var(--surface); }
.cop-figures dt { color: var(--muted); font-size: .82rem; }
.cop-figures dd { margin: 2px 0 0; font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cop-checklist { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.cop-checklist li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--warn); }
.cop-checklist li.ok { color: var(--teal); }
.cop-route { padding: 12px 0; }
.cop-route + .cop-route { border-top: 1px solid var(--line); }
.cop-route h3 { margin: 0 0 6px; }
.cop-route-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 2px; }
.cop-route-list li > span { display: inline-block; min-width: min(60%, 260px); overflow-wrap: anywhere; }
.cop-route-list .btn.icon { width: 30px; min-height: 30px; vertical-align: middle; }

/* ---------------------------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  body.cop-open { overflow: hidden; }
  .cop-split { grid-template-columns: minmax(0, 1fr); }
  .cop-side { position: static; max-height: none; overflow: visible; }
  .cop-split.chatting .cop-side, .cop-split.listing .cop-main { display: none; }
  .cop-back { display: inline-flex; }
  .cop-prefs { grid-template-columns: minmax(0, 1fr); }
  table.cop-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cop-table, table.cop-table tbody, table.cop-table tr, table.cop-table td { display: block; width: 100%; }
  table.cop-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.cop-table tr:last-child { border-bottom: 0; }
  table.cop-table td { border: 0; padding: 3px 0; }
  table.cop-table td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 600; color: var(--muted); }
  table.cop-table td.cop-cell-actions { text-align: left; padding-top: 8px; }
  table.cop-table td.cop-cell-actions .btn { margin: 0 6px 4px 0; }
}
@media (max-width: 600px) {
  .cop-panel { width: 100%; }
  .cop-layer { background: var(--paper); }
  .cop-composer-hint { visibility: hidden; }
  .cop-bubble { max-width: 96%; }
}
@media (prefers-reduced-motion: reduce) {
  .cop-panel { animation: none; }
  .cop-dots i { animation: none; opacity: .7; }
  .cop-page input[role=switch], .cop-page input[role=switch]::after, .cop-suggestion { transition: none; }
}

/* page headers of the assistant: several secondary actions must wrap on phones */
.page-head.cop-head > .page-head-actions { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.cop-page label.field select, .cop-page label.field input, .cop-page label.field textarea { font-weight: 400; }
/* twelve sections: wrapped on wide screens so none is hidden, scrolled sideways on phones (base .tabs behaviour) */
@media (min-width: 901px) { .cop-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; } }
table.cop-table th { overflow-wrap: normal; }
/* approval summary: may be long and multi-line (a plan lists its steps) */
.cop-approval-sum b { display: block; overflow-wrap: anywhere; }
.cop-approval-detail { display: block; margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; font-weight: 400; font-size: .88rem; max-height: 50vh; overflow-y: auto; }
.cop-approval-sum .btn { margin-top: 6px; }
select.cop-cover { width: auto; max-width: 100%; min-height: 32px; padding: 4px 8px; font-weight: 400; }

/* automation card: what each run will do (server wording), before any action */
.cop-runs { margin: 10px 0 2px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .9rem; }
.cop-runs ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.cop-runs li { white-space: pre-line; overflow-wrap: anywhere; }
.cop-runs .cop-quiet { margin: 4px 0 0; }
.cop-args { display: block; margin-top: 4px; padding: 4px 8px; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.cop-sum-line { display: block; }
.cop-sum-line.verified { font-weight: 600; color: var(--text); }

/* =====================================================================================================
   « Corriger un passage » (pages/repair.tsx) — every selector is scoped .cx / .cx-*. Hierarchy: the dark scope
   (waveform + problem bands + marked passage, the one memorable element) → the directives as quiet rows, each
   carrying its fixes and, once applied, the before / after comparison.
   ===================================================================================================== */
.cx { --cx-gap: clamp(16px, 2.4vw, 28px); --cx-err: #ff8f7e; --cx-warn: #f2c14e; --cx-info: #9ab8d8; --cx-mark: #f08a4b; }
.cx-head { margin-bottom: var(--cx-gap); }
.cx-head h1 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -.025em; text-wrap: balance; }
.cx-back { display: inline-block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; text-decoration: none; }
.cx-back:hover { text-decoration: underline; }
.cx-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 6px 0 0; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.cx-file b { color: var(--text); font-size: 1rem; overflow-wrap: anywhere; }
.cx-lead { margin: 6px 0 0; max-width: 62ch; color: var(--muted); }

/* ---------------------------------------------------------------- scope (dark panel) */
.cx-scope { background: var(--ink); color: #f3efe9; border-radius: 18px; padding: clamp(18px, 2.6vw, 30px); margin-bottom: var(--cx-gap); display: flex; flex-direction: column; gap: 14px; }
.cx-scope-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; }
.cx-scope h2 { color: #fff; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); margin: 0; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cx-hint { margin: 0; color: #a9a59e; font-size: .86rem; line-height: 1.5; }
.cx-scope-body { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.cx-scope-body > audio { display: none; }
.cx-video { width: 100%; max-height: 220px; border-radius: 10px; background: #000; object-fit: contain; }
@media (min-width: 900px) { .cx-scope.has-video .cx-scope-body { grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); align-items: center; } }

.cx-scope-wave { min-width: 0; }
.cx-wave { position: relative; height: clamp(120px, 18vw, 180px); border-radius: 10px; background: var(--ink-2); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.cx-wave.editable { cursor: crosshair; touch-action: none; }
.cx-wave.dragging { cursor: ew-resize; }
.cx-peaks { position: absolute; inset: 10px 0; width: 100%; height: calc(100% - 20px); display: block; stroke: #8d8a85; }
.cx-peaks.lit { stroke: #fff6ee; }
.cx-flat { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed #5b5f69; }
.cx-wave::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(243, 239, 233, .08); pointer-events: none; }

/* problem bands: translucent column + a solid cap so even a 3 px band is visible */
.cx-band { position: absolute; top: 0; bottom: 0; pointer-events: none; background: color-mix(in srgb, var(--cx-c) 18%, transparent); box-shadow: inset 0 4px 0 var(--cx-c); }
.cx-band.sev-err { --cx-c: var(--cx-err); }
.cx-band.sev-warn { --cx-c: var(--cx-warn); }
.cx-band.sev-info { --cx-c: var(--cx-info); }
.cx-band.focus { background: color-mix(in srgb, var(--cx-c) 30%, transparent); box-shadow: inset 0 4px 0 var(--cx-c), inset 0 -2px 0 var(--cx-c); }

/* marked passage: a lit window with two handles */
.cx-sel { position: absolute; top: 0; bottom: 0; overflow: visible; pointer-events: none; background: rgba(240, 138, 75, .14); box-shadow: inset 2px 0 0 var(--cx-mark), inset -2px 0 0 var(--cx-mark); }
.cx-sel-lit { position: absolute; top: 0; bottom: 0; }
.cx-sel-clip { position: absolute; inset: 0; overflow: hidden; }
.cx-handle { position: absolute; top: 0; bottom: 0; width: 22px; margin-left: -11px; pointer-events: auto; cursor: ew-resize; touch-action: none; display: flex; align-items: center; justify-content: center; }
.cx-handle.start { left: 0; }
.cx-handle.end { left: 100%; }
.cx-handle::before { content: ''; width: 8px; height: 34px; border-radius: 4px; background: var(--cx-mark); box-shadow: 0 0 0 2px var(--ink); }
.cx-handle:focus-visible { box-shadow: none; }
.cx-handle:focus-visible::before { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px #f6c3a5; }
.cx-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.cx-playhead[hidden] { display: none; }

/* analysis in progress: one slow sweep over the analysed range */
.cx-scan { position: absolute; top: 0; bottom: 0; overflow: hidden; pointer-events: none; background: rgba(154, 184, 216, .08); }
.cx-scan i { position: absolute; top: 0; bottom: 0; left: 0; width: 24%; background: linear-gradient(90deg, transparent, rgba(243, 239, 233, .22), transparent); animation: cx-sweep 1.6s linear infinite; }
@keyframes cx-sweep { from { transform: translateX(-100%); } to { transform: translateX(420%); } }

.cx-ruler { position: relative; height: 20px; margin-top: 6px; color: #a9a59e; font-size: .76rem; font-variant-numeric: tabular-nums; }
.cx-ruler span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.cx-ruler span:first-child { transform: none; }
.cx-ruler span::before { content: ''; position: absolute; left: 50%; top: -6px; height: 4px; border-left: 1px solid #5b5f69; }
.cx-ruler span:first-child::before { left: 0; }

.cx-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .84rem; color: #d6d2cb; }
.cx-legend li { display: inline-flex; align-items: center; gap: 7px; }
.cx-legend .sev-err { --cx-c: var(--cx-err); }
.cx-legend .sev-warn { --cx-c: var(--cx-warn); }
.cx-legend .sev-info { --cx-c: var(--cx-info); }
.cx-legend .cx-sev-dot { width: 12px; height: 8px; border-radius: 2px; background: var(--cx-c); }

.cx-controls { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; padding-top: 14px; border-top: 1px solid rgba(243, 239, 233, .12); }
.cx-times { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.cx-time { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: #d6d2cb; }
.cx-time input { width: 7.5em; min-height: 40px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--ink-3); background: var(--ink-2); color: #fff; font-variant-numeric: tabular-nums; }
.cx-time input::placeholder { color: #7d7a75; }
.cx-time input:focus-visible { border-color: #f6c3a5; box-shadow: 0 0 0 2px rgba(246, 195, 165, .45); }
.cx-len { color: #a9a59e; font-size: .86rem; font-variant-numeric: tabular-nums; padding-bottom: 10px; }
.cx-go-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cx-scope .cx-quiet { background: transparent; color: #f3efe9; border-color: rgba(243, 239, 233, .35); min-height: 44px; border-radius: 999px; padding: 0 16px; touch-action: manipulation; }
.cx-scope .cx-quiet:hover { border-color: #f3efe9; }
.cx-go { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .98rem; cursor: pointer; touch-action: manipulation; transition: background-color .15s; }
.cx-go:hover { background: var(--accent-hover); }
.cx-go[disabled] { opacity: .6; cursor: progress; }
.cx-scope .cx-quiet:focus-visible, .cx-go:focus-visible { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #f6c3a5; border-radius: 999px; }

/* ---------------------------------------------------------------- directives */
.cx-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.cx-section-head h2 { font-size: var(--fs-h2); margin: 0; }
.cx-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.cx-state { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.cx-state.idle { display: block; }
.cx-state p { margin: 0; max-width: 70ch; }
.cx-state p + p { margin-top: 6px; }
.cx-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cx-clean { padding: 16px 18px; border-radius: 12px; background: var(--teal-soft); border: 1px solid var(--ok-line); color: var(--ok-text); }
.cx-clean b { display: block; font-size: 1rem; }
.cx-clean p { margin: 4px 0 0; font-size: .9rem; max-width: 70ch; }
.cx-spin { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: cx-turn .8s linear infinite; }
@keyframes cx-turn { to { transform: rotate(360deg); } }

.cx-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cx-item { --cx-c: var(--line-strong); padding: 16px 18px 16px 20px; display: flex; flex-direction: column; gap: 8px; position: relative; scroll-margin-top: 16px; }
.cx-item::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cx-c); }
.cx-item + .cx-item { border-top: 1px solid var(--line); }
.cx-item.sev-err { --cx-c: var(--danger); }
.cx-item.sev-warn { --cx-c: #c48a12; }
.cx-item.sev-info { --cx-c: #5a7fa8; }
.cx-item.focus { background: #fcfaf7; }
.cx-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.cx-item-head h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.cx-sev { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--cx-c); }
.cx-item.sev-warn .cx-sev { color: var(--warn); }
.cx-sev-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.cx-when { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.cx-why { margin: 0; color: var(--text); font-size: .92rem; line-height: 1.5; max-width: 72ch; }
.cx-item-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -8px; }
.cx-item-tools .btn { color: var(--text); }
.cx-item-tools .btn:hover { background: var(--surface-hover); }
.cx-fixes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cx-fixes .btn { white-space: normal; text-align: left; min-height: 36px; touch-action: manipulation; }
.cx-fixes .btn.primary .rec-dot.sm { background: #fff; }

/* before / after, inside the directive it corrects */
.cx-compare { margin-top: 6px; padding: 16px; border-radius: 12px; background: var(--surface-sunk); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.cx-compare.busy { flex-direction: row; align-items: center; color: var(--muted); font-size: .9rem; }
.cx-compare h4 { margin: 0; font-size: .98rem; }
.cx-compare-lead { margin: -6px 0 0; color: var(--muted); font-size: .88rem; }
.cx-compare-err { margin-top: 6px; }
.cx-sides { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .cx-sides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cx-side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.cx-side b { font-size: .92rem; }
.cx-side-len { justify-self: end; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.cx-mini { grid-column: 1 / -1; position: relative; height: 44px; border-radius: 6px; background: var(--ink-2); overflow: hidden; }
.cx-side.res .cx-mini { background: #12302c; }
.cx-mini .cx-peaks { inset: 4px 0; height: calc(100% - 8px); stroke: #b7b3ad; }
.cx-side.res .cx-mini .cx-peaks { stroke: #8fe0d3; }
.cx-side .btn { grid-column: 1 / -1; justify-self: start; }
.cx-res-video { display: none; }
.cx-compare > audio { display: none; }
.cx-decide { display: flex; flex-wrap: wrap; gap: 10px; }
.cx-decide .btn { min-height: 42px; touch-action: manipulation; }
.cx-note { margin: 0; color: var(--muted); font-size: .84rem; max-width: 70ch; }

/* médiathèque tile hook: « Corriger » next to « Supprimer » */
.cx-tile-actions { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; }
.cx-tile-actions .bib-del { margin-top: 0; }
.cx-tile-fix { padding-inline: 6px; color: var(--text); }
.cx-tile-fix:hover { background: var(--surface-hover); }

@media (max-width: 640px) {
  .cx-controls { flex-direction: column; align-items: stretch; }
  .cx-go-row > * { flex: 1 1 100%; justify-content: center; }
  .cx-time { flex: 1 1 40%; }
  .cx-time input { width: 100%; }
  .cx-len { flex: 1 1 100%; padding-bottom: 0; }
  .cx-item { padding: 14px 14px 14px 16px; }
  .cx-decide .btn { flex: 1 1 100%; }
}
/* phone / touch: every button of the page is a 44 px finger target (DESIGN.md) */
@media (max-width: 640px), (pointer: coarse) {
  .cx-item-tools .btn, .cx-fixes .btn, .cx-side .btn, .cx-decide .btn, .cx-failed .btn { min-height: 44px; touch-action: manipulation; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-scan i { animation: none; transform: none; width: 100%; background: rgba(243, 239, 233, .08); }
  .cx-spin { animation-duration: 2.4s; }
  .cx-go { transition: none; }
}

/* recommended fix: accent, but soft — the page keeps a single filled main action */
.cx-fixes .btn.cx-fix-reco { background: var(--accent-soft); border-color: #f0c2a8; color: var(--accent-text-hover); }
.cx-fixes .btn.cx-fix-reco:hover { border-color: var(--accent); }
.cx-ruler span.end { transform: translateX(-100%); }
.cx-ruler span.end::before { left: auto; right: 0; }

/* Voix & Dialogues — CVL-360 (#/voix-dialogues/…) — Design System tokens only (docs/DESIGN.md). Reuses .sv, .card,
   .badge, .tabs, .notice, label.field, .btn, table.table. Breakpoints: 390 / 834 / 1440 px. */
.cvl .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cvl .card { min-width: 0; }
/* inside a card the column gap spaces the blocks: paragraphs bring no margin of their own */
.cvl .card p { margin: 0; }
.cvl .card h2 { margin-bottom: 2px; }
.cvl h3 { margin-top: var(--sp-2); }
.cvl-between { justify-content: space-between; }
.cvl-between h2 { margin: 0; }
.cvl-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.cvl-cols.wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.cvl-cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cvl select, .cvl input, .cvl textarea { max-width: 100%; min-width: 0; }
.cvl label.field select, .cvl label.field input, .cvl label.field textarea { width: 100%; }
.cvl label.field.cvl-narrow { max-width: 460px; }
.cvl textarea { resize: vertical; font: inherit; line-height: 1.5; }
.cvl label.cvl-check { flex-wrap: nowrap; align-items: flex-start; gap: 10px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.cvl label.cvl-check input { margin-top: 3px; flex-shrink: 0; }
.cvl label.cvl-check .col { gap: 2px; }
.cvl label.cvl-check .small { font-weight: 400; }
.cvl .notice ul { margin: 6px 0 0; padding-left: 18px; }
.cvl-disabled, .cvl-failure { display: flex; flex-direction: column; gap: 4px; }
.cvl-running { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.cvl-err { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin: 0; overflow-wrap: anywhere; }
.cvl-err code { opacity: .8; }
.cvl-file { margin: 0; overflow-wrap: anywhere; }
/* a long button label wraps on phones instead of widening the page */
.cvl .btn.cvl-long { white-space: normal; height: auto; min-height: 38px; text-align: left; max-width: 100%; }

/* the three steps of the main journey */
.cvl-step { display: flex; flex-direction: column; gap: 10px; padding-top: var(--sp-3); border-top: 1px solid var(--line); min-width: 0; }
.cvl-step:first-of-type { border-top: 0; padding-top: 0; }
.cvl-step h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1rem; }
.cvl-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* source preview and face target */
.cvl-stage { position: relative; display: inline-block; align-self: flex-start; max-width: 100%; line-height: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--ink); }
.cvl-stage video, .cvl-stage img { display: block; max-width: 100%; max-height: 380px; width: auto; height: auto; }
.cvl-pick { position: absolute; inset: 0; cursor: crosshair; touch-action: manipulation; }
.cvl-pick:focus-visible { outline: 3px solid var(--violet); outline-offset: -3px; }
.cvl-stage.picking { box-shadow: 0 0 0 2px var(--violet); }
.cvl-mark { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px rgba(12, 17, 32, .45); pointer-events: none; }
.cvl-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent); }
.cvl-face, .cvl-engines { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px 10px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.cvl-face legend, .cvl-engines legend { font-weight: 600; font-size: .86rem; padding: 0 4px; }
.cvl-face p { margin: 0; }

/* voice player */
.cvl-player { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cvl-player audio { width: 100%; max-width: 100%; }
.cvl-wave { height: 40px; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--teal); overflow: hidden; }

/* engine choice */
.cvl-engine { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; cursor: pointer; }
.cvl-engine input { margin-top: 4px; }
.cvl-engine .col { gap: 2px; overflow-wrap: anywhere; }
.cvl-engine.off { cursor: not-allowed; }
.cvl-engine.off b { color: var(--muted); font-weight: 600; }

/* folding panels */
.cvl-fold { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.cvl-fold summary { cursor: pointer; font-weight: 600; padding: 10px 12px; }
.cvl-fold-body { padding: 4px 12px 12px; }

/* key / value lists, notes */
.cvl-dl { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: .9rem; }
.cvl-dl dt { color: var(--muted); }
.cvl-dl dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.cvl-notes { margin: 0; padding-left: 18px; font-size: .88rem; display: grid; gap: 4px; overflow-wrap: anywhere; }
.cvl-plain, .cvl-jobs, .cvl-events, .cvl-alert-list, .cvl-evidence, .cvl-blocked-list { list-style: none; margin: 0; padding: 0; }
.cvl-quote { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px; }
.cvl-quote h3 { margin: 0; }
.cvl-quote p { margin: 0; }

/* list of passes */
.cvl-jobs li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cvl-jobs li:first-child { padding-top: 0; }
.cvl-jobs li:last-child { border-bottom: 0; padding-bottom: 0; }
.cvl-job-link { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.cvl-job-link:hover b { color: var(--accent-text); }
.cvl-job-text { gap: 1px !important; overflow-wrap: anywhere; }
.cvl-job-side { align-items: flex-end; gap: 4px !important; }
.cvl-thumb { width: 72px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--ink); color: var(--on-ink-muted); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cvl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cvl-fail { color: var(--danger); }

/* before / after */
.cvl-compare { position: relative; width: 100%; background: #000; border-radius: var(--radius-sm); overflow: hidden; line-height: 0; }
.cvl-compare video, .cvl-compare img { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #000; }
.cvl-compare #cvl-res { cursor: pointer; }
.cvl-compare.curtain .cvl-cmp-b { position: absolute; inset: 0; }
.cvl-compare.curtain .cvl-cmp-b video { height: 100%; }
.cvl-compare.side { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cvl-compare.side .cvl-cmp-a, .cvl-compare.side .cvl-cmp-b { position: relative; }
.cvl-curtain-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(12, 17, 32, .5); pointer-events: none; }
.cvl-tag { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(12, 17, 32, .78); color: var(--on-ink); font-size: .75rem; font-weight: 700; line-height: 1.4; padding: 2px 8px; border-radius: 999px; }
.cvl-tag.r { left: auto; right: 8px; }
.cvl-range { display: flex; flex-direction: column; gap: 2px; }
.cvl-range input, .cvl-seek input { width: 100%; }
.cvl-transport { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cvl-seek { display: block; min-width: 0; }
.cvl-time { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.cvl-tools { justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.cvl-seg { gap: 4px; flex-wrap: wrap; }

/* alerts, journal */
.cvl-alert-list { display: grid; gap: 8px; font-size: .9rem; }
.cvl-alert-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; color: var(--warn); overflow-wrap: anywhere; }
.cvl-alert-list svg { margin-top: 2px; }
.cvl-events li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cvl-events li:last-child { border-bottom: 0; }
.cvl-events .col { gap: 2px; overflow-wrap: anywhere; }

/* dialogue shots */
.cvl-shots td { overflow-wrap: anywhere; }
.cvl-shots th { white-space: nowrap; }
.cvl-shots .cvl-shot-sel { width: 36px; }
.cvl-shots .cvl-shot-text { min-width: 180px; }
.cvl-shots .cvl-shot-why { display: block; margin-top: 2px; }
.cvl-shots .cvl-shot-act { text-align: right; }
.cvl-shots .cvl-shot-act .btn { margin: 0 0 4px 4px; }
.cvl-repair-launch { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.cvl-repair-total { margin: 0; }

/* engines */
.cvl-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--sp-4); align-items: start; }
.cvl-engine-card h2 { margin: 0; }
.cvl-engine-card p { margin: 0; overflow-wrap: anywhere; }
.cvl-engine-card header .row { gap: 6px; flex-wrap: wrap; }
.cvl-evidence { display: grid; gap: 10px; font-size: .88rem; }
.cvl-evidence li { display: flex; flex-direction: column; gap: 2px; }
.cvl-evidence a { overflow-wrap: anywhere; }
.cvl-evidence blockquote { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid var(--line-strong); color: var(--muted); overflow-wrap: anywhere; }
.cvl-blocked-list { display: grid; gap: 10px; }
.cvl-blocked-list li { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--danger); border-radius: var(--radius-sm); background: var(--surface-2); overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .cvl-cols, .cvl-cols.wide, .cvl-cols.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  /* dialogue shots: one stacked block per shot (docs/DESIGN.md, tables) */
  .cvl-shots thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cvl-shots, .cvl-shots tbody, .cvl-shots tr, .cvl-shots td { display: block; width: 100%; }
  .cvl-shots tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .cvl-shots td { border: 0 !important; padding: 2px 0 !important; }
  .cvl-shots td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-size: .8rem; }
  .cvl-shots .cvl-shot-sel { width: auto; }
  .cvl-shots .cvl-shot-text { min-width: 0; }
  .cvl-shots .cvl-shot-act { text-align: left; }
  .cvl-shots .cvl-shot-act .btn { margin: 4px 4px 0 0; }
}
@media (max-width: 560px) {
  .cvl-dl { grid-template-columns: minmax(0, 1fr); }
  .cvl-dl dt { margin-top: 6px; }
  .cvl-compare.side { grid-template-columns: 1fr; }
  .cvl-transport { grid-template-columns: auto minmax(0, 1fr); }
  .cvl-transport .cvl-time { grid-column: 1 / -1; }
  .cvl-job-link { grid-template-columns: 56px minmax(0, 1fr); }
  .cvl-thumb { width: 56px; }
  .cvl-job-side { grid-column: 2; flex-direction: row !important; align-items: center; flex-wrap: wrap; }
  .cvl-events li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cvl-stage video, .cvl-stage img { max-height: 300px; }
}

/* repair: totals, outcome of a launch, hint under a refusal, locked shot */
.cvl-err-hint { flex-basis: 100%; font-size: .84rem; }
.cvl-totals { gap: 6px; flex-wrap: wrap; margin: 0; }
.cvl-outcome { display: flex; flex-direction: column; gap: 4px; }
.cvl-outcome .cvl-outcome-close { align-self: flex-start; }
.cvl-lock { color: var(--muted); display: inline-flex; }

/* « Dépenses et plafonds » (#/admin/depenses, pages/spend-admin.tsx) */
.sp-period { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 16px; }
.sp-period .field { min-width: 180px; }
.sp-alerts { display: grid; gap: 8px; margin: 0 0 16px; }
.sp-gauges { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sp-gauge { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line, #ddd); border-radius: 10px; min-width: 0; }
.sp-gauge-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-gauge-head b { flex: 1 1 100%; overflow-wrap: anywhere; }
.sp-gauge.warn .progress > div { background: var(--warn); }
.sp-gauge.err .progress > div { background: var(--danger-text, #7a1a12); }
.sp-gauge-figures { font-size: .9em; overflow-wrap: anywhere; }
.sp-bar { min-width: 80px; }
.sp-tariff-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; margin-top: 14px; }

/* « Préparer pour… » (Publicité produit lot 7, ui/destinations.tsx) — scoped to .dst / .dst-export */
.dst h2 { font-size: var(--fs-h2); margin: 0 0 6px; }
.dst-intro { margin: 0 0 14px; max-width: 70ch; }
.dst-grid { display: grid; gap: 18px 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .dst-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); } }
.dst-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.dst-side .field, .dst-side select { width: 100%; }
.dst-go { touch-action: manipulation; }
.dst-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.dst-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dst-check { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dst-check:last-child { border-bottom: 0; }
.dst-check .badge { flex: none; min-width: 6.5em; justify-content: center; }
.dst-msg { min-width: 0; }
.dst-specs { margin-top: 14px; }
.dst-specs summary, .dst-export summary { cursor: pointer; font-weight: 600; }
.dst-table-wrap { overflow-x: auto; }
.dst-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-top: 8px; }
.dst-table th, .dst-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dst-table thead th { font-size: .8rem; color: var(--ink-3, #555); }
.dst-note { display: block; }
.dst-export { margin-top: 10px; }
@media (max-width: 699px) {
  .dst-table thead { display: none; }
  .dst-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .dst-table th, .dst-table td { display: block; border: 0; padding: 2px 0; }
}

/* ============================================================================================= Missions IA — Réalisateur IA 360 (pages/director.tsx) */
.dr { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dr h2 { font-size: 1.08rem; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr h3 { font-size: .98rem; margin: 0; }
.dr .field { min-width: 0; }
.dr .field input, .dr .field textarea, .dr .field select { width: 100%; min-width: 0; box-sizing: border-box; }
.dr-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dr-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dr-form { gap: 14px; }
.dr-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.dr-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.dr-fieldset { border: 1px solid var(--line); border-radius: var(--radius, 8px); padding: 10px 14px 12px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dr-fieldset legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.dr-check { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; touch-action: manipulation; min-width: 0; }
.dr-check input { margin-top: 3px; flex: none; }
.dr-check .badge { margin-left: 6px; }
.dr-fold summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.dr-fold[open] > summary { margin-bottom: 10px; }
.dr-bullets { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.dr-detail { margin: 4px 0 0; overflow-wrap: anywhere; }
.dr-error { margin: 4px 0 0; color: var(--danger); overflow-wrap: anywhere; }

/* progress bar */
.dr-bar { display: block; position: relative; height: 8px; border-radius: 999px; background: var(--track-2); overflow: hidden; flex: 1; min-width: 60px; }
.dr-bar > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: inherit; transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .dr-bar > span { transition: none; } }

/* list */
.dr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dr-list a { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; min-width: 0; touch-action: manipulation; }
.dr-list a:hover { border-color: var(--accent); }
.dr-row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.dr-row-main b { overflow-wrap: anywhere; }
.dr-row-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* quote */
.dr-quote { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dr-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 0; }
.dr-figures > div { min-width: 0; }
.dr-figures dt { font-size: .8rem; color: var(--muted); }
.dr-figures dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.dr-engines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.dr-engines li { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.dr-engines .badge { flex: none; white-space: nowrap; }
.dr-warnings { margin: 0; padding: 8px 12px 8px 28px; background: var(--warn-soft); color: var(--warn-text); border-radius: 8px; font-size: .86rem; display: flex; flex-direction: column; gap: 4px; }
.dr-table td .badge { white-space: nowrap; }

/* mission header */
.dr-head { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; max-width: 640px; }
.dr-head-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dr-head-progress { display: flex; align-items: center; gap: 10px; }
.dr-head-progress b { font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: right; }

/* layout */
.dr-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.dr-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* decision */
.dr-decision { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border: 2px solid var(--accent); border-radius: 12px; background: var(--accent-soft); min-width: 0; }
.dr-decision h2 { color: var(--accent-text); }
.dr-question { margin: 0; font-size: .98rem; overflow-wrap: anywhere; white-space: pre-line; }
.dr-decision .field textarea { background: var(--surface); }
.dr-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* authorise */
.dr-authorize { border-color: var(--accent); }
.dr-auth-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.dr-auth-form .field { flex: 1 1 240px; }

/* delivery */
.dr-delivery { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--ok-line); background: var(--teal-soft); color: var(--ok-text); min-width: 0; }
.dr-delivery h2 { color: var(--teal); }
.dr-delivery p { margin: 4px 0 0; }

/* stepper */
.dr-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dr-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.dr-step:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.dr-step.is-succeeded:not(:last-child)::before { background: var(--teal); }
.dr-step-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); background: var(--surface); color: var(--muted); box-sizing: border-box; font-size: .78rem; font-weight: 700; }
.is-succeeded .dr-step-icon { background: var(--teal); border-color: var(--teal); color: #fff; }
.is-running .dr-step-icon { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.is-waiting .dr-step-icon { border-color: var(--accent); color: var(--accent-text); }
.is-failed .dr-step-icon { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.is-skipped .dr-step-icon, .is-canceled .dr-step-icon { border-style: dashed; }
.dr-step-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 4px; }
.dr-step-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr-step-label { overflow-wrap: anywhere; }
.is-pending .dr-step-label { color: var(--muted); font-weight: 600; }
.dr-step-progress { display: flex; align-items: center; gap: 8px; max-width: 360px; }
.dr-restart { align-self: flex-start; }

/* journal */
.dr-journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dr-journal li { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 4px 14px; padding: 8px 0 8px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.dr-journal li:last-child { border-bottom: 0; }
.dr-journal li.lvl-warning { border-left-color: var(--warn); }
.dr-journal li.lvl-error { border-left-color: var(--danger); }
.dr-journal li.lvl-decision { border-left-color: var(--accent); }
.dr-journal li.lvl-cost { border-left-color: var(--teal); }
.dr-journal-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.dr-journal-msg { font-size: .9rem; overflow-wrap: anywhere; min-width: 0; }

@media (max-width: 900px) {
  .dr-cols { grid-template-columns: minmax(0, 1fr); }
  .dr-journal li { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dr-actions { justify-content: stretch; }
  .dr-actions .btn { flex: 1 1 auto; }
  .dr-delivery .btn { width: 100%; justify-content: center; }
  .dr-table thead { display: none; }
  .dr-table tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .dr-table td { display: flex; gap: 8px; border: 0; padding: 3px 4px; }
  .dr-table td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; min-width: 7.5em; flex: none; }
}

/* Pages « editeur » — redesign section owned by one agent; appended after styles.css at build time. */
/* =====================================================================================================
   Timeline editor (editor/editor.tsx), scoped to .editor / .ed-*. A calm dark workspace built from the ink tokens:
   the accent is kept for the main action (Play); active states use the warm marker of the sidebar (#f08a4b).
   GEOMETRY IS NOT TOUCHED here: track heads / lanes 54 px, ruler 26 px, clip top 5 px + height 44 px, heads column
   150 px, playhead and pixel-per-second maths (tests/e2e/run.ts measures them).
   ===================================================================================================== */
.editor {
  --ed-bg: var(--ink);
  --ed-panel: var(--ink-2);
  --ed-raise: var(--ink-3);
  --ed-line: #2f3440;
  --ed-line-soft: #262a33;
  --ed-text: #ece9e4;
  --ed-muted: #a3a7b1;
  --ed-mark: #f08a4b;
  --ed-mark-soft: rgba(240, 138, 75, .16);
  background: var(--ed-bg); color: var(--ed-text); border-radius: 14px; padding: 12px; gap: 10px;
  color-scheme: dark; /* native spinners, scrollbars and select popups match the dark workspace */
}
.editor .timeline { user-select: none; -webkit-user-select: none; }      /* no text selection while dragging clips */
.editor .timeline .scroller { overscroll-behavior-x: contain; }           /* horizontal scroll never triggers history swipe */
.editor .muted { color: var(--ed-muted); }
.editor a { color: #f6b48a; }
.editor .btn { background: var(--ed-raise); border-color: #3a404d; color: var(--ed-text); touch-action: manipulation; }
.editor .btn:hover:not([disabled]) { border-color: #6b7180; background: #323845; }
.editor .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.editor .btn.primary:hover:not([disabled]) { background: var(--accent-hover); border-color: var(--accent-hover); }
.editor .btn.danger { color: #ff9b91; border-color: #6b3330; }
.editor .btn.ghost { background: transparent; border-color: transparent; }
.editor .btn[disabled] { opacity: .4; }
.editor input, .editor select, .editor textarea { background: #171a20; border: 1px solid #3a404d; color: var(--ed-text); border-radius: 7px; }
.editor input:hover:not(:disabled), .editor select:hover:not(:disabled), .editor textarea:hover:not(:disabled) { border-color: #59606e; }
.editor input[type=color] { background: #171a20; border-color: #3a404d; }
.editor input[type=checkbox], .editor input[type=range] { accent-color: var(--ed-mark); }
.editor :focus-visible { box-shadow: 0 0 0 2px var(--ed-bg), 0 0 0 4px #f6b48a; }
.editor .badge { background: #2f3440; color: #d6d8de; }
.editor .badge.ok { background: rgba(15, 124, 112, .22); color: #7fd6c9; }
.editor .badge.warn { background: rgba(138, 90, 0, .3); color: #f2c66d; }
.editor .badge.err { background: rgba(180, 35, 24, .28); color: #ffaaa1; }

/* ---------- preview */
.editor .stage-wrap { background: #08090b; border-radius: 10px; }

/* ---------- toolbar: labelled groups, quiet buttons, one accent (Play) */
.editor .toolbar { gap: 6px 14px; padding: 6px 4px; }
.ed-group { display: flex; align-items: center; gap: 4px; }
.ed-group + .ed-group, .toolbar > .badge + .ed-group { padding-left: 14px; border-left: 1px solid var(--ed-line); }
.editor .ed-icon { padding: 0; width: 38px; }
.editor .ed-play { width: 44px; min-height: 40px; padding: 0; border-radius: 999px; }
.editor .ed-play svg { width: 18px; height: 18px; }
.editor .timecode { background: #08090b; border: 1px solid var(--ed-line-soft); color: #fff; font-weight: 700; font-size: .94rem; letter-spacing: .01em; padding: 8px 12px; border-radius: 8px; min-width: 168px; }
.editor .ed-toggle[aria-pressed="true"] { background: var(--ed-mark-soft); border-color: var(--ed-mark); color: #ffd2b5; }
.ed-check { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; cursor: pointer; min-height: 32px; }
.ed-check input { width: 16px; height: 16px; margin: 0; flex: none; }
.toolbar .ed-check { padding: 0 6px; }
.ed-save { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--ed-muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ed-save::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex: none; background: #7fd6c9; }
.ed-save.busy::before { background: #f2c66d; }
.ed-save.err { color: #ffaaa1; }
.ed-save.err::before { background: #ff7a6e; }

/* ---------- timeline (colours and type only) */
.editor .timeline { background: #191c23; border: 1px solid var(--ed-line-soft); }
.editor .timeline .heads { border-right-color: var(--ed-line); background: #1b1e25; }
.editor .timeline .head { border-bottom-color: var(--ed-line-soft); padding: 5px 8px; gap: 3px; font-size: .78rem; }
.editor .timeline .head.locked { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .025) 6px 12px); }
.ed-head-name { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.ed-head-name b { font-size: .8rem; color: var(--ed-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ed-head-name .muted { font-size: .7rem; flex: none; }
.ed-head-ctl { display: flex; align-items: center; gap: 3px; }
.editor .timeline .head .ed-head-ctl button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; padding: 0; border-radius: 5px; border: 1px solid #383e4a; background: transparent; color: #b9bdc6; cursor: pointer; }
.editor .timeline .head .ed-head-ctl button:hover { border-color: #6b7180; color: #fff; }
.editor .timeline .head .ed-head-ctl button.on { background: var(--ed-mark-soft); border-color: var(--ed-mark); color: #ffd2b5; }
.ed-head-ctl input[type=range] { width: 52px; min-width: 0; height: 22px; padding: 0; margin-left: 2px; border: 0; background: transparent; }
.ed-add-track { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px; }
.ed-add-track > span { width: 100%; font-size: .72rem; color: var(--ed-muted); }
.ed-add-track button { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 6px; border-radius: 5px; border: 1px dashed #464c59; background: transparent; color: #cfd2da; font-size: .72rem; cursor: pointer; }
.ed-add-track button:hover { border-style: solid; border-color: #6b7180; color: #fff; }
.editor .timeline .ruler-head { border-bottom-color: var(--ed-line); background: #1b1e25; }
.editor .timeline .ruler { background: #20242c; border-bottom-color: var(--ed-line); }
.editor .timeline .tick { border-left-color: #3a404d; color: #959aa6; font-variant-numeric: tabular-nums; }
.editor .timeline .lane { border-bottom-color: var(--ed-line-soft); }
.editor .timeline .lane.drop { background: var(--ed-mark-soft); }
.editor .clip { border: 1px solid rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); font-size: .74rem; }
.editor .clip.video { background: #33527a; }
.editor .clip.image { background: #56478a; }
.editor .clip.audio { background: #17695f; }
.editor .clip.text { background: #8f3a12; }
.editor .clip:hover { border-color: rgba(255, 255, 255, .34); }
.editor .clip.selected { outline: 2px solid #fff4ea; outline-offset: 1px; box-shadow: 0 0 0 5px rgba(240, 138, 75, .45); }
.editor .clip:focus-visible { outline: 2px solid #f6b48a; outline-offset: 1px; box-shadow: none; border-radius: 6px; }
.editor .clip .lbl { font-weight: 600; }
.editor .clip .lbl.dur { font-weight: 400; opacity: .8; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; }
.ed-muted-mark { display: inline-flex; }
.editor .clip .h:hover { background: rgba(255, 255, 255, .28); }

/* ---------- inspector */
.editor .inspector { background: var(--ed-panel); border: 1px solid var(--ed-line-soft); padding: 0; gap: 0; font-size: .86rem; line-height: 1.45; }
.ed-tabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--ed-line); position: sticky; top: 0; background: var(--ed-panel); z-index: 1; }
.ed-tab { flex: 1 1 auto; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 11px 6px 9px; color: var(--ed-muted); font-weight: 600; font-size: .85rem; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.ed-tab:hover { color: var(--ed-text); }
.ed-tab.active { color: #fff; border-bottom-color: var(--ed-mark); }
.editor .ed-tab:focus-visible { box-shadow: inset 0 0 0 2px #f6b48a; border-radius: 6px 6px 0 0; }
.ed-panel { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ed-fields { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ed-fields:disabled .ed-field, .ed-fields:disabled .ed-range, .ed-fields:disabled .ed-check { opacity: .6; }
.editor .inspector h3 { text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 700; color: var(--ed-text); margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--ed-line); }
.ed-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .84rem; color: #d6d8de; }
.ed-field input[type=number] { width: 88px; min-height: 32px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.ed-field select { min-height: 32px; padding: 4px 8px; max-width: 170px; }
.ed-field > span { min-width: 0; display: inline-flex; align-items: center; gap: 8px; }
.ed-range { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; color: #d6d8de; }
.ed-range > span { display: flex; justify-content: space-between; gap: 10px; }
.ed-val { color: var(--ed-muted); font-variant-numeric: tabular-nums; }
.ed-range input[type=range] { width: 100%; padding: 0; border: 0; background: transparent; min-height: 22px; }
.ed-stack { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.ed-stack select { min-height: 34px; padding: 4px 8px; }
.ed-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.ed-grid2 .ed-field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.ed-grid2 .ed-field input[type=number] { width: 100%; }
.ed-presets, .ed-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-actions { padding-top: 4px; }
.ed-hint { margin: 0; color: var(--ed-muted); font-size: .8rem; line-height: 1.5; }
.ed-note { margin: 8px 0 0; width: 100%; padding: 8px 10px; border-radius: 7px; background: rgba(138, 90, 0, .22); color: #f2d08f; font-size: .8rem; }
.ed-empty { padding: 16px 14px; border: 1px dashed #3a404d; border-radius: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ed-empty b { font-size: .9rem; }
.ed-empty p { margin: 0; color: var(--ed-muted); font-size: .84rem; max-width: 38ch; }
.ed-cliphead { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding-bottom: 2px; }
.ed-swatch { width: 10px; height: 34px; border-radius: 3px; flex: none; margin-top: 2px; }
.ed-swatch.video { background: #4a73a8; } .ed-swatch.image { background: #7562b5; } .ed-swatch.audio { background: #1f8d7f; } .ed-swatch.text { background: #c2531c; }
.ed-cliphead-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ed-cliphead-text b { font-size: .95rem; overflow-wrap: anywhere; }
.ed-cliphead-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--ed-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.editor .inspector textarea { min-height: 72px; padding: 8px; }
.ed-facts { margin: 0; display: flex; flex-direction: column; }
.ed-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .84rem; }
.ed-facts div + div { border-top: 1px solid var(--ed-line-soft); }
.ed-facts dt { color: var(--ed-muted); }
.ed-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ed-panel > h3:first-child, .ed-fields > h3:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.ed-panel .ed-check { align-items: flex-start; }
.ed-panel .ed-check input { margin-top: 2px; }

/* media panel */
.ed-seg { display: flex; padding: 3px; gap: 2px; border-radius: 9px; background: #171a20; border: 1px solid var(--ed-line-soft); }
.ed-seg button { flex: 1; min-height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--ed-muted); font-weight: 600; font-size: .8rem; cursor: pointer; touch-action: manipulation; }
.ed-seg button:hover { color: var(--ed-text); }
.ed-seg button.active { background: var(--ed-raise); color: #fff; box-shadow: inset 0 -2px 0 var(--ed-mark); }
.editor .library { gap: 8px; }
.editor .library button { background: #191c23; border: 1px solid var(--ed-line-soft); border-radius: 9px; padding: 6px; color: var(--ed-text); font-size: .76rem; display: flex; flex-direction: column; gap: 2px; min-width: 0; touch-action: manipulation; }
.editor .library button:hover:not(:disabled) { border-color: var(--ed-mark); background: #20242c; }
.editor .library button:disabled { opacity: .55; cursor: not-allowed; }
.editor .library .thumb { background-color: #262a33; background-image: none; border-radius: 6px; margin-bottom: 4px; display: grid; place-items: center; color: var(--ed-muted); }
.editor .library .thumb[style*="background-image"] { background-size: cover; background-position: center; }
.editor .library .thumb.audio { background-color: rgba(15, 124, 112, .25); color: #7fd6c9; }
.editor .library .thumb svg { width: 20px; height: 20px; }
.ed-lib-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* captions panel */
.ed-svc { border: 1px solid var(--ed-line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #191c23; }
.ed-svc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.ed-svc-top b { font-size: .9rem; }
.ed-svc p { margin: 0; color: var(--ed-muted); font-size: .82rem; line-height: 1.5; }
.ed-svc + h3 { border-top: 0; padding-top: 4px; }
/* one cue = start | end | delete on the first line, its full text below (legible in a 300 px column) */
.editor .cues { gap: 0; max-height: 320px; }
.editor .cue { grid-template-columns: 76px 76px minmax(0, 1fr) 30px; grid-template-areas: "s e . x" "txt txt txt txt"; gap: 6px; padding: 8px 0; }
.editor .cues .cue + .cue { border-top: 1px solid var(--ed-line-soft); }
.editor .cue > :nth-child(1) { grid-area: s; } .editor .cue > :nth-child(2) { grid-area: e; }
.editor .cue > :nth-child(3) { grid-area: txt; } .editor .cue > :nth-child(4) { grid-area: x; }
.editor .cue input { min-height: 32px; padding: 4px 8px; font-size: .84rem; min-width: 0; }
.editor .cue input:not([data-testid]) { font-variant-numeric: tabular-nums; text-align: right; }
.editor .cue .ed-icon { width: 30px; min-height: 30px; color: var(--ed-muted); }
.editor .cue .ed-icon:hover { color: #ffaaa1; }
.editor .ed-cue-head { font-size: .74rem; color: var(--ed-muted); padding: 0; grid-template-areas: "s e . x"; margin-bottom: -6px; }
.ed-cue-head span:nth-child(-n+2) { text-align: right; padding-right: 8px; }
.ed-cue-head span:nth-child(3) { display: none; }

/* phones: simplified list (editor.tsx ClipList) */
.ed-cliplist { grid-area: timeline; background: #191c23; border: 1px solid var(--ed-line-soft); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ed-pos { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 600; }
.ed-pos input[type=range] { width: 100%; border: 0; padding: 0; background: transparent; min-height: 28px; }
.ed-cl-track { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--ed-line-soft); }
.ed-cl-name { font-size: .8rem; font-weight: 700; color: var(--ed-muted); }
.editor .clip.ed-cl-clip { position: relative; top: 0; height: auto; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 8px 12px; font: inherit; font-size: .84rem; cursor: pointer; touch-action: manipulation; }
.ed-cl-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ed-cl-time { flex: none; font-variant-numeric: tabular-nums; opacity: .85; font-size: .78rem; }
.ed-cl-empty { font-size: .8rem; color: var(--ed-muted); padding: 8px 12px; border: 1px dashed #3a404d; border-radius: 8px; }

/* ---------- below the editor: shortcuts and the rule of tracks */
.ed-help { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; font-size: .82rem; color: var(--muted); }
.ed-help p { margin: 0; max-width: 72ch; }
.ed-keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ed-keys li { display: inline-flex; align-items: center; gap: 6px; }
.ed-kbd { display: inline-flex; gap: 3px; }
.ed-help kbd { font: inherit; font-size: .74rem; font-weight: 600; min-width: 22px; text-align: center; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--text); }

@media (max-width: 1199px) {
  /* the toolbar wraps here: dividers would start a line, so groups are told apart by spacing only */
  .ed-group + .ed-group, .toolbar > .badge + .ed-group { padding-left: 0; border-left: 0; }
  .editor .toolbar { column-gap: 18px; }
}
@media (max-width: 900px) {
  .editor { grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; } /* a 1fr track would widen to its content and overflow the phone */
  .editor > * { min-width: 0; max-width: 100%; }
  .ed-group { flex-wrap: wrap; min-width: 0; max-width: 100%; } /* the cut / text / generate group wraps instead of pushing past the edge */
  .editor .inspector { max-height: none; }
  .ed-tabs { padding-inline: 10px; gap: 4px; }
  .ed-tab { flex: 0 1 auto; padding-inline: 14px; }
}
@media (max-width: 759px) {
  .editor { padding: 10px; border-radius: 12px; }
  .editor .toolbar { gap: 8px 10px; }
  .ed-tab { flex: 1 1 auto; padding-inline: 4px; }
  .editor .timecode { min-width: 0; flex: 1; }
  .ed-transport { flex: 1 1 100%; }
  .ed-save { flex: 1 1 100%; }
  .toolbar > .grow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .editor * { transition: none !important; } }

/* ---------- smart captions panel (editor/captions-panel.tsx) */
.editor .inspector .ed-cap-title { border-top: 0; padding-top: 0; margin-top: 0; font-size: 1rem; }
.ed-cap-group { border: 1px solid var(--ed-line); border-radius: 10px; overflow: hidden; }
.ed-acc { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #191c23; border: 0; color: var(--ed-text); font-weight: 700; font-size: .86rem; padding: 9px 12px; cursor: pointer; text-align: left; touch-action: manipulation; }
.ed-acc:hover { background: #1f232b; }
.ed-acc[aria-expanded="true"] { border-bottom: 1px solid var(--ed-line-soft); }
.ed-cap-body { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; }
.ed-cap-body .ed-hint:first-child { margin-top: 0; }
.ed-presets .btn[aria-pressed="true"] { background: var(--ed-mark-soft); border-color: var(--ed-mark); color: #ffd2b5; }
.ed-custom { display: inline-flex; align-items: center; gap: 2px; }
.ed-sync { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ed-sync li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .82rem; padding: 6px 0; border-bottom: 1px solid var(--ed-line-soft); }
.ed-sync li:last-child { border-bottom: 0; }
.ed-sync b { min-width: 0; overflow-wrap: anywhere; }
.ed-words { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-word { background: #171a20; border: 1px solid #3a404d; color: var(--ed-text); border-radius: 6px; padding: 3px 7px; font-size: .84rem; cursor: pointer; touch-action: manipulation; }
.ed-word:hover:not([disabled]) { border-color: #6b7180; }
.ed-word.sug { border-style: dashed; border-color: #f2c66d; }
.ed-word.em, .ed-word[aria-pressed="true"] { background: rgba(255, 159, 67, .22); border-color: #ff9f43; color: #ffd2b5; }
.editor .cue.current input { border-color: var(--ed-mark); }

/* ---------- montage workspace: preview and timeline visible together (wide screens), splitter between them.
   The track geometry above is unchanged (heads 150 px, lanes 54 px, ruler 26 px). */
.editor .stage-wrap { position: relative; }
.ed-split { grid-area: split; display: none; }
@media (min-width: 901px) {
  .editor {
    height: calc(100dvh - var(--header-h) - 24px); min-height: 540px;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: minmax(140px, min(var(--ed-top, 40%), calc(100% - 300px))) 12px auto minmax(180px, 1fr);
    grid-template-areas: "stage inspector" "split split" "toolbar toolbar" "timeline timeline";
    row-gap: 4px;
  }
  .editor .stage-wrap { min-height: 0; overflow: hidden; }
  .editor .stage { max-height: none; }
  .editor .inspector { max-height: none; min-height: 0; }
  .editor .timeline { min-height: 0; }
  .ed-split { display: flex; align-items: center; justify-content: center; cursor: row-resize; touch-action: none; border-radius: 6px; }
  .ed-split span { width: 56px; height: 4px; border-radius: 2px; background: #3a404d; transition: background .15s; }
  .ed-split:hover span, .ed-split.active span, .ed-split:focus-visible span { background: var(--ed-mark); }
}

/* lanes scroll in both directions; heads follow vertically (editor.tsx onScroll), ruler stays on top */
.editor .timeline { position: relative; grid-template-rows: minmax(0, 1fr); }
.editor .timeline .heads { overflow: hidden; min-height: 0; }
.editor .timeline .scroller { overflow: auto; min-height: 0; scroll-behavior: auto; }
.ed-content { position: relative; min-height: 100%; }
.editor .timeline .ruler { position: sticky; top: 0; z-index: 6; touch-action: none; }
.editor .timeline .ruler-head { position: sticky; top: 0; z-index: 2; }
.ed-add-track { height: 92px; overflow: hidden; align-content: flex-start; }
.lane-spacer { height: 92px; }
.ph-flag { position: absolute; top: 0; bottom: -1px; width: 2px; background: #ff6b5b; pointer-events: none; z-index: 2; }
.ph-flag::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: #ff6b5b; }
@media (max-width: 900px) {
  .editor .timeline .scroller, .editor .timeline .heads { max-height: 62vh; }
}

/* playhead off-screen (paused) and « Reprendre le suivi » (follow suspended during playback), on the ruler */
.ed-off, .ed-resume {
  position: absolute; top: 2px; z-index: 8; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: 999px; border: 1px solid rgba(255, 107, 91, .65); background: rgba(24, 27, 33, .94); color: #ffb9b0;
  font-family: inherit; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4); touch-action: manipulation;
}
.ed-off:hover, .ed-resume:hover { background: #2a1f22; color: #fff; }
.ed-off[hidden], .ed-resume[hidden] { display: none; }
.ed-off[data-side=left], .ed-resume[data-side=left] { left: 156px; }
.ed-off[data-side=right], .ed-resume[data-side=right] { right: 18px; }
.ed-off[data-side=left] .ed-off-r, .ed-off[data-side=right] .ed-off-l { display: none; }
.ed-off span { display: inline-flex; }
.ed-resume { border-color: var(--ed-mark); color: #ffd2b5; }

/* filmstrip in visual clips (editor.tsx Filmstrip, frames from editor/thumbs.ts); the colour block stays underneath */
.ed-strip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.ed-fr { position: absolute; top: 0; bottom: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .25s; box-shadow: inset -1px 0 0 rgba(0, 0, 0, .35); }
.ed-fr[style*="background-image"] { opacity: .92; }
.ed-strip::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 14, 22, .8) 0, rgba(10, 14, 22, .3) 58%, rgba(10, 14, 22, .12)); }
.editor .clip .lbl { text-shadow: 0 1px 2px rgba(0, 0, 0, .75); }
.editor .clip.video .wave { opacity: .3; } /* the sound of a video clip stays readable without hiding its frames */
@media (prefers-reduced-motion: reduce) { .ed-fr { transition: none; } }

/* ---------- Ergonomics and accessibility (remediation wave 2, docs/qualite/ACCESSIBILITE.md) */

/* ANO-UX-003: a tab bar wider than its box fades on the side where tabs are hidden (ui/layout-hooks.ts sets data-more) */
.tabs { scrollbar-width: thin; scroll-padding-inline: 32px; }
.tabs[data-more] { --tabs-fade: 44px; }
.tabs[data-more="end"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--tabs-fade)), transparent); mask-image: linear-gradient(to right, #000 calc(100% - var(--tabs-fade)), transparent); }
.tabs[data-more="start"] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - var(--tabs-fade)), transparent); mask-image: linear-gradient(to left, #000 calc(100% - var(--tabs-fade)), transparent); }
.tabs[data-more="both"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--tabs-fade), #000 calc(100% - var(--tabs-fade)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--tabs-fade), #000 calc(100% - var(--tabs-fade)), transparent); }

/* ANO-UX-001: figures of « Performances » (Diffusion sociale) drawn like the cards of Vidéos courtes, without link */
.sv-kpi.static { cursor: default; }
.sv-kpi.static:hover b { color: inherit; }

/* ANO-UX-004: text entry dialog (promptDialog) */
.prompt-dialog .dialog { width: min(520px, calc(100vw - 32px)); }
.prompt-form { gap: 10px; }
.prompt-form input, .prompt-form textarea { width: 100%; }
.prompt-area { min-height: 180px; resize: vertical; font: inherit; }
.field-error { margin: 0; color: var(--danger, #b42318); font-size: .86rem; font-weight: 600; }

/* ANO-UX-002: estimate failure shown in the panel */
.intel-estimate-err { align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ANO-UX-005: admin journal — readable label, code in second plan */
.adm-code { display: block; overflow-wrap: anywhere; }

/* Keyboard focus (WCAG 1.4.11 / 2.4.7): a 2 px ring of solid colour with a gap, at least 3:1 against the page in both
   themes (the former 35 % orange halo measured 1.6:1 on white) */
:root { --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
html:root[data-theme=dark] { --focus: 0 0 0 2px var(--surface), 0 0 0 4px #ffa366; }

/* ANO-UX-007: a line of a menu group never ends in « … » at the default width: a long label takes a second line
   (the full label and what the page is for stay in the tooltip) */
.sidebar .nav-sub .nav-row > a .nav-label { white-space: normal; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }

/* Sign-in / sign-up: the pitch is a paragraph (the title of the form is the page's only h1), same look as before */
.auth .hero .auth-headline { font-size: 2.4rem; line-height: 1.12; letter-spacing: -.03em; margin: 0 0 16px; max-width: 460px; color: #fff; font-weight: 700; text-wrap: balance; }
@media (max-width: 900px) { .auth .hero .auth-headline { font-size: 1.6rem; margin-bottom: 10px; } }
/* language switch of the sign-in page in the dark theme: the chosen language stays legible (was 1.2:1) */
html[data-theme=dark] .auth-lang-btn.on { background: #f3efe9; color: #141b2d; }
/* « OK / Actif » badges in the light theme: darker teal text, 4.5:1 on its tint (was 4.4:1) */
.badge.ok { color: #0b6a60; }
html[data-theme=dark] .badge.ok { color: var(--teal); }
/* « Préparer pour… » table headers in the dark theme (were navy on navy, 1.2:1) */
.dst-table thead th { color: var(--muted); }

/* audit B, A6: the value of a date/month/time field restated in the interface language (ui/components.tsx DateEcho) */
.date-echo { display: block; font-weight: 400; }
.date-echo:empty { display: none; }
.adm-month .date-echo { display: inline; }

/* Atelier Cinéma (pages/film.tsx): wizard, Écriture, Structure, Continuité. Scoped .fm-*; tokens of styles.css only. */
.fm-wizard .fm-fieldset, .fm-fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); margin: 0; display: grid; gap: var(--sp-2); }
.fm-fieldset legend { padding: 0 var(--sp-1); font-weight: 700; }

.fm-steps, .fm-seqs, .fm-tree, .fm-tree ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.fm-step-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.fm-step-head h3 { margin: 0; }
.fm-proposal { border-top: 1px solid var(--line); margin-top: var(--sp-3); padding-top: var(--sp-3); display: grid; gap: var(--sp-2); }
.fm-doc { margin: 0; }
.fm-list { padding-left: var(--sp-5); display: grid; gap: var(--sp-1); }
.fm-screenplay { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 22rem; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3); font: inherit; font-size: 0.875rem; }
.fm-seqs > li { border-top: 1px solid var(--line); padding-top: var(--sp-3); }

.fm-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-4); }
.fm-figures div { display: grid; gap: 2px; }
.fm-figures dt { color: var(--ink-2, var(--ink)); font-size: 0.8125rem; }
.fm-figures dd { margin: 0; font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }

.fm-tree { margin-top: var(--sp-4); }
.fm-act h3 { margin: 0 0 var(--sp-2); }
.fm-seq { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.fm-seq-main { display: grid; gap: 2px; min-width: 0; }
.fm-seq-main > * { overflow-wrap: anywhere; }
.fm-seq-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; flex-shrink: 0; }

.fm-fact { display: grid; grid-template-columns: 1.2fr 0.9fr 1fr 1fr; gap: var(--sp-2); }
.fm-fact input, .fm-fact select { min-width: 0; }

@media (max-width: 699px) {
  .fm-seq { flex-direction: column; }
  .fm-fact { grid-template-columns: 1fr 1fr; }
  .fm-figures dd { font-size: 1.0625rem; }
}

/* long labels and table cells never push the page sideways (390 px) */
.fm-continuity .actions, .fm-writing .actions, .fm-structure .actions { flex-wrap: wrap; }
.fm-continuity .cn-check, .fm-wizard .cn-check { white-space: normal; min-width: 0; }
.fm-findings td, .fm-world td, .fm-cost td { overflow-wrap: anywhere; }
.fm-continuity .table, .fm-structure .table { max-width: 100%; }

@media (max-width: 699px) {
  /* findings, world state and cost tables stacked as cards: labelled cells (data-label), actions below */
  .fm-findings thead, .fm-world thead, .fm-cost thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fm-findings, .fm-findings tbody, .fm-findings tr, .fm-findings td,
  .fm-world, .fm-world tbody, .fm-world tr, .fm-world td,
  .fm-cost, .fm-cost tbody, .fm-cost tfoot, .fm-cost tr, .fm-cost td, .fm-cost tfoot th { display: block; width: 100%; min-width: 0; }
  .fm-findings tr, .fm-world tr, .fm-cost tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .fm-findings td, .fm-world td, .fm-cost td, .fm-cost tfoot th { border: 0; padding: 3px 0; text-align: left; }
  .fm-findings td[data-label], .fm-world td[data-label], .fm-cost td[data-label] { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr); gap: 0 10px; align-items: baseline; }
  .fm-findings td[data-label]::before, .fm-world td[data-label]::before, .fm-cost td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
}
.fm-cost .cn-num { white-space: nowrap; }

/* dashboard (§23) */
.fm-stages { list-style: none; margin: var(--sp-3) 0; padding: 0; display: grid; gap: var(--sp-2); }
.fm-stages li { display: grid; grid-template-columns: minmax(8em, 12em) minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; }
.fm-auth { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; margin-top: var(--sp-3); }
.fm-auth .field { min-width: 0; flex: 1 1 12rem; }
.fm-tasks td { overflow-wrap: anywhere; }
.fm-tasks td .btn + .btn, .fm-tasks td .btn { margin: 2px 0; }
@media (max-width: 699px) {
  .fm-stages li { grid-template-columns: minmax(0, 1fr) auto; }
  .fm-stages .cn-progress-bar { grid-column: 1 / -1; grid-row: 2; }
  .fm-tasks thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fm-tasks, .fm-tasks tbody, .fm-tasks tr, .fm-tasks td { display: block; width: 100%; min-width: 0; }
  .fm-tasks tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .fm-tasks td { border: 0; padding: 3px 0; text-align: left; }
  .fm-tasks td[data-label] { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr); gap: 0 10px; align-items: baseline; }
  .fm-tasks td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
}
.fm-stages .cn-progress-bar { width: 100%; }

/* =====================================================================================================
   « Générer un plan » (pages/generate.tsx, pages/gen-admin.tsx) — every selector is scoped .gx / .gx-*.
   Hierarchy: quiet form rows on paper (type, starting point, model, framing, description) → the dark stage, the one
   memorable element: a frame that takes the shape of the chosen format, then holds the progress and the result,
   with the cost and the single main action under it → the history as a plain table.
   ===================================================================================================== */
.gx { --gx-gap: clamp(16px, 2.4vw, 28px); --gx-h: 340px; --gx-light: #f6c3a5; }
.gx-head { margin-bottom: var(--gx-gap); }
.gx-head > div { flex: 1 1 420px; min-width: 0; }
.gx-head h1 { font-size: clamp(1.85rem, 1.4rem + 1.2vw, 2.4rem); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 8px; text-wrap: balance; }
.gx-back { display: inline-block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; text-decoration: none; }
.gx-back:hover { text-decoration: underline; }
.gx-lead { margin: 0; max-width: 62ch; color: var(--muted); font-size: 1rem; }
.gx-gap { margin-bottom: 16px; }
.gx .notice p { margin: 4px 0 0; }
.gx .notice ul { margin: 6px 0 0; padding-left: 18px; }

.gx-layout { display: grid; gap: var(--gx-gap); grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: calc(var(--gx-gap) * 1.4); }
@media (min-width: 1100px) {
  .gx-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); }
  .gx-stage { position: sticky; top: 16px; }
}

/* ---------------------------------------------------------------- form */
.gx-form { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.gx-group { border: 0; margin: 0; padding: 18px 20px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.gx-group + .gx-group { border-top: 1px solid var(--line); }
.gx-group legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; font-weight: 700; font-size: 1.02rem; }
.gx-group legend + * { clear: both; }
.gx-group[disabled] { opacity: .62; }
.gx-sub { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gx-label { font-size: .86rem; font-weight: 600; }
.gx-hint { color: var(--muted); font-size: .82rem; line-height: 1.45; margin: 0; font-weight: 400; }

.gx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-chip { position: relative; display: inline-flex; touch-action: manipulation; }
.gx-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.gx-chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .88rem; font-variant-numeric: tabular-nums; }
.gx-chip:hover span { border-color: var(--muted); }
.gx-chip.on span { background: var(--ink); border-color: var(--ink); color: #fff; }
.gx-chip input:focus-visible + span { box-shadow: var(--focus); }
.gx-chip input:disabled { cursor: not-allowed; }

.gx-sources { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); max-height: 268px; overflow-y: auto; padding: 2px; }
.gx-src { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; min-width: 0; }
.gx-src input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gx-src .thumb { aspect-ratio: 4 / 3; }
.gx-src.on { border-color: var(--accent); background: var(--accent-soft); }
.gx-src:has(input:focus-visible) { box-shadow: var(--focus); }
.gx-src-name { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-src-more { align-self: flex-start; }
.gx-empty-src { padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.gx-empty-src p { margin: 0; flex: 1 1 260px; color: var(--muted); font-size: .9rem; }

.gx-models { display: flex; flex-direction: column; gap: 6px; }
.gx-model { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-height: 48px; touch-action: manipulation; }
.gx-model input { flex: none; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.gx-model:hover { border-color: var(--line-strong); }
.gx-model.on { border-color: var(--accent); background: #fffaf6; }
.gx-model-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gx-model-text b { font-size: .94rem; }
.gx-model-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.gx-number input { width: 8em; }
.gx-switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.gx-switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background-color .15s; }
.gx-switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--field-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.gx-switch input:checked { background: var(--accent); }
.gx-switch input:checked::after { transform: translateX(18px); }
.gx-switch input:focus-visible { box-shadow: var(--focus); }
.gx-switch-text { display: flex; flex-direction: column; gap: 2px; }
.gx-switch-text b { font-size: .92rem; }
.gx-form textarea { width: 100%; }
.gx-count-chars { align-self: flex-end; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- stage (dark panel) */
.gx-stage { background: var(--ink); color: #f3efe9; border-radius: 18px; padding: clamp(16px, 2.4vw, 24px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gx-stage-top { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.gx-frame { --gx-ar: 1.7778; position: relative; aspect-ratio: var(--gx-ar); width: min(100%, calc(var(--gx-h) * var(--gx-ar))); max-height: var(--gx-h); border-radius: 10px; background: var(--ink-2); box-shadow: inset 0 0 0 1px rgba(243, 239, 233, .16); overflow: hidden; display: flex; align-items: center; justify-content: center; transition: width .25s ease; }
.gx-frame.has-result { box-shadow: inset 0 0 0 1px rgba(143, 224, 211, .5); }
.gx-result, .gx-source-preview { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.gx-source-preview { opacity: .55; object-fit: cover; }
.gx-placeholder { color: #8d8a85; font-size: .9rem; padding: 0 16px; text-align: center; }
.gx-frame-facts { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; color: #a9a59e; font-size: .82rem; font-variant-numeric: tabular-nums; }
.gx-progress { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 16px 18px; background: linear-gradient(180deg, rgba(21, 23, 29, .25), rgba(21, 23, 29, .85)); font-size: .86rem; }
.gx-progress b { color: #fff; font-size: .95rem; }
.gx-pulse { width: 10px; height: 10px; border-radius: 50%; background: #f08a4b; animation: gx-pulse 1.2s ease-in-out infinite; }
@keyframes gx-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
.gx-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; color: #8d8a85; }
.gx-steps li { display: flex; align-items: center; gap: 8px; }
.gx-steps li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.gx-steps li.done { color: #8fe0d3; }
.gx-steps li.done::before { background: currentColor; }
.gx-steps li.now { color: #fff; }
.gx-steps li.now::before { background: #f08a4b; border-color: #f08a4b; }
.gx-elapsed { color: #a9a59e; font-size: .78rem; font-variant-numeric: tabular-nums; }

.gx-done { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.gx-done-lead { margin: 0; color: #8fe0d3; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.gx-done-actions, .gx-cost-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gx-note { margin: 0; color: #a9a59e; font-size: .82rem; line-height: 1.5; }
.gx-missing { margin: 0; color: var(--gx-light); font-size: .86rem; }

.gx-cost { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid rgba(243, 239, 233, .12); }
.gx-cost-line { margin: 0; display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.gx-quote, .gx-budget { margin: 0; display: grid; gap: 8px; }
.gx-quote div, .gx-budget div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.gx-quote dt, .gx-budget dt { color: #d6d2cb; font-size: .88rem; }
.gx-quote dd, .gx-budget dd { margin: 0; color: #fff; font-weight: 700; white-space: nowrap; }
.gx-quote-main dd { font-size: 1.3rem; letter-spacing: -.01em; }
.gx-budget { padding: 10px 12px; border-radius: 10px; background: var(--ink-2); }
.gx-budget dt { font-size: .82rem; color: #a9a59e; }
.gx-budget dd { font-weight: 600; font-size: .86rem; color: #d6d2cb; }

.gx-go { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700; font-size: .98rem; cursor: pointer; text-decoration: none; touch-action: manipulation; transition: background-color .15s; }
.gx-go:hover { background: var(--accent-hover); }
.gx-go[disabled] { opacity: .55; cursor: not-allowed; }
.gx-go svg { width: 18px; height: 18px; }
.gx-stage .gx-quiet { background: transparent; color: #f3efe9; border-color: rgba(243, 239, 233, .35); min-height: 44px; border-radius: 999px; padding: 0 16px; touch-action: manipulation; }
.gx-stage .gx-quiet:hover { border-color: #f3efe9; }
.gx-stage .gx-quiet[disabled] { opacity: .45; }
.gx-go:focus-visible, .gx-stage .gx-quiet:focus-visible { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--gx-light); border-radius: 999px; }
.gx-stage a:not(.btn):not(.gx-go) { color: var(--gx-light); }

/* ---------------------------------------------------------------- history */
.gx-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.gx-section-head h2 { font-size: var(--fs-h2); margin: 0; }
.gx-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.gx-quiet-text { margin: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: .9rem; }
.gx-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gx-table { margin: 0; }
.gx-table tr:last-child td { border-bottom: 0; }
.gx-table th.num, .gx-table td.num { text-align: right; }
.gx-table td > span:not(.badge) { display: block; }
.gx-meta { color: var(--muted); font-size: .8rem; }
.gx-when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.gx-prompt { max-width: 38ch; overflow-wrap: anywhere; }
.gx-prompt > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gx-costcell { white-space: nowrap; }
.gx-actions { text-align: right; white-space: nowrap; }
.gx-modal-media { display: flex; justify-content: center; background: #000; border-radius: 10px; overflow: hidden; }
.gx-modal-media img, .gx-modal-media video { max-width: 100%; max-height: 62vh; display: block; }

/* entry points elsewhere: Médiathèque head */
.bib-head .gx-entry { align-self: flex-end; }

/* admin (service page « Images et plans vidéo ») */
.gx-caps-models { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.gx-caps-models legend { font-weight: 600; font-size: .9rem; margin-bottom: 4px; padding: 0; }
.gx-caps-list { list-style: none; margin: 4px 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gx-caps-list .row { gap: 8px; }
.gx-caps-models .adm-check, .gx-caps-list label { min-height: 32px; }
.gx-consumption h3 { margin-top: 14px; }

/* ---------------------------------------------------------------- tablet / phone */
@media (max-width: 1099px) { .gx { --gx-h: 300px; } }
@media (max-width: 699px) {
  .gx { --gx-h: 260px; }
  .gx-group { padding: 16px 14px; }
  .gx-go, .gx-stage .gx-quiet { flex: 1 1 100%; }
  .gx-done-actions > *, .gx-cost-actions > * { flex: 1 1 100%; }
  .gx-sources { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  /* history: one stacked block per generation, no horizontal scroll */
  .gx-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .gx-table, .gx-table tbody, .gx-table tr, .gx-table td { display: block; width: 100%; }
  .gx-table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .gx-table tr:last-child { border-bottom: 0; }
  table.gx-table td { border: 0; padding: 3px 0; text-align: left !important; max-width: none; white-space: normal; }
  .gx-table td[data-label] { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr); gap: 0 10px; }
  .gx-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; grid-row: 1 / span 4; }
  .gx-table td[data-label] > * { grid-column: 2; }
  .gx-actions .btn { width: 100%; margin-top: 6px; }
}
/* phone / touch: every control of the page is a 44 px finger target (DESIGN.md) */
@media (max-width: 699px), (pointer: coarse) {
  .gx-chip span { min-height: 44px; }
  .gx .btn, .gx-src-more { min-height: 44px; touch-action: manipulation; }
  .gx-model { min-height: 52px; }
  .gx-number input { min-height: 44px; }
  .gx-src { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-pulse { animation: none; opacity: 1; }
  .gx-frame, .gx-go, .gx-switch input, .gx-switch input::after { transition: none; }
}

/* « Modèles IA » matrix and production KPIs (docs/STUDIO-COHERENCE.md) */
.gx-matrix { font-size: .82rem; }
.gx-matrix td, .gx-matrix th { white-space: nowrap; }
.gx-matrix td:first-child { white-space: normal; min-width: 160px; }
.gx-models { overflow-x: auto; }
.gx-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.gx-kpi-grid dt { color: var(--muted); font-size: .82rem; }
.gx-kpi-grid dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 700; display: flex; flex-direction: column; }
.gx-kpi-grid dd .adm-meta { font-weight: 400; font-size: .78rem; }

/* Inspiration vidéo (#/inspiration/…) — Design System tokens only (docs/DESIGN.md). Reuses .sv, .card, .badge,
   .insp-dl / .insp-line of the Vidéos courtes pages. Breakpoints: 390 / 834 / 1440 px. */
.intel .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.intel-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.intel-kpi { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; transition: border-color var(--t-fast); }
.intel-kpi:hover, .intel-kpi:focus-visible { border-color: var(--accent); }
.intel-kpi-n { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.intel-meter, .intel-bar { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.intel-meter > span, .intel-bar > span { display: block; height: 100%; background: var(--teal); }
.intel-bar { flex: 1; min-width: 60px; height: 6px; }
.intel-services { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.intel-flow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.intel-flow a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .88rem; }
.intel-flow a:hover { border-color: var(--accent); color: var(--accent-text); }
.intel-step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: .75rem; }

.intel-tiers, .intel-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); border: 0; padding: 0; margin: 0; }
.intel-modes legend { font-weight: 600; margin-bottom: 6px; }
.intel-tier, .intel-mode { display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: 14px; }
.intel-tier input, .intel-mode input { position: absolute; opacity: 0; pointer-events: none; }
.intel-tier.active, .intel-mode.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.intel-tier:focus-within, .intel-mode:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.intel-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 12px; border: 0; padding: 0; margin: 0; }
.intel-checks legend { font-weight: 600; margin-bottom: 6px; }

.intel-refs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.intel-ref { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.intel-ref:hover b { color: var(--accent-text); }
.intel-thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--ink-2); color: var(--on-ink-muted); display: grid; place-items: center; overflow: hidden; }
.intel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.intel-preview, .intel-player { width: 100%; max-height: 62vh; background: #000; border-radius: var(--radius-sm); }
.intel-oembed { width: 160px; border-radius: var(--radius-sm); }
.intel-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.intel-table th, .intel-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.intel-table thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
/* wide tables scroll inside their card on a phone instead of widening the page */
.intel-table-wrap { overflow-x: auto; max-width: 100%; }
.intel-autopub { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; min-width: 0; gap: 8px; }
.intel-autopub legend { font-weight: 700; font-size: .9rem; padding: 0 4px; }
.intel-scroll { overflow-x: auto; }

/* laboratory */
.intel-lab-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: var(--sp-4); align-items: start; }
.intel-lab-side { position: sticky; top: calc(var(--header-h, 64px) + 12px); }
.intel-panel { max-height: calc(100vh - 120px); display: flex; flex-direction: column; overflow: hidden; }
.intel-panel > .tabs { flex-shrink: 0; }
.intel-panel > .col, .intel-panel > div:not(.tabs) { overflow-y: auto; min-height: 0; }
.intel-timeline { display: flex; flex-direction: column; gap: 6px; }
.intel-track { position: relative; height: 34px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; overflow: hidden; }
.intel-track:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.intel-shot { position: absolute; top: 0; bottom: 0; border-right: 2px solid var(--surface); }
.intel-silence { position: absolute; bottom: 0; height: 8px; background: repeating-linear-gradient(45deg, var(--ink-3), var(--ink-3) 3px, transparent 3px, transparent 6px); }
.intel-playhead { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); box-shadow: 0 0 0 1px var(--surface); }
.intel-track-emo { position: relative; height: 10px; }
.intel-track-emo span { position: absolute; top: 1px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; }
.intel-legend { gap: 14px; }
.intel-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.intel-sw-sil { background: repeating-linear-gradient(45deg, var(--ink-3), var(--ink-3) 2px, transparent 2px, transparent 4px); }
.intel-keyframes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.intel-keyframes li { display: flex; flex-direction: column; gap: 2px; }
.intel-kf { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; overflow: hidden; text-align: left; }
.intel-kf:hover, .intel-kf:focus-visible { border-color: var(--accent); }
.intel-kf img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: var(--ink-2); }
.intel-kf > span { padding: 2px 6px 4px; }
.intel-kf-none { display: grid; place-items: center; aspect-ratio: 9 / 16; color: var(--muted); font-size: .8rem; }
.intel-palette { gap: 6px; align-items: center; display: flex; flex-wrap: wrap; margin-top: 10px; }
.intel-chip { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line-strong); display: inline-block; }
.intel-chart { margin: 0; }
.intel-chart svg { width: 100%; height: auto; display: block; }
.intel-chart figcaption { gap: 12px; margin-top: 6px; }
.intel-cues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.intel-cue > button { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; padding: 6px 8px; border: 0; border-left: 3px solid transparent; background: none; cursor: pointer; font: inherit; color: inherit; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.intel-cue > button:hover { background: var(--surface-2); }
.intel-cue > button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.intel-cue.current > button { background: var(--accent-soft); border-left-color: var(--accent); }
.intel-at { min-height: 24px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.intel-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; font-size: .88rem; }
.intel-obs h3 { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.intel-scores { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.intel-scores li { display: grid; grid-template-columns: 150px 1fr 44px; gap: 8px; align-items: center; }

/* creative side */
.intel-dna-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-3); }
.intel-dna-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; height: 100%; }
.intel-dna-card:hover, .intel-dna-card:focus-visible { border-color: var(--accent); }
.intel-dna-card .intel-palette { margin: 0; }
.intel-dna-field > span.row { justify-content: space-between; }
.intel-structure { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.intel-ideas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); }
.intel-idea { display: flex; flex-direction: column; gap: 6px; }
.intel-idea.rejected { opacity: .7; border-style: dashed; }
.intel-scenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.intel-vo { font-size: 1.02rem; margin: 0; }

@media (max-width: 1100px) {
  .intel-lab-grid { grid-template-columns: minmax(0, 1fr); }
  .intel-lab-side { position: static; }
  .intel-panel { max-height: none; }
}
@media (max-width: 600px) {
  .intel-ref { grid-template-columns: 64px minmax(0, 1fr); }
  .intel-ref > .row { grid-column: 1 / -1; }
  .intel-thumb { width: 64px; }
  .intel-preview, .intel-player { max-height: 48vh; }
  .intel-scores li { grid-template-columns: 110px 1fr 40px; }
  .intel-table { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { .intel-kpi, .intel-kf { transition: none; } }

/* Musique & Chansons — Atelier Music 360 (#/musique/…) — Design System tokens only (docs/DESIGN.md). Reuses .sv,
   .sv-narrow, .card, .badge, .tabs, .notice, label.field, .btn. Breakpoints: 390 / 834 / 1440 px. */
.mus .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mus .card { min-width: 0; }
.mus h3 { margin-top: var(--sp-2); }
.mus-between { justify-content: space-between; }
.mus-between h2 { margin: 0; }
.mus-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.mus-cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-3); align-items: start; }
.mus-end { display: flex; align-items: flex-end; height: 100%; }
.mus select, .mus input, .mus textarea { max-width: 100%; min-width: 0; }
.mus label.field select, .mus label.field input, .mus label.field textarea { width: 100%; }
.mus textarea { resize: vertical; }
.mus label.mus-check { flex-wrap: nowrap; align-items: flex-start; font-weight: 600; font-size: .9rem; }
.mus label.mus-check input { margin-top: 3px; flex-shrink: 0; }

/* quick creation */
.mus-quick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3); align-items: end; margin-bottom: var(--sp-2); }

/* list of songs */
.mus-tracks, .mus-blocks, .mus-lv, .mus-events, .mus-flags, .mus-evidence, .mus-diff { list-style: none; margin: 0; padding: 0; }
.mus-tracks li { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mus-tracks li:last-child { border-bottom: 0; padding-bottom: 0; }
.mus-track-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.mus-track-link .col { gap: 2px; }
.mus-track-link b { overflow-wrap: anywhere; }
.mus-track-link:hover b { color: var(--accent-text); }

/* player */
.mus-player { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mus-player audio { width: 100%; max-width: 100%; }
.mus-wave { height: 40px; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--teal); overflow: hidden; }

/* key / value lists */
.mus-dl { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: .9rem; }
.mus-dl dt { color: var(--muted); }
.mus-dl dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.mus-notes { margin: 0; padding-left: 18px; font-size: .88rem; display: grid; gap: 4px; overflow-wrap: anywhere; }
.mus .notice ul { margin: 6px 0 0; padding-left: 18px; }

/* folding panels */
.mus-fold { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.mus-fold summary { cursor: pointer; font-weight: 600; padding: 10px 12px; }
.mus-fold-body { padding: 4px 12px 12px; }

/* lyrics editor */
.mus-blocks { display: grid; gap: var(--sp-3); }
.mus-block { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.mus-block.locked { border-color: var(--line-strong); background: var(--surface); }
.mus-block-head { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.mus-block-tools { gap: 2px; flex-wrap: nowrap; }
.mus-block-tools .btn[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); }
.mus-block textarea { width: 100%; font: inherit; line-height: 1.5; }
.mus-lv { display: grid; gap: 10px; }
.mus-lv li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.mus-lv li:last-child { border-bottom: 0; padding-bottom: 0; }
.mus-diff { font-size: .85rem; overflow-wrap: anywhere; }

/* engine choice */
.mus-engines { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px 10px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.mus-engines legend { font-weight: 600; font-size: .86rem; padding: 0 4px; }
.mus-engine { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; cursor: pointer; }
.mus-engine input { margin-top: 4px; }
.mus-engine .col { gap: 2px; overflow-wrap: anywhere; }
.mus-engine.off { cursor: not-allowed; }
.mus-engine.off b { color: var(--muted); font-weight: 600; }
.mus-quote { border-top: 1px solid var(--line); padding-top: var(--sp-3); }

/* versions */
.mus-gen h2 { margin: 0; }
.mus-compare { table-layout: fixed; }
.mus-compare th, .mus-compare td { overflow-wrap: anywhere; }
.mus-compare tbody th { color: var(--text); font-size: .88rem; }

/* history */
.mus-events { display: grid; gap: 0; }
.mus-events li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mus-events li:last-child { border-bottom: 0; }
.mus-events .col { gap: 2px; overflow-wrap: anywhere; }

/* engines and licences */
.mus-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--sp-4); align-items: start; }
.mus-engine-card h2 { margin: 0; }
.mus-engine-card p { margin: 0; overflow-wrap: anywhere; }
.mus-flags { display: grid; gap: 6px; }
.mus-flags li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mus-flags .col { gap: 0; }
.mus-flags code { overflow-wrap: anywhere; }
.mus-evidence { display: grid; gap: 10px; font-size: .88rem; }
.mus-evidence li { display: flex; flex-direction: column; gap: 2px; }
.mus-evidence a { overflow-wrap: anywhere; }
.mus-evidence blockquote { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid var(--line-strong); color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .mus-cols, .mus-cols.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .mus-quick-row { grid-template-columns: minmax(0, 1fr); }
  .mus-block-head { grid-template-columns: minmax(0, 1fr); }
  .mus-block-tools { justify-content: flex-start; }
  .mus-dl { grid-template-columns: minmax(0, 1fr); }
  .mus-dl dt { margin-top: 6px; }
  .mus-events li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mus-end { height: auto; }
  .mus-compare th, .mus-compare td { padding: 6px 4px; font-size: .82rem; }
}

/* albums and EPs */
.mus-col-tracks { list-style: none; margin: 0; padding: 0; }
.mus-col-tracks li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mus-col-tracks li:last-child { border-bottom: 0; }
.mus-col-tracks .col { gap: 2px; }
.mus-col-tracks a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.mus-col-tracks a:hover b { color: var(--accent-text); }
.mus-col-pos { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 560px) {
  .mus-col-tracks li { grid-template-columns: 22px minmax(0, 1fr); }
  .mus-col-tracks .mus-block-tools { grid-column: 2; }
}

/* list tools, read-only previews, settings (functional lot) */
.mus-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); align-items: end; margin-bottom: var(--sp-2); }
.mus-track-actions { gap: 8px; }
.mus-pre { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font: inherit; font-size: .88rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.mus-pre-tall { max-height: 320px; overflow-y: auto; }
.mus fieldset.mus-engines .mus-grid { margin-top: 4px; }
.mus-styles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.mus-styles li { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.mus-ent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mus-ent-row:last-child { border-bottom: 0; }
.mus-formats { display: flex; flex-wrap: wrap; gap: 6px 14px; }
@media (max-width: 700px) {
  .mus-filters { grid-template-columns: minmax(0, 1fr); }
  .mus-ent-row { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================================================
   Menu organisation and favourites (docs/navigation/MENU.md): group lines with their star (ui/shell.tsx), the
   « Favoris » group, the admin entry kept apart at the bottom, and the section bar of a module (ui/module-nav.tsx).
   Same tokens as the rest of the app (docs/DESIGN.md). Loaded before videos.css: selectors stay specific.
   ========================================================================================================== */

/* ---------- a line of a group: the link and its favourite star */
.nav .nav-row { position: relative; display: flex; align-items: center; min-width: 0; }
.nav .nav-row > a { flex: 1; min-width: 0; padding-right: 30px; }
.fav-star { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--on-ink-muted); cursor: pointer; transition: opacity var(--t-fast), color var(--t-fast), background-color var(--t-fast); }
.fav-star svg { width: 15px; height: 15px; }
.fav-star.on { color: var(--accent-bright); }
.fav-star.on svg { fill: currentColor; }
.fav-star[aria-busy=true] { cursor: progress; opacity: .6; }
.nav .nav-row .fav-star { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); opacity: 0; }
.nav .nav-row:hover .fav-star, .nav .nav-row:focus-within .fav-star, .nav .nav-row .fav-star.on { opacity: 1; }
.nav .nav-row .fav-star:hover { color: #fff; background: var(--ink-3); }
.nav .nav-row .fav-star.on:hover { color: var(--accent-bright); }
.nav .nav-row .fav-star:focus-visible { outline: none; opacity: 1; box-shadow: var(--focus-on-ink); }
@media (hover: none) { .nav .nav-row .fav-star { opacity: 1; } }

/* ---------- Favoris */
.nav-ctx { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; font-weight: 400; color: var(--on-ink-muted); }
.nav-empty { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 6px 10px; font-size: .8rem; line-height: 1.4; color: var(--on-ink-muted); }
.nav-empty svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }

/* ---------- closed module, shown to the super-administrator only (ANO-UX-009) */
.nav-off { display: block; font-size: .72rem; font-weight: 400; color: var(--on-ink-muted); font-style: italic; }

/* ---------- Console admin, apart at the bottom */
.nav.nav-admin { margin-top: 8px; }

@media (min-width: 901px) {
  /* icon rail: the star becomes a small badge in the corner of its icon (shown when pinned, on hover / focus, on touch) */
  .shell.rail .nav .nav-row > a { padding-right: 0; }
  .shell.rail .nav .nav-row .fav-star { top: 1px; right: -2px; transform: none; width: 22px; height: 22px; }
  .shell.rail .nav .nav-row .fav-star svg { width: 12px; height: 12px; }
  .shell.rail .nav-empty { justify-content: center; padding: 8px 0; }
  .shell.rail .nav-empty span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 900px) {
  /* drawer: the star is always shown and big enough for a finger */
  .nav .nav-row > a { padding-right: 48px; }
  .nav .nav-row .fav-star { width: 40px; height: 40px; right: 2px; opacity: 1; }
}

/* ---------- section bar of a module (top of its section pages) */
.module-nav { display: flex; flex-direction: column; gap: 4px; margin: 0 0 var(--sp-4); min-width: 0; }
.module-nav-head { display: flex; align-items: center; gap: 4px; min-width: 0; }
.module-nav-name { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border-radius: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.module-nav-name:hover { color: var(--text); }
.module-nav-name:focus-visible { outline: none; box-shadow: var(--focus); }
.module-nav .module-tabs { margin-bottom: 0; }
.tabs.module-tabs { align-items: stretch; }
.module-tab { display: inline-flex; align-items: center; flex: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.module-tab.active { border-bottom-color: var(--accent); }
.tabs.module-tabs .module-tab > a { border-bottom: 0; }
.module-tab:has(.fav-star) > a { padding-right: 4px; }
.module-tabs .fav-star, .module-nav-head .fav-star { color: var(--muted); margin-right: 6px; }
.module-tabs .fav-star { opacity: 0; }
.module-tab:hover .fav-star, .module-tab:focus-within .fav-star, .module-tabs .fav-star.on { opacity: 1; }
.module-tabs .fav-star:hover, .module-nav-head .fav-star:hover { color: var(--text); background: rgba(28, 30, 36, .06); }
.module-tabs .fav-star.on, .module-nav-head .fav-star.on { color: var(--accent-text); }
.module-tabs .fav-star:focus-visible, .module-nav-head .fav-star:focus-visible { outline: none; opacity: 1; box-shadow: var(--focus); }
@media (hover: none) { .module-tabs .fav-star { opacity: 1; } }
@media (max-width: 900px) { .module-tabs .fav-star, .module-nav-head .fav-star { width: 36px; height: 36px; } }

/* ---------- « Favoris » in the header, next to the bell (ui/shell.tsx FavMenu) */
.hdr-fav.has-favs svg { fill: currentColor; color: var(--accent-bright); }
.dd-panel .fav-item .ntf-icon { background: var(--surface-2); color: var(--accent-text); }
.dd-panel .fav-item.current { background: var(--surface-2); }
.dd-panel .fav-item.current b { color: var(--accent-text); }

/* ---------- group heads (owner mock-up 23/11): an open group reads as a section — bold label, faint band */
.sidebar .nav-group.open > .nav-group-head { color: #fff; font-weight: 600; background: rgba(255, 255, 255, .04); }
.sidebar .nav-group.open > .nav-group-head:hover { background: var(--ink-2); }
.sidebar .nav-group.has-active > .nav-group-head .nav-label { font-weight: 600; }
.sidebar .nav-group + .nav-group { margin-top: 2px; }

/* number of favourites next to « Favoris » */
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.nav-count + .nav-chevron { margin-left: 6px; }
@media (min-width: 901px) {
  .shell.rail .nav-group-head { position: relative; }
  .shell.rail .nav-count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: .64rem; }
}

/* first-use suggestions of an empty « Favoris » */
.fav-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 10px 8px; }
.fav-suggest-lead { font-size: .78rem; color: var(--on-ink-muted); }
.fav-suggest-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 3px 10px; border-radius: 14px; border: 1px solid var(--on-ink-line); background: none; color: #fff; font: inherit; font-size: .8rem; cursor: pointer; }
.fav-suggest-btn:hover { background: var(--ink-2); }
.fav-suggest-btn:focus-visible { outline: none; box-shadow: var(--focus-on-ink); }
.fav-suggest-btn svg { color: var(--accent-bright); }
.dd-panel .fav-suggest { padding: 0 10px 12px; justify-content: center; }
.dd-panel .fav-suggest-lead { color: var(--muted); }
.dd-panel .fav-suggest-btn { border-color: var(--line); color: var(--text); }
.dd-panel .fav-suggest-btn:hover { background: var(--surface-2); }
.dd-panel .fav-suggest-btn:focus-visible { box-shadow: var(--focus); }
.dd-panel .fav-suggest-btn svg { color: var(--accent-text); }
@media (max-width: 900px) { .fav-suggest-btn { min-height: 40px; } }

/* « Organiser » in the header panel: up / down / remove, unavailable favourites */
.fav-edit { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 8px; }
.fav-edit .ntf-text { flex: 1; min-width: 0; }
.fav-edit.gone { opacity: .75; }
.fav-edit-actions { display: inline-flex; gap: 2px; flex: none; }
.dd-panel .icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; color: var(--text); }
.dd-panel .icon-btn.sm:hover:not(:disabled) { background: var(--surface-2); }
.dd-panel .icon-btn.sm:disabled { opacity: .3; cursor: default; }
.dd-panel .icon-btn.sm:focus-visible { box-shadow: var(--focus); }
@media (max-width: 900px) { .dd-panel .icon-btn.sm { width: 40px; height: 40px; } }
.fav-gone-head { margin: 8px 10px 2px; font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }

/* « Personnages » bar (Acteurs IA ↔ Mes avatars) */
.family-hint { margin: 0; font-size: .86rem; color: var(--muted); }

/* reduced motion: no transition on the menu */
@media (prefers-reduced-motion: reduce) {
  .nav a, .nav-group-head, .nav-chevron, .fav-star, .module-nav a, .fav-suggest-btn { transition: none !important; }
}

/* ---------- premium scrollbar of the sidebar: thin (4 px drawn, 6 px on hover), on a transparent track; the gutter
   is reserved so that the content never shifts sideways when the bar appears */
.sidebar { scrollbar-gutter: stable; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background-color: rgba(163, 168, 184, .32); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.sidebar:hover::-webkit-scrollbar-thumb { background-color: rgba(163, 168, 184, .5); }
.sidebar::-webkit-scrollbar-thumb:hover, .sidebar::-webkit-scrollbar-thumb:active { background-color: rgba(198, 203, 216, .75); border-width: 1px; }
.sidebar::-webkit-scrollbar-corner { background: transparent; }
/* browsers without the -webkit- pseudo-elements (Firefox): the standard thin bar, same colours */
@supports not selector(::-webkit-scrollbar) {
  .sidebar { scrollbar-width: thin; scrollbar-color: rgba(163, 168, 184, .45) transparent; }
}

/* ---------- resize handle on the right border of the labelled menu (ui/sidebar-resize.tsx) — just right of the border,
   never over the scrollbar; invisible at rest, a thin line on hover / focus / drag */
.nav-resizer { position: fixed; top: var(--header-h); bottom: 0; left: calc(var(--sidebar-w) - 1px); width: 9px; z-index: var(--z-sidebar); cursor: col-resize; touch-action: none; outline: none; }
.nav-resizer::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: transparent; transition: background-color var(--t-fast); }
.nav-resizer:hover::before { background: rgba(240, 138, 75, .55); }
.nav-resizer[data-dragging]::before, .nav-resizer:focus-visible::before { background: var(--accent-bright); }
.nav-resizer:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-bright); border-radius: 2px; }
body.nav-resizing, body.nav-resizing * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 900px) { .nav-resizer { display: none; } }
@media (prefers-reduced-motion: reduce) { .nav-resizer::before { transition: none; } }
/* the reserved gutter replaces part of the right padding: same room for the labels as before */
.sidebar { padding-right: 4px; }
@media (min-width: 901px) { .shell.rail .sidebar { padding-right: 2px; } }

/* ---------- any dialog open: the page behind stays where it is (app.tsx toggles html.modal-open); the gutter keeps
   the layout from shifting when its scrollbar goes */
html.modal-open { overflow: hidden; scrollbar-gutter: stable; }

/* ---------- search palette (ui/search.tsx): its own scrolling list, a thin bar, the active result always visible */
.palette { display: flex; flex-direction: column; max-height: min(78vh, 640px); }
.palette-backdrop .dialog { display: flex; flex-direction: column; }
.palette-input .palette-kbd { flex: none; font-size: .72rem; }
.palette .palette-list { position: relative; flex: 1 1 auto; min-height: 0; max-height: min(60vh, 480px); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.palette .palette-list::-webkit-scrollbar { width: 8px; }
.palette .palette-list::-webkit-scrollbar-thumb { background-color: var(--line-strong); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.palette-row { display: flex; align-items: center; gap: 4px; border-radius: 8px; padding-right: 6px; }
.palette-row .palette-item { flex: 1; min-width: 0; }
.palette-row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.palette-row .palette-item.on, .palette-row .palette-item:hover { background: none; }
.palette-row.on .palette-item svg { color: var(--accent-text); }
.palette-item-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.palette-item-title b { flex: 0 1 auto; }
.palette-cat { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .7rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.palette-desc { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-row .fav-star { flex: none; width: 32px; height: 32px; color: var(--muted); opacity: .55; }
.palette-row.on .fav-star, .palette-row .fav-star:hover, .palette-row .fav-star.on, .palette-row .fav-star:focus-visible { opacity: 1; }
.palette-row .fav-star:hover { background: var(--surface-2); color: var(--text); }
.palette-row .fav-star.on { color: var(--accent-text); }
.palette-row .fav-star:focus-visible { outline: none; box-shadow: var(--focus); }
@media (max-width: 900px) { .palette-row .fav-star { width: 40px; height: 40px; opacity: 1; } .palette-cat { display: none; } .palette-foot span:nth-child(3) { display: none; } }

/* ---------- « Apparence » (ui/theme-choice.tsx): radio group in Paramètres, three items in the account menu */
.theme-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-opt { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; }
.theme-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-opt svg { color: var(--muted); }
.theme-opt:hover { border-color: var(--accent); }
.theme-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-opt.on svg { color: var(--accent-text); }
.theme-opt:has(input:focus-visible) { box-shadow: var(--focus); }
.dd-label { padding: 6px 10px 2px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dd-theme .dd-item.on { font-weight: 600; }
.dd-check { margin-left: auto; display: inline-flex; color: var(--accent-text); }

/* ---------- « Tout déplier » / « Tout replier » (ui/shell.tsx): two compact commands at the top of the menu */
.nav-bulk { display: flex; gap: 4px; padding: 0 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--on-ink-line); }
.nav-bulk-btn { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 4px 4px; border-radius: 8px; border: 1px solid var(--on-ink-line); background: none; color: #e8e6e1; font: inherit; font-size: .78rem; letter-spacing: -.005em; font-weight: 600; cursor: pointer; transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.nav-bulk-btn.expand { background: var(--ink-3); border-color: var(--ink-3); color: #fff; }
.nav-bulk-btn:hover:not([aria-disabled=true]) { background: var(--ink-2); border-color: rgba(255, 255, 255, .22); color: #fff; }
.nav-bulk-btn.expand:hover:not([aria-disabled=true]) { background: #323d63; }
.nav-bulk-btn:focus-visible { outline: none; box-shadow: var(--focus-on-ink); }
.nav-bulk-btn[aria-disabled=true] { opacity: .45; cursor: default; }
.nav-bulk-btn svg { flex: none; width: 15px; height: 15px; }
.nav-bulk-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 901px) {
  /* icon rail: two icons side by side, the label in the tooltip and for screen readers */
  .shell.rail .nav-bulk { gap: 4px; padding-bottom: 6px; }
  .shell.rail .nav-bulk-btn { padding: 4px 0; min-height: 28px; }
  .shell.rail .nav-bulk-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 900px) { .nav-bulk-btn { min-height: 40px; } }
@media (prefers-reduced-motion: reduce) { .nav-bulk-btn { transition: none; } }

/* ==========================================================================================================
   Offres et abonnements (pages/offres.tsx, pages/offres-admin.tsx — docs/saas/OFFRES-ET-ABONNEMENTS.md).
   Tokens only (styles.css / theme-sombre.css): the dark theme follows without any rule of its own here.
   ========================================================================================================== */
.of { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.of label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 32px; }
.of label.check input { width: 18px; height: 18px; flex: none; }
.of-sandbox { margin: 0; }
.of-switches { display: flex; flex-wrap: wrap; gap: 12px; }
.of-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.of-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.of-card h3 { margin: 0; font-size: 18px; }
.of-card p { margin: 0; }
.of-price { font-size: 15px; }
.of-price b { font-size: 24px; color: var(--text); }
.of-pending { display: inline-block; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 4px 8px; font-size: 14px; }
.of-facts, .of-included, .of-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.of-facts li::before { content: '·'; margin-right: 6px; color: var(--muted); }
.of-included li, .of-features li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.of-cta { margin-top: auto; padding-top: 6px; }
.of-cta .btn { width: 100%; justify-content: center; }
.of-pending-note p { margin: 4px 0 0; }

.of-caps h2 { margin-bottom: 4px; }
.of-caps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; }
.of-caps-group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.of-caps-group h3 { margin: 0 0 8px; font-size: 15px; }
.of-caps-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.of-caps-group li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; font-size: 14px; }
.of-cap-note { grid-column: 1 / -1; }

.of-sub { display: flex; flex-direction: column; gap: 12px; }
.of-sub-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.of-sub-head h2, .of-sub-head h3 { margin: 0; }
.of-sub-actions { flex-wrap: wrap; gap: 8px; }
.of-sub .notice { margin: 0; }
.of-confirm p { margin: 0 0 6px; }
.of-meter { display: block; height: 6px; background: var(--line); border-radius: 3px; margin-top: 4px; max-width: 160px; overflow: hidden; }
.of-meter span { display: block; height: 100%; background: var(--teal); }
.of-meter span.full { background: var(--danger); }
.of-features { margin-top: 12px; }
.of-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.of-events .cr-date { color: var(--muted); margin-right: 6px; }

/* public page (visitors without an account) */
.of-public { min-height: 100vh; background: var(--paper); color: var(--text); display: flex; flex-direction: column; }
.of-public-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 24px; background: var(--header-bg); color: var(--on-ink); }
.of-public-top .row { gap: 8px; flex-wrap: wrap; align-items: center; }
.of-brand { color: var(--on-ink); text-decoration: none; gap: 10px; align-items: center; font-size: 20px; }
.of-public-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 24px 40px; box-sizing: border-box; flex: 1; }
.of-public-main > h1 { margin: 0 0 4px; }

/* console */
.of-admin .of-modes .cr-figures { margin: 0; }
.of-admin .of-modes .badge { margin-right: 6px; }
.of-plan { display: flex; flex-direction: column; gap: 10px; }
.of-plan .badge { font-size: 12px; }
.of-ents { display: flex; flex-direction: column; gap: 4px; }
.of-filters { flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.of-filters .field { min-width: 160px; }
.of-versions td { vertical-align: top; }

@media (max-width: 640px) {
  .of-public-top { padding: 12px 16px; }
  .of-public-main { padding: 18px 16px 32px; }
  .of-caps-group li { grid-template-columns: 1fr; }
  .of-sub-actions .btn { flex: 1 1 auto; }
}

/* « Vente des abonnements » (console Offres et abonnements): each condition and what lifts it */
.of-sale { margin: 12px 0; }
.of-sale-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.of-sale-list .small { margin: 2px 0 0; }

/* Pages « projet » — redesign section owned by one agent; appended after styles.css at build time.
   Scopes: .pj (project page chrome + scénario / exports / versions), .rv (revue tab), .sh (public share page).
   Bold element: the « slate » next to the title (project frame at its real ratio + montage duration). Everything else
   stays quiet: white panels, 1 px lines, accent on the one main action of each tab. */

.pj { --pj-gap: clamp(14px, 2vw, 22px); min-width: 0; }
.pj > * { min-width: 0; }
.pj-num { font-variant-numeric: tabular-nums; }
.pj-err { color: var(--danger); overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ header */
.pj-head { display: grid; gap: 14px 24px; grid-template-columns: minmax(0, 1fr); align-items: end; margin-bottom: 18px; }
.pj-back { justify-self: start; font-size: .88rem; font-weight: 600; text-decoration: none; padding: 4px 0; }
.pj-back:hover { text-decoration: underline; }
.pj-head-main { display: flex; gap: 18px; align-items: center; min-width: 0; }
.pj-head-text { min-width: 0; }
.pj-head h1 { font-size: clamp(1.6rem, 1.25rem + 1.1vw, 2.2rem); line-height: 1.12; letter-spacing: -.028em; margin: 0 0 8px; text-wrap: balance; overflow-wrap: anywhere; }
.pj-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: .88rem; }
.pj-facts > div { display: flex; align-items: baseline; gap: 6px; }
.pj-facts dt { color: var(--muted); }
.pj-facts dd { margin: 0; font-weight: 600; }
.pj-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-head-actions select.btn { width: auto; padding-right: 30px; }

.pj-slate { flex: none; display: grid; place-items: center; width: 108px; height: 84px; background: var(--ink); border-radius: 12px; }
.pj-slate-frame { position: relative; display: grid; place-items: center; height: 50px; aspect-ratio: 16 / 9; border: 1.5px solid rgba(255, 255, 255, .42); border-radius: 3px; }
.pj-slate.r9x16 .pj-slate-frame { height: 62px; aspect-ratio: 9 / 16; }
.pj-slate.r1x1 .pj-slate-frame { height: 56px; aspect-ratio: 1; }
.pj-slate.r4x5 .pj-slate-frame { height: 60px; aspect-ratio: 4 / 5; }
.pj-slate-frame::before, .pj-slate-frame::after { content: ""; position: absolute; width: 9px; height: 9px; border: 2px solid #f08a4b; }
.pj-slate-frame::before { top: -5px; left: -5px; border-right: 0; border-bottom: 0; }
.pj-slate-frame::after { bottom: -5px; right: -5px; border-left: 0; border-top: 0; }
.pj-slate-clock { color: #fff; font-weight: 700; font-size: .92rem; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.pj-slate.r9x16 .pj-slate-clock, .pj-slate.r4x5 .pj-slate-clock { font-size: .78rem; }

@media (min-width: 1000px) {
  .pj-head { grid-template-columns: minmax(0, 1fr) auto; }
  .pj-back { grid-column: 1 / -1; }
  .pj-head-actions { justify-content: flex-end; }
}

/* ------------------------------------------------------------------ tabs */
.pj .pj-tabs { gap: 2px; margin-bottom: var(--pj-gap); scrollbar-width: none; }
.pj .pj-tabs a { padding: 12px 16px; font-size: .98rem; color: var(--muted); touch-action: manipulation; }
.pj .pj-tabs a:hover { color: var(--text); }
.pj .pj-tabs a.active { color: var(--text); }
.pj .pj-tabs a:focus-visible { border-radius: 6px 6px 0 0; }

/* ------------------------------------------------------------------ shared bar (tab intro + actions) */
.pj-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.pj-bar-text { flex: 1 1 340px; min-width: 0; }
.pj-bar-text h2 { font-size: var(--fs-h2); margin: 0 0 4px; }
.pj-bar-text p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; max-width: 66ch; }
.pj-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------------ AI services strip */
.pj-svc { margin-bottom: 14px; }
.pj-svc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pj-svc li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 16px; font-size: .88rem; }
.pj-svc li + li { border-top: 1px solid var(--line); }
.pj-svc-name { font-weight: 700; min-width: 13ch; }
.pj-svc-why { color: var(--muted); flex: 1 1 260px; }

/* ------------------------------------------------------------------ scenes */
.pj-scene-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pj-scene { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.pj-scene-num { width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .88rem; font-variant-numeric: tabular-nums; }
.pj-scene-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pj-scene-head { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.pj-scene-head input.pj-scene-title { flex: 1 1 220px; width: auto; min-width: 0; font-weight: 700; font-size: 1rem; }
.pj-scene-head select.pj-scene-kind { flex: 0 1 auto; width: auto; max-width: 100%; }
.pj-scene-tools { display: flex; gap: 2px; margin-left: auto; }
.pj-scene-tools .btn { min-width: 36px; min-height: 36px; padding: 4px 8px; color: var(--muted); }
.pj-scene-tools .btn:not([disabled]):hover { color: var(--text); background: var(--surface-hover); }
.pj .pj-del:not([disabled]):hover, .rv .pj-del:hover { color: var(--danger); }
.pj-script { gap: 6px; }
.pj-script textarea { font-weight: 400; font-size: 1rem; line-height: 1.55; min-height: 96px; background: #fdfcfa; }
.pj-script textarea:focus { background: var(--field-bg); }
.pj-scene-opts, .pj-scene-media { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.pj-scene-opts:empty { display: none; }
.pj .pj-opt, .pj-scene-opts > label.row { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); font-weight: 600; }
.pj-opt select { width: auto; max-width: min(260px, 60vw); color: var(--text); font-weight: 400; }
.pj-opt input.pj-dur { width: 92px; color: var(--text); font-weight: 400; }
.pj-pick { max-width: 100%; }
.pj-pick-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pj-pick.set { border-color: var(--ok-line); background: var(--teal-soft); color: var(--ok-text); }
.pj-narr-audio { height: 34px; max-width: 280px; }
.pj-scene-foot { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.pj-scene-thumb { width: 120px; flex: none; }

.pj-add { margin-top: 14px; padding: 16px 18px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, .55); }
.pj-add h3 { font-size: .95rem; margin: 0 0 10px; }
.pj-add-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-add-kinds .btn { touch-action: manipulation; }

/* ------------------------------------------------------------------ exports */
.pj-exports { display: flex; flex-direction: column; gap: calc(var(--pj-gap) + 6px); }
.pj-export-new h2, .pj-export-list h2, .pj-share h2 { font-size: var(--fs-h2); margin: 0 0 14px; }
.pj-export-grid { display: grid; gap: 18px 32px; grid-template-columns: minmax(0, 1fr); }
.pj-presets { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pj-presets legend { font-weight: 600; font-size: .86rem; padding: 0; margin-bottom: 8px; }
.pj-preset { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; touch-action: manipulation; }
.pj-preset:hover { border-color: var(--line-strong); }
.pj-preset.on { border-color: var(--accent); background: var(--surface-selected); box-shadow: inset 3px 0 0 var(--accent); }
.pj-preset input { margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.pj-preset > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pj-preset b { font-size: .93rem; }
.pj-preset-detail { color: var(--muted); font-size: .84rem; }
.pj-export-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pj-check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: .92rem; cursor: pointer; }
.pj-export-facts { margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: .86rem; line-height: 1.5; }
.pj-export-facts dt { font-weight: 700; }
.pj-export-facts dd { margin: 0; color: var(--muted); }
.pj-export-go { align-self: flex-start; min-height: 44px; padding: 0 22px; font-size: .95rem; touch-action: manipulation; }
@media (min-width: 900px) { .pj-export-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }

.pj-exp-items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pj-exp { display: grid; gap: 14px 22px; grid-template-columns: minmax(0, 1fr); padding: 18px 20px; }
.pj-exp + .pj-exp { border-top: 1px solid var(--line); }
.pj-exp-video { width: 100%; max-height: 360px; background: #000; border-radius: 8px; display: block; }
.pj-exp-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pj-exp-top { display: flex; align-items: center; gap: 10px; }
.pj-exp-top b { font-size: 1.05rem; }
.pj-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: .85rem; }
.pj-exp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-exp-actions:empty { display: none; }
.pj-exp-progress { display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 900px) {
  .pj-exp { grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); align-items: start; }
  .pj-exp-body:only-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ tables (versions, share links) */
table.pj-table { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: .9rem; }
table.pj-table th { background: var(--surface-sunk); padding: 10px 14px; }
table.pj-table td { padding: 12px 14px; vertical-align: middle; }
table.pj-table tbody tr:last-child td { border-bottom: 0; }
table.pj-table td.pj-cell-actions { text-align: right; white-space: nowrap; }
.pj-cell-main b { overflow-wrap: anywhere; }
.pj-cell-main .pj-meta { margin-top: 2px; font-size: .8rem; }
.pj-share > p { margin: 10px 0 0; }

/* phone: each row becomes a stacked block, cells keep their column name (the table keeps its semantics) */
@media (max-width: 699px) {
  table.pj-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.pj-table, table.pj-table tbody, table.pj-table tr, table.pj-table td { display: block; width: 100%; }
  table.pj-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.pj-table tbody tr:last-child { border-bottom: 0; }
  table.pj-table td { padding: 0; border: 0; }
  table.pj-table td + td { margin-top: 6px; }
  table.pj-table td[data-label] { display: flex; justify-content: space-between; gap: 12px; }
  table.pj-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .84rem; }
  table.pj-table td.pj-cell-actions { text-align: left; margin-top: 10px; }
  table.pj-table td.pj-cell-actions:empty { display: none; }
}

/* ------------------------------------------------------------------ revue */
.rv { display: grid; gap: var(--pj-gap, 18px); grid-template-columns: minmax(0, 1fr); grid-template-areas: "status" "comments"; align-items: start; }
.rv > * { min-width: 0; }
.rv-comments { grid-area: comments; }
.rv-status { grid-area: status; display: flex; flex-direction: column; gap: 14px; }
.rv h2 { font-size: var(--fs-h2); margin: 0; }
.rv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rv-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
@media (min-width: 1100px) { .rv { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "comments status"; } .rv-status { position: sticky; top: 20px; } }

.rv-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rv-flow li { position: relative; display: flex; gap: 12px; padding: 0 0 14px; }
.rv-flow li:last-child { padding-bottom: 0; }
.rv-flow li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.rv-flow li.done:not(:last-child)::before { background: var(--teal); }
.rv-dot { flex: none; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); }
.rv-flow li.done .rv-dot { background: var(--teal); box-shadow: none; }
.rv-flow li.now .rv-dot { background: var(--ink); box-shadow: 0 0 0 3px #e9e4dc; }
.rv-flow li.now.err .rv-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.rv-step { display: flex; flex-direction: column; gap: 1px; font-size: .88rem; }
.rv-step span { color: var(--muted); font-size: .82rem; }
.rv-flow li:not(.now):not(.done) .rv-step b { color: var(--muted); font-weight: 600; }
.rv-note { margin: 0; padding: 10px 12px; background: var(--surface-sunk); border-left: 3px solid var(--line-strong); border-radius: 0 8px 8px 0; font-size: .9rem; }
.rv-hint { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.rv-note-field textarea { min-height: 64px; font-weight: 400; }
.rv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.rv-compose { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }
.rv-compose textarea { min-height: 80px; }
.rv-compose-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.rv-check { display: flex; gap: 8px; align-items: center; font-size: .86rem; color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.rv-list { list-style: none; margin: 8px 0 0; padding: 0; }
.rv-item { padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.rv-item.resolved > .rv-body, .rv-item.resolved > .rv-replies { color: var(--muted); }
.rv-item-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.rv-tc { font-variant-numeric: tabular-nums; gap: 6px; }
.rv-tc svg { width: 12px; height: 12px; }
.rv-who { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: .86rem; }
.rv-who span:not(.badge) { color: var(--muted); }
.rv-item-tools { display: flex; gap: 2px; margin-left: auto; }
.rv-item-tools .btn { color: var(--muted); }
.rv-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.rv-replies { list-style: none; margin: 0 0 0 14px; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.rv-reply { display: flex; gap: 8px; margin-left: 14px; }
.rv-reply input { flex: 1; min-width: 0; width: auto; }
.rv-reply-open { align-self: flex-start; }
.rv-empty { margin: 14px 0 0; color: var(--muted); font-size: .9rem; padding: 14px; background: var(--surface-sunk); border-radius: 8px; }

/* ------------------------------------------------------------------ assistance dialog */
.pj-assist-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 12px 0; }
.pj-assist-row .field { flex: 1 1 160px; }

/* ------------------------------------------------------------------ public share page */
.sh { min-height: 100vh; background: var(--ink); color: #f3efe9; display: flex; flex-direction: column; align-items: center; padding: 20px clamp(14px, 3vw, 32px) 28px; gap: 18px; }
.sh-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.05rem; align-self: stretch; justify-content: center; }
.sh-main { width: min(1040px, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px; flex: 1; justify-content: center; }
.sh-title { color: #fff; margin: 0; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); letter-spacing: -.025em; text-align: center; text-wrap: balance; overflow-wrap: anywhere; }
.sh-video { display: block; width: auto; max-width: 100%; max-height: 75vh; background: #000; border-radius: 10px; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sh .btn.sh-ghost { background: transparent; color: #f3efe9; border-color: rgba(243, 239, 233, .4); }
.sh .btn.sh-ghost:hover { border-color: #f3efe9; }
.sh .btn:focus-visible { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #f6c3a5; }
.sh-lock { background: var(--surface); color: var(--text); border-radius: 14px; padding: 22px; width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.sh-lock h1 { font-size: 1.15rem; margin: 0; text-wrap: balance; }

/* ------------------------------------------------------------------ phones */
@media (max-width: 699px) {
  .pj-head-main { gap: 14px; align-items: flex-start; }
  .pj-slate { width: 76px; height: 64px; border-radius: 10px; }
  .pj-slate-frame { height: 34px; }
  .pj-slate.r9x16 .pj-slate-frame { height: 46px; }
  .pj-slate.r1x1 .pj-slate-frame, .pj-slate.r4x5 .pj-slate-frame { height: 40px; }
  .pj-slate-clock { font-size: .74rem; }
  .pj-slate.r9x16 .pj-slate-clock, .pj-slate.r4x5 .pj-slate-clock { font-size: .66rem; }
  .pj-facts { gap: 4px 16px; font-size: .85rem; }
  .pj-head-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pj-head-actions select.btn { width: 100%; }
  .pj .pj-tabs { margin-left: -14px; margin-right: -14px; padding: 0 6px; }
  .pj .pj-tabs a { flex: 1 0 auto; text-align: center; padding: 12px 8px; font-size: .9rem; }
  .pj-bar-actions { width: 100%; }
  .pj-bar-actions .btn { flex: 1 1 auto; }
  .pj-scene { grid-template-columns: 28px minmax(0, 1fr); padding: 14px 14px 14px 12px; gap: 10px; }
  .pj-scene-num { width: 28px; height: 28px; font-size: .8rem; }
  .pj-scene-head select.pj-scene-kind { flex: 1 1 auto; }
  .pj-pick { width: 100%; justify-content: flex-start; }
  .pj-svc li { padding: 10px 14px; }
  .pj-export-go { align-self: stretch; }
  .pj-exp { padding: 16px; }
  .rv-compose-bar .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .pj *, .rv *, .sh * { transition: none !important; } }

/* ============================================================================================= Publicité produit, lot 4 (pages/pub-acteur.tsx) */
.pa .pub-form { max-width: 920px; }
.pa-engines { gap: 10px !important; }
.pa-engine { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; touch-action: manipulation; min-width: 0; }
.pa-engine input { margin-top: 4px; flex: none; }
.pa-engine.off { background: var(--bg-soft, #f6f6f4); }
.pa-engine-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.pa-engine-body .badge { align-self: flex-start; }
.pa-char-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pa-char { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.pa-char.on { border-color: var(--accent, #0f7c70); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #0f7c70) 25%, transparent); }
.pa-char-pick { display: flex; gap: 10px; align-items: center; cursor: pointer; min-width: 0; touch-action: manipulation; }
.pa-char-pick input { flex: none; }
.pa-char-pick img, .pa-char-ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg-soft, #eee); display: grid; place-items: center; }
.pa-char-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.pa-char .btn, .pa-char .badge { align-self: flex-start; }
.pa-ok { color: var(--ok, #1d7a3a); }
.pa-ko { color: var(--err, #b3261e); }
.pa-indent { margin-left: 26px; flex-wrap: wrap; gap: 8px; align-items: center; }
.pa-indent audio { max-width: 100%; }
.pa-face summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: 4px 0; }
.pa-face > .col { gap: 10px; padding-top: 8px; }
.pa-videos { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.pa-notices { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.pa-scenes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.pa-scene { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pa-scene-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pa-scene-text { margin: 0; overflow-wrap: anywhere; }
.pa-scene textarea { width: 100%; }
.pa-result { width: 100%; max-width: 420px; max-height: 420px; border-radius: 8px; background: #000; }
@media (max-width: 560px) { .pa-indent { margin-left: 0; } .pa-char-list { grid-template-columns: 1fr; } }

/* ============================================ Publicité produit, lot 5: guide, live cost, poster, shoot (ui/guide.tsx, ui/cost-live.tsx, pages/pub-*.tsx) */
/* step-by-step guide: inside the page, never a modal */
.guide { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--teal, #1f8a80); border-radius: 12px; background: var(--teal-soft, #eaf5f3); min-width: 0; }
.guide-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.guide-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface, #fff); color: var(--teal, #1f8a80); flex: none; }
.guide-name { font-weight: 600; font-size: .92rem; flex: 1; min-width: 0; }
.guide-count { font-weight: 600; color: var(--teal, #1f8a80); }
.guide-dots { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.guide-dots li { width: 22px; height: 4px; border-radius: 2px; background: var(--line, #ddd); }
.guide-dots li.past { background: var(--teal, #1f8a80); opacity: .45; }
.guide-dots li.on { background: var(--teal, #1f8a80); }
.guide-title { font-size: 1.02rem; margin: 0; }
.guide-title:focus { outline: 2px solid var(--teal, #1f8a80); outline-offset: 3px; border-radius: 4px; }
.guide-text { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.guide-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.guide-skip { margin-left: auto; }
.guide-keys { margin: 0; }
.guide-closed { display: flex; justify-content: flex-end; }
.guide-flash { outline: 3px solid var(--accent, #ff7a3d) !important; outline-offset: 3px; transition: outline-color .3s; }
@media (max-width: 520px) { .guide-skip { margin-left: 0; } .guide-keys { display: none; } }

/* live cost panel */
.cost-live { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper, #faf8f4); min-width: 0; }
.cost-live.short { border-color: var(--err, #c0392b); }
.cost-live-title { display: flex; align-items: center; gap: 6px; font-size: .95rem; margin: 0; }
.cost-live-title:focus { outline: none; }
.cost-live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0; }
.cost-live-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cost-live-grid dt { font-size: .76rem; color: var(--muted); }
.cost-live-grid dd { margin: 0; font-weight: 700; font-size: 1rem; }
.cost-live-grid dd.neg { color: var(--err, #c0392b); }
.cost-live-blockers { margin: 0; padding-left: 18px; color: var(--err, #c0392b); }
.cost-live-short { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.cost-live-short p { margin: 0; }

/* example (schematic) */
.pub-example summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.pub-example figure { margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.pub-example-svg { width: 100%; max-width: 420px; height: auto; display: block; }

/* poster + shoot */
.pub-honesty p { margin: 0; }
.pub-honesty { display: flex; flex-direction: column; gap: 4px; }
.pub-subpanel { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; min-width: 0; }
.pub-ref-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-ref-item { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pub-ref-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.pub-ai { gap: 12px; min-width: 0; }
.pub-ai-model { margin: 0; align-self: end; }
.pub-ai-results h3 { font-size: .98rem; margin: 0 0 6px; }
.pub-ai-results h3:focus { outline: none; }
.pub-ai-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pub-ai-item { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 2px solid transparent; border-radius: 10px; background: var(--surface, #fff); min-width: 0; }
.pub-ai-item.picked { border-color: var(--accent, #ff7a3d); }
.pub-ai-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: var(--track-2); }
.pub-ai-ph { display: grid; place-items: center; aspect-ratio: 4 / 5; border-radius: 6px; background: var(--track-2); text-align: center; padding: 6px; }
.pub-poster-img { width: 100%; max-width: 520px; height: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--track-2); }
.pub-poster-img.a-9x16 { max-width: 320px; }
.pub-shoot-ref { width: 100%; max-width: 280px; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.pub-cutout { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.pub-cutout[data-ready="0"] { color: var(--muted); }
.pub-cutout .hint { display: block; }

/* ============================================================================================= Publicité produit (pages/pub.tsx) */
.pub { display: flex; flex-direction: column; gap: var(--sp-4, 16px); min-width: 0; }
.pub-narrow { max-width: 860px; }
.pub h2 { font-size: 1.12rem; margin: 0; }
.pub .field { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; min-width: 0; }
.pub .field > label, .pub .pub-label label { font-weight: 600; }
.pub .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.pub .field input, .pub .field textarea, .pub .field select { width: 100%; min-width: 0; }
.pub-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub-prov { font-weight: 600; }
.pub-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.pub-form { gap: 14px; }
.pub-actions { margin-top: 4px; }
.pub fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pub legend { font-weight: 600; font-size: .9rem; padding: 0 4px; display: flex; align-items: center; gap: 8px; }
.pub-check { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; touch-action: manipulation; min-width: 0; }
.pub-check input { margin-top: 3px; flex: none; }
.pub-kind, .pub-radios { flex-direction: row !important; flex-wrap: wrap; gap: 8px 18px !important; }
.pub-kind legend, .pub-radios legend { width: 100%; }
.pub-url-row { flex-wrap: nowrap; }
.pub-url-row input { flex: 1; min-width: 0; }
.pub-url { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.pub-warnings { margin: 0; padding: 8px 12px 8px 28px; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); }
.pub-proposal { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-left: 3px solid var(--teal); background: var(--teal-soft); border-radius: var(--radius-sm); }
.pub-proposal h2:focus { outline: none; }
.pub-images ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

/* hub */
.pub-tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pub-tool > a, .pub-tool > div { display: flex; gap: 14px; height: 100%; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; box-sizing: border-box; min-width: 0; touch-action: manipulation; }
.pub-tool > a:hover { border-color: var(--accent); box-shadow: var(--shadow-pop, 0 4px 14px rgba(0,0,0,.08)); }
.pub-tool.soon > div { background: transparent; border-style: dashed; color: var(--muted); }
.pub-tool-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.pub-tool.soon .pub-tool-icon { background: var(--track-2); color: var(--muted); }
.pub-tool-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pub-tool-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.02rem; }
.pub-io { display: flex; flex-direction: column; gap: 2px; color: var(--ink-2, #333); }
.pub-io > span { min-width: 0; }
.pub-cost { color: var(--teal); font-weight: 600; }
.pub-tool.soon .pub-cost { color: var(--muted); font-weight: 400; }
.pub-summary { display: flex; flex-direction: column; gap: 6px; }

/* products */
.pub-products { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pub-products a { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; min-width: 0; }
.pub-products a:hover { border-color: var(--accent); }
.pub-thumb { flex: none; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--track-2); color: var(--muted); }
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pub-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pub-row-text b { overflow-wrap: anywhere; }
.pub-media { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pub-media li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* copy tool */
.pub-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
.pub-quick summary, .pub-history summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.pub-quick > .col { margin-top: 10px; }
.pub-results h2:focus { outline: none; }
.pub-variants { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pub-variant { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); min-width: 0; }
.pub-variant p { margin: 0; overflow-wrap: anywhere; }
.pub-variant-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pub-hook { font-weight: 700; }
.pub-text { white-space: pre-line; }
.pub-history ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 900px) {
  .pub-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  .pub-tools { grid-template-columns: minmax(0, 1fr); }
  .pub-url-row { flex-wrap: wrap; }
  .pub-url-row .btn { width: 100%; justify-content: center; }
}
.pub-summary p { margin: 0; }

/* promotional video (lot 3) */
.pub-aspects label { align-items: flex-start; }
.pub-promo-cost { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.pub-promo-cost h3 { margin: 0; font-size: .95rem; }
.pub-promo-cost h3:focus { outline: none; }
.pub-promo-cost p { margin: 0; }
.pub-promo-cost-lines { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.pub-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pub-step { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pub-step-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--muted); }
.pub-step.done .pub-step-mark { background: var(--ok-soft, #e3f1e6); color: var(--ok, #2e7d4f); }
.pub-step.running .pub-step-mark { background: var(--accent-soft, #fdeee2); color: var(--accent-text); }
.pub-step.blocked .pub-step-mark { background: var(--warn-soft); color: var(--warn); }
.pub-promo-progress p { margin: 0; }
.pub-promo-video { width: 100%; max-height: 520px; background: #111; border-radius: 10px; object-fit: contain; }
.pub-promo-video.a-9x16 { max-width: 300px; }
.pub-promo-video.a-4x5 { max-width: 420px; }
.pub-promo-video.a-1x1 { max-width: 460px; }
.pub-facts summary, .pub-script summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.pub-history h3 { margin: 6px 0 0; font-size: .95rem; }
.pub-history .btn { white-space: normal; text-align: left; }
.pub-promo-cost .pub-free { color: var(--teal); }

/* Diffusion sociale — connexion des comptes (QR code / même appareil) et page « Publier une vidéo »
   (web/src/pages/social-connect.tsx). Design tokens only (docs/DESIGN.md). */

/* ---- connect dialog */
.sc-connect { gap: 14px; }
.sc-nets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sc-net { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sc-net-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; min-height: 72px; padding: 12px 14px; text-align: left; white-space: normal; }
.sc-net.off .sc-net-btn { opacity: .75; }
.sc-block { font-size: .84rem; color: var(--muted); }
.sc-block summary { cursor: pointer; color: var(--text); }
.sc-block ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.sc-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sc-method { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; min-height: 84px; text-align: left; white-space: normal; }
.sc-method > span { display: flex; flex-direction: column; gap: 4px; }
.sc-qr-wrap { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 20px; align-items: start; }
.sc-qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.sc-qr svg { display: block; width: 100%; height: auto; }
.sc-qr.dead { opacity: .18; filter: grayscale(1); }
.sc-qr-side { gap: 8px; min-width: 0; }
.sc-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.sc-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
@media (max-width: 640px) { .sc-qr-wrap { grid-template-columns: 1fr; } .sc-qr { max-width: 260px; margin: 0 auto; } }

/* ---- phone page (#/connecter/…) */
.sc-phone { min-height: 100vh; background: var(--paper); display: flex; justify-content: center; padding: 24px 16px; }
.sc-phone-card { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; align-self: flex-start; }
.sc-phone-card h1 { font-size: 1.4rem; margin: 0; }
.sc-brand { margin: 0; color: var(--muted); font-size: .9rem; }
.sc-big { min-height: 48px; justify-content: center; font-size: 1rem; }
.sc-cands { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-cand { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; overflow-wrap: anywhere; }
.sc-cand input { margin-top: 3px; width: 20px; height: 20px; flex: none; }

/* ---- destinations (Comptes sociaux) */
.sc-head { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.sc-head h2 { margin: 0; }
.sc-sub { margin: 16px 0 4px; font-size: 1rem; }
.sc-dests > li { align-items: flex-start; justify-content: space-between; }
.sc-dest-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 280px; }
.sc-dest-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sc-dest-actions { flex-wrap: wrap; gap: 6px; }
.sc-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: .78rem; }
.sc-netstate { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sc-netstate > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sc-netstate > li:last-child { border-bottom: 0; }
.sc-netstate .sc-block { flex-basis: 100%; }

/* ---- publish page */
.sc-publish { display: flex; flex-direction: column; gap: 16px; }
.sc-video { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.sc-video-el { width: 220px; max-width: 100%; max-height: 220px; border-radius: 10px; background: #000; }
.sc-pick { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.sc-pick-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-height: 48px; overflow-wrap: anywhere; }
.sc-pick-item.on { border-color: var(--accent); background: var(--accent-soft); }
.sc-pick-item.off { opacity: .7; cursor: not-allowed; }
.sc-pick-item input { margin-top: 3px; flex: none; }
.sc-dest-form { display: flex; flex-direction: column; gap: 10px; }
.sc-dest-form h3 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sc-modes { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.sc-modes legend { font-weight: 600; margin-bottom: 6px; }
.sc-mode { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.sc-err { display: block; color: var(--danger); font-size: .84rem; margin-top: 4px; }
.sc-consent { display: flex; gap: 8px; align-items: flex-start; }
.sc-actions { gap: 10px; align-items: center; flex-wrap: wrap; }
.sc-recap td { vertical-align: top; }
.sc-recap-text { margin-top: 4px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .sc-recap thead { display: none; }
  .sc-recap tr { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .sc-recap td { border: 0; padding: 0; }
  .sc-video-el { width: 100%; }
}

/* Bibliothèque sonore « Musiques et sons » (pages/sound-library.tsx, ANO-FON-AUD-006) */
.sons-note { margin: 0 0 14px; }
.sons-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .sons-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sons-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; min-width: 0; }
.sons-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; }
.sons-title { overflow-wrap: anywhere; }
.sons-audio { width: 100%; }
.sons-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: .88rem; }
.sons-meta dt { color: var(--muted, #5b6072); }
.sons-meta dd { margin: 0; overflow-wrap: anywhere; }
.sons-form { display: flex; flex-direction: column; gap: 10px; }
.sons-attest { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
.sons-attest input { margin-top: 3px; }
.sons-pick { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sons-pick li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }

/* Écriture IA — Cinema Story Engine 360 (pages/story-engine.tsx): brief dialog, run dashboard, canon, screenplay,
   script doctor, versions. Scoped .se-*; tokens of styles.css only. The one distinctive element is the screenplay
   page (.se-page): a monospace column laid out like a professional script. */
.se { display: grid; gap: var(--sp-4); min-width: 0; }
.se-tabs { margin-bottom: 0; }
.se-tabs .tab { display: inline-flex; align-items: center; gap: 6px; }
.se-count { font-variant-numeric: tabular-nums; }
.se-panel { display: grid; gap: var(--sp-4); min-width: 0; }
.se-panel > *, .se > * { min-width: 0; }
.se-panel h3, .se-intro h2 { margin: 0 0 var(--sp-2); }
.se-panel h4, .se-panel h5 { margin: 0 0 var(--sp-1); font-size: .9rem; }
.se-panel p { margin: 0 0 var(--sp-2); overflow-wrap: anywhere; }
.se-panel .cn-panel > :last-child, .se-card > :last-child { margin-bottom: 0; }
.se-intro p { max-width: 75ch; }
.se .actions { flex-wrap: wrap; }

/* brief dialog */
.se-brief .se-fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); margin: 0; display: grid; gap: var(--sp-2); min-width: 0; }
.se-fieldset legend { padding: 0 var(--sp-1); font-weight: 700; }
.se-mode { white-space: normal; min-width: 0; align-items: flex-start; }
.se-more { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-2) var(--sp-4); }
.se-more > summary, .se-fold > summary { cursor: pointer; font-weight: 600; padding: var(--sp-1) 0; }
.se-more-body { padding: var(--sp-2) 0 var(--sp-1); }
.se-quote { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); display: grid; gap: var(--sp-2); }
.se-quote h3 { margin: 0; font-size: 1rem; }
.se-quote p { margin: 0; }
.se-cap input { max-width: 12rem; }

/* figures, facts, lists */
.se-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: var(--sp-3); margin: 0; }
.se-figures div { display: grid; gap: 2px; min-width: 0; }
.se-figures dt { color: var(--muted); font-size: .8125rem; }
.se-figures dd { margin: 0; font-weight: 700; font-size: 1.125rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.se-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-2); }
.se-facts:empty { display: none; }
.se-facts div { min-width: 0; }
.se-facts dt, .se-defs dt { color: var(--muted); font-size: .8rem; font-weight: 600; }
.se-facts dd, .se-defs dd { margin: 0; overflow-wrap: anywhere; }
.se-defs { display: grid; gap: var(--sp-2); margin: 0; }
.se-defs dt { color: var(--text); font-size: .92rem; }
.se-block { margin: 0 0 var(--sp-2); }
.se-bullets { margin: 0; padding-left: 1.2rem; display: grid; gap: 2px; overflow-wrap: anywhere; }
.se-prose { white-space: pre-wrap; max-width: 80ch; }
.se-link { background: none; border: 0; padding: 0; margin-right: 6px; font: inherit; font-weight: 700; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.se-link:hover { color: var(--accent-text-hover); }
.se-num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* dashboard */
.se-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.se-status { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-weight: 600; margin: 0; min-width: 0; }
.se-panel .se-status { margin: 0; }
.se-meter { display: grid; gap: 6px; margin: var(--sp-3) 0; }
.se-meter-line { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.se-meter p { margin: 0; }
.se-bar.cn-progress-bar { width: 100%; height: 8px; }
.se-dashboard .se-figures { margin: var(--sp-4) 0 var(--sp-2); }
.se-stages { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.se-stages li { padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
.se-stages li:first-child { border-top: 0; }
.se-stage-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--sp-3); align-items: center; }
.se-stage-state { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.se-stage-cost { font-variant-numeric: tabular-nums; white-space: nowrap; }
.se-panel .se-stage-error { margin: 4px 0 0; color: var(--danger); }

/* cards: concepts, characters, findings */
.se-cards, .se-findings, .se-versions, .se-acts, .se-seqs, .se-history ul { list-style: none; margin: 0; padding: 0; }
.se-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: var(--sp-3); }
.se-card { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.se-card.on { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.se-card-head, .se-version-head, .se-act-head, .se-history-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.se-card-head h4 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.se-card .se-facts { grid-template-columns: 1fr; }
.se-card .actions { margin-top: auto; }
.se-findings { display: grid; gap: var(--sp-3); }
.se-finding { display: grid; gap: var(--sp-2); }
.se-finding[data-severity="blocking"][data-status="open"], .se-finding[data-severity="blocking"][data-status="unresolved"] { border-left: 3px solid var(--danger); }
.se-finding-head { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.se-panel .se-finding-msg { font-weight: 600; margin: 0; }
.se-evidence { margin: 0; padding: var(--sp-1) var(--sp-3); border-left: 3px solid var(--line-strong); color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.se-finding .se-facts { margin: 0; }

/* structure */
.se-acts { display: grid; gap: var(--sp-3); }
.se-acts > li { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.se-acts > li:first-child { border-top: 0; padding-top: 0; }
.se-seqs { display: grid; gap: 4px; padding-left: var(--sp-4); overflow-wrap: anywhere; }
.se-seq { max-width: 100%; }
.se-seq td, .se-review td { overflow-wrap: anywhere; vertical-align: top; }
.se-seq-title { display: block; font-size: .85rem; }
.se-review-dim { min-width: 9rem; }

/* screenplay */
.se-scenes { display: grid; gap: var(--sp-2); }
.se-scene { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: calc(var(--header-h) + var(--sp-3)); }
.se-scene > summary { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); cursor: pointer; min-width: 0; }
.se-scene[open] > summary { border-bottom: 1px solid var(--line); }
.se-scene-key { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.se-scene-head { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; text-transform: uppercase; font-size: .85rem; letter-spacing: .02em; }
.se-scene-meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.se-scene-body { padding: var(--sp-4); display: grid; gap: var(--sp-3); min-width: 0; }
.se-page { font-family: "Courier Prime", "Courier New", Courier, ui-monospace, monospace; font-size: .95rem; line-height: 1.35; color: var(--text); width: 100%; max-width: 62ch; margin: 0 auto; min-width: 0; }
.se-panel .se-page p { margin: 0 0 1em; overflow-wrap: anywhere; white-space: pre-wrap; }
.se-page .se-heading { font-weight: 700; text-transform: uppercase; }
.se-panel .se-page .se-dialogue { margin: 0 0 1em; }
.se-panel .se-page .se-dialogue p { margin: 0; }
.se-page .se-speaker { padding-left: 36%; text-transform: uppercase; }
.se-page .se-paren { padding-left: 26%; padding-right: 22%; }
.se-page .se-speech { padding-left: 17%; padding-right: 15%; }
.se-page .se-transition { text-align: right; text-transform: uppercase; }
pre.se-raw { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 auto; }
.se-edit-text { font-family: "Courier Prime", "Courier New", Courier, ui-monospace, monospace; font-size: .92rem; line-height: 1.4; }
.se-scene-actions { justify-content: flex-start; border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.se-history { border-top: 1px solid var(--line); padding-top: var(--sp-3); display: grid; gap: var(--sp-2); }
.se-history ul { display: grid; gap: var(--sp-2); }
.se-history li { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); }
.se-history .se-page { margin-top: var(--sp-2); }

/* versions */
.se-versions { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.se-versions > li { border-top: 1px solid var(--line); padding-top: var(--sp-3); display: grid; gap: var(--sp-2); }
.se-versions > li:first-child { border-top: 0; padding-top: 0; }
.se-versions p { margin: 0; }
.se-exports { justify-content: flex-start; }

@media (max-width: 699px) {
  .se-stage-line { grid-template-columns: minmax(0, 1fr) auto; }
  .se-stage-state { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .se-scene > summary { flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); padding: var(--sp-2) var(--sp-3); }
  .se-scene-head { flex-basis: 60%; }
  .se-scene-meta { justify-content: flex-start; }
  .se-scene-body { padding: var(--sp-3); }
  .se-page { font-size: .85rem; }
  .se-page .se-speaker { padding-left: 28%; }
  .se-page .se-paren { padding-left: 18%; padding-right: 8%; }
  .se-page .se-speech { padding-left: 9%; padding-right: 5%; }
  /* sequencer and review grid stacked as cards: labelled cells (data-label) */
  .se-seq thead, .se-review thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .se-seq, .se-seq tbody, .se-seq tr, .se-seq td, .se-review, .se-review tbody, .se-review tr, .se-review td { display: block; width: 100%; min-width: 0; }
  .se-seq tr, .se-review tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .se-seq td, .se-review td { border: 0; padding: 3px 0; text-align: left; }
  .se-seq td[data-label], .se-review td[data-label] { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr); gap: 0 10px; align-items: baseline; }
  .se-seq td[data-label]::before, .se-review td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
  .se-seq-title { display: inline; margin-left: 6px; }
}

/* wide tables scroll inside their panel instead of pushing the page sideways */
.se-structure .cn-panel, .se-doctor .cn-panel { overflow-x: auto; }

/* three actions in the header of the works list: they wrap on a narrow screen instead of widening the page */
.page-head.cn-head > .page-head-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.page-head.cn-head > .page-head-actions > .btn { max-width: 100%; white-space: normal; }

/* ==========================================================================================================
   Dark theme (ui/theme.ts sets <html data-theme="dark">; « Clair / Sombre / Automatique » in the account menu and
   in Paramètres). It redefines the semantic tokens of styles.css — it is not an inversion: surfaces are layered
   (page #0B1220 < secondary #111C2E < cards #172337), texts are light (#F3F6FB 14.5:1 on cards, secondary #B5C1D2
   8.6:1), the orange fill stays dark enough for white text (#C2501A, 4.7:1) and the orange used as text is brighter
   (#FFA366, 8:1). Header and sidebar keep the navy of the brand. Videos and images are never recoloured.
   ========================================================================================================== */
html[data-theme=dark] {
  color-scheme: dark;                  /* native controls, scrollbars and date pickers in dark */
  --paper: #0b1220;
  --surface: #172337;
  --surface-2: #111c2e;
  --line: #29364b;
  --line-strong: #4a5b77;
  --text: #f3f6fb;
  --muted: #b5c1d2;
  --accent: #c2501a;
  --accent-hover: #a8440f;
  --accent-soft: rgba(255, 163, 102, .14);
  --accent-text: #ffa366;
  --accent-text-hover: #ffbd8f;
  --violet: #a5a0ff;
  --violet-soft: rgba(165, 160, 255, .16);
  --teal: #4fd1bf;
  --teal-soft: rgba(79, 209, 191, .13);
  --teal-bright: #4fd1bf;
  --danger: #ff8a80;
  --danger-soft: rgba(255, 138, 128, .13);
  --warn: #f2c66d;
  --warn-soft: rgba(242, 198, 109, .13);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .3);
  --shadow-pop: 0 10px 32px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  --focus: 0 0 0 3px rgba(255, 163, 102, .55);
  /* surfaces and marks that used to be hard-coded */
  --field-bg: #0f1a2b;
  --surface-sunk: #0f1828;
  --surface-hover: #1f2d44;
  --code-bg: #0f1828;
  --track: #29364b;
  --track-2: #223047;
  --thumb-bg: #1c2a40;
  --thumb-bg-2: #1c2a40;
  --surface-selected: rgba(255, 163, 102, .08);
  --violet-faint: rgba(165, 160, 255, .14);
  --teal-faint: rgba(79, 209, 191, .1);
  --info-bg: rgba(122, 170, 230, .12); --info-line: #3a5679; --info-text: #b9d4f5;
  --warn-text: #f5d48c; --warn-line: #6b5523;
  --danger-text: #ffb3ab; --danger-line: #7a3a35;
  --ok-text: #8fe3d6; --ok-line: #2c6a61;
  --badge-text: #d5dce7;
}
/* smooth switch between themes, never while the user asked for less motion */
@media (prefers-reduced-motion: no-preference) {
  html.theme-switching, html.theme-switching * { transition: background-color .2s ease, border-color .2s ease, color .2s ease !important; }
}

/* the few colours still written by value in the page styles */
html[data-theme=dark] .thumb { background-image: linear-gradient(45deg, #223047 25%, transparent 25%), linear-gradient(-45deg, #223047 25%, transparent 25%); }
html[data-theme=dark] .vx-play:hover { background: rgba(255, 163, 102, .18); }
html[data-theme=dark] .vx-accent { background: var(--track-2); color: var(--text); }
html[data-theme=dark] .vx-accent.cote_ivoire { background: rgba(255, 163, 102, .18); color: var(--accent-text); }
html[data-theme=dark] .wz-chip:has(input:checked) { color: var(--accent-text); }
html[data-theme=dark] .pj-script textarea { background: var(--field-bg); }
html[data-theme=dark] .bib-import-drop .dropzone { background: var(--surface-2); }
html[data-theme=dark] .cx-item.focus { background: var(--surface-selected); }
html[data-theme=dark] .gx-model.on { background: var(--surface-selected); }
html[data-theme=dark] .backdrop { background: rgba(2, 6, 14, .7); }
html[data-theme=dark] .kbd { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
html[data-theme=dark] img, html[data-theme=dark] video { color-scheme: normal; }
/* translucent white panels of the light theme: a faint lighter layer instead */
html[data-theme=dark] .empty, html[data-theme=dark] .pj-add { background: rgba(255, 255, 255, .03); }
html[data-theme=dark] .sv-pool-grid li .btn.icon { background: rgba(11, 18, 32, .85); color: var(--text); }
html[data-theme=dark] .sv-preview-frame.empty { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 10px, #16233a 10px, #16233a 20px); }

/* Vidéo → Vidéo (#/video-vers-video/…) — Design System tokens only (docs/DESIGN.md). Reuses .sv, .sv-cols, .card,
   .badge, .tabs, .notice. Breakpoints: 390 / 834 / 1440 px. */
.v2v .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v2v-jobs, .v2v-engines, .v2v-seglinks, .v2v-four, .v2v-kf { list-style: none; margin: 0; padding: 0; }
.v2v-jobs li a { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.v2v-jobs li a:hover b { color: var(--accent-text); }
.v2v-jobs .col { gap: 2px; }
.v2v-right { align-items: flex-end; }
.v2v-thumb { width: 88px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--ink-2); color: var(--on-ink-muted); display: grid; place-items: center; overflow: hidden; }
.v2v-thumb img { width: 100%; height: 100%; object-fit: cover; }
.v2v-engines { display: grid; gap: 10px; }
.v2v-engines li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.v2v-dl { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: .9rem; }
.v2v-dl dt { color: var(--muted); }
.v2v-dl dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.v2v-four { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); }
.v2v-four li { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.v2v-four li.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.v2v-mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.v2v-mode { display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: 12px; box-shadow: none; }
.v2v-mode input { position: absolute; opacity: 0; pointer-events: none; }
.v2v-mode.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.v2v-mode:focus-within { box-shadow: var(--focus); }
.v2v-picked { align-items: center; }
.v2v-mini { width: 160px; max-width: 40vw; border-radius: var(--radius-sm); background: #000; }
.v2v-player { width: 100%; max-height: 60vh; background: #000; border-radius: var(--radius-sm); }
.v2v-player.sm { max-height: 36vh; }
.v2v-kf { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.v2v-kf li { display: flex; flex-direction: column; gap: 2px; }
.v2v-kf img { width: 100%; border-radius: var(--radius-sm); }
.v2v-checks { display: grid; gap: 4px; border: 0; padding: 0; margin: 0; }
.v2v-checks legend { font-weight: 600; margin-bottom: 6px; }
.v2v-refused { color: var(--danger); font-weight: 700; }
.v2v-adv summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.v2v-adv[open] { display: flex; flex-direction: column; gap: 8px; }
.v2v-maskview { position: relative; width: 100%; max-width: 520px; background: var(--ink-2); border-radius: var(--radius-sm); overflow: hidden; }
.v2v-maskview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.v2v-box { position: absolute; border: 2px solid var(--accent-bright); background: rgba(240, 138, 75, .18); color: #fff; font-size: .75rem; font-weight: 700; padding: 0 4px; }
.v2v-boxrow { gap: 6px; align-items: end; }
.v2v-boxrow input { width: 76px; }
.v2v-track { position: relative; height: 30px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.v2v-shot { position: absolute; top: 0; bottom: 0; background: var(--violet-soft); border-right: 2px solid var(--surface); }
.v2v-shot.alt { background: var(--teal-soft); }
.v2v-range { position: absolute; top: 0; bottom: 0; border: 2px solid var(--accent); background: rgba(185, 65, 15, .08); }
.v2v-segs { height: 36px; }
.v2v-seg { position: absolute; top: 3px; bottom: 3px; border: 0; border-right: 1px solid var(--surface); background: var(--line-strong); cursor: pointer; padding: 0; }
.v2v-seg.passthrough { background: repeating-linear-gradient(45deg, var(--line), var(--line) 3px, var(--surface-2) 3px, var(--surface-2) 6px); }
.v2v-seg.ok { background: var(--teal); }
.v2v-seg.accent { background: var(--accent-bright); }
.v2v-seg.warn { background: #d9a400; }
.v2v-seg.err { background: var(--danger); }
.v2v-seg.sel { box-shadow: var(--focus); z-index: 1; }
.v2v-seg:focus-visible { box-shadow: var(--focus); z-index: 1; }
.v2v-compare { position: relative; width: 100%; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.v2v-compare video { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: #000; }
.v2v-compare.slider .v2v-cmp-b { position: absolute; inset: 0; }
.v2v-compare.slider .v2v-cmp-b video { height: 100%; }
.v2v-compare.side { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.v2v-compare.side .v2v-cmp-b, .v2v-compare.side .v2v-cmp-a { position: relative; }
.v2v-tag { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(12, 17, 32, .75); color: var(--on-ink); font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.v2v-tag.r { left: auto; right: 8px; }
.v2v-compare + input[type=range] { width: 100%; }
@media (max-width: 834px) {
  .v2v-compare.side { grid-template-columns: 1fr; }
  .v2v-jobs li a { grid-template-columns: 64px minmax(0, 1fr); }
  .v2v-jobs .v2v-right { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 8px; }
  .v2v-thumb { width: 64px; }
}
@media (max-width: 480px) {
  .v2v-dl { grid-template-columns: 1fr; }
  .v2v-dl dt { margin-top: 6px; }
  .v2v-boxrow input { width: 64px; }
}
.v2v label.row { flex-wrap: nowrap; align-items: flex-start; }
.v2v label.row input[type=checkbox] { margin-top: 3px; flex-shrink: 0; }

/* ==========================================================================================================
   Vidéos courtes, Inspiration, Diffusion sociale (pages/videos.tsx, inspiration.tsx, diffusion.tsx) + the two
   collapsible groups of the sidebar (ui/shell.tsx). Same tokens as the rest of the app (docs/DESIGN.md).
   ========================================================================================================== */

/* ---------- sidebar groups */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: #cfd0d6; font: inherit; font-size: .93rem; text-align: left; cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast); }
.nav-group-head:hover { background: var(--ink-2); color: #fff; }
.nav-group-head:focus-visible { outline: none; box-shadow: var(--focus-on-ink); }
.nav-group-head svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-group.has-active > .nav-group-head { color: #fff; }
/* chevrons of the groups: white and fully opaque, clearly visible on the dark sidebar (owner request 23/11) */
.nav-chevron { margin-left: auto; display: inline-flex; transition: transform var(--t-fast); color: #fff; opacity: 1; }
.nav-chevron svg { width: 16px; height: 16px; stroke-width: 2.4; opacity: 1; }
.nav-group:not(.open) .nav-chevron { transform: rotate(-90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 0 0 4px 14px; padding-left: 8px; border-left: 1px solid var(--on-ink-line); }
.nav-sub a { padding: 7px 10px; font-size: .88rem; }
.nav-sub a svg { width: 16px; height: 16px; }
@media (min-width: 901px) {
  .shell.rail .nav-group-head { justify-content: center; padding: 10px 0; }
  .shell.rail .nav-chevron { display: none; }
  .shell.rail .nav-sub { margin: 0; padding: 0; border-left: 0; border-top: 1px solid var(--on-ink-line); border-bottom: 1px solid var(--on-ink-line); }
  .shell.rail .nav-sub a { justify-content: center; padding: 8px 0; }
}
@media (max-width: 900px) { .nav-group-head { min-height: 44px; } .nav-sub a { min-height: 40px; } }

/* ---------- page frame */
.sv { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
/* form pages (new video, new analysis, new song, v2v): full content width like every page — only text measures (.lead, notes) stay capped */
.sv-narrow > * { min-width: 0; }
.sv h2 { font-size: var(--fs-h2); margin: 0 0 10px; letter-spacing: -.01em; }
.sv h3 { font-size: .95rem; margin: 0 0 6px; }
.sv-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.sv-section-head h2 { margin: 0; }
.sv-meta { gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sv-actions { gap: 8px; flex-wrap: wrap; }
.sv-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sv-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--sp-4); align-items: start; }
.sv-form, .sv .col { gap: 12px; }
.sv-err { color: var(--danger); overflow-wrap: anywhere; }
.sv-empty-actions { gap: 10px; justify-content: center; flex-wrap: wrap; }
.sv-inline { flex-direction: row; align-items: center; gap: 8px; }
.sv-inline input { width: 90px; }
.sv-checks { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; margin: 0; }
.sv-checks legend { font-weight: 600; font-size: .86rem; padding: 0 4px; }
.sv-checks label { gap: 8px; font-size: .9rem; align-items: center; }
.sv-days { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
.sv-confirm { color: var(--warn); font-size: .85rem !important; }
.sv-table-wrap { padding: 0; overflow-x: auto; }
.sv-row-actions { white-space: nowrap; text-align: right; }
.sv-row-actions .btn + .btn { margin-left: 6px; }
.sv-sim { background: var(--violet-faint); color: var(--violet); letter-spacing: .04em; }
.sv-pub-badge { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* ---------- KPIs */
.sv-kpis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sv-kpis li { display: flex; }
.sv-kpi { position: relative; flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.sv-kpi b { font-size: 1.5rem; transform: translateZ(22px); transition: color var(--t-fast); }
.sv-kpi span { color: var(--muted); font-size: .85rem; transform: translateZ(12px); }
.sv-kpi svg { position: absolute; top: 12px; right: 12px; color: var(--muted); opacity: .45; transform: rotate(-90deg); transition: opacity var(--t-fast), transform var(--t-fast), color var(--t-fast); }
.sv-kpi:hover svg, .sv-kpi:focus-visible svg { opacity: 1; color: var(--accent-text); transform: rotate(-90deg) translateY(3px); }
.sv-kpi:hover b, .sv-kpi:focus-visible b, .sv-kpi.accent b { color: var(--accent-text); }
.sv-kpi.warn { box-shadow: inset 3px 0 0 var(--warn); }

/* ---------- 3D cards: resting depth, pointer tilt (vars set by `tilt` in videos.tsx) and a sheen that follows the pointer */
.sv-3d { --lift: 0px; transform-style: preserve-3d; transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 2px 4px rgba(12, 17, 32, .06), 0 10px 20px -12px rgba(12, 17, 32, .28);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, border-color .2s; }
.sv-3d::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .45), transparent 60%); }
.sv-3d:hover, .sv-3d:focus-visible { --lift: -5px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); transition-duration: .12s, .2s, .2s;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 22px 36px -16px rgba(12, 17, 32, .42), 0 4px 10px rgba(12, 17, 32, .08); }
.sv-3d:hover::after { opacity: 1; }
.sv-3d:active { --lift: -1px; }
.sv-kpi.warn.sv-3d { box-shadow: inset 3px 0 0 var(--warn), 0 2px 4px rgba(12, 17, 32, .06), 0 10px 20px -12px rgba(12, 17, 32, .28); }
.sv-kpi.warn.sv-3d:hover { box-shadow: inset 3px 0 0 var(--warn), 0 22px 36px -16px rgba(12, 17, 32, .42), 0 4px 10px rgba(12, 17, 32, .08); }
@media (prefers-reduced-motion: reduce) { .sv-3d, .sv-3d:hover, .sv-3d:focus-visible, .sv-3d:active { transform: none; transition: box-shadow .2s, border-color .2s; } .sv-3d::after { display: none; } }

/* ---------- lists */
.sv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sv-list > li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.sv-list > li:last-child { border-bottom: 0; }
.sv-list > li > a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.sv-list > li > a:hover .sv-what { color: var(--accent-text); }
.sv-what { flex: 1; min-width: 160px; font-weight: 600; overflow-wrap: anywhere; }
.sv-when { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ---------- channel cards (cover image or gradient drawn from the channel colours) */
.sv-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sv-channel { position: relative; padding: 0; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.sv-channel-cover img, .sv-channel-cover svg { transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.sv-channel:hover .sv-channel-cover img { transform: scale(1.06); }
.sv-channel:hover .sv-channel-cover svg { transform: translateY(-4px) scale(1.15); }
@media (prefers-reduced-motion: reduce) { .sv-channel:hover .sv-channel-cover img, .sv-channel:hover .sv-channel-cover svg { transform: none; } }
.sv-channel-cover { display: grid; place-items: center; aspect-ratio: 16 / 9; color: rgba(255, 255, 255, .85); overflow: hidden; }
.sv-channel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sv-channel-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.sv-channel-body b { font-size: 1.02rem; }

/* ---------- creation */
.sv-themes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.sv-theme { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font: inherit; color: inherit; }
.sv-theme:hover { border-color: var(--accent); }
.sv-theme.close { border-style: dashed; opacity: .8; }

/* ---------- production page */
.sv-steps { list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; background: var(--ink); border-radius: var(--radius-lg); color: var(--on-ink); }
.sv-step { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sv-step-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.sv-step.done .sv-step-dot { background: var(--teal-bright); border-color: var(--teal-bright); color: #fff; }
.sv-step.running .sv-step-dot { border-color: var(--accent-bright); box-shadow: 0 0 0 3px rgba(240, 138, 75, .25); }
.sv-step.blocked .sv-step-dot { background: #e5484d; border-color: #e5484d; color: #fff; }
.sv-step-label { font-weight: 600; font-size: .85rem; }
.sv-step-state { color: var(--on-ink-muted); }
.sv-step-msg { color: #f6c0a3; overflow-wrap: anywhere; }
.sv-prod-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 24vw, 420px); gap: var(--sp-4); align-items: start; }
.sv-prod-main, .sv-prod-side { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.sv-segments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sv-segments li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.sv-segments li .field:first-child { grid-column: 1 / -1; }
.sv-visual { font-weight: 500 !important; }
.sv-script .notice ul { margin: 6px 0 0; padding-left: 18px; }
.sv-script .notice li.block { font-weight: 600; }
/* vertical preview: always inside its card (never wider/taller than the column or the viewport) */
.sv-preview-card { overflow: hidden; }
.sv-preview-frame { aspect-ratio: 9 / 16; width: min(100%, calc(62vh * 9 / 16)); max-width: 100%; margin: 0 auto; background: #000; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.sv-preview-frame video { width: 100%; height: 100%; object-fit: contain; display: block; }
.sv-preview-frame.empty { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 10px, #f1ede6 10px, #f1ede6 20px); border: 1px dashed var(--line-strong); padding: 12px; text-align: center; }
.sv-dl { gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.sv-qc-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sv-qc-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.sv-qc-items li { display: flex; gap: 8px; align-items: baseline; }
.sv-qc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--teal); transform: translateY(1px); }
.sv-qc-items li.warn .sv-qc-dot { background: #d69e00; }
.sv-qc-items li.block .sv-qc-dot { background: var(--danger); }
.sv-qc-items li.block { font-weight: 600; }
.sv-cost td, .sv-cost th { font-size: .86rem; }
.sv-journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.sv-journal li { font-size: .88rem; overflow-wrap: anywhere; }
.sv-accounts { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- pools */
.sv-pool-grid { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.sv-pool-grid li { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sv-pool-grid li .btn.icon { position: absolute; top: 4px; right: 4px; background: rgba(255, 255, 255, .9); width: 26px; min-height: 26px; }
.sv-pool-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- inspiration */
.insp-sec.obs { border-left: 3px solid var(--teal); }
.insp-sec.interp { border-left: 3px solid var(--accent); }
.insp-dl { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.insp-line { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 10px; font-size: .9rem; }
.insp-line dt { color: var(--muted); }
.insp-line dd { margin: 0; overflow-wrap: anywhere; }
.insp-structure { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.insp-ideas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.insp-ideas li { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.insp-cues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow: auto; font-size: .9rem; }
.insp-cues .mono { color: var(--muted); margin-right: 6px; }
.insp-text { white-space: pre-wrap; max-height: 360px; overflow: auto; }

/* ---------- calendar */
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.cal-view[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cal-bar .row { gap: 6px; align-items: center; flex-wrap: wrap; }
.cal-range { min-width: 160px; text-align: center; text-transform: capitalize; }
.cal-next svg { transform: rotate(180deg); }
.cal-grid { display: grid; gap: 8px; }
.cal-grid.week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid.month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid.day { grid-template-columns: minmax(0, 1fr); }
.cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-grid.month .cal-day { min-height: 90px; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.cal-day-head { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.cal-slot { display: flex; flex-direction: column; gap: 3px; padding: 7px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.cal-slot:hover { border-color: var(--accent); }
.cal-slot.approved { border-left: 3px solid var(--teal); }
.cal-slot.missed { opacity: .75; }
.cal-time { font-weight: 700; font-size: .85rem; }
.cal-title { font-weight: 600; font-size: .85rem; overflow-wrap: anywhere; }
.cal-sub { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-badges { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-badges .badge { font-size: .68rem; }
.cal-pub { font-size: .68rem; padding: 1px 6px; border-radius: 999px; background: var(--violet-faint); color: var(--violet); font-weight: 600; }
.cal .sv-list > li { flex-wrap: nowrap; align-items: stretch; }
.cal .sv-list .cal-slot { flex: 1; }

/* ---------- dashboard panel */
.dash-shorts-list { list-style: none; margin: 6px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }

/* ---------- responsive */
@media (max-width: 1100px) { .sv-prod-grid { grid-template-columns: minmax(0, 1fr); } .sv-prod-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 900px) {
  .sv-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cal-grid.week, .cal-grid.month { grid-template-columns: minmax(0, 1fr); }
  .cal-day { min-height: 0; }
  .sv-cols { grid-template-columns: minmax(0, 1fr); }
  .insp-line { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 520px) { .sv-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sv-preview-frame { width: min(100%, calc(56vh * 9 / 16)); } }

/* « Contexte pour l’assistant », visuals and voice of a production (docs/videos-courtes/20) */
.sv-brief { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 10px; min-width: 0; }
.sv-brief legend { font-weight: 600; padding: 0 4px; }
.sv-brief textarea { width: 100%; }
.sv-brief-files { display: grid; gap: 6px; }
.sv-brief-files .btn.disabled { opacity: .5; pointer-events: none; }
.sv-brief-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sv-brief-card .sv-brief { border: 0; padding: 0; }
.sv-vis-grid { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.sv-vis { display: grid; gap: 4px; min-width: 0; }
.sv-vis-frame { aspect-ratio: 9 / 16; background: var(--surface-2, #eee); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; text-align: center; padding: 2px; }
.sv-vis-frame img, .sv-vis-frame video { width: 100%; height: 100%; object-fit: cover; }
.sv-vis.failed .sv-vis-frame, .sv-vis.expired .sv-vis-frame { outline: 2px solid var(--danger, #c0392b); }
.sv-voice ul { margin: 4px 0 8px; padding-left: 18px; }

/* ---------- « Contenu & Prompt IA » (pages/sv-prompts.tsx) */
.svp-tabs { margin-bottom: 4px; }
/* flex children shrink with the card: the history table scrolls inside its own frame, never the page */
.svp, .svp .col, .svp .col > * { min-width: 0; }
.svp .table-scroll { width: 100%; }
.svp-history .sv-row-actions { white-space: normal; }
.svp-history .sv-row-actions .btn { margin: 0 0 4px 4px; }
.svp-head { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 12px 20px; align-items: start; }
.svp-pick { min-width: 180px; }
.svp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 16px; margin: 0; }
.svp-facts > div { min-width: 0; }
.svp-facts dt { font-size: .76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.svp-facts dd { margin: 2px 0 0; font-size: .9rem; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.svp-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: var(--sp-4); align-items: start; }
.svp-editor-main { min-width: 0; }
.svp-editor-side { position: sticky; top: 12px; min-width: 0; }
.svp-area { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.svp-area-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.svp-area-label { font-weight: 600; font-size: .9rem; }
.svp-tools { gap: 6px; flex-wrap: wrap; align-items: center; }
.svp-search { width: 190px; min-height: 30px; padding: 4px 8px; font-size: .84rem; }
.svp-text { width: 100%; min-height: 120px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.5; tab-size: 2; }
.svp-count.over { color: var(--danger); font-weight: 600; }
.svp-area.full { position: fixed; inset: 0; z-index: var(--z-modal, 60); background: var(--surface); padding: 16px 20px; overflow: auto; }
.svp-area.full .svp-text { flex: 1; min-height: 0; resize: none; }
.svp-vars { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.svp-vars summary, .svp-profile summary { font-weight: 600; font-size: .9rem; cursor: pointer; }
.svp-vars ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.svp-vars li { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.svp-profile { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.svp-profile[open] summary { margin-bottom: 10px; }
.svp-pre { margin: 0; padding: 10px 12px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; line-height: 1.5; max-height: 460px; overflow: auto; }
.svp-pre:focus-visible, .svp-diff-body:focus-visible { outline: none; box-shadow: var(--focus); }
.svp-script { font-family: inherit; font-size: .92rem; }
.svp-h4 { font-size: .84rem; margin: 6px 0 4px; }
.svp-findings ul, .svp-verdict { margin: 0; padding-left: 18px; }
.svp-findings li.block, .svp-verdict li.block { font-weight: 600; color: var(--danger-text); }
.svp-verdict li.warn { color: var(--warn-text); }
.svp-protected { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.svp-protected h3 { display: flex; align-items: center; gap: 6px; }
.svp-protected ul { margin: 4px 0 8px; padding-left: 18px; }
.svp-models { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--sp-4); align-items: start; }
.svp-models > li { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.svp-check { gap: 8px; font-size: .9rem; align-items: center; grid-column: 1 / -1; }
.svp-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.svp-part { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.svp-part.channel, .svp-part.model { border-left-color: var(--accent); }
.svp-part.engine { background: var(--surface-2); }
.svp-part-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.svp-part ul { margin: 0; padding-left: 18px; }
.svp-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--sp-4); align-items: start; }
.svp-trial { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.svp-diff-body { margin: 0; padding: 8px 0; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.5; max-height: 460px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.svp-dl { display: block; padding: 0 12px 0 0; position: relative; }
.svp-dm { display: inline-block; width: 22px; text-align: center; font-weight: 700; user-select: none; }
.svp-dl.add { background: var(--teal-soft); color: var(--ok-text); }
.svp-dl.del { background: var(--danger-soft); color: var(--danger-text); text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.svp-history td { vertical-align: top; }
@media (max-width: 900px) {
  .svp-head, .svp-editor { grid-template-columns: minmax(0, 1fr); }
  .svp-editor-side { position: static; }
  .svp-search { width: 100%; }
  .svp-area-head { align-items: stretch; flex-direction: column; }
}
