/* Atelier coloriage — l'interface parle le langage d'un cahier de coloriage :
   papier blanc, contours d'encre, et de la couleur seulement là où quelque chose est « colorié ». */

:root {
  --table: #E6ECF1;        /* la table à dessin, derrière les feuilles */
  --paper: #FFFFFF;
  --ink: #000000;
  --ink-soft: #4A5058;
  --lemon: #FFD23F;        /* proposé, action principale */
  --sky: #5BC0EB;          /* en cours de dessin */
  --grass: #8BD17C;        /* terminé, prêt */
  --coral: #FF7A6B;        /* échec, sous licence */
  --graphite: #C9CFD6;     /* écarté, vide */
  --radius: 10px;
  --line: 2px solid var(--ink);
  --lift: 4px 4px 0 var(--ink);
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --table: #1D232A; --paper: #262D35; --ink: #EDEFF2; --ink-soft: #A9B1BB; --graphite: #4A525C;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--table); color: var(--ink); font: 400 17px/1.5 var(--font); }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; max-width: 22ch; }
h2 { font-size: 1.15rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 600; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }

/* En-tête */
.masthead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 24px; background: var(--paper); border-bottom: var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.2rem; }
.brand svg { width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.brand .brand-fill { fill: var(--lemon); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 320px; min-width: 0; }
.tabs a { text-decoration: none; padding: 6px 14px; border: 2px solid transparent; border-radius: 999px; font-weight: 600; }
.tabs a:hover { border-color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--lemon); border-color: var(--ink); color: #000; }
/* L'accès : le dialogue d'entrée (passkey) et la liste des appareils autorisés. */
.access-dialog { width: min(560px, calc(100vw - 32px)); padding: 24px; color: var(--ink); }
.access-dialog::backdrop { background: rgb(0 0 0 / .55); }
/* Tant qu'on n'est pas entré, l'atelier ne se montre pas : seul le dialogue d'entrée (et ses messages). */
body.gated > :not(dialog):not(#toast) { visibility: hidden; }
body.gated .access-dialog::backdrop { background: var(--table); }
.access-dialog .actions { align-items: center; }
.passkey-list { display: grid; gap: 8px; }
.passkey { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: var(--line); border-radius: var(--radius); }
.passkey small { color: var(--ink-soft); }
/* Consignes au dessinateur : les consignes en vigueur, puis la boîte où l'on parle au dessinateur en texte libre. */
.directive-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.directive { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 8px 12px; border: var(--line); border-radius: var(--radius); background: var(--paper); }
.directive p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.directive small { color: var(--ink-soft); white-space: nowrap; }
.directive-num { font-weight: 800; border: 2px solid var(--ink); border-radius: 999px; min-width: 1.4em; text-align: center; padding: 0 5px; font-size: .9rem; }
.directive-form { display: grid; gap: 10px; }
.directive-form textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.directive-form .actions { align-items: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) { .directive { grid-template-columns: auto 1fr; } .directive small, .directive button { grid-column: 2; justify-self: start; } }
/* La bulle du solde OpenRouter : toujours en haut à droite, lisible d'un coup d'œil, colorée selon le niveau. */
.masthead-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.credit { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border: var(--line); border-radius: 999px; background: var(--paper); box-shadow: var(--lift); text-decoration: none; color: var(--ink); white-space: nowrap; line-height: 1.2; }
.credit:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.credit-label { font-size: .8rem; font-weight: 600; opacity: .85; }
.credit-amount { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.credit[data-level="ok"] { background: var(--grass); color: #000; }
.credit[data-level="low"] { background: var(--lemon); color: #000; }
.credit[data-level="empty"] { background: var(--coral); color: #000; }
.credit[data-level="unknown"] { background: var(--graphite); }
.credit[data-level="pending"] .credit-amount { opacity: .5; }

main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 64px; }
.view-head { margin-bottom: 24px; }
.lede { color: var(--ink-soft); max-width: 68ch; margin: 10px 0 0; }
.hint { color: var(--ink-soft); font-size: .9rem; margin: 0; }

/* Feuilles de papier */
.sheet { background: var(--paper); border: var(--line); border-radius: var(--radius); box-shadow: var(--lift); padding: 20px; }

.split { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .masthead { position: static; } .masthead-tools { margin-left: 0; } .split { grid-template-columns: 1fr; } main { padding: 20px 16px 48px; } .masthead { padding: 12px 16px; } }

.history h2 { margin-bottom: 10px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list button { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--paper); border: var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; }
.plain-list button:hover { box-shadow: 3px 3px 0 var(--ink); }
.plain-list button[aria-pressed="true"] { box-shadow: var(--lift); transform: translate(-2px, -2px); }
.plain-list small { color: var(--ink-soft); }
.empty { color: var(--ink-soft); font-style: italic; }

/* Formulaires */
label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
textarea { resize: vertical; }
.scout-form { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-bottom: 28px; }
.scout-form .grow { flex: 1 1 260px; }
.scout-form .hint { flex-basis: 100%; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > label { flex: 1 1 110px; }

.btn { font: inherit; font-weight: 600; cursor: pointer; border: var(--line); border-radius: 999px; padding: 9px 18px; background: var(--paper); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover:not(:disabled) { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn-primary { background: var(--lemon); color: #000; }
.btn-go { background: var(--grass); color: #000; }
.btn-ghost { border-color: transparent; }
.btn-small { padding: 4px 12px; font-size: .9rem; }

/* Pastilles de statut : un aplat de crayon */
.status { display: inline-block; padding: 1px 10px; border: 2px solid var(--ink); border-radius: 999px; font-size: .85rem; font-weight: 600; color: #000; background: var(--graphite); }
.status[data-s="proposed"] { background: var(--lemon); }
.status[data-s="illustrating"], .status[data-s="preparing"], .status[data-s="lettering"] { background: var(--sky); }
.status[data-s="cover_review"] { background: var(--lemon); }
.status[data-s="illustrated"], .status[data-s="ready"] { background: var(--grass); }
.status[data-s="failed"] { background: var(--coral); }

/* Rapport de tendances */
.report { display: grid; gap: 14px; }
.report-meta { color: var(--ink-soft); }
.trend { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 6px 16px; align-items: start; background: var(--paper); border: var(--line); border-radius: var(--radius); padding: 14px 16px; }
.trend.restricted { background: repeating-linear-gradient(135deg, var(--paper) 0 10px, color-mix(in srgb, var(--coral) 18%, var(--paper)) 10px 12px); }
.trend-rank { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.trend-body { display: grid; gap: 6px; }
.trend-body p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.trend-actions { align-self: center; }
.momentum { height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; max-width: 320px; }
.momentum span { display: block; height: 100%; background: repeating-linear-gradient(100deg, var(--lemon) 0 7px, color-mix(in srgb, var(--lemon) 70%, #fff) 7px 9px); border-right: 2px solid var(--ink); }
.sources { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; }
.licence { font-weight: 600; color: var(--ink); }
.inline-proposal { grid-column: 1 / -1; border-top: 2px dashed var(--ink); padding-top: 12px; }
@media (max-width: 600px) { .trend { grid-template-columns: 2rem 1fr; } .trend-actions { grid-column: 2; } }

/* Livre */
.book { display: grid; gap: 20px; }
.book-head { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: start; }
.book-head .cover { aspect-ratio: 3 / 4; }
.book-head h2 { font-size: 1.7rem; letter-spacing: -0.01em; }
.subtitle { margin: 6px 0 12px; color: var(--ink-soft); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) { .book-head { grid-template-columns: 1fr; } .book-head .cover { max-width: 220px; } }

/* La signature : la grille de pages qui se remplit */
.progress-line { font-weight: 600; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.page, .cover { margin: 0; position: relative; background: var(--paper); border: var(--line); border-radius: 6px; overflow: hidden; }
.page { display: grid; grid-template-rows: auto 1fr; }
.page-art { aspect-ratio: 3 / 4; display: grid; place-items: center; border-bottom: var(--line); background: #fff; }
.page-art img, .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page[data-s="pending"] .page-art { background: repeating-linear-gradient(45deg, #fff 0 12px, #EEF2F5 12px 14px); }
.page[data-s="failed"] .page-art { background: color-mix(in srgb, var(--coral) 35%, #fff); }
.page-num { position: absolute; top: 6px; left: 6px; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; min-width: 28px; padding: 0 6px; text-align: center; font-weight: 800; font-size: .85rem; }
.page-foot { padding: 8px 10px; display: grid; gap: 6px; font-size: .85rem; }
.page-foot p { margin: 0; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.page-error { color: var(--ink); font-weight: 600; }
.drawing-now .page-art::after { content: ""; width: 38%; aspect-ratio: 1; border: 3px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .drawing-now .page-art::after { animation: none; border-top-color: var(--ink); } }
.scenes { margin: 0; padding-left: 1.4rem; display: grid; gap: 4px; max-width: 75ch; }

/* Paquet KDP */
.package { display: grid; gap: 18px; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.specs div { border: var(--line); border-radius: 8px; padding: 8px 12px; background: var(--paper); }
.specs dt { font-size: .85rem; color: var(--ink-soft); }
.specs dd { margin: 0; font-weight: 800; font-size: 1.1rem; }
.copy-field { display: grid; gap: 4px; }
.copy-field .copy-row { display: flex; gap: 8px; align-items: start; }
.copy-field output { flex: 1; border: 2px dashed var(--ink); border-radius: 8px; padding: 8px 10px; background: var(--paper); white-space: pre-wrap; overflow-wrap: anywhere; }
.keywords { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.keywords li { border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; background: var(--paper); }
.checklist { margin: 0; padding-left: 1.4rem; display: grid; gap: 6px; max-width: 75ch; }

/* Assistant */
.chat { display: grid; grid-template-rows: 1fr auto; gap: 16px; min-height: 60vh; max-width: 900px; }
.chat-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; align-content: start; overflow-y: auto; max-height: 62vh; }
.msg { max-width: 80ch; padding: 10px 14px; border: var(--line); border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-user { justify-self: end; background: var(--lemon); color: #000; border-bottom-right-radius: 2px; }
.msg-assistant { justify-self: start; background: var(--paper); border-bottom-left-radius: 2px; }
.msg-tool { justify-self: start; font-size: .85rem; border-style: dashed; color: var(--ink-soft); background: transparent; padding: 6px 12px; }
.msg-tool summary { cursor: pointer; }
.msg-tool pre { max-height: 240px; overflow: auto; font-size: .8rem; }
.msg-thinking { color: var(--ink-soft); border-style: dashed; }
.chat-form { display: grid; gap: 10px; }
.chat-actions { display: flex; justify-content: space-between; gap: 10px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); background: var(--paper); border: var(--line); border-radius: var(--radius); box-shadow: var(--lift); padding: 12px 18px; font-weight: 600; z-index: 10; }
.toast[data-kind="error"] { background: var(--coral); color: #000; }

/* Modale de redessin */
.redraw-dialog { width: min(760px, calc(100vw - 32px)); padding: 24px; color: var(--ink); }
.redraw-dialog::backdrop { background: rgb(0 0 0 / .45); }
.redraw-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.redraw-preview { aspect-ratio: 3 / 4; border: var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.redraw-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.redraw-dialog .actions { justify-content: flex-end; }
@media (max-width: 600px) { .redraw-layout { grid-template-columns: 1fr; } .redraw-preview { max-width: 160px; } }

/* Couverture : épreuve de la face avant et aperçu complet */
.cover-stage { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 24px; align-items: start; }
.front-proof { aspect-ratio: 3 / 4; border: var(--line); border-radius: 6px; overflow: hidden; background: repeating-linear-gradient(45deg, #fff 0 12px, #EEF2F5 12px 14px); display: grid; }
.front-proof img { width: 100%; height: 100%; object-fit: cover; display: block; }
.front-proof .page-art { border: 0; background: transparent; }
.proof-list { margin: 0; padding-left: 1.3rem; display: grid; gap: 4px; }
.cover-preview { width: 100%; height: auto; border: var(--line); border-radius: 6px; display: block; }
@media (max-width: 700px) { .cover-stage { grid-template-columns: 1fr; } .front-proof { max-width: 260px; } }

/* Analyse marketing et titre */
.marketing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; margin: 12px 0; }
.marketing-grid dt { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.marketing-grid dd { margin: 2px 0 0; }
.title-count { margin: -4px 0 0; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.title-count[data-over="true"] { color: #B3261E; }

/* Suggestions de titres */
.suggest-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.title-suggestions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 42vh; overflow-y: auto; }
.suggestion { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--paper); border: var(--line); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; display: grid; gap: 2px; }
.suggestion:hover { box-shadow: 3px 3px 0 var(--ink); }
.suggestion[aria-pressed="true"] { background: var(--lemon); color: #000; }
.suggestion small { color: var(--ink-soft); }
.suggestion[aria-pressed="true"] small { color: #333; }

/* Rayon de la veille, étiquettes */
.shelf-switch { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; align-items: center; }
.shelf-switch legend { font-weight: 600; font-size: .95rem; margin-bottom: 4px; float: left; width: 100%; }
.shelf-switch label { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.shelf-switch input { margin: 0; accent-color: var(--ink); }
.shelf-switch label:has(input:checked) { background: var(--lemon); color: #000; }
.tag { display: inline-block; border: 2px solid var(--ink); border-radius: 6px; padding: 0 6px; font-size: .78rem; font-weight: 800; letter-spacing: .02em; vertical-align: 1px; }
.status[data-s="drawing"] { background: var(--sky); }
.status[data-s="drawn"] { background: var(--grass); }

/* Choix du style graphique : un nuancier par style */
.style-picker { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.style-picker legend { font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.style-card { position: relative; display: grid; gap: 4px; align-content: start; border: var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--paper); cursor: pointer; font-weight: 400; }
.style-card input { position: absolute; opacity: 0; pointer-events: none; }
.style-card:has(input:checked) { box-shadow: var(--lift); transform: translate(-2px, -2px); outline: 3px solid var(--lemon); outline-offset: -5px; }
.style-card:has(input:focus-visible) { outline: 3px solid var(--sky); }
.style-card small { color: var(--ink-soft); font-size: .82rem; line-height: 1.35; }
.style-card .audiences { font-style: italic; }
.swatches { display: flex; height: 16px; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.swatches i { flex: 1; }

/* BD : accroche, personnages, scénario */
.logline p:first-child { margin: 0 0 8px; font-size: 1.15rem; font-weight: 600; }
.logline p { margin: 0; }
.cast { display: grid; gap: 12px; }
.model-sheet { width: 100%; max-height: 360px; object-fit: contain; background: #fff; border: var(--line); border-radius: 6px; }
.characters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.characters li { border: 2px dashed var(--ink); border-radius: 8px; padding: 8px 10px; }
.characters small { color: var(--ink-soft); }
.characters p { margin: 4px 0 0; font-size: .85rem; color: var(--ink-soft); }
.script-page { border-top: 2px solid var(--ink); padding-top: 8px; }
.script-page summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.script-page summary small { color: var(--ink-soft); }
.panel-script { margin: 10px 0 4px; padding-left: 1.4rem; display: grid; gap: 10px; }
.panel-script p { margin: 0 0 6px; }
.panel-script small { color: var(--ink-soft); }
.balloon-edit { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 4px 0; }
.balloon-edit input { flex: 1 1 240px; padding: 5px 8px; }
.balloon-edit .kind { font-size: .8rem; font-weight: 800; min-width: 9ch; }
.balloon-edit .kind[data-kind="caption"] { background: #FFF4C2; color: #000; border: 2px solid var(--ink); padding: 0 6px; }
.balloon-edit .kind[data-kind="sfx"] { color: #000; background: #FFC400; border: 2px solid var(--ink); padding: 0 6px; transform: rotate(-3deg); }

/* BD : la grille des planches */
.planches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.planche { margin: 0; position: relative; background: var(--paper); border: var(--line); border-radius: 6px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.planche-open { all: unset; cursor: pointer; display: block; position: relative; }
.planche-open:focus-visible { outline: 3px solid var(--sky); outline-offset: -3px; }
.planche-art { aspect-ratio: 8.5 / 11; display: grid; place-items: center; border-bottom: var(--line); background: #fff; }
.planche-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.planche[data-s="failed"] .planche-art { background: color-mix(in srgb, var(--coral) 30%, #fff); }
.planche:hover { box-shadow: 3px 3px 0 var(--ink); }
.drawing-now .planche-art::after { content: ""; position: absolute; width: 30%; aspect-ratio: 1; border: 3px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .drawing-now .planche-art::after { animation: none; border-top-color: var(--ink); } }
.mini-grid { width: 64%; margin-top: 18px; aspect-ratio: 8.5 / 11; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; align-content: start; }
.mini-grid i { aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 2px; background: repeating-linear-gradient(45deg, #fff 0 5px, #EEF2F5 5px 7px); }
.mini-grid i[data-s="drawn"] { background: var(--sky); }
.mini-grid i[data-s="failed"] { background: var(--coral); }

/* BD : la fenêtre d'une planche */
.planche-dialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 24px; color: var(--ink); }
.planche-dialog::backdrop { background: rgb(0 0 0 / .45); }
.planche-layout { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 24px; align-items: start; }
.planche-proof { aspect-ratio: 8.5 / 11; border: var(--line); border-radius: 6px; overflow: hidden; background: #fff; position: sticky; top: 0; }
.planche-proof[data-empty="true"] { background: repeating-linear-gradient(45deg, #fff 0 12px, #EEF2F5 12px 14px); }
.planche-proof img { width: 100%; height: 100%; object-fit: contain; display: block; }
.planche-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-editor { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.panel-edit { display: grid; grid-template-columns: 120px 1fr; gap: 12px; border-top: 2px dashed var(--ink); padding-top: 12px; }
.panel-thumb { aspect-ratio: 4 / 3; border: var(--line); border-radius: 4px; overflow: hidden; background: repeating-linear-gradient(45deg, #fff 0 8px, #EEF2F5 8px 10px); }
.panel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel-edit[data-s="failed"] .panel-thumb { background: color-mix(in srgb, var(--coral) 35%, #fff); }
@media (max-width: 760px) { .planche-layout { grid-template-columns: 1fr; } .planche-proof { position: static; max-width: 320px; } .panel-edit { grid-template-columns: 80px 1fr; } }
.redraw-panel .btn { justify-self: start; }
.status[data-s="writing"] { background: var(--sky); }
.status[data-s="writing_failed"] { background: var(--coral); }
.status[data-s="paused"] { background: var(--lemon); }

/* Coûts d'une BD */
.cost-estimate { margin: 0; padding: 8px 12px; border: 2px dashed var(--ink); border-radius: 8px; font-size: .92rem; }
.cost-estimate small, .costs small { color: var(--ink-soft); }
.costs p { margin: 8px 0 0; }
.cost-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 0; }
.cost-grid div { border: var(--line); border-radius: 8px; padding: 8px 12px; background: var(--paper); display: grid; gap: 2px; }
.cost-grid dt { font-size: .85rem; color: var(--ink-soft); }
.cost-grid dd { margin: 0; font-weight: 800; font-size: 1.15rem; }
.page-redraw { border: 2px dashed var(--ink); border-radius: 8px; padding: 10px 12px; } .page-redraw .btn { justify-self: start; }
.flag { display: inline-block; background: var(--coral); color: #000; border: 2px solid var(--ink); border-radius: 6px; padding: 0 6px; font-size: .82rem; font-weight: 700; }
.flag-corner { position: absolute; top: 6px; right: 6px; z-index: 1; }

/* Bandeau d'activité d'une BD */
.activity { display: flex; gap: 14px; align-items: center; justify-content: space-between; border: var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--lift); }
.activity p { margin: 2px 0; }
.activity-live { background: color-mix(in srgb, var(--sky) 30%, var(--paper)); justify-content: flex-start; }
.activity-paused { background: color-mix(in srgb, var(--lemon) 35%, var(--paper)); }
.activity-spinner { flex: none; width: 26px; height: 26px; border: 3px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .activity-spinner { animation: none; border-top-color: var(--ink); } }
@media (max-width: 600px) { .activity { flex-direction: column; align-items: flex-start; } }
