/* Posada 7 — interface sobre, mobile d'abord (listes groupées façon iOS) */

:root {
  --bg: #f3f3ef;
  --card: #ffffff;
  --fill: #ececE7;
  --ink: #15181a;
  --ink-2: #5f6569;
  --ink-3: #9a9fa3;
  --line: #e8e7e2;
  --accent: #1d5a49;
  --accent-ink: #ffffff;
  --accent-soft: #e6efeb;
  --done: #2e8b57;
  --run: #d4870f;
  --wait: #3a6ad4;
  --todo: #c9cccd;
  --danger: #c23b30;
  --danger-soft: #fbe9e7;
  --warn-soft: #fbf1df;
  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgb(20 24 22 / 0.04), 0 8px 28px rgb(20 24 22 / 0.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --tabs-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1110;
    --card: #1a1d1c;
    --fill: #262a28;
    --ink: #eef1ef;
    --ink-2: #a3aaa6;
    --ink-3: #6f7773;
    --line: #2a2f2d;
    --accent: #5fbf9f;
    --accent-ink: #0b1612;
    --accent-soft: #1b2f29;
    --todo: #4a504d;
    --danger-soft: #3a1f1c;
    --warn-soft: #382d1b;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
svg { flex: none; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { width: 56px; opacity: 0.8; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ── Cadre ───────────────────────────────────────────────────────────── */

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -0.01em; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.top .tabs { display: none; }
.top .spacer { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.85rem;
}

.tabbar {
  position: fixed; inset: auto 0 0; z-index: 20; display: flex;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; font-size: 0.7rem; font-weight: 600; color: var(--ink-3); }
.tabbar a.on { color: var(--accent); }
.tabbar svg { width: 25px; height: 25px; }

main { max-width: 760px; margin: 0 auto; padding: 6px 16px calc(var(--tabs-h) + 32px + env(safe-area-inset-bottom)); }

@media (min-width: 820px) {
  .tabbar { display: none; }
  .top { padding: 14px 28px; }
  .top .tabs { display: flex; gap: 4px; margin-left: 24px; }
  .top .tabs a { padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 0.94rem; color: var(--ink-2); }
  .top .tabs a:hover { color: var(--ink); }
  .top .tabs a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
  .top .tabs svg { display: none; }
  main { padding: 20px 24px 64px; }
}

/* ── Titres ──────────────────────────────────────────────────────────── */

.head { margin: 10px 0 20px; }
.head h1 { font-size: 2rem; line-height: 1.12; font-weight: 800; letter-spacing: -0.025em; }
.head p { color: var(--ink-2); margin-top: 6px; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; margin: 4px 0 2px -4px; padding: 4px; border: 0; background: none; }
.back svg { width: 20px; height: 20px; }
.label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); margin: 26px 4px 8px; }

/* ── Cartes et listes groupées ───────────────────────────────────────── */

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }

.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 12px 16px;
  border: 0; background: none; text-align: left; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; border-top: 1px solid var(--line); }
