/* ==========================================================================
   md-to-pdf — interface applicative
   Aucune dépendance externe : le service doit rester utilisable hors ligne.

   Le shell tient dans la fenêtre : le <body> ne scrolle jamais. Chaque vue
   gère son propre défilement, et à l'intérieur d'une vue chaque panneau
   scrolle indépendamment. C'est ce qui distingue une console d'une page.
   ========================================================================== */

/* ─────────────────────────────── tokens ─────────────────────────────── */

:root {
  --bg: #090e17;
  --bg-alt: #0c1220;
  --panel: #101827;
  --panel-2: #141d2e;
  --border: #22304a;
  --border-soft: #1a2437;
  --text: #dde5f2;
  --text-dim: #8fa1bd;
  --text-faint: #64758f;

  --accent: #4fd1e0;
  --accent-2: #a78bfa;
  --accent-3: #ffcf70;
  --ok: #4ade9b;
  --err: #ff7b7b;
  --warn: #ffbf5e;

  --tint: color-mix(in srgb, var(--accent) 12%, transparent);
  --tint-soft: color-mix(in srgb, var(--accent) 7%, transparent);

  --r-lg: 14px;
  --r: 10px;
  --r-sm: 7px;
  --r-xs: 5px;

  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .7);
  --shadow: 0 14px 32px -14px rgba(0, 0, 0, .6);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --topbar-h: 56px;
  --maxw: 1280px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

:root[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-alt: #eef2f8;
  --panel: #ffffff;
  --panel-2: #f4f7fb;
  --border: #dbe3ef;
  --border-soft: #e7ecf5;
  --text: #101a2b;
  --text-dim: #4a5a73;
  --text-faint: #7b8aa3;

  --accent: #0e8ea3;
  --accent-2: #6d4bd6;
  --accent-3: #9a6300;
  --ok: #12805a;
  --err: #c0322f;
  --warn: #8a5a00;

  --shadow-lg: 0 24px 56px -20px rgba(20, 40, 80, .22);
  --shadow: 0 12px 28px -14px rgba(20, 40, 80, .18);
  --shadow-sm: 0 1px 4px rgba(20, 40, 80, .1);
}

/* ──────────────────────────────── base ──────────────────────────────── */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;                 /* le shell ne scrolle pas, ses panneaux si */
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, kbd { font-family: var(--mono); }

code {
  font-size: .875em;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xs);
  padding: .08em .38em;
}

pre { margin: 0; font-size: 12.5px; line-height: 1.65; overflow-x: auto; tab-size: 2; }

kbd {
  display: inline-block;
  font-size: 10.5px;
  line-height: 15px;
  min-width: 17px;
  text-align: center;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  padding: 0 4px;
  color: var(--text-faint);
  background: var(--panel-2);
}

button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* défilement discret, cohérent entre les panneaux */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border: 3px solid transparent; background-clip: content-box; border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

.skip-link {
  position: fixed;
  left: -999px; top: 10px;
  z-index: 200;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--r-sm);
}
.skip-link:focus { left: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ───────────────────────────── primitives ───────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease), transform .12s var(--ease);
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); background: var(--panel); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.btn.primary {
  color: #04121a;
  background: linear-gradient(96deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--accent-2)));
  border-color: transparent;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn.primary:hover { filter: brightness(1.08); }
:root[data-theme="light"] .btn.primary { color: #fff; }

.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }

.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.lg { padding: 10px 20px; font-size: 15px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); border-color: var(--border); }

input, textarea, select {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 9px;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
input:hover, textarea:hover, select:hover { border-color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
textarea { width: 100%; resize: vertical; line-height: 1.55; }
select { cursor: pointer; }
::placeholder { color: var(--text-faint); opacity: .8; }

.method {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #04121a;
  background: var(--accent);
  border-radius: var(--r-xs);
  padding: 2px 7px;
  flex: none;
}
.method.get { background: var(--ok); }
.method.post { background: var(--accent); }
:root[data-theme="light"] .method { color: #fff; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 2px 10px;
}
.tag b { color: var(--text); font-weight: 700; }
.tag.dashed { border-style: dashed; background: transparent; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }

.card {
  display: block;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 16px;
  color: inherit;
  cursor: pointer;
  transition: border-color .16s var(--ease), transform .16s var(--ease), background .16s var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-2px); text-decoration: none; }
.card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.card h3 svg { color: var(--accent); flex: none; }
.card p { margin-top: 7px; font-size: 13.5px; color: var(--text-dim); }
.card .route { display: inline-flex; gap: 7px; align-items: center; margin-top: 11px; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }

/* onglets */

.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs button {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 6px 12px;
  cursor: pointer;
  transition: color .14s var(--ease), border-color .14s var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* groupe segmenté */

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
}
.segmented button {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: var(--r-xs);
  padding: 4px 11px;
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button.active { color: var(--text); background: var(--panel); box-shadow: var(--shadow-sm); }

/* blocs de code */

.code-wrap { position: relative; }
.code-wrap pre {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 15px 17px;
}
.code-wrap.scroll pre { max-height: 420px; overflow: auto; }

.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 3px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease);
}
.code-wrap:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

