/* ════════════════════════════════════════════════════════════════════
   PDF Toolkit — thème « salle des archives »
   Papier bleu-gris, encre marine, accent encre bleue, rouge réservé
   aux actions destructives. Titres et badges en chasse fixe (dossier
   dactylographié), corps en police système. Aucune webfont : l'outil
   fonctionne hors ligne.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* --paper: #111000; */
  /* --paper-soft: #f5f7fa; */
  /* --surface: #ffffff; */
  /* --ink: #e7ecf5; */
  /* --ink-soft: #c6cfdd; */
  /* --muted: #5e6e88; */
  /* --line: #d4dce7; */
  /* --line-soft: #e3e9f1; */
  /* --line-strong: #b9c5d6; */
  /* --accent: #2244c4; */
  /* --accent-strong: #1a37a5; */
  /* --accent-tint: #ebf0fd; */
  /* --danger: #c22e1e; */
  /* --danger-tint: #fbebe8; */
  /* --danger-ink: #93231a; */
  /* --ok: #1e7a4e; */
  /* --ok-tint: #e5f3ec; */
  /* --ok-ink: #14563a; */
  /* --grid: #e9eef6; */
  /* --grid-hover: #dbe5f6; */
    --paper: #111000;
    --paper-soft: #1b2230;
    --surface: #1e2634;
    --ink: #e7ecf5;
    --ink-soft: #c6cfdd;
    --muted: #8b98ad;
    --line: #303b4e;
    --line-soft: #2a3444;
    --line-strong: #3d4a61;
    --accent: #7c9bff;
    --accent-strong: #9ab2ff;
    --accent-tint: #232e4a;
    --danger: #e06b5c;
    --danger-tint: #3a2320;
    --danger-ink: #f0a296;
    --ok: #4cc38a;
    --ok-tint: #1c3328;
    --ok-ink: #8fddb6;
    --grid: #1d2534;
    --grid-hover: #253150;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --shadow-1: 0 1px 2px rgb(20 32 58 / 0.06);
  --shadow-2: 0 6px 18px rgb(20 32 58 / 0.14);
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111000;
    --paper-soft: #1b2230;
    --surface: #1e2634;
    --ink: #e7ecf5;
    --ink-soft: #c6cfdd;
    --muted: #8b98ad;
    --line: #303b4e;
    --line-soft: #2a3444;
    --line-strong: #3d4a61;
    --accent: #7c9bff;
    --accent-strong: #9ab2ff;
    --accent-tint: #232e4a;
    --danger: #e06b5c;
    --danger-tint: #3a2320;
    --danger-ink: #f0a296;
    --ok: #4cc38a;
    --ok-tint: #1c3328;
    --ok-ink: #8fddb6;
    --grid: #1d2534;
    --grid-hover: #253150;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-2: 0 6px 18px rgb(0 0 0 / 0.45);
  }
}

/* ── Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.icon {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
use[href="#i-drag"] { fill: currentColor; stroke: none; }

:where(button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Bandeau d'erreur fatale ──────────────────────────────────────── */
.fatal {
  background: var(--danger);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.85rem;
  text-align: center;
}

/* ── En-tête ──────────────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 36px);
  border-bottom: 1px solid var(--line);
}
.brand h1 {
  margin: 0;
  font: 700 1.15rem var(--mono);
  letter-spacing: 0.02em;
}
.tagline {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Le tampon : signature visuelle de l'application */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.7rem;
  font: 600 0.72rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  border: 1.5px solid currentColor;
  border-radius: 7px;
  outline: 1.5px solid currentColor;
  outline-offset: 2.5px;
  transform: rotate(-1.5deg);
  user-select: none;
}
.stamp .icon { width: 15px; height: 15px; }

/* ── Disposition générale ─────────────────────────────────────────── */
.app-body {
  display: flex;
  align-items: flex-start;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}
.content {
  flex: 1;
  min-width: 0;
  padding: 26px clamp(16px, 3.5vw, 36px) 64px;
}
.app-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Navigation ───────────────────────────────────────────────────── */
.sidebar {
  flex: none;
  width: 232px;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group {
  margin: 16px 10px 6px;
  font: 600 0.66rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.nav-group:first-child { margin-top: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-soft);
  font: 500 0.86rem var(--sans);
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface); }
.nav-item[aria-current="page"] {
  background: var(--surface);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-1);
}

/* ── En-tête d'outil ──────────────────────────────────────────────── */
.tool-head h2 {
  margin: 0 0 6px;
  font: 700 1.35rem var(--mono);
}
.tool-head p {
  margin: 0 0 22px;
  max-width: 64ch;
  color: var(--muted);
}