.list.flat .row + .row::before { left: 16px; }
button.row:active, a.row:active { background: var(--fill); }
@media (hover: hover) { button.row:hover, a.row:hover { background: color-mix(in srgb, var(--fill) 55%, transparent); } }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; line-height: 1.3; }
.row .main > .t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.row .s { font-size: 0.86rem; color: var(--ink-2); margin-top: 2px; }
.row .main > .s { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .trail { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.row .trail svg { width: 18px; height: 18px; }
.row.dim .t { color: var(--ink-2); font-weight: 500; }

.icon-box { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 0.85rem; }
.icon-box svg { width: 20px; height: 20px; }
.ft { width: 38px; height: 44px; border-radius: 8px; display: grid; place-items: center; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; background: #fbe8e5; color: #b33a2e; }
.ft.img { background: #e5edfb; color: #2f5fc4; }
.ft.zip { background: #f7eedb; color: #9a6b14; }
.ft.other { background: var(--fill); color: var(--ink-2); }
@media (prefers-color-scheme: dark) {
  .ft { background: #3a2220; color: #f09a8f; }
  .ft.img { background: #1f2b44; color: #93b2f0; }
  .ft.zip { background: #3a301c; color: #e2bb6a; }
}

/* ── Boutons et champs ───────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 0; background: var(--card); color: var(--ink); font-weight: 650; font-size: 0.95rem;
  box-shadow: var(--shadow); white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.plain { background: none; box-shadow: none; color: var(--accent); padding: 0 8px; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 0.875rem; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.icon { width: 40px; padding: 0; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.field { display: block; }
.field > span { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 2px; }
.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--fill); font-size: 16px; outline: none;
}
.input:focus { border-color: var(--accent); background: var(--card); }
textarea.input { min-height: 88px; resize: vertical; }
.form { display: grid; gap: 16px; }
.two { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 19px; height: 19px; color: var(--ink-3); }
.search .input { padding-left: 42px; background: var(--card); box-shadow: var(--shadow); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; font-weight: 550; cursor: pointer; }
.toggle input { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--todo); position: relative; transition: background 0.15s; flex: none; cursor: pointer; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: translate 0.15s; }
.toggle input:checked { background: var(--done); }
.toggle input:checked::after { translate: 20px 0; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; background: var(--fill); border-radius: 12px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 9px 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; border-radius: 999px; padding: 7px 14px; background: var(--card); box-shadow: var(--shadow); font-size: 0.875rem; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--bg); }

/* ── Avancement ──────────────────────────────────────────────────────── */

.hero .pct { font-size: 3.4rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .pct small { font-size: 1.6rem; font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.hero .cap { color: var(--ink-2); margin-top: 6px; }
.bar { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; display: flex; margin-top: 18px; }
.bar i { height: 100%; }
.bar .d { background: var(--done); }
.bar .r { background: var(--run); }
.bar .w { background: var(--wait); }
.bar.thin { height: 6px; margin-top: 12px; }

.next { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding: 18px 20px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); width: 100%; border: 0; text-align: left; }
.next svg { width: 24px; height: 24px; margin-top: 2px; opacity: 0.9; }
.next small { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.next b { display: block; font-size: 1.05rem; line-height: 1.3; margin-top: 3px; }
.next span { display: block; margin-top: 6px; font-size: 0.9rem; opacity: 0.9; }
.next .when { font-weight: 750; opacity: 1; }
.next span span { display: inline; margin: 0; }

.ring { width: 38px; height: 38px; position: relative; display: grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 38px; height: 38px; rotate: -90deg; }
.ring .bg { stroke: var(--fill); }
.ring .fg { stroke: var(--accent); }
.ring.done { background: var(--done); border-radius: 50%; color: #fff; }
.ring .ck { width: 20px; height: 20px; position: static; rotate: 0deg; }
.ring b { font-size: 0.68rem; font-weight: 750; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.banner { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: var(--r); background: var(--warn-soft); border: 0; text-align: left; margin-bottom: 14px; font-weight: 600; }
.banner.danger { background: var(--danger-soft); }
.banner svg { width: 20px; height: 20px; color: var(--run); }
.banner.danger svg { color: var(--danger); }
.banner .main { flex: 1; }

/* Étapes d'un chantier : frise verticale */
.steps { list-style: none; margin: 0; padding: 6px 10px 4px 6px; }
.step { display: grid; grid-template-columns: 40px 1fr; position: relative; }
.step::before { content: ""; position: absolute; left: 19px; top: 36px; bottom: -6px; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step.terminat::before { background: color-mix(in srgb, var(--done) 45%, var(--line)); }
.dot {
  width: 28px; height: 28px; border-radius: 50%; margin: 8px 0 0 6px; display: grid; place-items: center; border: 0; padding: 0;
  background: var(--card); box-shadow: inset 0 0 0 2px var(--todo); color: #fff; position: relative; z-index: 1;
}
.dot svg { width: 16px; height: 16px; }
.step.terminat .dot { background: var(--done); box-shadow: none; }
.step.in_curs .dot { box-shadow: inset 0 0 0 2px var(--run); color: var(--run); }
.step.asteptare .dot { box-shadow: inset 0 0 0 2px var(--wait); color: var(--wait); }
.step .body { width: 100%; border: 0; background: none; text-align: left; padding: 9px 8px 20px 10px; border-radius: var(--r-sm); }
@media (hover: hover) { .step .body:hover { background: color-mix(in srgb, var(--fill) 55%, transparent); } }
.step .t { font-weight: 600; line-height: 1.35; }
.step.terminat .t { font-weight: 500; color: var(--ink-2); }
.step .m { font-size: 0.85rem; color: var(--ink-3); margin-top: 3px; }
.step .m.wait { color: var(--wait); font-weight: 600; }
.step .m.run { color: var(--run); font-weight: 600; }
.step .m .late { color: var(--danger); }
.step .note { font-size: 0.85rem; color: var(--ink-2); margin-top: 4px; }

.st-terminat, .st-gata { color: var(--done); }
.st-in_curs { color: var(--run); }
.st-asteptare { color: var(--wait); }
.st-de_facut, .st-de_solicitat { color: var(--ink-3); }

/* ── Documents ───────────────────────────────────────────────────────── */

.upload-zone {
  display: grid; justify-items: center; gap: 6px; padding: 34px 16px; border-radius: var(--r);
  border: 2px dashed var(--todo); background: var(--card); text-align: center; cursor: pointer; width: 100%; color: var(--ink);
}
.upload-zone svg { width: 34px; height: 34px; color: var(--accent); }
.upload-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.file-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.file-card .hd { display: flex; align-items: center; gap: 12px; }
.file-card .hd .main { flex: 1; min-width: 0; }
.file-card .hd b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .name { font-size: 0.82rem; color: var(--ink-2); overflow-wrap: anywhere; }
.file-card .name code { font-family: var(--mono); color: var(--accent); }
.file-card.ok { box-shadow: inset 0 0 0 2px var(--done); }
.file-card.err { box-shadow: inset 0 0 0 2px var(--danger); }
.stack { display: grid; gap: 12px; }
.progress { height: 4px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }

.check { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--todo); color: #fff; }
.check svg { width: 15px; height: 15px; }
.check.on { background: var(--accent); box-shadow: none; }

.dock {
  position: sticky; bottom: calc(var(--tabs-h) + 10px + env(safe-area-inset-bottom)); z-index: 5; margin-top: 16px;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgb(0 0 0 / 0.2);
}
.dock .main { flex: 1; font-size: 0.9rem; min-width: 0; }
.dock .btn.primary { background: var(--bg); color: var(--ink); }
@media (min-width: 820px) { .dock { bottom: 16px; } }

/* ── Feuilles (bas de l'écran sur téléphone, centrées sur grand écran) ── */

dialog { border: 0; padding: 0; background: none; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
dialog.sheet {
  width: 100%; margin: auto 0 0; max-height: 92vh; overflow: auto; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  animation: up 0.22s cubic-bezier(.2,.8,.2,1);
}
dialog.sheet::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 999px; background: var(--todo); margin: 0 auto 12px; }
@keyframes up { from { translate: 0 30%; opacity: 0.4; } }
@media (min-width: 820px) {
  dialog.sheet { width: min(560px, calc(100% - 40px)); margin: auto; border-radius: 22px; padding: 22px 24px 24px; animation: none; }
  dialog.sheet.wide { width: min(720px, calc(100% - 40px)); }
  dialog.sheet::before { display: none; }
}
.sheet-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.sheet-h h2 { flex: 1; font-size: 1.25rem; font-weight: 750; letter-spacing: -0.01em; line-height: 1.25; }
.sheet-f { display: flex; gap: 10px; margin-top: 22px; }
.sheet-f .btn { flex: 1; }
.close { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--fill); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.close svg { width: 16px; height: 16px; }

.secret { font-family: var(--mono); font-size: 1.3rem; text-align: center; padding: 16px; border-radius: var(--r-sm); background: var(--card); letter-spacing: 0.04em; user-select: all; }
.message { white-space: pre-wrap; font-size: 0.86rem; padding: 14px; border-radius: var(--r-sm); background: var(--card); color: var(--ink-2); max-height: 220px; overflow: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.92rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.hash { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); word-break: break-all; }

/* ── Visionneuse ─────────────────────────────────────────────────────── */

dialog.viewer { width: 100%; height: 100%; margin: 0; background: #1b1c1d; color: #f2f2f2; display: flex; flex-direction: column; }
dialog.viewer:not([open]) { display: none; }
.vh { display: flex; align-items: center; gap: 4px; padding: max(8px, env(safe-area-inset-top)) 8px 8px; }
.vh .t { flex: 1; min-width: 0; padding: 0 4px; }
.vh .t b { display: block; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh .t small { display: block; font-size: 0.78rem; color: #a5a8aa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: none; color: #f2f2f2; display: grid; place-items: center; flex: none; }
.vbtn:hover { background: rgb(255 255 255 / 0.1); }
.vbtn svg { width: 22px; height: 22px; }
.vbtn:disabled { opacity: 0.3; }
.vmain { flex: 1; overflow: auto; position: relative; overscroll-behavior: contain; }
.pages { display: grid; justify-items: center; gap: 12px; padding: 10px 10px 100px; }
.page { background: #fff; box-shadow: 0 2px 12px rgb(0 0 0 / 0.4); }
.page canvas { display: block; width: 100%; height: 100%; }
.vimg { display: flex; justify-content: center; align-items: flex-start; padding: 12px; min-height: 100%; }
.vimg img { max-width: 100%; height: auto; cursor: zoom-in; }
.vimg.zoom img { max-width: none; cursor: zoom-out; }
.vtext { white-space: pre-wrap; font-family: var(--mono); font-size: 0.86rem; padding: 18px; color: #e6e6e6; }
.vmsg { display: grid; place-items: center; min-height: 100%; padding: 24px; text-align: center; color: #b9bcbe; }
.vtools {
  position: absolute; left: 50%; translate: -50% 0; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 2;
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: rgb(40 41 43 / 0.92);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.4); backdrop-filter: blur(10px);
}
.vtools span { font-size: 0.82rem; padding: 0 8px; font-variant-numeric: tabular-nums; color: #d6d8d9; }
.vtools .vbtn { width: 38px; height: 38px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgb(255 255 255 / 0.2); border-top-color: #fff; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { rotate: 360deg; } }

/* ── Journal ─────────────────────────────────────────────────────────── */

.day { font-size: 0.8rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin: 22px 4px 8px; }
.ev { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; position: relative; }
.ev + .ev::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; border-top: 1px solid var(--line); }
.ev .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--ink-2); flex: none; }
.ev .ic svg { width: 16px; height: 16px; }
.ev .ic.red { background: var(--danger-soft); color: var(--danger); }
.ev .ic.green { background: var(--accent-soft); color: var(--accent); }
.ev .main { flex: 1; min-width: 0; font-size: 0.93rem; overflow-wrap: anywhere; }
.ev .main b { font-weight: 650; }
.ev .main .s { font-size: 0.8rem; color: var(--ink-3); margin-top: 2px; }
.ev time { font-size: 0.82rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── Connexion ───────────────────────────────────────────────────────── */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 18px; }
.login .box { width: min(380px, 100%); }
.login .logo-big { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 18px; }
.login h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.login .err { color: var(--danger); font-size: 0.9rem; min-height: 1.3em; }

.empty { text-align: center; padding: 44px 16px; color: var(--ink-2); }
.empty svg { width: 36px; height: 36px; color: var(--ink-3); margin-bottom: 8px; }

#toasts { position: fixed; z-index: 100; left: 50%; translate: -50% 0; top: max(14px, env(safe-area-inset-top)); display: grid; gap: 8px; width: min(420px, calc(100% - 28px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: 0.92rem; font-weight: 550; box-shadow: 0 10px 30px rgb(0 0 0 / 0.2); animation: drop 0.2s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes drop { from { opacity: 0; translate: 0 -10px; } }

/* Documents liés à une étape */
.doc-links { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 8px 18px 10px; margin-top: -12px; }
.doc-links button { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; padding: 4px 9px; max-width: 100%; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 600; }
.doc-links svg { width: 14px; height: 14px; }
.doc-links span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
