/* Upfull Signer — « papier & sceau » : document clair, chrome anthracite, rouge Upfull réservé aux actions et au cachet. */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/montserrat-latin-2f5adf11.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/montserrat-latin-ext-de38a218.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 700; font-display: swap; src: url('../fonts/jetbrains-mono-latin-1cd702cd.woff2') format('woff2'); }
@font-face { font-family: 'Signature'; font-weight: 400; font-display: block; src: url('../fonts/signature-script.woff2') format('woff2'); }

:root {
  --red: #EA0D43;
  --red-ink: #C40934;
  --red-wash: #FDEEF2;
  --ink: #1E1F23;
  --ink-2: #3A3B42;
  --muted: #6B6B73;
  --paper: #F5F3EF;
  --paper-2: #ECE9E3;
  --surface: #FFFFFF;
  --line: #E2DED6;
  --line-2: #D3CEC4;
  --ok: #0E7A4B;
  --ok-wash: #E6F4EC;
  --warn: #A15C00;
  --warn-wash: #FFF3DF;
  --info: #1D4ED8;
  --info-wash: #E8EEFD;
  --radius: 10px;
  --shadow-1: 0 1px 2px rgba(30,31,35,.06), 0 1px 1px rgba(30,31,35,.04);
  --shadow-2: 0 10px 30px -12px rgba(30,31,35,.25), 0 2px 6px rgba(30,31,35,.06);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: 'Montserrat', system-ui, sans-serif; font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--paper);
  background-image: radial-gradient(rgba(30,31,35,.035) 1px, transparent 1px);
  background-size: 18px 18px;
  min-height: 100dvh;
}
a { color: var(--red-ink); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: .86em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(234,13,67,.45); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Barre du haut ---------- */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 40; }
.topbar__in { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .06em; font-size: 15px; }
.brand__seal { width: 30px; height: 30px; border-radius: 50%; background: var(--red); display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.brand__seal svg { width: 16px; height: 16px; }
.brand small { font-weight: 500; letter-spacing: .02em; color: #A9AAB2; font-size: 13px; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.topbar nav a, .topbar nav button { color: #D7D8DD; text-decoration: none; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 8px; background: none; border: 0; cursor: pointer; min-height: 40px; }
.topbar nav a:hover, .topbar nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 20px 64px; }
.wrap--narrow { max-width: 620px; }

/* ---------- Boutons ---------- */
.btn { --bg: var(--surface); --fg: var(--ink); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd); border-radius: 9px;
  font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .15s, box-shadow .15s, border-color .15s; touch-action: manipulation; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { --bg: var(--red); --fg: #fff; --bd: var(--red); box-shadow: 0 6px 16px -8px rgba(234,13,67,.7); }
.btn--primary:hover { --bg: var(--red-ink); --bd: var(--red-ink); }
.btn--dark { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn--ghost { --bg: transparent; --bd: transparent; }
.btn--ghost:hover { --bg: var(--paper-2); --bd: transparent; }
.btn--danger { --fg: #B42318; }
.btn--danger:hover { --bg: #FEF3F2; --bd: #FDA29B; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; }
.btn.is-loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label, .label { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(30,31,35,.1); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 14.5px; }
.check input { width: 22px; height: 22px; accent-color: var(--red); margin: 1px 0 0; flex: none; }

/* ---------- Cartes / alertes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1); }
.card__pad { padding: 28px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-bottom: 18px; display: flex; gap: 10px; align-items: flex-start; }
.alert--ok { background: var(--ok-wash); color: var(--ok); }
.alert--error { background: #FEF3F2; color: #B42318; }
.alert--info { background: var(--info-wash); color: var(--info); }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* ---------- En-têtes de page ---------- */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.pagehead h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.pagehead p { margin: 6px 0 0; color: var(--muted); }

/* ---------- Tableau de bord ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s var(--ease); }
.stat:hover { border-color: var(--ink-2); }
.stat[aria-current="true"] { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--red); }
.stat__n { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.stat__l { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.doclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.docrow { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .2s; position: relative; }
.docrow:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.docrow__title { font-weight: 700; font-size: 15.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.docrow__meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.people { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.person { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }
.person__dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; }
.person__dot svg { width: 11px; height: 11px; }
.person--signed { background: var(--ok-wash); border-color: #BFE3CF; }
.person--opened { background: var(--info-wash); border-color: #C9D6FA; }
.person--sent { background: var(--warn-wash); border-color: #F5D9A8; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; background: var(--paper-2); color: var(--ink-2); }
.badge--sent { background: var(--warn-wash); color: var(--warn); }
.badge--completed { background: var(--ok-wash); color: var(--ok); }
.badge--draft { background: var(--paper-2); color: var(--muted); }
.badge--cancelled, .badge--expired, .badge--declined { background: #FEF3F2; color: #B42318; }
.empty { text-align: center; padding: 64px 20px; border: 2px dashed var(--line-2); border-radius: 16px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 20px; margin-bottom: 8px; }

/* ---------- Détail ---------- */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.section-t { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.signer-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.signer-card:first-of-type { border-top: 0; }
.signer-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.steps { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.timeline li::after { content: ''; position: absolute; left: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.is-key::before { background: var(--red); }
.timeline time { display: block; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.hash { font-family: var(--mono); font-size: 12px; word-break: break-all; background: var(--paper); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* Cachet « Signé » */
.seal { width: 116px; height: 116px; border-radius: 50%; border: 3px solid var(--red); color: var(--red); display: grid; place-items: center; text-align: center;
  font-weight: 900; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; transform: rotate(-12deg); position: relative; background: rgba(234,13,67,.03); }
.seal::before { content: ''; position: absolute; inset: 6px; border: 1.5px dashed rgba(234,13,67,.6); border-radius: 50%; }
.seal span { display: block; font-size: 22px; letter-spacing: .06em; }
.seal--stamp { animation: stamp .55s var(--ease) both; }
@keyframes stamp { 0% { transform: rotate(-12deg) scale(2.2); opacity: 0; } 60% { transform: rotate(-12deg) scale(.94); opacity: 1; } 100% { transform: rotate(-12deg) scale(1); } }

/* ---------- Import ---------- */
.drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 40px 20px; text-align: center; background: var(--paper); cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.drop:hover, .drop.is-over { border-color: var(--red); background: var(--red-wash); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg { width: 40px; height: 40px; color: var(--red); }
.drop strong { display: block; font-size: 16px; margin-top: 8px; }
.drop .file-name { margin-top: 10px; font-weight: 700; color: var(--ink); }

/* ---------- Éditeur ---------- */
.editor { display: grid; grid-template-columns: 320px 1fr; height: calc(100dvh - 60px); }
.panel { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.panel h2 { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.signer-row { display: grid; grid-template-columns: 22px 1fr 32px; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--paper); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.signer-row.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--surface); }
.signer-row__dot { width: 22px; height: 22px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 11px; margin-top: 10px; }
.signer-row .input { min-height: 38px; padding: 6px 10px; font-size: 14px; margin-bottom: 4px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 700; cursor: grab; text-align: left; min-height: 44px; color: var(--ink); transition: border-color .15s, background .15s; touch-action: none; }
.tool:hover { border-color: var(--tool-color, var(--ink)); background: var(--paper); }
.tool svg { width: 18px; height: 18px; color: var(--tool-color, var(--ink)); flex: none; }
.tool:active { cursor: grabbing; }
.panel .hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.panel__foot { margin-top: auto; display: grid; gap: 8px; position: sticky; bottom: -20px; background: var(--surface); padding: 12px 0 20px; border-top: 1px solid var(--line); }
.errors { background: #FEF3F2; color: #B42318; border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.errors ul { margin: 0; padding-left: 18px; }

.canvas-area { overflow: auto; padding: 28px 24px 80px; background: var(--paper-2); }
.pages { display: grid; gap: 22px; justify-items: center; }
.page { position: relative; background: #fff; box-shadow: var(--shadow-2); }
.page canvas { display: block; width: 100%; height: 100%; }
.page__label { position: absolute; top: -18px; left: 0; font-size: 11px; color: var(--muted); font-weight: 700; }
.zone { position: absolute; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 4px; cursor: move; display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 800; color: var(--c); user-select: none; touch-action: none; overflow: hidden; }
.zone svg { width: 14px; height: 14px; flex: none; }
.zone.is-selected { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.zone__del { position: absolute; top: 1px; right: 1px; width: 20px; height: 20px; border: 0; border-radius: 4px; background: var(--c); color: #fff; display: none; place-items: center; cursor: pointer; padding: 0; }
.zone.is-selected .zone__del { display: grid; }
.zone__del svg { width: 12px; height: 12px; }
.zone__resize { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; background: var(--c); cursor: nwse-resize; border-radius: 3px 0 3px 0; }
.zone__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loading-pages { padding: 60px; color: var(--muted); font-weight: 600; }

/* ---------- Page de signature ---------- */
.signbar { position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; }
.signbar__in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; min-height: 60px; }
.signbar__title { min-width: 0; flex: 1; }
.signbar__title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.signbar__title small { color: #A9AAB2; font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { font-size: 13px; font-weight: 700; color: #D7D8DD; white-space: nowrap; font-variant-numeric: tabular-nums; }
.intro { max-width: 980px; margin: 0 auto; padding: 22px 16px 6px; }
.intro .card__pad { padding: 20px 22px; }
.sign-pages { max-width: 980px; margin: 0 auto; padding: 18px 12px 140px; display: grid; gap: 18px; justify-items: center; }
.sfield { position: absolute; border: 2px dashed var(--red); background: rgba(234,13,67,.07); border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: clamp(9px, 1.4vw, 12px); font-weight: 800; color: var(--red-ink); cursor: pointer; padding: 0; overflow: hidden; transition: background .15s, transform .15s var(--ease); }
.sfield:hover { background: rgba(234,13,67,.14); }
.sfield svg { width: 14px; height: 14px; flex: none; }
.sfield.is-filled { border-style: solid; border-color: rgba(14,122,75,.5); background: rgba(14,122,75,.04); }
.sfield.is-filled img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sfield.is-auto { border-style: solid; border-color: rgba(30,31,35,.18); background: rgba(30,31,35,.03); color: var(--ink); cursor: default; font-weight: 600; font-family: Helvetica, Arial, sans-serif; justify-content: flex-start; padding-left: 3px; }
.sfield--text { cursor: text; justify-content: flex-start; padding: 0 4px; font-family: Helvetica, Arial, sans-serif; font-weight: 500; color: #14141e; text-align: left; }
.sfield--text::placeholder { color: var(--red-ink); font-family: 'Montserrat', sans-serif; font-weight: 700; opacity: .85; }
.sfield--text:focus { outline: none; background: #fff; border-style: solid; box-shadow: 0 0 0 3px rgba(234,13,67,.2); }
.sfield.is-next { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(234,13,67,.35); } 50% { box-shadow: 0 0 0 8px rgba(234,13,67,0); } }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.dock__in { max-width: 980px; margin: 0 auto; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.dock .check { flex: 1; min-width: 240px; font-size: 13.5px; }

/* Modale de signature */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center; background: rgba(15,15,18,.55); padding: 0; }
.modal.is-open { display: flex; }
.modal__box { background: var(--surface); width: 100%; max-width: 640px; border-radius: 18px 18px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .25s var(--ease); max-height: 94dvh; overflow-y: auto; }
@media (min-width: 700px) { .modal { align-items: center; padding: 20px; } .modal__box { border-radius: 18px; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal__head h2 { font-size: 18px; font-weight: 800; }
.tabs { display: flex; gap: 4px; background: var(--paper); padding: 4px; border-radius: 10px; margin-bottom: 14px; }
.tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.pad-wrap { position: relative; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; overflow: hidden; }
.pad-wrap canvas { display: block; width: 100%; height: 200px; touch-action: none; cursor: crosshair; }
.pad-wrap::after { content: ''; position: absolute; left: 24px; right: 24px; bottom: 46px; border-bottom: 1.5px solid var(--line-2); pointer-events: none; }
.pad-hint { position: absolute; left: 24px; bottom: 22px; font-size: 12px; color: var(--muted); pointer-events: none; }
.typed-preview { height: 200px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 12px; font-family: 'Signature', cursive; font-size: 64px; color: #0E1A3A; overflow: hidden; padding: 0 16px; white-space: nowrap; }
.modal__foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Écrans d'état (merci / bloqué) */
.state { text-align: center; padding: 56px 24px; }
.state .seal { margin: 0 auto 26px; }
.state h1 { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.state p { color: var(--muted); max-width: 460px; margin: 0 auto 8px; }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 16px 32px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; height: auto; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel__foot { position: static; }
  .canvas-area { min-height: 70vh; }
}
@media (max-width: 600px) {
  .wrap { padding: 22px 14px 48px; }
  .docrow { grid-template-columns: 1fr; }
  .card__pad { padding: 20px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .topbar__in { gap: 12px; }
  .brand small { display: none; }
  .dock .btn { width: 100%; }
  .dock .check { font-size: 12.5px; line-height: 1.4; }
  .dock { padding-top: 10px; }
  .dock__in { gap: 10px; }
}

/* ---------- Tableaux de statistiques ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tbl thead th { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tbl tfoot th { border-top: 2px solid var(--ink); border-bottom: 0; color: var(--ink); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.is-empty td { color: #b5b1a8; }
.tbl tbody tr:hover td { background: var(--paper); }
.order-line { display: grid; grid-template-columns: 1fr 76px 32px; gap: 6px; margin-bottom: 6px; }
.order-line .input { min-height: 38px; padding: 6px 10px; font-size: 14px; }
