/* Éditeur PDF : papier et encre. Neutres chauds pour le bureau, encre froide pour l'action. */
:root {
  --desk: oklch(0.925 0.007 85);
  --surface: oklch(0.988 0.004 85);
  --surface-2: oklch(0.965 0.006 85);
  --hover: oklch(0.935 0.008 85);
  --press: oklch(0.9 0.01 85);
  --line: oklch(0.885 0.009 85);
  --line-strong: oklch(0.8 0.012 85);
  --text: oklch(0.25 0.015 266);
  --text-2: oklch(0.45 0.014 266);
  --text-3: oklch(0.6 0.012 266);
  --accent: oklch(0.5 0.19 266);
  --accent-hover: oklch(0.44 0.19 266);
  --accent-press: oklch(0.39 0.18 266);
  --accent-soft: oklch(0.935 0.04 266);
  --accent-soft-2: oklch(0.89 0.065 266);
  --on-accent: oklch(0.99 0.006 266);
  --danger: oklch(0.54 0.2 27);
  --danger-soft: oklch(0.95 0.03 27);
  --paper: oklch(1 0 0);
  --shadow-1: 0 0 0 1px oklch(0.25 0.015 266 / 0.07), 0 1px 2px oklch(0.25 0.015 266 / 0.06), 0 4px 12px oklch(0.25 0.015 266 / 0.06);
  --shadow-2: 0 0 0 1px oklch(0.25 0.015 266 / 0.06), 0 4px 10px oklch(0.25 0.015 266 / 0.08), 0 14px 32px oklch(0.25 0.015 266 / 0.12);
  --r: 7px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 13px/1.4 var(--font);
  color: var(--text);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.app { display: flex; flex-direction: column; height: 100%; user-select: none; -webkit-user-select: none; }
.app.is-empty .doc-only,
.app.is-empty #btn-sidebar,
.app.is-empty .filename,
.app.is-empty .topbar .bar-sep { display: none; }

/* ---------- Barres ---------- */
.topbar, .toolbar {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.topbar { height: 48px; padding: 0 10px; }
.toolbar { min-height: 44px; padding: 5px 10px; flex-wrap: wrap; row-gap: 4px; }
.bar-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; flex: none; }
.bar-fill { flex: 1; min-width: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 10px;
  border-radius: var(--r);
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { background: var(--hover); }
.btn:active { background: var(--press); }
.btn.lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:active { background: var(--accent-press); }
.btn.outline { box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn:disabled, .ibtn:disabled { opacity: 0.38; pointer-events: none; }
.btn svg, .ibtn svg { width: 18px; height: 18px; flex: none; }
.btn i, .ibtn i { display: contents; }

.ibtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none;
  border-radius: var(--r);
  color: var(--text-2);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.ibtn:hover { background: var(--hover); color: var(--text); }
.ibtn:active { background: var(--press); }
.ibtn.sm { width: 26px; height: 26px; border-radius: 6px; }
.ibtn.sm svg { width: 16px; height: 16px; }
.ibtn[aria-pressed="true"], .btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.ibtn[aria-pressed="true"]:hover { background: var(--accent-soft-2); }

.split { display: inline-flex; margin-left: 4px; }
.split .btn:first-child { border-radius: var(--r) 0 0 var(--r); padding-right: 12px; }
.split .btn:last-child { border-radius: 0 var(--r) var(--r) 0; padding: 0 6px; box-shadow: inset 1px 0 0 oklch(1 0 0 / 0.22); }
.split .btn:last-child svg { width: 14px; height: 14px; }
#btn-doc svg { width: 14px; height: 14px; margin-left: -2px; color: var(--text-3); }

.filename {
  width: clamp(110px, 20vw, 260px); height: 30px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; font-weight: 600; text-overflow: ellipsis;
}
.filename:hover { border-color: var(--line); }
.filename:focus { border-color: var(--accent); background: var(--paper); outline: none; }

.tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.tools .tool-sep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; }

.viewbar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 2px; padding: 4px 6px;
  background: var(--surface); border-radius: 11px; box-shadow: var(--shadow-2);
}
.viewbar .bar-sep { margin: 0 4px; height: 16px; }
.pager { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); margin: 0 4px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pager input {
  width: 36px; height: 26px; text-align: center; padding: 0 2px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper);
}
.pager input:focus { border-color: var(--accent); outline: none; }
.zoom-val { min-width: 58px; height: 26px; padding: 0 4px; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- Corps ---------- */
.body { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 178px; flex: none; display: flex; flex-direction: column;
  background: var(--surface-2); border-right: 1px solid var(--line);
}
.app.side-closed .sidebar { display: none; }
.side-head { display: flex; align-items: center; gap: 1px; height: 38px; padding: 0 6px; border-bottom: 1px solid var(--line); flex: none; }
.thumbs { flex: 1; overflow-y: auto; padding: 12px 0 24px; position: relative; outline: none; }
.thumb {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 7px 0 5px; margin: 0 10px; border-radius: 8px; cursor: pointer; user-select: none;
}
.thumb:hover { background: var(--hover); }
.thumb.selected { background: var(--accent-soft); }
.thumb-frame { background: var(--paper); box-shadow: 0 0 0 1px oklch(0.25 0.015 266 / 0.14), 0 1px 3px oklch(0.25 0.015 266 / 0.1); line-height: 0; }
.thumb.selected .thumb-frame { box-shadow: 0 0 0 2px var(--accent); }
.thumb-frame canvas { display: block; width: 100%; height: 100%; }
.thumb-num { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; line-height: 1.2; }
.thumb.current .thumb-num { color: var(--accent); font-weight: 650; }
.thumb.dragging { opacity: 0.4; }
.drop-line { position: absolute; left: 14px; right: 14px; height: 2px; margin-top: -1px; background: var(--accent); border-radius: 2px; pointer-events: none; }

.stage { flex: 1; position: relative; min-width: 0; }
.viewer { position: absolute; inset: 0; overflow: auto; background: var(--desk); outline: none; }
.pages {
  --z: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 64px 24px 84px; width: max-content; min-width: 100%;
}
.page { position: relative; flex: none; background: var(--paper); box-shadow: var(--shadow-1); }
.page-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.page-canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.layer { position: absolute; inset: 0; }
.mark-layer, .obj-layer, .hit-layer { pointer-events: none; }
.sel-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }

/* Curseurs par outil */
.pages[data-tool="text"] .page { cursor: text; }
.pages[data-tool="pen"] .page, .pages[data-tool="highlighter"] .page,
.pages[data-tool="rect"] .page, .pages[data-tool="ellipse"] .page,
.pages[data-tool="line"] .page, .pages[data-tool="arrow"] .page,
.pages[data-tool="mask"] .page { cursor: crosshair; touch-action: none; }
.pages:not([data-tool="select"]):not([data-tool="text"]) .obj,
.pages:not([data-tool="select"]):not([data-tool="text"]) .obj * { pointer-events: none !important; }
.pages:not([data-tool="select"]) .form-layer { pointer-events: none; }

/* Objets */
.obj { position: absolute; transform-origin: center; pointer-events: none; }
.obj svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.obj .hit { fill: none; stroke: transparent; pointer-events: stroke; cursor: move; }
.obj .vis { cursor: move; }
.obj-text, .obj-image { pointer-events: auto; cursor: move; }
.obj-text { width: max-content; }
.obj-text .txt { outline: none; min-width: 6px; user-select: none; -webkit-user-select: none; overflow-wrap: break-word; }
.obj-text.editing { cursor: text; }
.obj-text.editing .txt { user-select: text; -webkit-user-select: text; cursor: text; min-width: 1ch; }
.obj-text.editing .txt:empty::before { content: "Tapez votre texte"; color: var(--text-3); pointer-events: none; }
.obj-text canvas.rast { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.obj-text.raster .txt { visibility: hidden; }
.obj-text.raster.editing .txt { visibility: visible; }
.obj-text.editing canvas.rast { display: none; }
.pages[data-tool="edittext"] .page { cursor: crosshair; touch-action: none; }
.region-preview { position: absolute; outline: calc(1.5px / var(--z)) dashed var(--accent); background: oklch(0.5 0.19 266 / 0.08); pointer-events: none; }
.obj-image img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.ink-preview { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

/* Sélection */
.selbox { position: absolute; transform-origin: center; pointer-events: none; outline: calc(1.5px / var(--z)) solid var(--accent); }
.selbox.sel-line { outline: none; left: 0; top: 0; width: 0; height: 0; }
.selbox.is-editing .hd, .selbox.is-editing::before { display: none; }
.selbox.has-rot::before {
  content: ""; position: absolute; left: 50%; top: calc(-24px / var(--z));
  width: calc(1.5px / var(--z)); height: calc(24px / var(--z)); margin-left: calc(-0.75px / var(--z));
  background: var(--accent);
}
.hd {
  position: absolute; pointer-events: auto;
  width: calc(10px / var(--z)); height: calc(10px / var(--z));
  margin: calc(-5px / var(--z)) 0 0 calc(-5px / var(--z));
  background: var(--paper); border: calc(1.5px / var(--z)) solid var(--accent);
  border-radius: calc(2.5px / var(--z));
}
.hd::after { content: ""; position: absolute; inset: calc(-7px / var(--z)); }
.hd[data-handle="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.hd[data-handle="n"] { left: 50%; top: 0; cursor: ns-resize; }
.hd[data-handle="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.hd[data-handle="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.hd[data-handle="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.hd[data-handle="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.hd[data-handle="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.hd[data-handle="w"] { left: 0; top: 50%; cursor: ew-resize; }
.hd[data-handle="rot"] { left: 50%; top: calc(-28px / var(--z)); border-radius: 50%; cursor: grab; }
.hd[data-handle="p1"], .hd[data-handle="p2"] { border-radius: 50%; cursor: move; }

/* Formulaires */
.form-field {
  position: absolute; margin: 0; border: 0; border-radius: 1px;
  background: oklch(0.62 0.14 266 / 0.13); color: oklch(0.2 0.01 266);
  font-family: Helvetica, Arial, sans-serif; padding: 0 2px; line-height: 1.15;
}
.form-field:hover { background: oklch(0.62 0.14 266 / 0.2); }
.form-field:focus { outline: 1.5px solid var(--accent); outline-offset: 0; background: oklch(1 0 0 / 0.9); }
textarea.form-field { resize: none; padding: 2px; }
input[type="checkbox"].form-field, input[type="radio"].form-field { padding: 0; accent-color: oklch(0.3 0.02 266); cursor: pointer; }

/* Texte existant et recherche */
.textline { position: absolute; transform-origin: 0 0; pointer-events: auto; cursor: text; border-radius: 2px; outline: calc(1px / var(--z)) dashed oklch(0.5 0.19 266 / 0.3); }
.textline:hover { background: oklch(0.5 0.19 266 / 0.12); outline: calc(1.5px / var(--z)) solid var(--accent); }
.search-hit { position: absolute; transform-origin: 0 0; background: oklch(0.88 0.17 98); mix-blend-mode: multiply; border-radius: 1px; }
.search-hit.current { background: oklch(0.78 0.17 62); }

/* ---------- Barre de propriétés ---------- */
.props {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; padding: 4px 6px;
  width: max-content; max-width: calc(100% - 20px);
  background: var(--surface); border-radius: 11px; box-shadow: var(--shadow-2);
}
.props .bar-sep { margin: 0 4px; }
.props .ibtn, .props .btn { height: 28px; }
.props .ibtn { width: 28px; }
.props .ibtn svg { width: 16px; height: 16px; }
.prop { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 4px; color: var(--text-2); font-size: 12px; white-space: nowrap; flex: none; }
.prop select, .prop input[type="number"] {
  height: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--text); padding: 0 4px;
}
.prop select:focus, .prop input[type="number"]:focus { border-color: var(--accent); outline: none; }
.prop input[type="number"] { width: 50px; }
.prop input[type="range"] { width: 64px; accent-color: var(--accent); }
.prop .val { min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.glyph { font-size: 14px; line-height: 1; font-family: Georgia, "Times New Roman", serif; }
.swatch-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 7px 0 5px; border-radius: 6px; font-size: 12px; color: var(--text-2); flex: none; white-space: nowrap; }
.swatch-btn:hover { background: var(--hover); color: var(--text); }
.swatch {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 1px oklch(0.25 0.015 266 / 0.22);
}
.swatch.none {
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), var(--danger) calc(50% - 1px), var(--danger) calc(50% + 1px), transparent calc(50% + 1px)),
    var(--paper);
}

/* ---------- Popovers et menus ---------- */
.pop {
  position: fixed; z-index: 60; min-width: 190px; max-width: min(340px, calc(100vw - 16px));
  padding: 5px; background: var(--surface); border-radius: 11px; box-shadow: var(--shadow-2);
  animation: pop-in 0.14s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.mi {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 4px 9px;
  border-radius: 6px; text-align: left;
}
.mi:hover, .mi:focus-visible { background: var(--hover); outline: none; }
.mi svg { width: 16px; height: 16px; color: var(--text-2); flex: none; }
.mi .kbd { margin-left: auto; padding-left: 16px; color: var(--text-3); font-size: 12px; }
.mi.danger { color: var(--danger); }
.mi.danger svg { color: inherit; }
.mi[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.mi:disabled { opacity: 0.4; pointer-events: none; }
.msep { height: 1px; background: var(--line); margin: 5px 4px; }
.mhead { padding: 6px 9px 3px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }

.palette { display: grid; grid-template-columns: repeat(6, 26px); gap: 5px; padding: 6px; }
.palette button { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.palette button:hover .swatch { transform: scale(1.12); }
.palette .swatch { width: 22px; height: 22px; transition: transform 0.12s var(--ease); }
.palette button[aria-checked="true"] .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.palette-foot { display: flex; align-items: center; gap: 8px; padding: 6px 8px 5px; border-top: 1px solid var(--line); margin-top: 3px; font-size: 12px; color: var(--text-2); }
.palette-foot input[type="color"] { width: 30px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; }

.form { display: grid; gap: 10px; padding: 9px; width: 290px; }
.form h3 { margin: 0; font-size: 14px; font-weight: 650; }
.form .hint { margin: -4px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.45; }
.form label.row { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.form .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 2px; }
.field {
  width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--paper); color: var(--text); font-weight: 400;
}
.field:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft-2); outline-offset: 0; }
select.field { padding: 0 6px; }
.form input[type="range"] { width: 100%; accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

/* ---------- Dialogues ---------- */
.dlg {
  border: 0; padding: 0; border-radius: 14px; color: var(--text); background: var(--surface);
  width: min(620px, calc(100vw - 32px)); box-shadow: var(--shadow-2);
}
.dlg.dlg-sm { width: min(380px, calc(100vw - 32px)); }
.dlg::backdrop { background: oklch(0.25 0.015 266 / 0.32); }
.dlg[open] { animation: dlg-in 0.18s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 18px; }
.dlg-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.dlg-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; }
.ask-body { padding: 4px 18px 6px; display: grid; gap: 10px; }
.ask-body p { margin: 0; color: var(--text-2); }
.tabs { display: flex; gap: 2px; padding: 4px 18px 0; border-bottom: 1px solid var(--line); }
.tabs button { padding: 8px 12px; color: var(--text-2); font-weight: 500; border-radius: 6px 6px 0 0; box-shadow: inset 0 -2px 0 transparent; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.sig-body { padding: 16px 18px 4px; min-height: 262px; }
.sig-panel { display: grid; gap: 10px; }
.sig-pad-wrap { position: relative; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); overflow: hidden; }
.sig-pad { display: block; width: 100%; aspect-ratio: 14 / 5; touch-action: none; cursor: crosshair; }
.sig-pad-wrap::after { content: ""; position: absolute; left: 7%; right: 7%; bottom: 26%; border-bottom: 1px dashed var(--line-strong); pointer-events: none; }
.sig-hint { position: absolute; left: 7%; bottom: 10%; font-size: 12px; color: var(--text-3); pointer-events: none; }
.sig-row { display: flex; align-items: center; gap: 8px; }
.sig-colors { display: flex; gap: 6px; }
.sig-colors button { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.sig-colors button[aria-checked="true"] .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.sig-fonts { display: grid; gap: 8px; }
.sig-fonts button {
  height: 58px; padding: 0 16px; text-align: left; font-size: 30px; border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--paper);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sig-fonts button[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.sig-import {
  display: grid; place-items: center; width: 100%; height: 190px; border-radius: 10px;
  border: 1.5px dashed var(--line-strong); background: var(--paper); color: var(--text-2);
}
.sig-import:hover { border-color: var(--accent); color: var(--accent); }
.sig-import img { max-width: 90%; max-height: 170px; }
.sig-saved { display: flex; gap: 8px; padding: 10px 18px 0; flex-wrap: wrap; align-items: center; }
.sig-saved .saved-label { font-size: 12px; color: var(--text-2); width: 100%; }
.saved-item { position: relative; }
.saved-item > button:first-child { width: 112px; height: 50px; border-radius: 8px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); display: grid; place-items: center; padding: 5px; }
.saved-item > button:first-child:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.saved-item img, .saved-item svg { max-width: 100%; max-height: 40px; }
.saved-item .rm { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); color: var(--surface); display: none; place-items: center; }
.saved-item .rm svg { width: 11px; height: 11px; }
.saved-item:hover .rm, .saved-item .rm:focus-visible { display: grid; }

/* ---------- Recherche ---------- */
.searchbar {
  position: absolute; top: 10px; right: 18px; z-index: 6;
  display: flex; align-items: center; gap: 2px; padding: 4px 5px 4px 10px;
  background: var(--surface); border-radius: 11px; box-shadow: var(--shadow-2);
}
.searchbar > svg, .searchbar > i svg { width: 16px; height: 16px; color: var(--text-3); }
.searchbar > i { display: contents; }
.searchbar input { width: 200px; height: 28px; border: 0; background: none; outline: none; padding: 0 6px; }
.search-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }

/* ---------- État vide ---------- */
.empty { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px; overflow: auto; }
.app.is-empty .empty { display: flex; }
.app.is-empty .viewer, .app.is-empty .props, .app.is-empty .searchbar, .app.is-empty .viewbar { display: none; }
.app.is-empty .topbar .lbl { display: inline; }
.drop {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: min(520px, 100%); padding: 44px 32px 40px;
  border: 1.5px dashed var(--line-strong); border-radius: 18px; background: oklch(0.988 0.004 85 / 0.6);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.app.is-dragging .drop { border-color: var(--accent); background: var(--accent-soft); }
.drop-mark { color: var(--accent); margin-bottom: 14px; }
.drop-mark svg { width: 44px; height: 44px; display: block; }
.drop h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.drop-sub { margin: 8px 0 22px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.drop-actions .btn:not(.primary) { box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); }
.drop-actions .btn:not(.primary):hover { background: var(--hover); }
.hints { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, auto); gap: 9px 30px; color: var(--text-2); }
.hints li { display: flex; align-items: center; gap: 9px; }
kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
  font: 600 11px var(--font); color: var(--text-2);
  background: var(--surface); border-radius: 5px; box-shadow: 0 0 0 1px var(--line-strong), 0 1px 0 1px var(--line-strong);
}

.dropveil {
  position: absolute; inset: 10px; z-index: 20; display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: 14px; background: oklch(0.935 0.04 266 / 0.82);
  color: var(--accent); font-size: 16px; font-weight: 600; pointer-events: none;
}

/* ---------- Notifications et infobulles ---------- */
.toasts { position: fixed; left: 50%; bottom: 66px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 32px));
  padding: 9px 14px; border-radius: 10px; pointer-events: auto;
  background: oklch(0.27 0.015 266); color: oklch(0.97 0.005 85); box-shadow: var(--shadow-2);
  animation: toast-in 0.2s var(--ease);
}
.toast.error { background: oklch(0.42 0.16 27); }
.toast button { color: oklch(0.86 0.09 266); font-weight: 600; white-space: nowrap; }
.toast.out { opacity: 0; transition: opacity 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.tip {
  position: fixed; z-index: 90; padding: 4px 8px; border-radius: 6px; pointer-events: none;
  background: oklch(0.27 0.015 266); color: oklch(0.97 0.005 85); font-size: 12px; white-space: nowrap;
}
.busy { cursor: progress; }
.busy .btn.primary { opacity: 0.7; pointer-events: none; }

@media (max-width: 900px) {
  .topbar .lbl { display: none; }
  .sidebar { width: 148px; }
  .hints { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 560px) {
  #btn-export span { display: none; }
  .split .btn:first-child { padding: 0 8px; }
  .filename { width: 90px; }
  .hints { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