.hl-str { color: var(--accent-3); }
.hl-num, .hl-lit { color: var(--accent-2); }
.hl-key { color: var(--accent); }
.hl-cmt { color: var(--text-faint); font-style: italic; }
.hl-cmd { color: var(--ok); }
.hl-flag { color: var(--accent); }

/* tableaux */

.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--r); }

table.grid { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { text-align: left; padding: 9px 12px; vertical-align: top; }
table.grid thead th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--panel-2);
  border-bottom: 1px solid var(--border-soft);
}
table.grid tbody tr + tr td { border-top: 1px solid var(--border-soft); }
table.grid tbody tr:hover td { background: var(--tint-soft); }
table.grid td:first-child { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
table.grid .type { font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); }
table.grid .req { color: var(--err); font-weight: 700; }
table.grid td.desc { color: var(--text-dim); }

/* encarts */

.callout {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
}
.callout + .callout { margin-top: 12px; }
.callout strong { color: var(--text); }
.callout.warn { border-left-color: var(--warn); }

.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────── topbar ─────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -.02em;
  flex: none;
}
.brand:hover { text-decoration: none; }
.brand svg { color: var(--accent); }
.brand .ver { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--text-faint); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }

.topnav { display: flex; gap: 2px; }
.topnav a {
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  transition: color .14s var(--ease), background .14s var(--ease);
}
.topnav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--accent); background: var(--tint); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.cmdk-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 5px 8px 5px 10px;
  cursor: pointer;
  transition: border-color .14s var(--ease), color .14s var(--ease);
}
.cmdk-hint:hover { color: var(--text-dim); border-color: var(--border); }

.health {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
}
.health:hover { border-color: var(--border); color: var(--text); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot.ok { background: var(--ok); color: var(--ok); animation: pulse 2.6s ease-out infinite; }
.dot.err { background: var(--err); color: var(--err); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ──────────────────────────── popover réglages ──────────────────────── */

.popover {
  position: absolute;
  top: calc(var(--topbar-h) - 4px);
  right: 14px;
  z-index: 60;
  width: 340px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  animation: pop .16s var(--ease);
}
.popover[hidden] { display: none; }
.popover h3 { font-size: 13px; margin-bottom: 12px; }
.popover .field { margin-bottom: 12px; }
.popover .field label { display: block; font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-bottom: 5px; }
.popover .field input { width: 100%; }
.popover .row { display: flex; gap: 8px; align-items: center; }
.popover .note { font-size: 12px; color: var(--text-faint); margin-top: 10px; line-height: 1.5; }

@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* ──────────────────────────────── vues ──────────────────────────────── */

#app { position: relative; min-height: 0; }

.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; animation: viewIn .22s var(--ease); }
.view.scrolls { overflow-y: auto; overflow-x: hidden; }

@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.section-head { max-width: 66ch; }
.section-head h2 { font-size: clamp(22px, 2.4vw, 28px); }
.section-head p { margin-top: 8px; color: var(--text-dim); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ─────────────────────────────── accueil ────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.hero-glow {
  position: absolute;
  inset: -50% 30% 20% -15%;
  background:
    radial-gradient(42% 42% at 32% 42%, color-mix(in srgb, var(--accent) 26%, transparent) 0%, transparent 70%),
    radial-gradient(38% 38% at 64% 56%, color-mix(in srgb, var(--accent-2) 22%, transparent) 0%, transparent 72%);
  filter: blur(30px);
  opacity: .7;
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 44px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 60px;
}

.hero h1 { margin-top: 14px; font-size: clamp(30px, 3.8vw, 48px); font-weight: 800; }
.grad {
  background: linear-gradient(96deg, var(--accent) 0%, var(--accent-2) 60%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { margin-top: 16px; max-width: 52ch; font-size: 16px; color: var(--text-dim); }
.lede.small { margin-top: 12px; font-size: 14px; }
.hero-cta { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 34px; max-width: 540px; }
.stat {
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 10px 13px;
}
.stat-value { display: block; font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--accent); line-height: 1.3; }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }

/* illustration du pipeline */

.pipeline { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, .84fr); gap: 12px; align-items: center; }
.pipe-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; }
.pipe-card.in { transform: rotate(-1deg); }
.pipe-card.out { transform: rotate(1.2deg); }
.pipe-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  padding: 7px 11px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border-soft);
}
.chip {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 1px 7px;
}
.pipe-body { padding: 11px; font-size: 11px; color: var(--text-dim); white-space: pre; }
.tok-h { color: var(--accent); font-weight: 700; }
.tok-b { color: var(--text); font-weight: 700; }
.tok-c { color: var(--accent-2); }

