:root {
  --bg: #f4f3f1; --panel: #fff; --ink: #151515; --muted: #6b6b6b; --line: #e4e2de;
  --accent: #151515; --accent-ink: #fff; --ok: #1f7a4d; --warn: #b26b00; --bad: #b3261e; --live: #1f7a4d;
  --radius: 10px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Trois états de thème : système (media query), choix explicite clair, choix explicite sombre.
   Tous les jetons sont définis dans :root ; les blocs ci-dessous ne font que les redéfinir. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #17181a;
    --panel: #202225;
    --ink: #ececed;
    --muted: #a0a2a6;
    --line: #34363a;
    --accent: #ececed;
    --accent-ink: #17181a;
    --ok: #5fce9b;
    --warn: #e5a04a;
    --bad: #f08a80;
    --live: #5fce9b;
  }
}
:root[data-theme='dark'] {
  --bg: #17181a;
  --panel: #202225;
  --ink: #ececed;
  --muted: #a0a2a6;
  --line: #34363a;
  --accent: #ececed;
  --accent-ink: #17181a;
  --ok: #5fce9b;
  --warn: #e5a04a;
  --bad: #f08a80;
  --live: #5fce9b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
h1, h2, h3 { margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 18px; } h3 { font-size: 15px; }
a { color: inherit; }
.loading { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
button { font: inherit; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }
button:disabled { opacity: .5; cursor: wait; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.ghost:hover { border-color: var(--ink); }
button.danger { color: var(--bad); }
button.link { background: none; border: 0; color: inherit; padding: 6px 0; display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; font-weight: 500; flex-wrap: wrap; }
button.icon { padding: 2px 10px; font-size: 18px; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel); width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; }
input[type=color] { padding: 2px; height: 38px; }
textarea { resize: vertical; }

.top { display: flex; align-items: center; gap: 20px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; gap: 8px; align-items: baseline; }
.brand strong { font-family: 'Arial Black', Arial, sans-serif; }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs a.active { background: var(--bg); color: var(--ink); }
.user { display: flex; gap: 10px; align-items: center; }
.version { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.content { padding: 20px; max-width: 1280px; margin: 0 auto; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.side { position: sticky; top: 76px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; flex: 1; }
.toolbar input[type=search] { max-width: 260px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.row.between { justify-content: space-between; margin-top: 0; }
.row input { flex: 1; min-width: 180px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 16px; align-items: start; }
.grid2.tight { margin-top: 0; gap: 8px; }
.span2 { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.grid2 .field { margin-bottom: 0; }
.field-label { font-weight: 600; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.checks label { display: flex; gap: 6px; align-items: center; }

.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 600; }
.chip.small { font-size: 11px; padding: 1px 7px; margin-left: 6px; }
.chip.bad, .chip.error, .chip.too_long { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.chip.live, .chip.pushed { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.chip.upcoming, .chip.would_push { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip.demo { background: var(--ink); color: var(--bg); }
.gauge { height: 4px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.gauge div { height: 100%; background: var(--ink); }
.warnings { margin: 0 0 12px; padding: 10px 10px 10px 28px; background: color-mix(in srgb, var(--warn) 12%, transparent); border-radius: 8px; color: var(--warn); }
/* Les signatures sont toujours rendues sur fond blanc : c'est le fond d'un client mail. */
.mail { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; overflow-x: auto; background: #fff; margin-bottom: 8px; }
.sigframe { width: 100%; border: 0; min-height: 160px; display: block; }

.table-wrap { overflow-x: auto; }
.table-wrap.scroll { max-height: 42vh; overflow-y: auto; }
.import-report { margin-top: 14px; }
.import-report td { font-size: 13px; }
/* Styles de tableaux limités au back-office : ne pas toucher aux <table> des signatures (.sigbox). */
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap th { font-size: 12px; color: var(--muted); font-weight: 600; }
.table-wrap tr.dim td { opacity: .5; }
.table-wrap tr.error td { color: var(--bad); }
td.actions { white-space: nowrap; text-align: right; }
td.actions button { padding: 5px 9px; font-size: 12px; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list small { width: 100%; padding-left: 20px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card.live { border-color: var(--live); }
.card.past, .card.off { opacity: .6; }
.card img { width: 100%; aspect-ratio: 4 / 1; object-fit: cover; display: block; background: var(--bg); max-width: 100%; }
.card-body { padding: 12px; display: grid; gap: 4px; }
.thumb { aspect-ratio: 4 / 1; background: var(--bg); border-radius: 8px; display: grid; place-items: center; overflow: hidden; margin-top: 8px; max-width: 600px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.banner-demo { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { background: var(--panel); border-radius: 12px; width: min(760px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal header, .modal footer { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal header h3 { margin: 0; }
.modal footer { border-bottom: 0; border-top: 1px solid var(--line); justify-content: flex-end; gap: 8px; }
.modal-body { padding: 0 18px 18px; overflow: auto; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: min(600px, calc(100vw - 32px)); }
.toast.error { background: var(--bad); }

.login { max-width: 420px; margin: 12vh auto; display: grid; gap: 12px; }
.install { max-width: 760px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 16px; }
.sigbox { padding: 16px; border: 1px dashed var(--line); border-radius: 8px; margin: 12px 0; background: #fff; color: #1a1a1a; overflow-x: auto; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }

@media (max-width: 860px) {
  .split, .grid2 { grid-template-columns: 1fr; }
  .side { position: static; }
  .content { padding: 12px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; order: 3; flex-basis: 100%; }
  .top { gap: 10px; padding: 10px 12px; }
}
/* Un lien qui a l'air d'un bouton (vers l'éditeur, vers la fiche) */
a.button { display: inline-block; text-decoration: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 8px 14px; font-weight: 600; white-space: nowrap; text-align: center; }
a.button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
a.button.ghost:hover { border-color: var(--ink); }

/* ===================================================================================================
   Écran Chartes — la fiche (docs/REFONTE-CHARTES.md §2)
   =================================================================================================== */
.split.sheet { grid-template-columns: 250px minmax(0, 1fr); }
.list li.current { background: var(--bg); border-radius: 6px; }
.list a.link { text-decoration: none; padding: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 500; }
.sheet-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sheet-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.sheet-domains .field { margin-bottom: 6px; }
.sheet-domains .coverage { display: block; font-weight: 600; font-size: 13px; margin: 2px 0 10px; }
input.readonly { background: var(--bg); color: var(--muted); }
details.advanced > summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; }
.sheet-section .section-title { margin: 0 0 10px; font-size: 15px; }
.section-title small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.font-field { display: grid; gap: 4px; min-width: 260px; }
.font-field small { color: var(--muted); font-size: 12px; }
.sheet-preview { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.sheet-preview .mail { margin-bottom: 0; }
.preview-side { display: grid; gap: 10px; }
.preview-side .meters { display: grid; gap: 6px; }
.meters { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.meter-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-count.bad { color: var(--bad); font-weight: 600; }
.meter-weight { padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; width: max-content; }
.meter-weight.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.meter-weight.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
/* Tableau des styles : six rôles × cinq colonnes */
.styles-wrap { margin-bottom: 8px; }
table.styles th small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
table.styles th[scope=row] { font-weight: 600; color: var(--ink); font-size: 13px; white-space: nowrap; }
table.styles td { vertical-align: middle; }
table.styles input[type=number] { width: 84px; padding: 5px 8px; }
table.styles select { width: auto; padding: 5px 8px; }
.style-color { display: inline-flex; gap: 6px; align-items: center; }
.style-color input[type=color] { width: 36px; height: 30px; padding: 1px; }
.style-color code { font-size: 12px; }
tr.role-row.focus th, tr.role-row.focus td { background: color-mix(in srgb, var(--warn) 12%, transparent); }
p.small { font-size: 12px; }
.brand-picker { display: none; }
details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3 { pointer-events: none; }
@media (max-width: 899px) {
  .split.sheet { grid-template-columns: minmax(0, 1fr); }
  .split.sheet > .side { display: none; }
  .brand-picker { display: block; max-width: 220px; padding: 6px 8px; }
  .toolbar:has(.brand-picker) h2 { display: none; }
  .sheet-preview { grid-template-columns: minmax(0, 1fr); }
  details.fold > summary h3::before { content: '▸ '; font-size: 12px; }
  details.fold[open] > summary h3::before { content: '▾ '; }
}

/* ===================================================================================================
   Éditeur de mise en page — plein écran (docs/REFONTE-CHARTES.md §3, §4)
   ≥ 1 200 px : palette | canevas | panneau ; 900–1 200 : palette en icônes, panneau en tiroir ;
   < 900 : canevas pleine largeur, puis deux onglets Blocs / Propriétés. Jamais rogné : zoom + défilement.
   =================================================================================================== */
body.editor-full .top { display: none; }
.content.full { padding: 0; max-width: none; margin: 0; }
.ed { display: flex; flex-direction: column; height: 100vh; background: var(--panel); }
.ed-bar { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; position: relative; flex-wrap: wrap; }
.ed-bar-left, .ed-bar-center, .ed-bar-right { display: flex; gap: 8px; align-items: center; }
.ed-bar-left { flex: 1 1 0; min-width: 0; }
.ed-bar-center { flex: 0 0 auto; }
.ed-bar-right { flex: 1 1 0; justify-content: flex-end; min-width: 0; }
.ed-bar button { padding: 4px 10px; font-size: 12px; }
.ed-bar button.on { border-color: var(--ink); font-weight: 700; }
.ed-brand-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-dirty { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: 0 0 auto; }
.ed-dirty.on { background: var(--warn); }
.ed-zoom { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; }
.ed-inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ed-panel-toggle, .ed-more { display: none; }
.ed-more { position: static; border: 0; padding: 0; }
.ed-more > summary { list-style: none; cursor: pointer; padding: 2px 10px; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; line-height: 18px; }
.ed-more > summary::-webkit-details-marker { display: none; }
.ed-more[open] > summary { border-color: var(--ink); }
.ed-more-body { position: absolute; right: 8px; top: calc(100% + 4px); z-index: 6; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: grid; gap: 10px; min-width: 220px; }
.ed-brand-name-more { font-weight: 600; }
.ed-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 170px minmax(0, 1fr) 300px; position: relative; }
.ed-palette { padding: 12px; border-right: 1px solid var(--line); display: grid; gap: 6px; align-content: start; overflow: auto; }
.ed-palette-title, .ed-panel-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.ed-panel-title small { font-weight: 400; }
.ed-close { margin-left: auto; padding: 0 8px; }
.ed-chip, .ed .ed-chip { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; cursor: pointer; background: var(--panel); user-select: none; text-align: left; font-weight: 500; white-space: normal; color: var(--ink); }
.ed-chip:hover { border-color: var(--ink); }
.ed-chip.used, .ed-chip:disabled { opacity: .4; cursor: not-allowed; }
.ed-crumbs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ed-crumbs .ed-crumb, .ed-inline .ed-crumb { padding: 2px 8px; font-size: 12px; }
.ed-stage-wrap { overflow: auto; background: #f4f3f1; padding: 20px; min-width: 0; }
.ed-width-label { font-size: 11px; color: #6b6b6b; margin: 0 0 6px; }
.ed-gestures { font-size: 12px; color: #6b6b6b; margin: 10px 0 0; max-width: 632px; }
.ed-gestures b { color: #1a1a1a; font-weight: 600; }
.ed.stacked .ed-gestures { margin: 6px 2px 4px; }
/* Bandeau « nouvelle version en ligne » : la page à ancres ne se recharge jamais seule */
.update-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.update-banner button { background: var(--bg); color: var(--ink); border-color: var(--bg); padding: 5px 12px; font-size: 12px; }
.ed-stage { position: relative; background: #fff; color: #1a1a1a; padding: 16px; min-height: 200px; outline: none; width: max-content; box-sizing: border-box; }
.ed-stage:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 25%, transparent); }
.ed-canvas { position: relative; }
.ed-overlay { position: absolute; inset: 0; pointer-events: none; }
.ed-box { position: absolute; box-sizing: border-box; pointer-events: none; }
.ed-box.hover { outline: 1px dashed #4a90d9; }
.ed-box.selected { outline: 2px solid #1a73e8; }
.ed-tag { position: absolute; left: 0; top: -18px; background: #1a73e8; color: #fff; font: 600 10px/16px -apple-system, Arial, sans-serif; padding: 0 6px; border-radius: 3px 3px 0 0; white-space: nowrap; }
.ed-del { position: absolute; right: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #1a73e8; color: #fff; font: 700 13px/20px Arial; padding: 0; cursor: pointer; pointer-events: auto; }
.ed-handle { position: absolute; width: 6px; cursor: col-resize; pointer-events: auto; border-radius: 3px; }
.ed-handle:hover { background: color-mix(in srgb, #1a73e8 35%, transparent); }
body.ed-resizing { cursor: col-resize; user-select: none; }
.ed-marker { position: absolute; background: #1a73e8; border-radius: 2px; pointer-events: none; box-shadow: 0 0 0 1px #fff; }
.ed-marker.refused { background: var(--bad); }
.ed-panel { padding: 12px 14px; border-left: 1px solid var(--line); display: grid; gap: 12px; align-content: start; font-size: 13px; overflow: auto; }
.ed-prop { display: grid; gap: 4px; }
.ed-prop > span:first-child, .ed-style > span:first-child { font-weight: 600; font-size: 12px; }
.ed-prop input, .ed-prop select { padding: 5px 8px; font-size: 13px; }
.ed-inline input[type=number] { width: 64px; }
.ed-inline input[type=color] { width: 40px; height: 30px; padding: 1px; }
.ed-inline button.ghost { padding: 3px 8px; }
.ed-inline select { width: auto; max-width: 180px; }
.ed-check { display: flex; gap: 4px; align-items: center; font-weight: 400; }
.ed-border { display: grid; grid-template-columns: 1fr 64px 24px; gap: 6px; align-items: center; }
.ed-border label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.ed-style { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ed-style p { margin: 0; font-size: 12px; }
.ed-style-role { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.ed-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); }
.ed-styles-note { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ed-styles-note p { margin: 0; font-size: 12px; }
.ed-actions { padding-top: 6px; border-top: 1px solid var(--line); }
.ed-actions button { font-size: 12px; padding: 5px 10px; }
.ed-tabs { display: none; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
/* Tiroir (900–1 200 px) : palette en bandeau au-dessus du canevas (libellés complets), panneau flottant ; barre sur une ligne */
.ed.drawer .ed-body { display: flex; flex-direction: column; overflow: hidden; }
.ed.drawer .ed-stage-wrap { flex: 1 1 auto; min-height: 0; }
.ed.drawer .ed-bar { flex-wrap: nowrap; gap: 6px; padding: 6px 8px; overflow-x: auto; white-space: nowrap; }
.ed.drawer .ed-bar > * { flex: 0 0 auto; }
.ed.drawer .ed-bar-right { flex: 1 1 auto; }
.ed.drawer .ed-brand-name, .ed.drawer .ed-back-label { display: none; }
.ed-bar .meters { flex-wrap: nowrap; }
.ed.drawer .ed-palette { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
.ed.drawer .ed-palette-title { margin: 0 6px 0 0; }
.ed.drawer .ed-palette > small { flex-basis: 100%; }
.ed.drawer .ed-panel-toggle { display: inline-block; }
.ed.drawer .ed-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 90%); background: var(--panel); box-shadow: -6px 0 18px rgba(0,0,0,.12); transform: translateX(105%); transition: transform .15s ease; z-index: 3; }
.ed.drawer.drawer-open .ed-panel { transform: none; }
/* Empilé (< 900 px) : canevas seul en pleine largeur, puis deux onglets */
.ed.stacked { height: auto; min-height: 100vh; }
.ed.stacked .ed-body { display: flex; flex-direction: column; }
.ed.stacked .ed-stage-wrap { padding: 4px; }
.ed.stacked .ed-stage { padding: 4px; }
.ed.stacked .ed-width-label { margin: 2px 0 4px 2px; }
.ed.stacked .ed-tabs { display: flex; }
.ed.stacked .ed-tabs button { flex: 1; }
.ed.stacked .ed-palette, .ed.stacked .ed-panel { border: 0; display: none; }
.ed.stacked.tab-blocks .ed-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.ed.stacked.tab-blocks .ed-palette-title, .ed.stacked.tab-blocks .ed-palette > small { flex-basis: 100%; }
.ed.stacked.tab-props .ed-panel { display: grid; }
.ed.stacked .ed-bar { flex-wrap: nowrap; gap: 6px; padding: 6px 8px; overflow-x: auto; white-space: nowrap; }
.ed.stacked .ed-bar > * { flex: 0 0 auto; }
.ed.stacked .ed-bar-left { flex: 0 0 auto; }
.ed.stacked .ed-bar-right { flex: 1 1 auto; }
.ed.stacked .ed-brand-name, .ed.stacked .ed-back-label { display: none; }
.ed.stacked .ed-more { display: block; }
.ed.stacked .ed-bar button { padding: 4px 8px; }

/* ===================================================================================================
   Écran Campagnes (phase 3) : onglets d'état, recherche, filtre de dates, liste avec vignettes ;
   fiche en trois onglets Éditer / Scénario / Assigner.
   =================================================================================================== */
.spacer { flex: 1 1 0; }
.cfilters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.ctabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ctabs button { padding: 5px 10px; font-size: 13px; }
.ctabs button.on { border-color: var(--ink); font-weight: 700; }
.csearch { max-width: 260px; padding: 6px 10px; }
.cfilters input[type=date] { width: auto; padding: 5px 8px; }
table.clist td { vertical-align: middle; }
table.clist .block { display: block; }
.cthumb { width: 120px; height: auto; display: block; border-radius: 4px; background: var(--bg); object-fit: contain; }
.modal-tabs { margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.thumb.free { aspect-ratio: auto; max-width: 600px; }
.thumb.free img { width: 100%; height: auto; object-fit: contain; }
.prios { display: grid; gap: 8px; }
.prio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.prio input { margin-top: 3px; }
.prio > span { flex: 1; }
.prio small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.rule { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-weight: 600; font-size: 13px; }
.rule .muted { font-weight: 400; }
.checks.col { flex-direction: column; align-items: flex-start; gap: 6px; }
small.block { display: block; margin-top: 2px; }
.dates[hidden] { display: none; }
tr.past td, tr.off td { opacity: .6; }