/* ── Zone de dépôt (fond papier millimétré) ───────────────────────── */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 54px 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background-image:
    linear-gradient(var(--grid-hover) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-hover) 1px, transparent 1px);
}
.dropzone.dragover { background-color: var(--accent-tint); }
.dz-icon { width: 34px; height: 34px; color: var(--accent); }
.dz-title { font: 600 1rem var(--mono); }
.dz-hint { font-size: 0.8rem; color: var(--muted); }

/* ── Espace de travail et barres ──────────────────────────────────── */
.workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.workspace.narrow { max-width: 540px; }

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.select-bar {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.footer-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.spacer { flex: 1; }
.muted { color: var(--muted); font-size: 0.82rem; }

/* ── Boutons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 600 0.84rem var(--sans);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.btn:hover:not(:disabled) { background: var(--paper-soft); border-color: var(--muted); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #0e1526; }
}

.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-tint); }

.btn-link {
  border: none;
  background: none;
  padding: 0.25rem 0.2rem;
  color: var(--accent);
  font: 600 0.8rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link.danger { color: var(--danger); }

.btn-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.btn-icon:hover { background: var(--paper-soft); color: var(--ink); }

/* ── Puces des fichiers sources (organiseur) ──────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.28rem 0.3rem 0.28rem 0.4rem;
  border: 1px solid hsl(var(--hue) 45% 78%);
  border-radius: 999px;
  background: hsl(var(--hue) 65% 93%);
  color: hsl(var(--hue) 55% 28%);
  font: 600 0.74rem var(--mono);
}
.chip .tag {
  padding: 0 0.42rem;
  border-radius: 999px;
  background: hsl(var(--hue) 55% 32%);
  color: #fff;
}
.chip .chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.chip .btn-icon { width: 20px; height: 20px; color: inherit; }
.chip .btn-icon:hover { background: hsl(var(--hue) 50% 85%); }
.chip .btn-icon .icon { width: 12px; height: 12px; stroke-width: 2.4; }
@media (prefers-color-scheme: dark) {
  .chip { background: hsl(var(--hue) 32% 22%); color: hsl(var(--hue) 65% 82%); border-color: hsl(var(--hue) 28% 36%); }
  .chip .tag { background: hsl(var(--hue) 45% 62%); color: #10141d; }
  .chip .btn-icon:hover { background: hsl(var(--hue) 30% 30%); }
}

/* ── Grille de pages (organiseur et images → PDF) ─────────────────── */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  counter-reset: pg;
}
.page-card {
  position: relative;
  counter-increment: pg;
  padding: 8px 8px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  cursor: grab;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.page-card:active { cursor: grabbing; }
.page-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
  background: var(--accent-tint);
}
.page-card.selected::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent) center / 11px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4.5 4.5L19 7'/%3E%3C/svg%3E");
}

.thumb-box {
  display: grid;
  place-items: center;
  min-height: 118px;
  background: var(--paper-soft);
  border-radius: 4px;
  overflow: hidden;
}
.thumb-box canvas, .thumb-box img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  height: auto;
  box-shadow: 0 1px 3px rgb(20 32 58 / 0.18);
}

/* Numéro de position dans le document final : compteur CSS,
   la renumérotation suit automatiquement l'ordre du DOM. */
.pos {
  position: absolute;
  left: 6px;
  bottom: 5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.66rem var(--mono);
}
.pos::before { content: counter(pg); }

.src-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 1;
  padding: 1px 5px;
  border: 1px solid hsl(var(--hue) 45% 76%);
  border-radius: 4px;
  background: hsl(var(--hue) 65% 92%);
  color: hsl(var(--hue) 55% 28%);
  font: 600 0.62rem var(--mono);
}
@media (prefers-color-scheme: dark) {
  .src-badge { background: hsl(var(--hue) 32% 22%); color: hsl(var(--hue) 65% 82%); border-color: hsl(var(--hue) 28% 38%); }
}

.card-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}
.page-card:hover .card-actions,
.page-card:focus-within .card-actions { opacity: 1; }
@media (hover: none) { .card-actions { opacity: 1; } }
.card-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.card-btn:hover { color: var(--ink); border-color: var(--muted); }
.card-btn[data-act="remove"]:hover { color: var(--danger); border-color: var(--danger); }
.card-btn .icon { width: 14px; height: 14px; }

