/* Ambiance « atelier » : papier crème, terracotta pour les rectos, vert sauge pour les versos. */
:root {
  --bg: #f6efe4;
  --surface: #fffdf9;
  --surface-2: #fbf5ec;
  --text: #2e2620;
  --muted: #7a6d62;
  --border: #e8dccb;
  --accent: #c2563a;
  --accent-hover: #a9472e;
  --accent-soft: #fbe8df;
  --sage: #3f7d6e;
  --sage-soft: #e2efe9;
  --table: #ebe1d2;
  --danger: #b3261e;
  --warning: #8a5a00;
  --warning-bg: #fff3d3;
  --info-bg: #eef4f1;
  --info-text: #2f6658;
  --error-bg: #fde8e4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(80, 50, 20, .06), 0 6px 18px rgba(80, 50, 20, .07);
  --shadow-hover: 0 2px 4px rgba(80, 50, 20, .08), 0 10px 26px rgba(80, 50, 20, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", "Nunito", var(--font);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
h1, h2, h3, .brand, .capacity-main { font-family: var(--font-round); letter-spacing: -.01em; }
h1 { font-size: 1.75rem; margin: 0; font-weight: 800; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; font-weight: 700; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: .9rem; }
.subtitle { color: var(--muted); margin: .3rem 0 0; }

/* Barre du haut */
.topbar { height: 62px; display: flex; align-items: center; gap: 2rem; padding: 0 1.75rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.brand small { display: block; font-family: var(--font); font-weight: 400; font-size: .75rem; color: var(--muted); letter-spacing: 0; }
.brand svg { width: 34px; height: 34px; flex: none; }
.topbar nav { display: flex; gap: .4rem; }
.topbar nav a { text-decoration: none; color: var(--muted); padding: .4rem .85rem; border-radius: 999px; font-weight: 500; }
.topbar nav a:hover { background: var(--surface-2); color: var(--text); }
.topbar nav a.active { color: var(--accent); background: var(--accent-soft); }

main { max-width: 1400px; margin: 0 auto; padding: 2rem 1.75rem 4rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .9rem; text-decoration: none; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--accent); }

/* Boutons */
button, a.button { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: .5rem 1.1rem; border-radius: 999px; transition: background .15s, box-shadow .15s, transform .1s; display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; }
button:hover, a.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:active, a.button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(194, 86, 58, .3); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, a.button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
button.secondary:hover, a.button.secondary:hover { background: var(--surface-2); border-color: #dccdb8; }
button.danger { background: var(--danger); border-color: var(--danger); }
button.danger-text { color: var(--danger); }
button.small, a.button.small { padding: .25rem .7rem; font-size: .85rem; }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; font-weight: 500; border-radius: 0; }
button.ghost, a.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover, a.button.ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }

/* Tuiles (jeux, paquets) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.1rem; }
.tile { border-top: 5px solid var(--tile-color, var(--accent)); position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tile-cover { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.1rem .9rem; text-decoration: none; color: inherit; flex: 1; }
.tile-cover .badge { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-round); font-weight: 800; font-size: 1.35rem; color: #fff; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.tile-cover .mini-card { flex: none; border-radius: 5px; border: 2px solid var(--accent); background: var(--accent-soft); }
.tile-title { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.tile-title strong { font-family: var(--font-round); font-size: 1.08rem; overflow-wrap: anywhere; }
.tile-meta { display: flex; flex-wrap: wrap; gap: .3rem; padding: 0 1.1rem .8rem; }
.chip { font-size: .76rem; padding: .12rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip.sage { background: var(--sage-soft); border-color: #cfe3da; color: var(--sage); }
.chip.accent { background: var(--accent-soft); border-color: #f3d3c6; color: var(--accent); }
.tile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .45rem .6rem; border-top: 1px solid var(--border); background: var(--surface-2); }
.tile-actions .spacer { flex: 1; }
.tile.new { border-top-width: 2px; border: 2px dashed #dccdb8; background: transparent; box-shadow: none; align-items: center; justify-content: center; min-height: 150px; color: var(--muted); text-decoration: none; font-weight: 600; gap: .4rem; }
.tile.new:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,255,255,.5); }
.tile.new .plus { font-size: 2rem; line-height: 1; }

/* État vide */
.empty-state { text-align: center; padding: 3rem 1.5rem; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.empty-state svg { width: 150px; height: auto; margin-bottom: .5rem; }
.empty-state h2 { margin-bottom: .4rem; }
.empty-state p { color: var(--muted); max-width: 440px; margin: 0 auto 1.25rem; line-height: 1.5; }
.empty { color: var(--muted); padding: 2rem; text-align: center; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border); }

/* Listes simples */
.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.item { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.item-main { flex: 1; display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: inherit; }
.item-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.tag { display: inline-block; font-size: .72rem; padding: .08rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin-left: .5rem; vertical-align: middle; }

/* Fenêtres */
dialog.modal { border: none; border-radius: 18px; padding: 1.6rem 1.75rem; width: min(480px, 92vw); box-shadow: 0 20px 60px rgba(60, 35, 15, .3); background: var(--surface); color: var(--text); }
dialog.modal::backdrop { background: rgba(46, 38, 32, .4); backdrop-filter: blur(2px); }
dialog.modal input[type=text]:not(.num) { width: 100%; }
dialog.wide { width: min(640px, 94vw); }
.actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.4rem; }

/* Formulaires */
input[type=text], select { font: inherit; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--text); }
input[type=text]:focus, select:focus { border-color: var(--accent); outline: 3px solid rgba(194, 86, 58, .18); outline-offset: 0; }
input.num { width: 5.5rem; text-align: right; }
input.invalid { border-color: var(--danger); background: var(--error-bg); }
input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 1rem; height: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.field > label, .field > .label { font-weight: 650; font-size: .9rem; }
.field .hint { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.pair { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.form-section { font-family: var(--font-round); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.4rem 0 .8rem; display: flex; align-items: center; gap: .6rem; }
.form-section::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.form-section:first-child { margin-top: 0; }

/* Messages */
.msg { border-radius: var(--radius-sm); padding: .55rem .8rem; font-size: .88rem; margin: .3rem 0; line-height: 1.4; }
.msg.error { background: var(--error-bg); color: var(--danger); }
.msg.warning { background: var(--warning-bg); color: var(--warning); }
.msg.info { background: var(--info-bg); color: var(--info-text); }
.msg.tip { background: var(--accent-soft); color: var(--accent-hover); }
.error { background: var(--error-bg); color: var(--danger); padding: 1rem; border-radius: var(--radius); }

/* Interrupteur à deux positions */
.segmented { align-self: flex-start; display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; gap: 2px; }
.segmented button { background: transparent; color: var(--muted); border: none; border-radius: 999px; padding: .38rem .95rem; font-weight: 600; }
.segmented button:hover { background: rgba(255,255,255,.7); color: var(--text); border: none; }
.segmented button.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(80, 50, 20, .15); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
details.advanced { border-top: 1px solid var(--border); margin-top: .75rem; padding-top: 1rem; }
details.advanced summary { cursor: pointer; font-weight: 650; margin-bottom: .9rem; color: var(--muted); }
details.advanced summary:hover { color: var(--accent); }

/* Tableau des formats */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 1rem; }
table.formats { width: 100%; border-collapse: collapse; }
table.formats th, table.formats td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
table.formats tr:last-child td { border-bottom: none; }
table.formats th { background: var(--surface-2); font-weight: 650; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
table.formats tbody tr:hover { background: #fffaf3; }
table.formats td { white-space: nowrap; }
table.formats td:first-child { white-space: normal; font-weight: 600; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.bleed { background: var(--sage-soft); color: var(--sage); padding: .5rem .8rem; border-radius: var(--radius-sm); font-size: .88rem; margin: .2rem 0; }

/* Configuration d'un paquet */
.deck-editor { display: grid; grid-template-columns: minmax(330px, 430px) 1fr; gap: 1.75rem; align-items: start; }
.deck-preview { position: sticky; top: 5rem; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.capacity { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); display: flex; align-items: center; gap: .9rem; }
.capacity .big { font-family: var(--font-round); font-size: 2.1rem; font-weight: 800; color: var(--accent); line-height: 1; }
.capacity-main { font-size: 1.15rem; font-weight: 750; }
@media (max-width: 900px) { .deck-editor { grid-template-columns: 1fr; } .deck-preview { position: static; } }

/* Planches : posées sur une « table » */
.table-top { background: var(--table); border-radius: 18px; padding: 1.5rem; box-shadow: inset 0 2px 8px rgba(80, 50, 20, .08); }
.sheet-row { display: flex; gap: 1.75rem; flex-wrap: wrap; align-items: flex-start; }
figure.sheet { margin: 0; }
figure.sheet figcaption { font-family: var(--font-round); font-weight: 800; letter-spacing: .04em; margin-bottom: .5rem; font-size: .85rem; display: flex; align-items: center; gap: .45rem; color: var(--text); }
figure.sheet figcaption::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
figure.sheet.verso figcaption::before { background: var(--sage); }
.deck-preview .sheet-page { width: calc(var(--page-w) * 1.5px); max-width: 100%; }
.sheet-page { display: block; height: auto; box-shadow: 0 1px 2px rgba(60, 35, 15, .15), 0 8px 22px rgba(60, 35, 15, .16); background: #fff; border-radius: 2px; }
.sheets .sheet-page { width: calc(var(--page-scale, 1.6) * var(--page-w) * 1px); }
.sheets { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1rem; }
.sheet-block { overflow-x: auto; background: var(--table); border-radius: 18px; padding: 1.1rem 1.4rem 1.5rem; box-shadow: inset 0 2px 8px rgba(80, 50, 20, .07); }
.sheet-block-header { display: flex; align-items: center; gap: .8rem; margin-bottom: .9rem; flex-wrap: wrap; }
.sheet-block-header h2 { margin: 0; }
.sheet-block-header .spacer { flex: 1; }
.deck-bar { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1.1rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.deck-bar .counter { font-weight: 650; }
.deck-bar .zoom { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); min-width: 120px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }

/* Emplacements interactifs */
.slot-hit { fill: transparent; stroke: none; }
.sheet-page.interactive .slot { cursor: pointer; }
.sheet-page.interactive .slot:hover .slot-hit { fill: rgba(194, 86, 58, .08); stroke: var(--accent); stroke-width: .8; }
.sheet-page .slot.selected .slot-hit { fill: rgba(194, 86, 58, .12); stroke: var(--accent); stroke-width: 1.4; }
.sheet-page .slot.drag-source { opacity: .35; }
.sheet-page .slot.drop-target .slot-hit { fill: rgba(63, 125, 110, .18); stroke: var(--sage); stroke-width: 1.6; }
.sheet-page.dragging { cursor: grabbing; }

/* Vue d'un paquet : messages, panneau « Carte », dépôt de fichiers */
.deck-view { position: relative; }
.deck-view.with-drawer { padding-right: 410px; }
.notice-area:empty { display: none; }
.msg.notice { display: flex; align-items: flex-start; gap: .75rem; justify-content: space-between; }
.msg.notice ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.msg.notice button { color: inherit; }
.progress-msg { display: flex; align-items: center; gap: 1rem; }
.progress-msg .progress { flex: 1; max-width: 360px; }

.drawer { position: fixed; top: 62px; right: 0; bottom: 0; width: 390px; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(80, 50, 20, .1); overflow-y: auto; padding: 1.2rem 1.3rem 2rem; z-index: 5; animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .5rem; }
.drawer-header h2 { margin: 0; }
.drawer-section { border-top: 1px solid var(--border); padding: 1rem 0; }
.side-title { display: flex; align-items: center; gap: .45rem; font-family: var(--font-round); }
.side-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.side-title.verso::before { background: var(--sage); }
.drawer-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.drawer-tip { margin-top: .5rem; }
.hint { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.image-block { display: flex; gap: .9rem; align-items: flex-start; }
.image-block img { width: 110px; max-height: 160px; object-fit: contain; border-radius: 6px; background: var(--surface-2); box-shadow: var(--shadow); }
.image-info { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.image-info strong { overflow-wrap: anywhere; font-size: .9rem; }
.image-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.dropzone { border: 2px dashed #dccdb8; border-radius: var(--radius); padding: 1.2rem; text-align: center; color: var(--muted); background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone p { margin: 0 0 .7rem; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.drop-overlay { display: none; position: fixed; inset: 62px 0 0 0; border: 3px dashed var(--accent); border-radius: 18px; background: rgba(251, 232, 223, .18); z-index: 20; pointer-events: none; justify-content: center; align-items: flex-start; padding-top: 1rem; }
.drop-banner { display: flex; flex-direction: column; align-items: center; gap: .2rem; background: var(--accent); color: #fff; padding: .7rem 1.4rem; border-radius: 14px; box-shadow: var(--shadow-hover); text-align: center; }
.drop-banner strong { font-family: var(--font-round); font-size: 1.15rem; }
.deck-view.file-over .drop-overlay { display: flex; }

dialog.large-modal { width: min(900px, 94vw); }
.large-view { display: grid; place-items: center; background: var(--table); border-radius: var(--radius); padding: 1rem; }
img.large { max-width: 100%; max-height: 70vh; object-fit: contain; box-shadow: var(--shadow); }
.sheet-page .slot.empty { opacity: .4; }
.back-advice { line-height: 1.5; }
.back-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; max-height: 50vh; overflow-y: auto; padding: .2rem; }
button.back-choice { flex-direction: column; align-items: center; gap: .3rem; background: var(--surface-2); color: var(--text); border: 2px solid var(--border); border-radius: var(--radius); padding: .6rem; font-weight: 500; }
button.back-choice:hover { border-color: var(--sage); background: var(--sage-soft); }
button.back-choice img { width: 90px; max-height: 120px; object-fit: contain; border-radius: 6px; }
button.back-choice strong { font-size: .8rem; overflow-wrap: anywhere; text-align: center; }

/* Onglets de la configuration */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin: -.3rem 0 1.2rem; }
button.tab { background: none; border: none; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); padding: .55rem .9rem; font-family: var(--font-round); font-size: 1rem; font-weight: 700; margin-bottom: -1px; }
button.tab:hover { background: none; color: var(--text); border-color: transparent; border-bottom-color: var(--border); }
button.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab-note { margin: .2rem 0 1rem; }
.sub-field { margin-top: -.5rem; padding: .7rem .8rem; background: var(--surface-2); border-radius: var(--radius-sm); }

/* Fenêtre « Gérer les cartes » */
dialog.cards-window { width: min(860px, 95vw); max-height: 90vh; display: flex; flex-direction: column; }
dialog.cards-window[open] { display: flex; }
.cw-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.cw-header h2 { margin-bottom: .2rem; }
.cw-header p { margin: 0 0 .8rem; max-width: 520px; }
.cw-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cw-actions .over, .cw-common.over { outline: 3px solid var(--sage); }
.cw-common { display: flex; align-items: center; gap: .9rem; padding: .7rem .9rem; border: 2px dashed #cfe3da; background: var(--sage-soft); border-radius: var(--radius); margin-bottom: .6rem; }
.cw-common > div { flex: 1; }
.cards-list { overflow-y: auto; flex: 1; min-height: 120px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.cw-row { display: grid; grid-template-columns: 70px 1fr 1fr 40px; gap: .6rem; align-items: center; padding: .45rem .7rem; border-bottom: 1px solid var(--border); }
.cw-row:last-child { border-bottom: none; }
.cw-head { position: sticky; top: 0; background: var(--surface-2); z-index: 1; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cw-num { display: flex; flex-direction: column; line-height: 1.1; }
.cw-num strong { font-family: var(--font-round); font-size: 1.15rem; }
.cw-num small { color: var(--muted); font-size: .72rem; }
.cw-cell { display: flex; align-items: center; gap: .6rem; padding: .3rem; border-radius: var(--radius-sm); border: 2px solid transparent; cursor: pointer; min-width: 0; }
.cw-cell:hover { background: var(--surface); border-color: var(--border); }
.cw-cell.over { border-color: var(--sage); background: var(--sage-soft); }
.cw-cell.empty-cell { border: 2px dashed #dccdb8; color: var(--muted); }
.cw-cell.missing { border-color: #e5a097; background: var(--error-bg); color: var(--danger); }
.cw-cell.common { cursor: default; color: var(--muted); }
.cw-cell.common:hover { background: none; border-color: transparent; }
.cw-thumb { width: 44px; height: 60px; object-fit: contain; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(80, 50, 20, .2); flex: none; }
.cw-placeholder { width: 44px; height: 60px; display: grid; place-items: center; border-radius: 4px; font-size: 1.3rem; font-weight: 700; flex: none; }
.cw-name { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-empty { padding: 2rem; text-align: center; color: var(--muted); }
.cw-footer { align-items: center; margin-top: 1rem; }
.cw-footer .spacer { flex: 1; }
.cw-row.no-back { grid-template-columns: 70px 1fr 40px; }

/* Vue du paquet simplifiée */
.bar-tools { margin-left: auto; display: flex; align-items: center; gap: 1.2rem; }
.bar-tools .zoom { margin-left: 0; }
.sheet-page .slot.linked .slot-hit { fill: rgba(63, 125, 110, .18); stroke: var(--sage); stroke-width: 1.6; }
details.back-advice summary { cursor: pointer; }
details.back-advice p { margin: .5rem 0 .1rem; }
button.add-sheet { width: 100%; justify-content: center; gap: 1rem; padding: 1.4rem; background: transparent; color: var(--muted); border: 2px dashed #d3c2aa; border-radius: 18px; font-weight: 600; }
button.add-sheet:hover { background: rgba(255, 255, 255, .55); border-color: var(--accent); color: var(--accent); }
button.add-sheet .plus { font-size: 2.2rem; line-height: 1; font-weight: 400; }
button.add-sheet > span:last-child { display: flex; flex-direction: column; align-items: flex-start; }
button.add-sheet strong { font-family: var(--font-round); font-size: 1.1rem; }
button.add-sheet small { font-weight: 400; }
.sheet-page .slot.level-error .slot-hit { stroke: #b3261e; stroke-width: 1.4; stroke-dasharray: 3 1.5; }
.sheet-page .slot.level-warning .slot-hit { stroke: #d29a2c; stroke-width: 1.2; stroke-dasharray: 3 1.5; }

/* Vérifications */
button.status { padding: .35rem .85rem; font-size: .88rem; gap: .45rem; border: 1px solid; }
button.status .status-icon { width: 1.25rem; height: 1.25rem; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; }
button.status-ok { background: var(--sage-soft); color: var(--sage); border-color: #cfe3da; }
button.status-ok .status-icon { background: var(--sage); }
button.status-warning { background: var(--warning-bg); color: var(--warning); border-color: #f0dca4; }
button.status-warning .status-icon { background: #d29a2c; }
button.status-error { background: var(--error-bg); color: var(--danger); border-color: #f2c4bc; }
button.status-error .status-icon { background: var(--danger); }
button.status:hover { filter: brightness(.97); background: inherit; }
button.status-ok:hover { background: var(--sage-soft); border-color: #cfe3da; }
button.status-warning:hover { background: var(--warning-bg); border-color: #f0dca4; }
button.status-error:hover { background: var(--error-bg); border-color: #f2c4bc; }
dialog.checks-modal { width: min(760px, 95vw); max-height: 90vh; overflow-y: auto; }
.checks-summary { display: flex; flex-direction: column; gap: .2rem; padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: .8rem; }
.checks-summary.status-ok { background: var(--sage-soft); color: var(--sage); }
.checks-summary.status-warning { background: var(--warning-bg); color: var(--warning); }
.checks-summary.status-error { background: var(--error-bg); color: var(--danger); }
.dpi-setting { margin-bottom: .8rem; font-size: .9rem; color: var(--muted); }
.issue-group h3 { margin: 1rem 0 .5rem; font-family: var(--font-round); }
.issue { display: flex; gap: .8rem; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 4px solid var(--border); margin-bottom: .5rem; }
.issue-error { border-left-color: var(--danger); }
.issue-warning { border-left-color: #d29a2c; }
.issue-info { border-left-color: var(--sage); }
.issue-thumb { width: 42px; height: 58px; object-fit: contain; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(80, 50, 20, .2); flex: none; }
.issue-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); margin-top: .35rem; flex: none; }
.issue-error .issue-dot { background: var(--danger); }
.issue-warning .issue-dot { background: #d29a2c; }
.issue-info .issue-dot { background: var(--sage); }
.issue-body { flex: 1; min-width: 0; }
.issue-title { font-weight: 600; font-size: .92rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; overflow-wrap: anywhere; }
.issue-level { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.issue-detail { margin: .3rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.issue-cards { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
button.chip-button { font-size: .76rem; padding: .12rem .55rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 500; }
button.chip-button:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.issue-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.issue-actions button.on { background: var(--sage); border-color: var(--sage); }
.drawer-issues .issue { margin-bottom: .4rem; }

/* Mon imprimante */
.printer-layout { display: grid; gap: 1.2rem; max-width: 980px; }
.printer-card h2 { margin-bottom: .4rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 1.5rem; margin-top: 1rem; align-items: start; }
.printer-card .actions { align-items: center; }
.printer-card .actions .spacer { flex: 1; }
.test-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin: 1rem 0 .5rem; }
.test-page { background: var(--surface-2); border-radius: var(--radius); padding: 1rem; border: 1px solid var(--border); }
.test-page h3 { font-family: var(--font-round); }
.margin-answer { margin-top: .8rem; font-size: .88rem; }
ol.wizard { padding-left: 1.3rem; margin: 1rem 0 0; display: grid; gap: 1.2rem; }
ol.wizard > li > strong { display: block; margin-bottom: .45rem; font-family: var(--font-round); }
ol.wizard select { max-width: 100%; }
.question { display: flex; flex-direction: column; gap: .35rem; margin: .6rem 0; font-size: .92rem; }
.wizard-result ul { margin: 0 0 .7rem; padding-left: 1.2rem; }

/* Impression (PDF) */
button.print-button { background: var(--sage); border-color: var(--sage); }
button.print-button:hover { background: #336a5d; border-color: #336a5d; }
dialog.export-modal { width: min(680px, 95vw); max-height: 92vh; overflow-y: auto; }
.recap { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: .5rem 0 1rem; }
.recap > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem; text-align: center; display: flex; flex-direction: column; }
.recap strong { font-family: var(--font-round); font-size: 1.6rem; color: var(--accent); line-height: 1.1; }
.recap span { font-size: .78rem; color: var(--muted); }
.export-body .field { margin-bottom: .9rem; }
.export-body .checkbox { margin-bottom: .7rem; }
.sheet-choice { margin: .3rem 0 .8rem; }
.sheet-choice summary { cursor: pointer; font-weight: 600; }
.sheet-checks { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .5rem; }
.print-advice { line-height: 1.5; }
.export-results .item-actions { margin-top: .5rem; }
textarea { font: inherit; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--text); width: 100%; resize: vertical; }
textarea:focus { border-color: var(--accent); outline: 3px solid rgba(194, 86, 58, .18); outline-offset: 0; }
.reinsert-field { margin-top: .9rem; max-width: 640px; }
.reinsert-note { line-height: 1.45; }

/* Export imprimeur */
.dialog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.dialog-head h2 { margin-bottom: .6rem; }
dialog.pro-modal { width: min(860px, 96vw); }
.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 1.2rem; }
.pro-checks { display: flex; flex-direction: column; gap: .4rem; grid-column: 1 / -1; margin-bottom: .8rem; }
.pro-preview { margin: .4rem 0 .8rem; }
.pro-preview .table-top { padding: 1rem; }
.pro-preview .sheet-page { width: calc(var(--page-w) * 1.2px); max-width: 100%; }
.pro-cards { display: flex; gap: 1rem; }
.pro-card { margin: 0; text-align: center; }
.pro-card img { width: 120px; border-radius: 4px; box-shadow: var(--shadow); background: #fff; }
.pro-card figcaption { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.undo-button { white-space: nowrap; }
.update-list { margin: .3rem 0 .8rem; padding-left: 1.2rem; max-height: 180px; overflow-y: auto; font-size: .9rem; }

/* Sauvegarde */
.chip.warn { background: var(--warning-bg); border-color: #f0dca4; color: var(--warning); }
.storage-info { margin-top: 2rem; text-align: center; line-height: 1.5; }
.home { min-height: 60vh; border-radius: 18px; }
.home.project-over { outline: 3px dashed var(--accent); outline-offset: 8px; }
.item-actions.center { justify-content: center; }
.actions.choices { flex-wrap: wrap; }
.backup-status { margin-bottom: 1rem; }