.pipe-arrow { display: grid; justify-items: center; gap: 5px; color: var(--text-faint); }
.pipe-engine { font-family: var(--mono); font-size: 10px; text-align: center; }

.page { background: #fff; padding: 15px 13px; display: grid; gap: 7px; position: relative; min-height: 196px; }
.page-h { height: 10px; width: 62%; border-radius: 3px; background: #2b3a52; }
.page-l { height: 6px; border-radius: 3px; background: #d6dde8; }
.page-l.short { width: 72%; }
.page-blur {
  height: 44px; border-radius: 4px;
  background: repeating-linear-gradient(115deg, #c9d3e2 0 10px, #dde4ee 10px 20px);
  filter: blur(1.1px);
  display: grid; place-items: center;
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #5a6a83;
}
.page-num { position: absolute; bottom: 7px; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 8.5px; color: #8b98ac; }

.home-section { padding: 48px 0; border-bottom: 1px solid var(--border-soft); }
.home-section.tinted { background: var(--bg-alt); }
.home-section .section-head { margin-bottom: 26px; }

.quick { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.quick-notes { display: grid; gap: 10px; }
.quick-note {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 12px 14px;
}
.quick-note h4 { font-size: 12.5px; }
.quick-note p { margin-top: 5px; font-size: 12.5px; color: var(--text-dim); }

.home-foot {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  padding: 22px 0 32px;
  font-size: 13px;
  color: var(--text-dim);
}
.home-foot .links { display: flex; gap: 16px; font-family: var(--mono); font-size: 12.5px; }

/* ───────────────────────────── vue API ──────────────────────────────── */

.split { display: grid; height: 100%; min-height: 0; }
#view-api .split,
#view-guides .split { grid-template-columns: 268px minmax(0, 1fr); }

.sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  background: var(--bg-alt);
  border-right: 1px solid var(--border-soft);
}

.sidebar-head { padding: 12px; border-bottom: 1px solid var(--border-soft); }

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 9px; color: var(--text-faint); pointer-events: none; }
.search input {
  width: 100%;
  font-family: var(--sans);
  font-size: 13px;
  padding: 7px 9px 7px 30px;
  background: var(--panel);
}

.sidebar-body { overflow-y: auto; padding: 10px 8px 24px; }

.nav-group + .nav-group { margin-top: 16px; }
.nav-group h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  color: var(--text-faint);
  padding: 0 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 6px 9px;
  cursor: pointer;
  transition: background .13s var(--ease), color .13s var(--ease);
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--tint); color: var(--accent); }
.nav-item .m {
  font-size: 9px; font-weight: 700; letter-spacing: .05em;
  color: var(--text-faint);
  min-width: 30px;
}
.nav-item.active .m { color: var(--accent); }
.nav-item .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-empty { padding: 10px; font-size: 12.5px; color: var(--text-faint); font-style: italic; }

.doc-pane { overflow-y: auto; min-height: 0; }
.doc-inner { max-width: 940px; margin: 0 auto; padding: 28px 32px 64px; }

.doc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-head code.path { font-size: 17px; font-weight: 700; background: none; border: 0; padding: 0; color: var(--text); }
.doc-head .spacer { flex: 1; }
.doc-back { display: none; }

.doc-title { margin-top: 18px; font-size: 22px; }
.doc-desc { margin-top: 8px; color: var(--text-dim); white-space: pre-line; max-width: 74ch; }
.doc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.doc-block { margin-top: 28px; }
.doc-block > h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.doc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.status-list { display: flex; flex-wrap: wrap; gap: 6px; }

.doc-prevnext { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.doc-prevnext .btn { font-family: var(--mono); font-size: 12.5px; }

/* ──────────────────────────── vue console ───────────────────────────── */

#view-console { display: none; }
#view-console.active { display: grid; grid-template-rows: auto minmax(0, 1fr); }

.console-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-soft);
}
.console-head .title { font-size: 13px; font-weight: 600; }
.console-head .sub { font-size: 12.5px; color: var(--text-faint); }
.console-head .spacer { flex: 1; }
.console-switch { display: none; }
.console-switch .seg-nav { display: none; }

.console-split {
  display: grid;
  grid-template-columns: 232px var(--split, 1fr) 6px minmax(0, 1fr);
  min-height: 0;
}

.pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.pane-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-2);
  min-height: 44px;
}
.pane-head h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); font-weight: 600; }
.pane-head .spacer { flex: 1; }
.pane-body { overflow-y: auto; padding: 14px; min-height: 0; }
.pane-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel-2);
}