.card-name {
  display: block;
  margin-top: 6px;
  font: 0.68rem var(--mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* États SortableJS */
.drag-ghost { opacity: 0.35; border-style: dashed !important; }
.drag-chosen { box-shadow: var(--shadow-2); }

/* ── Liste de fichiers (fusion) ───────────────────────────────────── */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  cursor: grab;
}
.file-row:active { cursor: grabbing; }
.row-drag { color: var(--line-strong); display: grid; place-items: center; }
.row-thumb {
  flex: none;
  width: 44px;
  min-height: 54px;
  display: grid;
  place-items: center;
  background: var(--paper-soft);
  border-radius: 4px;
  overflow: hidden;
}
.row-thumb canvas { display: block; max-width: 100%; height: auto; }
.row-body { flex: 1; min-width: 0; }
.row-name {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta {
  display: block;
  margin-top: 1px;
  font: 0.72rem var(--mono);
  color: var(--muted);
}
.row-order {
  flex: none;
  font: 600 0.72rem var(--mono);
  color: var(--muted);
  counter-increment: row;
}
.file-list { counter-reset: row; }
.row-order::before { content: counter(row, decimal-leading-zero); }

/* ── Carte fichier unique (protéger / déverrouiller / conversion) ─── */
.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.file-card .icon { width: 22px; height: 22px; color: var(--accent); }
.file-card .row-name { font-size: 0.9rem; }

/* ── Formulaires ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .field .label, .opt label, .seg-group legend {
  font: 600 0.76rem var(--mono);
  color: var(--ink-soft);
}
input[type="password"], input[type="text"], select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 0.9rem var(--sans);
}
input:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px var(--accent-tint);
}
select { cursor: pointer; }
input[type="range"] { accent-color: var(--accent); width: 100%; max-width: 190px; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-wrap .eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.hint { margin: 2px 0 0; font-size: 0.74rem; color: var(--muted); }
.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font: 400 0.86rem var(--sans);
  color: var(--ink);
}

.adv {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.adv summary {
  cursor: pointer;
  font: 600 0.74rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.adv[open] summary { margin-bottom: 12px; }
.adv .field + .field { margin-top: 12px; }

.msg {
  margin: 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
  font-size: 0.84rem;
}
.msg.error { background: var(--danger-tint); border-color: var(--danger); color: var(--danger-ink); }
.msg.ok { background: var(--ok-tint); border-color: var(--ok); color: var(--ok-ink); }

/* ── Rangée d'options ─────────────────────────────────────────────── */
.opt-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.opt { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.opt output { color: var(--accent); }

.seg-group { border: none; margin: 0; padding: 0; min-width: 0; }
.seg-group legend { padding: 0; margin-bottom: 6px; }
.seg { display: inline-block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: 600 0.8rem var(--sans);
  cursor: pointer;
  user-select: none;
}
.seg:first-of-type span { border-radius: var(--radius) 0 0 var(--radius); }
.seg:last-of-type span { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .seg input:checked + span { color: #0e1526; } }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Barre de progression ─────────────────────────────────────────── */
.progress { display: flex; align-items: center; gap: 0.6rem; min-width: 200px; }
.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line-soft);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.15s;
}
.progress.indeterminate .progress-fill {
  width: 35%;
  animation: prog-slide 1.1s ease-in-out infinite;
}
@keyframes prog-slide {
  0% { margin-left: -35%; }
  100% { margin-left: 100%; }
}
.progress-label {
  font: 600 0.72rem var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

/* ── Résultats de conversion ──────────────────────────────────────── */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.result-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.result-card img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--paper-soft);
}
.result-name {
  font: 0.66rem var(--mono);
  word-break: break-all;
}
.result-meta { font: 0.66rem var(--mono); color: var(--muted); }
.result-card .btn { justify-content: center; padding: 0.35rem; }

/* ── Modale ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(10 17 32 / 0.55);
}
.modal {
  width: min(430px, 100%);
  padding: 22px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal h3 { margin: 0; font: 700 1.05rem var(--mono); }
.modal .muted { word-break: break-all; }

/* ── Notifications ────────────────────────────────────────────────── */
#toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85rem;
  box-shadow: var(--shadow-2);
  animation: toast-in 0.18s ease-out;
}
.toast .icon { width: 16px; height: 16px; margin-top: 2px; }
.toast.success { background: var(--ok); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ── Indicateur d'attente ─────────────────────────────────────────── */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .app-body { flex-direction: column; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    overflow-x: auto;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .nav-group { margin: 0 4px 0 12px; white-space: nowrap; }
  .nav-group:first-child { margin-left: 0; }
  .nav-item {
    width: auto;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2.5px solid transparent;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .nav-item[aria-current="page"] { border-bottom-color: var(--accent); box-shadow: none; }
  .stamp { display: none; }
  .progress { min-width: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