.console-nav { background: var(--bg-alt); border-right: 1px solid var(--border-soft); }
.console-nav .pane-body { padding: 10px 8px; }

.console-req { border-right: 1px solid var(--border-soft); background: var(--panel); min-width: 320px; }
.console-res { background: var(--panel); min-width: 320px; }

.req-path { display: flex; align-items: center; gap: 8px; min-width: 0; }
.req-path code { background: none; border: 0; padding: 0; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.req-desc { font-size: 12.5px; color: var(--text-dim); white-space: pre-line; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--border-soft); }

/* poignée de redimensionnement */
.gutter {
  position: relative;
  cursor: col-resize;
  background: transparent;
  border: 0;
  padding: 0;
}
.gutter::after {
  content: "";
  position: absolute;
  inset: 0 2px;
  border-radius: 99px;
  background: transparent;
  transition: background .15s var(--ease);
}
.gutter:hover::after, .gutter.dragging::after { background: color-mix(in srgb, var(--accent) 55%, transparent); }

/* formulaire */

.field { margin-bottom: 12px; }
.field > label { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--accent-3); margin-bottom: 5px; }
.field .hint { color: var(--text-faint); }
.field input[type="text"], .field input[type="number"], .field select { width: 100%; }
.field.checkbox { display: flex; align-items: center; gap: 8px; }
.field.checkbox input { width: auto; }
.field.checkbox label { color: var(--text); margin: 0; font-family: var(--mono); font-size: 12px; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }

fieldset {
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  margin: 0 0 12px;
  padding: 6px 11px 4px;
  background: var(--bg-alt);
}
/* !important : .field.checkbox porte un display:flex plus spécifique */
fieldset.collapsed > *:not(legend) { display: none !important; }
fieldset.collapsed { padding-bottom: 6px; }
legend {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  padding: 0 6px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--r-xs);
}
legend:hover { color: var(--text); }

.pdf-picker { display: flex; gap: 6px; margin-bottom: 5px; }
.pdf-picker select { flex: 1; min-width: 0; }
.pdf-picker button {
  font-size: 12px; padding: 4px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  cursor: pointer;
}
.pdf-picker button:hover { color: var(--text); border-color: var(--accent); }

/* PDFs générés */

.saved-head { display: flex; align-items: center; gap: 6px; margin: 18px 0 6px; padding: 0 8px; }
.saved-head h4 { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); font-weight: 600; }
.saved-head .count { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.saved-list { display: grid; gap: 2px; }
.saved-list li { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 8px; border-radius: var(--r-xs); }
.saved-list li:hover { background: var(--panel); }
.saved-list li a { flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 0; }
.saved-list li button { background: none; border: 0; color: var(--text-faint); cursor: pointer; padding: 0 4px; font-size: 12px; }
.saved-list li button:hover { color: var(--err); }
.saved-list .empty { font-size: 11.5px; color: var(--text-faint); font-style: italic; padding: 2px 8px; }

/* réponse */

.res-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font-family: var(--mono); font-size: 12.5px; font-weight: 700; }
.badge.idle { color: var(--text-faint); font-weight: 400; }
.badge.ok { color: var(--ok); }
.badge.err { color: var(--err); }
.res-status .meta { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.res-status .meta::before { content: "·"; margin-right: 8px; color: var(--border); }

.res-pane { height: 100%; }
pre.res-pane, #tabPreview pre {
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
#tabPreview pre { max-height: none; }

.res-empty {
  display: grid;
  place-content: center;
  gap: 8px;
  justify-items: center;
  height: 100%;
  min-height: 220px;
  padding: 24px;
  text-align: center;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--r);
}
.res-empty svg { color: var(--border); }

iframe.preview { width: 100%; height: min(72vh, 780px); border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff; }
img.preview { max-width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff; }
.preview-link { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 12.5px; }

/* ───────────────────────────── vue accès ────────────────────────────── */

.acces-inner { max-width: 1080px; margin: 0 auto; padding: 40px 24px 64px; }

.acces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.acces-card {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 20px 18px 18px;
}
.acces-card h3 { font-size: 16px; }
.acces-card p { font-size: 13.5px; color: var(--text-dim); }
.acces-card .btn { justify-self: start; }
.acces-card .step {
  position: absolute;
  top: -11px; left: 18px;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  border-radius: 50%;
}

.key-inline { display: flex; gap: 8px; }
.key-inline input { flex: 1; min-width: 0; }

.key-state {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  min-height: 17px;
  /* le verdict nomme le service interrogé : une URL doit pouvoir passer à la ligne */
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.key-state.ok { color: var(--ok); }
.key-state.err { color: var(--err); }

.acces-notes { display: grid; gap: 12px; margin-top: 28px; }

/* pastille d'alerte sur le bouton clé, quand aucun token n'est enregistré */
.key-btn { position: relative; }
.need-key {
  position: absolute;
  top: 3px; right: 3px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 2px var(--bg);
}
.need-key[hidden] { display: none; }

/* bandeau de la console */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
  background: color-mix(in srgb, var(--warn) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
}
.banner[hidden] { display: none; }
.banner svg { color: var(--warn); flex: none; }
.banner strong { color: var(--text); }
.banner > div { flex: 1; min-width: 180px; }

/* réglages avancés du popover */
.adv { margin-top: 6px; border-top: 1px solid var(--border-soft); padding-top: 10px; }
.adv summary {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
  list-style: none;
}
.adv summary::before { content: "▸ "; }
.adv[open] summary::before { content: "▾ "; }
.adv summary:hover { color: var(--text); }
.adv input { width: 100%; margin-top: 8px; }

/* ─────────────────────────── palette ⌘K ─────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  justify-items: center;
  align-items: start;
  padding-top: 14vh;
  background: color-mix(in srgb, #000 52%, transparent);
  backdrop-filter: blur(3px);
  animation: fade .14s var(--ease);
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.palette {
  width: min(560px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .18s var(--ease);
}
.palette-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
.palette-head svg { color: var(--text-faint); flex: none; }
.palette-head input {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  background: none;
  border: 0;
  padding: 0;
}
.palette-head input:focus { box-shadow: none; }

.palette-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-dim);
}
.palette-item .m { font-family: var(--mono); font-size: 9px; font-weight: 700; min-width: 30px; color: var(--text-faint); }
.palette-item .name { font-size: 13.5px; color: var(--text); }
.palette-item .desc { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin-left: auto; }
.palette-item[aria-selected="true"] { background: var(--tint); }
.palette-item[aria-selected="true"] .name { color: var(--accent); }
.palette-foot {
  display: flex; gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel-2);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ───────────────────────────── toasts ───────────────────────────────── */

.toasts {
  position: fixed;
  bottom: 18px; right: 18px;
  z-index: 120;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 9px 14px;
  box-shadow: var(--shadow);
  animation: toastIn .2s var(--ease);
}
.toast.err { border-left-color: var(--err); }
.toast.leaving { animation: toastOut .2s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }

/* ─────────────────────────── responsive ─────────────────────────────── */

@media (max-width: 1240px) {
  #view-api .split,
  #view-guides .split { grid-template-columns: 232px minmax(0, 1fr); }
  .console-split { grid-template-columns: 200px var(--split, 1fr) 6px minmax(0, 1fr); }
}

@media (max-width: 1080px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-top: 40px; padding-bottom: 44px; }
  .pipeline { grid-template-columns: minmax(0, 1fr); }
  .pipe-arrow { transform: rotate(90deg); justify-self: center; }
  .pipe-card.in, .pipe-card.out { transform: none; }
  .quick { grid-template-columns: minmax(0, 1fr); }

  /* la console bascule en panneaux alternés : deux colonnes serrées valent
     moins qu'un panneau lisible à la fois */
  .console-switch { display: inline-flex; }
  .console-split { grid-template-columns: 200px minmax(0, 1fr); }
  .gutter { display: none; }
  .console-req, .console-res { grid-column: 2; grid-row: 1; }
  .console-split[data-pane="req"] .console-res,
  .console-split[data-pane="res"] .console-req { display: none; }
}

@media (max-width: 860px) {
  .topnav a { padding: 6px 9px; font-size: 13px; }
  .cmdk-hint { display: none; }
  .brand .ver { display: none; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-api .split,
  #view-guides .split { grid-template-columns: minmax(0, 1fr); }
  #view-api .sidebar,
  #view-guides .sidebar { display: none; }
  #view-api .split[data-mobile="list"] .sidebar,
  #view-guides .split[data-mobile="list"] .sidebar { display: grid; }
  #view-api .split[data-mobile="list"] .doc-pane,
  #view-guides .split[data-mobile="list"] .doc-pane { display: none; }
  .doc-back { display: inline-flex; }
  .doc-inner { padding: 20px 18px 48px; }
  .console-split { grid-template-columns: minmax(0, 1fr); }
  .console-nav { display: none; }
  .console-split[data-pane="nav"] .console-nav { display: grid; }
  .console-split[data-pane="nav"] .console-req,
  .console-split[data-pane="nav"] .console-res { display: none; }
  .console-req, .console-res { grid-column: 1; }
  .console-switch .seg-nav { display: inline-block; }
}

@media (max-width: 620px) {
  .topnav { display: none; }
  .health span:not(.dot) { display: none; }
  .wrap { padding: 0 16px; }
}

/* ──────────────────────────── sélecteur de langue ───────────────────── */

/* Deux boutons de trois lettres : la langue est un réglage, pas une décision
   à reprendre à chaque page. Il disparaît en premier sur petit écran. */
.lang-switch button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  padding: 5px 8px;
}
.lang-switch button[aria-pressed="true"] { color: var(--accent); }

/* ──────────────────────────── vue guides ────────────────────────────── */

/* Un titre de guide est une phrase, pas un identifiant : il passe à la ligne
   au lieu d'être coupé — « Censure : masquer ce qui ne doi… » ne dit rien. */
.nav-item.guide-item { font-family: inherit; font-size: 13px; align-items: flex-start; }
.nav-item.guide-item svg { flex: 0 0 auto; opacity: .7; margin-top: 2px; }
.nav-item.guide-item.active svg { opacity: 1; }
.nav-item.guide-item .label { white-space: normal; overflow: visible; line-height: 1.35; }

.guide-body { margin-top: 26px; }

.guide-h {
  margin-top: 34px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.01em;
  scroll-margin-top: 20px;
}
.guide-h:first-child { margin-top: 0; }

.guide-p { margin-top: 12px; max-width: 74ch; color: var(--text-dim); line-height: 1.65; }
.guide-p code, .guide-body td code, .guide-body .callout code { white-space: nowrap; }
.guide-p b, .guide-p strong { color: var(--text); font-weight: 650; }

.guide-body .code-wrap { margin-top: 14px; }
.guide-body .table-wrap { margin-top: 14px; }
.guide-body .callout { margin-top: 16px; max-width: 78ch; }

.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.guide-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 13px 14px;
  background: var(--bg-alt);
}
.guide-card h4 { font-size: 13px; font-weight: 650; }
.guide-card p { margin-top: 6px; font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }

.guide-try { margin-top: 20px; }

/* Galerie de thèmes : les aperçus viennent du service interrogé, pas d'une
   capture d'écran — une capture promet ce qu'un déploiement ne tient pas. */
.theme-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.theme-card {
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-alt);
}
.theme-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.414;
  object-fit: cover;
  object-position: top center;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
}
.theme-card figcaption { padding: 12px 13px 14px; }
.theme-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.theme-head strong { font-size: 13.5px; }
.theme-head code { font-size: 11px; }
.theme-card figcaption p { margin-top: 8px; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

.theme-tokens { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.theme-tokens .token {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 2px 7px 2px 3px;
}
.theme-tokens .token i {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, .35);
}
.theme-fonts { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
