/* La vitrine, aux couleurs de BeTomorrow : un en-tête et une ouverture bleu nuit,
   un fond bleu très clair, des cartes largement arrondies, des boutons en pastille,
   des titres en capitales fines, des cibles de 44 px au doigt. La police de la
   marque (PP Neue Montreal) sert si elle est installée ; sinon la grotesque du
   système : aucune police n'est téléchargée, la page n'appelle aucun service tiers.
   Les couleurs des zones sur la page sont celles d'Okabe-Ito, toujours doublées
   d'un trait ou d'un libellé. */
:root {
  --bg: #f3f8ff;
  --panel: #ffffff;
  --ink: #000b17;
  --text: #0b1626;
  --muted: #4a5565;
  --line: #dbe6f7;
  --soft: #e8f1ff;
  --soft-2: #c5d6f3;
  --accent: #1d1bea;
  --accent-ink: #ffffff;
  --accent-soft: #e8f1ff;
  --night: #03031e;
  --navy: #032143;
  --sky: #85a8ff;
  --on-night: #e8f1ff;
  --ok: #1e8e5a;
  --ok-soft: #e5f4ec;
  --warn: #a35a00;
  --warn-soft: #fff2e0;
  --added: #0072b2;
  --removed: #d55e00;
  --zone: #56b4e9;
  --zone-fill: rgba(86, 180, 233, 0.32);
  --radius: 24px;
  --shadow: 0 30px 60px -30px rgba(16, 22, 159, 0.3);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --head: 64px;
  --font: "PP Neue Montreal", "ppNeue", "Neue Montreal", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* La place de la barre de défilement est toujours réservée : une page qui passe sous
   la hauteur de l'écran ne doit pas élargir le document de 15 px. */
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  overflow-x: clip;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
b, strong { font-weight: 600; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- la coque : l'en-tête, puis la page ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; background: var(--night); color: var(--on-night); }
.top :focus-visible { outline-color: var(--sky); }
.top-in { max-width: 1440px; margin: 0 auto; padding: 10px clamp(14px, 3vw, 28px); display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--head); }
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; min-width: 0; }
.logo { display: block; width: 36px; height: 36px; color: #fff; flex: none; }
.logo svg { display: block; width: 100%; height: 100%; fill: currentColor; stroke: none; }
.brand-text { color: var(--on-night); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text b { font-weight: 500; }
.brand-sub { color: rgba(232, 241, 255, .7); font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; color: var(--ink); background: var(--soft); border-radius: 999px; padding: .4em .9em; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.ok::before { background: var(--ok); }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-size: .84rem; font-weight: 600; color: var(--ink); cursor: pointer; min-height: 34px; transition: background-color .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--panel); box-shadow: 0 2px 8px -3px rgba(16, 22, 159, .35); }
.top .seg { background: rgba(232, 241, 255, .12); }
.top .seg button { color: var(--on-night); font-weight: 400; }
.top .seg button[aria-pressed="true"] { background: var(--on-night); color: var(--ink); box-shadow: none; }
/* La langue de l'interface (FR | EN), comme le démonstrateur d'extraction. */
.seg.langue button { padding: 6px 10px; font-size: .76rem; letter-spacing: .04em; }
@media (max-width: 560px) { .top .seg.langue button { min-height: 36px; padding: 4px 8px; } }
.lbl-short { display: none; }
@media (max-width: 560px) { .lbl-long { display: none; } .lbl-short { display: inline; } }
/* Sur un téléphone, la vue document garde le logo seul : le nom, coupé, ne se lisait plus. */
@media (max-width: 560px) { .top:has(#modes:not([hidden])) .brand-text { display: none; } }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 48px; padding: 0 22px; min-height: 44px; font-weight: 500; font-size: .9rem; cursor: pointer; white-space: nowrap; border: 1px solid transparent; text-decoration: none; transition: background-color .15s, color .15s, border-color .15s, transform .15s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.sm { min-height: 36px; padding: 0 16px; font-size: .84rem; }
.btn.primary { background: radial-gradient(120% 180% at 50% 130%, var(--accent) 0%, #0a0b5c 55%, #040324 100%); color: var(--on-night); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--soft-2); }
.btn.link { background: none; color: var(--accent); padding: 0 6px; }
.btn.icon { width: 36px; padding: 0; }
@media (hover: hover) { .btn.ghost:hover { background: var(--soft); border-color: var(--ink); } .btn.primary:hover { filter: brightness(1.25); } }
.btn:disabled { opacity: .45; cursor: default; }
.btn[aria-pressed="true"] { background: var(--navy); color: var(--on-night); border-color: var(--navy); }
/* Sur le bleu nuit (en-tête, ouverture, bandeaux) : contour clair, ou pastille claire. */
.top .btn.ghost, .hello .btn.ghost, .cta .btn.ghost { color: var(--on-night); border-color: rgba(232, 241, 255, .55); }
.btn.light { background: var(--on-night); color: var(--ink); }
@media (hover: hover) { .top .btn.ghost:hover, .hello .btn.ghost:hover, .cta .btn.ghost:hover { background: rgba(232, 241, 255, .12); border-color: var(--on-night); } .btn.light:hover { background: #fff; } }
/* La flèche d'un appel à l'action avance au survol. */
.btn.arrow::after, .more::after { content: "→"; display: inline-block; transition: transform .3s var(--ease); }
@media (hover: hover) { .btn.arrow:hover::after, .point:hover .more::after, .more:hover::after { transform: translateX(5px); } }

/* ---------- l'accueil ---------- */
.app { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 20px clamp(14px, 3vw, 28px) 28px; }
.app:has(> #home:not([hidden])) { padding-top: 0; }
.home { margin: 0 auto; padding: 0 0 clamp(12px, 4vh, 40px); }
/* Ce qui entre dans la fenêtre monte en place (`reveal`, comment.js). */
.anim .rv { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease), box-shadow .2s, border-color .2s; transition-delay: calc(var(--i, 0) * 80ms); }
.anim .rv.in { opacity: 1; transform: none; }
/* Un titre sur deux lignes, la seconde derrière un tiret, en capitales fines. */
.duo { margin: 0; font-size: clamp(1.5rem, 3.6vw, 2.4rem); font-weight: 400; letter-spacing: -.02em; text-transform: uppercase; line-height: 1.05; color: var(--ink); }
.duo span { display: block; }
.duo span + span { color: var(--accent); }

/* L'ouverture prolonge l'en-tête : même bleu nuit, une lueur qui monte du bas à
   droite, un grain léger, d'un bord à l'autre de la fenêtre. À gauche ce que fait
   la solution, à droite une page qui se masque. */
.hello { position: relative; overflow: hidden; margin: -1px calc(50% - 50vw) clamp(40px, 7vh, 80px); padding: clamp(36px, 8vh, 80px) clamp(18px, 4vw, 40px) 0; color: var(--on-night); border-radius: 0 0 32px 32px; background: radial-gradient(90% 150% at 88% 118%, #1b9cfa 0%, #10169f 34%, var(--night) 78%); }
.hello::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; mix-blend-mode: soft-light; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hello-in { position: relative; max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.kicker { margin: 0 0 18px; font-size: .82rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: #d5e4ff; animation: rise .6s var(--ease) both; }
.hello h1 { margin: 0 0 18px; font-size: clamp(1.8rem, 4.1vw, 3.1rem); font-weight: 400; line-height: 1.04; letter-spacing: -.02em; text-transform: uppercase; color: var(--on-night); text-wrap: balance; animation: rise .7s var(--ease) .08s both; }
.hello h1 .accent { display: block; color: var(--sky); }
.hello .lead { margin: 0; max-width: 30em; color: rgba(232, 241, 255, .82); font-size: 1.1rem; animation: rise .7s var(--ease) .16s both; }
/* Trois repères sous les boutons : où ça tourne, ce qui est masqué, à quel rythme. */
.proof { display: flex; flex-wrap: wrap; gap: 0; margin-top: clamp(26px, 5vh, 44px); animation: rise .7s var(--ease) .32s both; }
.proof:empty { display: none; }
.proof > div { display: flex; flex-direction: column; gap: 2px; padding: 0 clamp(14px, 2.4vw, 28px); border-left: 1px solid rgba(232, 241, 255, .22); }
.proof > div:first-child { padding-left: 0; border-left: 0; }
.proof b { font-size: clamp(1.1rem, 2vw, 1.45rem); font-weight: 400; letter-spacing: -.01em; color: var(--on-night); white-space: nowrap; }
.proof span { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(232, 241, 255, .62); }
.hello-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; animation: rise .7s var(--ease) .24s both; }
/* La page du décor : une feuille penchée, un faisceau qui la parcourt, l'identité
   qui se masque, l'utile qui reste. Rien n'y est lu : c'est une image. */
.hello-art { position: relative; justify-self: center; width: min(400px, 100%); padding-top: 84px; animation: rise .9s var(--ease) .2s both; }
/* Dedans : un cadre en pointillés, « Votre infrastructure », où la page se masque. */
.perimeter { position: relative; border-radius: 28px; padding: 44px 26px 30px; background: rgba(232, 241, 255, .05); border: 1.5px dashed rgba(133, 168, 255, .75); }
.peri-label { position: absolute; top: 14px; left: 20px; display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--sky); }
.peri-label svg { width: 14px; height: 14px; }
/* Dehors : les services en ligne, éteints, au bout d'un lien coupé. */
.outside { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(232, 241, 255, .45); white-space: nowrap; }
.outside svg { width: 58px; height: 39px; stroke: rgba(232, 241, 255, .4); stroke-width: 1.4; fill: rgba(232, 241, 255, .05); }
.link-out { position: absolute; top: 56px; left: 50%; width: 0; height: 28px; border-left: 1.5px dashed rgba(232, 241, 255, .3); }
/* La barrière, sur le lien coupé : la croix et ce qu'elle veut dire, d'un seul tenant. */
.gate { position: absolute; top: 58px; left: 50%; z-index: 2; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 48px; font-size: .64rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: var(--on-night); background: #0b0b33; border: 1px solid rgba(229, 72, 77, .7); animation: gate 4.5s ease infinite; }
.gate-x { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .62rem; font-weight: 600; line-height: 1; color: #fff; background: #e5484d; }
/* Un point part de la page vers le dehors : il est arrêté à la frontière. */
.leak { position: absolute; top: 0; left: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--on-night); opacity: 0; animation: leak 4.5s ease-in-out infinite; }
@keyframes leak { 0% { transform: translateY(46px); opacity: 0; } 12% { opacity: .9; } 44% { transform: translateY(10px); opacity: .9; } 52% { transform: translateY(10px) scale(1.5); opacity: .9; } 74%, 100% { transform: translateY(40px); opacity: 0; } }
@keyframes gate { 0%, 40%, 70%, 100% { box-shadow: 0 0 0 4px rgba(3, 3, 30, .9); } 50% { box-shadow: 0 0 0 4px rgba(3, 3, 30, .9), 0 0 0 9px rgba(229, 72, 77, .35); } }
.sheet { position: relative; overflow: hidden; background: #fff; color: var(--ink); border-radius: 14px; padding: 20px 20px 14px; transform: rotate(1.4deg); box-shadow: 0 40px 80px -24px rgba(0, 11, 23, .7), 0 0 0 1px rgba(232, 241, 255, .2); font-size: .86rem; }
.sheet p { margin: 0; }
.sheet-title { font-weight: 600; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; margin-bottom: 4px !important; border-bottom: 1px solid var(--line); }
.sheet .row { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid #eef3fb; }
.sheet .row:last-child { border-bottom: 0; }
.sheet .k { flex: 0 0 76px; color: var(--muted); font-size: .76rem; }
.sheet .v { font-weight: 500; white-space: nowrap; }
.sheet .hand .v { font: italic 500 1.25rem "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; line-height: 1; }
.sheet .id { position: relative; display: inline-block; }
.sheet .id::after { content: ""; position: absolute; inset: -1px -3px; border-radius: 2px; background: var(--night); transform: scaleX(0); transform-origin: left; animation: mask 9s var(--ease) infinite; animation-delay: calc(var(--d) * .32s); }
.sheet .keep .v::after { content: " ✓"; color: var(--ok); font-weight: 600; opacity: 0; animation: kept 9s ease infinite; animation-delay: 1.4s; }
.sheet-beam { position: absolute; left: 0; right: 0; top: 0; height: 56px; pointer-events: none; background: linear-gradient(rgba(29, 27, 234, 0), rgba(29, 27, 234, .16)); border-bottom: 2px solid var(--accent); transform: translateY(-60px); animation: beam 9s linear infinite; }
@keyframes mask { 0%, 8% { transform: scaleX(0); opacity: 1; } 15%, 84% { transform: scaleX(1); opacity: 1; } 92%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes kept { 0%, 8% { opacity: 0; } 15%, 84% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes beam { 0% { transform: translateY(-60px); opacity: 1; } 34% { transform: translateY(320px); opacity: 1; } 38%, 100% { transform: translateY(320px); opacity: 0; } }
/* La pastille flottante du décor. Les pastilles de la vue document portent aussi
   `.chip` : ces règles restent dans le décor, sinon elles s'y empilent. Fond, marge
   et couleur viennent de `.chip` (plus bas), comme jusqu'ici. */
.perimeter .chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(133, 168, 255, .5), 0 18px 36px -18px rgba(0, 11, 23, .8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: float 3.6s ease-in-out infinite alternate; }
.perimeter .chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #5fe3a1; }
.perimeter .chip.c1 { bottom: -16px; left: 18px; }
@keyframes float { to { transform: translateY(-6px); } }
/* Les formats, en bande qui défile au pied de l'ouverture. */
.marquee { position: relative; margin: clamp(32px, 6vh, 64px) calc(-1 * clamp(18px, 4vw, 40px)) 0; padding: 14px 0; border-top: 1px solid rgba(232, 241, 255, .14); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-in { display: flex; width: max-content; animation: slide-left 36s linear infinite; }
.marquee span { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(232, 241, 255, .62); white-space: nowrap; }
.marquee span::after { content: "·"; margin: 0 22px; color: var(--sky); }
@keyframes slide-left { to { transform: translateX(-50%); } }
@media (max-width: 860px) {
  .hello-in { grid-template-columns: minmax(0, 1fr); }
  .hello-art { width: min(360px, 94%); margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .sheet .id::after { transform: none; } .sheet .keep .v::after { opacity: 1; } .sheet-beam, .leak { display: none; } }
.ideas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 auto; }
@media (max-width: 760px) { .ideas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.idea { text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@media (hover: hover) { .idea:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); } }
.idea .ic { width: 36px; height: 36px; border-radius: 50%; background: var(--panel); color: var(--accent); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.idea b { color: var(--ink); font-size: 1rem; font-weight: 500; }
/* La vignette : la difficulté du document en un dessin, l'identité qui se masque. */
.thumb { display: block; border-radius: 14px; margin-bottom: 8px; background: radial-gradient(70% 90% at 50% 110%, rgba(133, 168, 255, .45), transparent 70%), var(--soft); }
.thumb svg { display: block; width: 100%; height: 96px; stroke: none; fill: none; }
.thumb .t-paper { fill: #fff; stroke: var(--soft-2); stroke-width: 1; }
.thumb .t-paper.back { fill: #f3f8ff; }
.thumb .t-line { stroke: #c3cfe6; stroke-width: 2.4; stroke-linecap: round; }
.thumb .t-box { stroke: #c3cfe6; stroke-width: 1; }
.thumb .t-gray { fill: #b6bcc8; }
.thumb .t-stain { fill: #b89b62; opacity: .5; }
.thumb .t-id { fill: var(--accent); animation: tmask 5s ease infinite; animation-delay: calc(var(--i, 0) * .5s); }
@keyframes tmask { 0%, 30% { fill: var(--accent); } 45%, 88% { fill: var(--night); } 100% { fill: var(--accent); } }
@media (prefers-reduced-motion: reduce) { .thumb .t-id { fill: var(--night); } }
.idea span { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.idea .tags { color: var(--accent); font-size: .7rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-top: auto; padding-top: 4px; }
.idea.upload { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 16px; position: relative; border: 0; background: radial-gradient(70% 120% at 50% 130%, rgba(133, 168, 255, .35), transparent 70%), var(--soft); padding: 22px 24px; }
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.idea.upload::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; background: conic-gradient(from var(--angle), var(--accent), var(--sky), #1b9cfa, var(--night), var(--accent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: turn 6s linear infinite; }
@keyframes turn { to { --angle: 360deg; } }
.idea.upload .ic { width: 48px; height: 48px; background: var(--navy); color: var(--on-night); box-shadow: none; flex: none; }
.idea.upload .up-text { display: flex; flex-direction: column; gap: 3px; flex: 1 1 260px; min-width: 0; }
.idea.upload .up-text b { font-size: 1.2rem; }
.idea.upload .up-text span { color: var(--text); }
.idea.upload .up-cta { flex: none; pointer-events: none; }
.idea.upload.over { background: var(--soft-2); }
/* « Votre document » finit la rangée des exemples : toute la largeur quand elle est
   pleine, sinon la place qui reste (la carte compte parmi les enfants de la grille). */
.idea.upload:nth-child(3n + 2) { grid-column: span 2; }
.idea.upload:nth-child(3n) { grid-column: span 1; }
@media (max-width: 760px) { .idea.upload:nth-child(n) { grid-column: 1 / -1; } .idea.upload:nth-child(2n) { grid-column: span 1; } }
@media (max-width: 560px) { .idea.upload:nth-child(n) { grid-column: 1 / -1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- l'espace de travail : le document, et les réglages ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
/* Les six étapes, sur toute la largeur, entre « Précédente » et « Suivante ». */
.stepper { grid-column: 1 / -1; display: flex; align-items: center; gap: clamp(8px, 2vw, 24px); padding: 10px clamp(12px, 2vw, 22px); }
.stepper .flow { flex: 1; margin: 0; }
.stepper .btn { flex: none; }
@media (max-width: 760px) { .stepper .lbl { display: none; } .stepper .btn { width: 40px; padding: 0; } }
@media (max-width: 560px) { .stepper .st-name { display: none; } }
/* La page reste en haut de son cadre : centrée, elle descendait quand le panneau d'une
   étape s'allonge (la carte avec lui) et montait quand le curseur apparaît dessous. */
@media (min-width: 1001px) { .work > .doc, .work > .panel { min-height: calc(100dvh - var(--head) - 222px); } .viewer-box { flex: 1; align-items: flex-start; } }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.doc { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* Le document ouvert, au-dessus des étapes : le retour au choix, son nom. */
.doc-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-bottom: -6px; }
.doc-title { flex: 1; min-width: 0; }
.doc-title h2 { margin: 0; font-size: 1.15rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-title p { margin: 0; font-size: .8rem; }
.lang-pick select { border: 1px solid var(--soft-2); border-radius: 999px; padding: 6px 10px; background: var(--panel); font-size: .82rem; }
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pages button { border: 1px solid var(--soft-2); background: var(--panel); border-radius: 999px; min-width: 34px; height: 32px; padding: 0 10px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink); }
.pages button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pages button.stale { border-style: dashed; color: var(--muted); }
.view-tools { display: flex; gap: 6px; margin-left: auto; }
.page-mode { display: inline-flex; border: 1px solid var(--soft-2); border-radius: 999px; padding: 2px; background: var(--panel); }
.page-mode[hidden] { display: none; }
.page-mode button { border: 0; background: none; border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 28px; }
.page-mode button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* La page tient dans la place qui reste : sa largeur se déduit de la hauteur
   libre et de ses proportions (`--ar`). */
.viewer-box { display: flex; justify-content: center; }
.viewer {
  position: relative;
  --ar: .773;
  --chrome: 440px;
  aspect-ratio: var(--ar);
  width: min(100%, calc((100dvh - var(--head) - var(--chrome)) * var(--ar)));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  user-select: none;
}
.viewer img { display: block; width: 100%; height: 100%; }
#img-after { position: absolute; inset: 0; }
#img-after.morphing { transition: opacity .6s ease; }
.viewer-box[hidden], .column[hidden] { display: none; }
/* Toutes les pages : la colonne défile dans la place qu'occupait la page seule. */
.column { position: relative; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; overscroll-behavior: contain; max-height: calc(100dvh - var(--head) - 300px); padding-right: 4px; }
.col-page { margin: 0; }
.col-label { font-size: .76rem; font-weight: 500; color: var(--muted); margin: 0 0 4px; }
.col-viewer { width: 100%; }
.col-after { position: absolute; inset: 0; }
body.zoomed .column { max-height: calc(100dvh - 120px); }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: repeating-linear-gradient(45deg, #fafbfd 0 12px, #f2f4f8 12px 24px); }
.morph { display: flex; align-items: center; gap: 10px; }
.morph input[type="range"] { flex: 1; min-width: 60px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.morph-end { border: 1px solid var(--soft-2); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--ink); min-height: 32px; }
.morph-end[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); min-height: 1.4em; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 18px; height: 11px; border-radius: 2px; flex: none; }
.sw.rb-both { background: rgba(0, 114, 178, .12); border: 2px solid var(--added); }
.sw.rb-tesseract { background: rgba(213, 94, 0, .1); border: 2px dashed var(--removed); }
.sw.rb-apple { background: rgba(204, 121, 167, .12); border: 2px dotted #cc79a7; }
.sw.rb-hand { background: rgba(0, 158, 115, .1); border: 3px double #009e73; }
.sw.sw-det { border: 2px solid var(--zone); background: var(--zone-fill); }
.sw.sw-tfield { border: 2px dotted #555; background: rgba(120, 120, 120, .12); }
.sw.sw-mask { background: #111; }
.sw.sw-left { border: 2px dashed var(--removed); }
.sw.sw-reread { border: 3px solid var(--removed); }
.sw.sw-gain { border: 3px solid var(--added); background: rgba(0, 114, 178, .16); }
.sw.sw-loss { border: 3px dashed var(--removed); background: rgba(213, 94, 0, .12); }


/* Le pied du document : la vérification d'un exemple, et le PDF. */
.doc-foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.check { flex: 1 1 100%; font-size: .84rem; background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.check ul { margin: 4px 0 0; padding-left: 18px; }
.check .linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.check .linkbtn[aria-pressed="true"] { color: var(--removed); }

/* ---------- le panneau : les six étapes de la solution ---------- */
.panel { padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.panel-head h2 { margin: 0 0 4px; font-size: .76rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.panel-head p { margin: 2px 0 8px; font-size: .86rem; }
.sheet-handle { display: none; }

/* Les six étapes en onglets, sur un fil : un numéro, un nom. Une seule est ouverte,
   son contenu dessous sur toute la largeur. Celles d'avant sont faites (bleu marine),
   l'ouverte est en bleu vif. Chaque `li` s'efface (`display: contents`) : son bouton
   va sur la rangée des onglets, son contenu sur la suivante. */
.flow { position: relative; list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 4px; transition: opacity .2s var(--ease); }
.flow::before { content: ""; position: absolute; left: 8.33%; right: 8.33%; top: 25px; height: 2px; border-radius: 2px; background: var(--soft-2); }
.flow > li { display: contents; }
.st-head { grid-row: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; padding: 9px 2px 10px; cursor: pointer; text-align: center; border-radius: 14px; }
.st-num { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--ink); font-weight: 500; font-size: .9rem; box-shadow: 0 0 0 5px var(--panel); transition: background-color .2s, color .2s, box-shadow .2s; }
.flow > li:has(~ li.current) .st-num { background: var(--navy); color: var(--on-night); }
.flow > li.current .st-num { background: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--panel), 0 0 0 9px var(--accent-soft); }
/* Le nom d'une étape reste dans sa colonne : un mot long (« Compréhension ») se coupe
   en français plutôt que de déborder sur l'étape voisine. */
.st-name { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.st-name b { color: var(--muted); font-size: .78rem; font-weight: 500; line-height: 1.2; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
.flow > li.current .st-name b { color: var(--ink); }
.st-name small, .st-head .st-fig { display: none; }
.st-fig { flex: none; font-size: .78rem; font-weight: 500; color: var(--accent); background: var(--soft); border-radius: 999px; padding: 3px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-fig:empty { display: none; }
@media (hover: hover) { .flow > li:not(.current) .st-head:hover .st-name b { color: var(--accent); } }
.st-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-top h3 { margin: 0; font-size: 1.9rem; font-weight: 400; letter-spacing: -.01em; color: var(--ink); }
.st-body { display: flex; flex-direction: column; gap: 14px; animation: rise .3s var(--ease) both; }
.st-what { margin: 0; font-size: 1.05rem; color: var(--text); max-width: 34em; }
.fact { margin: 0; font-size: .88rem; color: var(--muted); }
/* Pendant un calcul : l'étape en cours tourne, celles d'après attendent. */
.work:has(.flow.stale) .st-body { opacity: .5; }
.flow > li.busy .st-num { color: transparent; background: var(--panel); box-shadow: inset 0 0 0 2px var(--soft-2), 0 0 0 5px var(--panel); }
.flow > li.busy .st-num::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); animation: spin .9s linear infinite; }
.flow > li.todo .st-num { opacity: .45; }
/* Une étape avant celle qui change : son calcul est gardé, elle ne tourne pas. */

.flow > li.reused .st-fig::before { content: attr(data-reused); font-weight: 600; color: var(--muted); }

/* Les lectures de la page, sous « Croiser deux OCR ». */
.adv.fixed label, .adv.disabled label { color: var(--muted); cursor: default; }
/* Les réglages avancés d'une étape, repliés sous elle. */
.adv-inline { border-top: 1px dashed var(--soft-2); padding-top: 6px; }
.adv-inline > summary { cursor: pointer; font-size: .8rem; font-weight: 500; color: var(--accent); padding: 4px 0; list-style-position: inside; }
.adv-inline .adv:first-of-type { border-top: 0; }
/* La langue, choisie dans l'étape qui applique ses règles. */
.locale-inline { display: block; margin: 4px 0 2px; border: 1px solid var(--soft-2); border-radius: 999px; padding: 3px 10px; background: var(--panel); font-size: .8rem; font-weight: 600; color: var(--ink); max-width: 100%; }

/* Un réglage : son nom sur ce document, ce qu'il fait, et son effet ici. */
.ctl { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; transition: border-color .15s, box-shadow .15s; }
@media (hover: hover) { .ctl:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } }
.ctl-text { min-width: 0; }
.ctl-title { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); font-size: .88rem; line-height: 1.3; }
.ctl-sub { font-size: .77rem; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.ctl.off .ctl-title { color: var(--muted); }
.ctl.level { grid-template-columns: minmax(0, 1fr); }
/* Qui lit quoi, sous « Croiser deux OCR ». */
.rgrid { display: none; }
.rgrid table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rgrid thead th { font-size: .7rem; font-weight: 600; color: var(--muted); line-height: 1.2; text-align: center; padding: 0 2px 6px; vertical-align: bottom; cursor: help; }
.rgrid thead td { width: 32%; }
.rgrid tbody th { text-align: left; font-size: .8rem; font-weight: 500; color: var(--ink); padding: 7px 4px 7px 0; border-top: 1px solid var(--line); }
.rgrid tbody td { text-align: center; padding: 7px 2px; border-top: 1px solid var(--line); }
.rgrid input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.rgrid input:disabled { cursor: default; }
.rg-none { color: var(--muted); opacity: .5; }
.rg-extra { display: flex; gap: 8px; align-items: center; margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--ink); cursor: pointer; }
.info { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--soft-2); background: var(--panel); color: var(--accent); font-weight: 600; font-size: .72rem; cursor: pointer; display: inline-grid; place-items: center; padding: 0; flex: none; }
@media (hover: hover) { .info:hover { background: var(--accent); border-color: var(--accent); color: #fff; } }
/* La personne du document : ce qu'on cherche, montré tel quel. */
.person { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.person .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.person-in { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.person-in b { color: var(--ink); font-size: .95rem; }
.person-in small { color: var(--muted); font-size: .74rem; }
.person.none .avatar { background: var(--soft); color: var(--muted); }
.person.none b { font-size: .84rem; }
.identity-fields { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 4px; }
.identity-fields input, .adv input[type="number"] { border: 1px solid var(--soft-2); border-radius: 10px; padding: 7px 10px; background: var(--panel); min-width: 0; font-size: 16px; }
/* L'effet ici : une pastille qu'on survole ou qu'on clique pour le voir sur la page.
   Trait plein : ce qu'il masque ; tirets : ce qui reste lisible. */
.impact-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 30px; }
.impact { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: .78rem; font-weight: 500; line-height: 1.3; border: 1.5px solid transparent; text-align: left; }
button.impact { cursor: pointer; }
.impact .eye svg { width: 15px; height: 15px; }
.impact.gain { background: #e7f0f8; color: #00507d; border-color: var(--added); }
.impact.loss { background: #fbeee6; color: #8f3d00; border-color: var(--removed); border-style: dashed; }
.impact.none { background: var(--soft); color: var(--muted); font-weight: 600; }
.impact[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent-soft); }
.impact.gain[aria-pressed="true"] { background: var(--added); color: #fff; }
.impact.loss[aria-pressed="true"] { background: var(--removed); color: #fff; }
.impact-need { font-size: .76rem; color: var(--muted); flex-basis: 100%; }
.go { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; text-decoration: underline; }
/* Les choix (niveau, apparence). */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { border: 1.5px solid var(--soft-2); background: var(--panel); border-radius: 12px; padding: 7px 10px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 1px; min-height: 44px; transition: border-color .15s; }
@media (hover: hover) { .choice:hover { border-color: var(--accent); } }
.choice b { font-size: .84rem; color: var(--ink); }
.choice small { font-size: .74rem; color: var(--muted); }
.choice small.delta-plus { color: var(--added); font-weight: 500; }
.choice small.delta-minus { color: var(--removed); font-weight: 500; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.work:has(.flow.stale) .choice small, .work:has(.flow.stale) .impact-row { opacity: .45; transition: opacity .2s var(--ease); }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--soft-2); border: 0; position: relative; cursor: pointer; padding: 0; transition: background-color .2s; flex: none; align-self: start; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 21px; }
.switch:disabled { opacity: .4; cursor: default; }
/* La lecture croisée en une barre : lu par les deux OCR, ou par un seul. */
.readbar-box { display: flex; flex-direction: column; gap: 6px; }
.readbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--soft); }
.readbar i { display: block; min-width: 4px; }
.readkeys { display: flex; flex-direction: column; gap: 2px; }
.readkey { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 3px 6px; border-radius: 8px; font-size: .8rem; color: var(--text); cursor: pointer; text-align: left; }
.readkey b { color: var(--ink); min-width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; }
.readkey.on, .readkey:hover { background: var(--soft); }
.rb-both { background: var(--added); }
.rb-tesseract { background: var(--removed); }
.rb-apple { background: #cc79a7; }
.rb-pdf { background: #9aa0a6; }
/* Ce qui est masqué, par catégorie : un clic les désigne sur la page. */
.counts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.counts-lead { font-size: .8rem; color: var(--muted); }
.chip { border: 1px solid var(--soft-2); background: var(--panel); border-radius: 999px; padding: 3px 11px; font-size: .8rem; cursor: pointer; color: var(--ink); }
.chip b { margin-right: 4px; }
.chip[aria-pressed="true"] { background: var(--zone); border-color: var(--zone); color: #08202e; }
.left-row { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; color: var(--ink); cursor: pointer; }
.left-row input { margin-top: 2px; accent-color: var(--accent); }
.panel-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding-top: 12px; margin-top: auto; }
.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 50% { background: var(--accent-soft); } 100% { background: var(--bg); } }

/* ---------- ce que chaque vue dessine sur la page ---------- */
.boxes { position: absolute; inset: 0; pointer-events: none; }
.boxes .b { position: absolute; pointer-events: auto; border: 2px solid transparent; border-radius: 2px; }
.boxes .b:hover { border-color: var(--zone); background: var(--zone-fill); }
.show-boxes .boxes .b { border-color: var(--zone); background: var(--zone-fill); }
.boxes .b.found-by-identity { border-style: dashed; }
.boxes .b.added { border: 3px solid var(--added); background: rgba(0, 114, 178, .16); }
.boxes .b.removed { border: 3px dashed var(--removed); background: rgba(213, 94, 0, .12); }
.boxes .b.added::after, .boxes .b.removed::after, .boxes .b.missed::after { content: attr(data-tag); position: absolute; bottom: -18px; right: -3px; font-size: 11px; font-weight: 600; line-height: 15px; padding: 0 5px; border-radius: 3px; color: #fff; }
.boxes .b.added::after { background: var(--added); }
.boxes .b.removed::after { background: var(--removed); }
.boxes .b.missed { border: 3px dashed var(--removed); background: rgba(213, 94, 0, .1); }
.boxes .b.missed::after { background: var(--removed); }
.highlighting .boxes .b.hl { border: 3px solid var(--zone); background: var(--zone-fill); }
/* La lecture croisée : chaque mot selon ce qui l'a lu ; une part survolée ressort. */
.boxes .b.word { transition: opacity .15s; }
.boxes .b.word.rb-both { border: 1px solid var(--added); background: rgba(0, 114, 178, .08); }
.boxes .b.word.rb-tesseract { border: 2px dashed var(--removed); background: rgba(213, 94, 0, .1); }
.boxes .b.word.rb-apple { border: 2px dotted #cc79a7; background: rgba(204, 121, 167, .14); }
.boxes .b.word.rb-pdf { border: 1px solid #9aa0a6; background: rgba(150, 150, 150, .1); }
/* Une ligne écrite à la main lue par l'IA de vision : trait double, vert d'Okabe-Ito. */
.boxes .b.word.rb-hand { border: 3px double #009e73; background: rgba(0, 158, 115, .08); }
.boxes .b.word.dim { opacity: .12; }
.boxes .b.word.focus { border-width: 2px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
/* Masqué au plus près des lettres : chaque rangée peinte, jamais l'englobant. */
.boxes .b.mask { background: #111; border: 0; border-radius: 1px; }
.boxes .b.mask:hover { background: #333; outline: 2px solid var(--zone); }
.highlighting .boxes .b.mask.hl { outline: 3px solid var(--zone); }
.boxes .b.hwline { border: 2px dotted var(--ink); }
/* Ce qu'un réglage change, désigné sur la page : trait plein et libellé pour ce
   qu'il masque, tirets et libellé pour ce qui reste lisible. */
.boxes .b.gain, .boxes .b.loss { animation: peek 1.4s var(--ease) 2; z-index: 2; }
.boxes .b.gain { border: 3px solid var(--added); background: rgba(0, 114, 178, .18); }
.boxes .b.loss { border: 3px dashed var(--removed); background: rgba(213, 94, 0, .14); }
.boxes .b.gain::after, .boxes .b.loss::after { content: attr(data-tag); position: absolute; top: -18px; left: -3px; font-size: 11px; font-weight: 600; line-height: 15px; padding: 0 5px; border-radius: 3px; color: #fff; white-space: nowrap; }
.boxes .b.gain::after { background: var(--added); }
.boxes .b.loss::after { background: var(--removed); }
@keyframes peek { 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .9), 0 0 0 9px rgba(0, 0, 0, .15); } }
.boxes .b.tfield { border: 2px dotted #555; background: rgba(120, 120, 120, .12); }
.boxes .b.det { border: 2px solid var(--cat, var(--zone)); background: color-mix(in srgb, var(--cat, var(--zone)) 20%, transparent); }
.boxes .b.reread { border: 3px solid var(--removed); outline: 2px solid #fff; }
.boxes .b.tfield::before, .boxes .b.det::before, .boxes .b.reread::before { position: absolute; left: -2px; top: -16px; font-size: 10.5px; line-height: 14px; padding: 0 4px; border-radius: 3px; white-space: nowrap; color: #fff; }
.boxes .b.tfield::before { content: attr(data-tag); background: #555; }
.boxes .b.det::before { content: attr(data-label); background: var(--cat, var(--zone)); }
.boxes .b.reread::before { content: attr(data-tag); background: var(--removed); }
.boxes .b[data-cat="nom"] { --cat: #0072b2; }
.boxes .b[data-cat="date"] { --cat: #d55e00; }
.boxes .b[data-cat="adresse"] { --cat: #009e73; }
.boxes .b[data-cat="contact"] { --cat: #cc79a7; }
.boxes .b[data-cat="identifiant"] { --cat: #8a6d00; }
.boxes .b[data-cat="signature"] { --cat: #5d3fa8; }
.boxes .b[data-cat="autre"] { --cat: #666; }
.boxes .b:focus-visible { outline: 3px solid var(--zone); outline-offset: 1px; }

/* Le calcul en cours sur la page affichée. */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; }
.topbar-fill { height: 100%; width: 4%; background: var(--accent); transition: width .4s ease; }
.working { position: absolute; inset: 0; padding: 10px; pointer-events: none; z-index: 4; }
.working-pill { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--accent); font-size: .8rem; font-weight: 600; box-shadow: var(--shadow); }
.spin { width: 12px; height: 12px; border: 2px solid var(--soft-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer.is-working img { filter: grayscale(.2) opacity(.6); }
.viewer.stale img { filter: grayscale(.4) opacity(.6); }
.viewer.stale::after { content: attr(data-stale); position: absolute; left: 8px; right: 8px; top: 8px; padding: 4px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: .8rem; z-index: 3; }

/* ---------- surimpressions : réglages avancés, exemple d'un réglage ---------- */
.scrim { position: fixed; inset: 0; background: rgba(3, 3, 30, .5); z-index: 39; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--panel); z-index: 40; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide .3s var(--ease); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.05rem; color: var(--ink); }
.drawer-head p { margin: 4px 0 0; font-size: .8rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 18px 24px; }
.eyebrow { margin: 0 0 6px; font-size: .76rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.adv-group h3 { margin: 18px 0 4px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.adv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.adv input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.adv input[type="number"] { width: 76px; padding: 4px 8px; font-size: .86rem; }
.adv label { cursor: pointer; color: var(--ink); font-weight: 600; }
.adv small { grid-column: 2; color: var(--muted); font-size: .78rem; }
.adv.changed label { color: var(--accent); }
.badge { font-size: .68rem; font-weight: 500; border-radius: 999px; padding: 1px 7px; margin-left: 6px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.modal { position: fixed; inset: 0; z-index: 41; display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; animation: rise .25s var(--ease); }
.modal-body { padding: 14px 18px 18px; }
.modal-body p { margin: 0 0 12px; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ba figure { margin: 0; }
.ba img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; background: #fff; }
.ba figcaption { font-size: .8rem; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.ba figcaption small { font-weight: 500; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- infobulles et notifications ---------- */
.tip { position: fixed; z-index: 45; max-width: min(340px, calc(100vw - 16px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: .82rem; box-shadow: var(--shadow); pointer-events: none; }
.tip strong { display: block; color: var(--ink); margin-bottom: 2px; }
.hint-tip { position: fixed; z-index: 70; max-width: 300px; padding: 8px 12px; border-radius: 12px; background: var(--night); color: var(--on-night); font-size: .8rem; line-height: 1.4; pointer-events: none; box-shadow: var(--shadow); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 48px; background: var(--night); color: #fff; font-size: .86rem; box-shadow: var(--shadow); animation: rise .2s var(--ease); transition: opacity .5s; }
.toast.error { background: #8a1c12; }
.toast.fade { opacity: 0; }
.toast button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; }
/* L'avis des limites de la démonstration : reste jusqu'à sa fermeture, avec le contact. */
.toast.limit { align-items: flex-start; border-radius: 18px; padding: 16px 14px 16px 18px; background: var(--night); box-shadow: inset 0 0 0 1px rgba(133, 168, 255, .45), var(--shadow); }
.limit-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; line-height: 1.45; }
.limit-body b { font-weight: 600; color: var(--sky); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.limit-note { color: rgba(232, 241, 255, .7); font-size: .8rem; }
.limit-body .btn { margin-top: 6px; }

/* « Agrandir » : la page seule, sur toute la fenêtre. */
body.zoomed { overflow: hidden; }
body.zoomed .doc { position: fixed; inset: 0; z-index: 35; border-radius: 0; overflow: auto; }
body.zoomed .viewer { --chrome: 120px; width: min(100%, calc((100dvh - var(--chrome)) * var(--ar) * 1.4)); }
body.zoomed .doc-foot, body.zoomed .legend { display: none; }

/* ---------- fenêtre moyenne et téléphone ---------- */
@media (max-width: 1000px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .doc { position: static; }
  .viewer { width: 100%; --chrome: 0px; }
  .brand-sub { display: none; }
  .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 32; display: flex; justify-content: center; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 40%); pointer-events: none; }
  .mobile-bar .btn { pointer-events: auto; min-height: 48px; padding: 0 22px; box-shadow: var(--shadow); }
  .work { padding-bottom: 72px; }
  /* Les réglages montent du bas, par-dessus la page, qui reste visible au-dessus. */
  .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; max-height: 62dvh; border-radius: 22px 22px 0 0; padding: 8px 16px max(16px, env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .35s var(--ease); box-shadow: 0 -10px 30px -12px rgba(16, 22, 159, .3); }
  .panel.open { transform: none; }
  .sheet-handle { display: block; width: 42px; height: 5px; border-radius: 99px; background: var(--soft-2); margin: 2px auto 8px; flex: none; }
}
@media (max-width: 560px) {
  .app { padding: 10px 10px 20px; }
  .pill { display: none; }
  .doc { padding: 10px; border-radius: 16px; }
  .btn.sm { min-height: 44px; }
  .btn.icon { width: 44px; }
  /* Le relevé comparé est une phrase : il passe à la ligne au lieu de déborder. */
  .foot-actions .btn { white-space: normal; max-width: 100%; text-align: left; padding-block: 8px; }
  .seg button { min-height: 40px; padding: 6px 12px; }
  .ba { grid-template-columns: 1fr; }
  .ideas { grid-template-columns: 1fr; }
  .identity-fields { grid-template-columns: 1fr; }
}
@media (pointer: coarse) { .info { width: 30px; height: 30px; font-size: .8rem; } }


/* Les candidats laissés lisibles : pointillés et étiquette, jamais la couleur seule. */
.boxes .b.left { border: 2px dashed var(--removed); background: transparent; }
.boxes .b.left::after { content: attr(data-tag); position: absolute; bottom: -18px; right: -3px; font-size: 11px; font-weight: 600; line-height: 15px; padding: 0 5px; border-radius: 3px; color: #fff; background: var(--removed); }
/* La fiche d'une zone : lecture, détection, résultat, dans l'ordre. */
.tip:has(.tip-sec) { max-width: min(420px, calc(100vw - 16px)); }
.tip .tip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tip .tip-head strong { margin: 0; }
.tip .st { font-size: .7rem; font-weight: 500; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.tip .st-masked { background: var(--ok-soft); color: var(--ok); }
.tip .st-left { background: color-mix(in srgb, var(--removed) 14%, transparent); color: var(--removed); }
.tip .tip-sec { padding: 6px 0; border-top: 1px solid var(--line); }
.tip .sec-title { display: flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.tip .sec-title .num { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: .66rem; letter-spacing: 0; }
.tip .sec-step { text-transform: none; letter-spacing: 0; font-weight: 600; }
.tip .row { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.tip .row .who { color: var(--muted); white-space: nowrap; }
.tip .row .read { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.tip .pct { font-variant-numeric: tabular-nums; color: var(--ink); }
.tip .row .pct { text-align: right; }
.tip .det + .det { margin-top: 5px; }
.tip .small { font-size: .74rem; }
.tip .res { font-weight: 500; }
.tip .res.masked::before { content: "■ "; color: var(--ink); }
.tip .res.left::before { content: "□ "; color: var(--removed); }
.tip .res.left { color: var(--removed); }
.tip .chk { display: flex; gap: 6px; align-items: baseline; }
.tip .chk .mark { font-weight: 600; width: 1em; flex: none; text-align: center; }
.tip .chk.ok .mark { color: var(--ok); }
.tip .chk.ko .mark { color: var(--removed); }

/* ---------- l'accueil : les enjeux, la réponse, la suite ---------- */
.why:empty, .after:empty { display: none; }
.sec { max-width: 1040px; margin: 0 auto clamp(40px, 8vh, 80px); }
.sec-head { max-width: 700px; margin-bottom: 24px; }
/* Trois enjeux : une icône, un titre, une ligne. */
.stakes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .stakes { grid-template-columns: 1fr; } }
.stake { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.stake::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(70% 60% at 50% 110%, rgba(133, 168, 255, .4), transparent 70%); opacity: 0; transition: opacity .3s; }
.stake > * { position: relative; }
@media (hover: hover) { .stake:hover { transform: translateY(-4px); border-color: var(--sky); box-shadow: var(--shadow); transition-delay: 0s; } .stake:hover::before { opacity: 1; } }
.stake .ic { width: 46px; height: 46px; border-radius: 50%; background: var(--soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.stake .ic svg { width: 22px; height: 22px; stroke-width: 1.6; }
.stake h3 { margin: 0; font-size: 1.3rem; font-weight: 400; letter-spacing: -.01em; line-height: 1.15; color: var(--ink); }
.stake p { margin: 0; color: var(--muted); font-size: .92rem; }
/* La réponse : un bandeau bleu nuit. Le schéma, les chiffres en cartes de verre,
   quatre atouts. */
.band { display: grid; gap: clamp(18px, 3vw, 28px); border-radius: 32px; padding: clamp(22px, 4.5vw, 52px); color: var(--on-night); background: radial-gradient(700px 520px at 8% 14%, rgba(47, 69, 255, .3), transparent), radial-gradient(600px 420px at 96% 96%, rgba(27, 156, 250, .32), transparent), var(--night); }
.band-top { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
@media (max-width: 820px) { .band-top { grid-template-columns: minmax(0, 1fr); } }
.band .eyebrow { color: var(--sky); }
.band .duo { color: var(--on-night); }
.band .duo span + span { color: var(--sky); }
.band-text > p:not(.eyebrow) { margin: 16px 0 0; color: rgba(232, 241, 255, .78); font-size: .98rem; max-width: 30em; }
.band .term { text-decoration-color: rgba(232, 241, 255, .5); }
.onprem { margin: 0; }
.onprem svg { width: 100%; height: auto; display: block; stroke: none; fill: none; stroke-width: 1; }
.onprem .o-zone { fill: rgba(232, 241, 255, .05); stroke: rgba(133, 168, 255, .7); stroke-width: 1.4; stroke-dasharray: 7 6; }
.onprem .o-cap { fill: var(--sky); font: 500 10px "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 1.4px; }
.onprem .o-node { fill: rgba(232, 241, 255, .1); stroke: rgba(232, 241, 255, .3); }
.onprem .o-core { fill: var(--on-night); }
.onprem .o-ico { stroke: var(--on-night); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.onprem .o-ico.inv { stroke: #9fb2d6; stroke-width: 4; }
.onprem .o-mask { fill: var(--night); transform-box: fill-box; transform-origin: left; animation: mask 6s var(--ease) infinite; }
.onprem .o-t { fill: var(--on-night); font: 500 11px "Helvetica Neue", Helvetica, Arial, sans-serif; }
.onprem .o-t.dim { fill: rgba(232, 241, 255, .5); }
.onprem .o-flow { stroke: var(--sky); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 8; animation: flow 1.2s linear infinite; }
.onprem .o-cut { stroke: rgba(232, 241, 255, .35); stroke-width: 1.4; stroke-dasharray: 3 5; }
.onprem .o-x { stroke: #ff8a7a; stroke-width: 2.2; stroke-linecap: round; }
.onprem .o-cloud path { fill: rgba(232, 241, 255, .05); stroke: rgba(232, 241, 255, .35); stroke-width: 1.2; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; gap: 3px; min-width: 0; background: linear-gradient(160deg, rgba(232, 241, 255, .13), rgba(232, 241, 255, .04)); box-shadow: inset 0 1px 0 rgba(232, 241, 255, .14); transition: transform .3s var(--ease); }
@media (hover: hover) { .stat:hover { transform: translateY(-3px); } }
.stat b { font-size: clamp(1.3rem, 2.3vw, 1.8rem); font-weight: 400; letter-spacing: -.02em; color: var(--on-night); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat span { font-size: .86rem; font-weight: 500; color: var(--on-night); line-height: 1.25; }
.stat small { font-size: .74rem; color: rgba(232, 241, 255, .62); line-height: 1.3; }
.sells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .sells { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .sells, .stats { grid-template-columns: 1fr; } }
.sell { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 24px; color: var(--on-night); text-decoration: none; box-shadow: inset 0 0 0 1px rgba(133, 168, 255, .4); }
.sell .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(232, 241, 255, .12); color: var(--sky); }
.sell b { font-size: .98rem; font-weight: 500; line-height: 1.25; }
.go-ex { margin-top: auto; font-size: .8rem; color: var(--sky); }
.go-ex::after { content: " →"; display: inline-block; transition: transform .3s var(--ease); }
@media (hover: hover) { a.sell:hover { background: rgba(232, 241, 255, .1); box-shadow: inset 0 0 0 1px var(--sky); transition-delay: 0s; } a.sell:hover .go-ex::after { transform: translateX(5px); } }
/* La suite : un dernier bandeau, puis la signature. */
.after { margin-top: clamp(40px, 8vh, 80px); }
.cta { text-align: center; border-radius: 32px; padding: clamp(32px, 7vw, 72px) clamp(20px, 5vw, 56px); color: var(--on-night); background: radial-gradient(90% 150% at 50% 125%, #1b9cfa 0%, #10169f 36%, var(--night) 80%); margin-bottom: 24px; }
.cta .eyebrow { color: var(--sky); }
.cta .duo { color: var(--on-night); font-size: clamp(1.7rem, 4.4vw, 3rem); }
.cta .duo span + span { color: var(--sky); }
.cta > p:not(.eyebrow) { margin: 16px auto 0; max-width: 36em; color: rgba(232, 241, 255, .8); }
.cta .hello-actions { justify-content: center; animation: none; }
.cta :focus-visible, .hello :focus-visible, .band :focus-visible { outline-color: var(--sky); }
/* « Voir aussi » : les autres vitrines, des cartes discrètes au-dessus de la signature,
   côte à côte quand la place le permet. */
.see-also { max-width: 1040px; margin: 0 auto 24px; text-align: center; }
.see-also .eyebrow { margin: 0 0 10px; }
.see-also-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.see-also-card { flex: 1 1 260px; max-width: 480px; display: grid; gap: 4px; align-content: start; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); text-decoration: none; }
.see-also-card b { font-size: 1.05rem; }
.see-also-card b::after { content: " ↗"; color: var(--accent); }
.see-also-card span { font-size: .88rem; color: var(--muted); }
@media (hover: hover) { .see-also-card:hover { border-color: var(--accent); } }
.foot { max-width: 1040px; margin: 0 auto; text-align: center; font-size: .8rem; color: var(--muted); }
.foot a { color: var(--ink); font-weight: 500; }
/* L'essai, mis en avant : une grande carte blanche qui se détache du fond, un titre
   en capitales, « Votre document » sur toute la largeur. */
.try { max-width: 1040px; margin: 0 auto; background: var(--panel); border-radius: 32px; box-shadow: var(--shadow); padding: clamp(20px, 4vw, 48px); scroll-margin-top: calc(var(--head) + 16px); }
.try .ideas { max-width: none; }
.ideas-head { margin: 0 0 24px; }
.ideas-head p:not(.eyebrow) { margin: 14px 0 0; font-size: .88rem; }
/* Le mode d'emploi, en trois gestes reliés par un trait. */
.howto { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 0; }
.howto li { display: flex; align-items: center; gap: 10px; font-size: .95rem; font-weight: 500; color: var(--ink); }
.howto li + li::before { content: ""; width: clamp(16px, 4vw, 44px); height: 1px; margin: 0 12px; background: linear-gradient(90deg, var(--soft-2) 50%, transparent 0) 0 0 / 8px 1px; animation: flow-x 1s linear infinite; }
.howto .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--navy); color: var(--on-night); font-size: .84rem; }
@keyframes flow-x { to { background-position: 8px 0; } }
@media (max-width: 640px) { .howto { flex-direction: column; } .howto li + li::before { display: none; } }

/* ---------- comment ça marche ---------- */
.how-in { max-width: 980px; margin: 0 auto; padding: 8px 0 40px; }
.how-head { margin-bottom: 8px; }
.how-head h1 { margin: 14px 0 10px; font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 400; letter-spacing: -.02em; text-transform: uppercase; line-height: 1.08; color: var(--ink); }
.how-head > p { margin: 0 0 18px; color: var(--muted); max-width: 680px; }
.how-head .btn span { display: inline-flex; }
.chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; counter-reset: step; }
@media (max-width: 900px) { .chain { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .chain { grid-template-columns: 1fr 1fr; } }
.chain li { display: flex; }
.chain button { width: 100%; text-align: left; cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 4px; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
@media (hover: hover) { .chain button:hover { border-color: var(--accent); transform: translateY(-2px); } }
.chain button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1.5px var(--accent); }
.chain .n { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: var(--on-night); font-size: .72rem; font-weight: 600; display: grid; place-items: center; }
.chain b { color: var(--ink); font-size: .88rem; }
.chain span { color: var(--muted); font-size: .78rem; line-height: 1.35; }

.hint { margin: 0 0 10px !important; font-size: .8rem; font-weight: 500; color: var(--accent) !important; }
.step-detail { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 20px; align-items: start; background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); animation: rise .3s var(--ease) both; }
@media (max-width: 760px) { .step-detail { grid-template-columns: minmax(0, 1fr); } }
.step-detail h3 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 400; letter-spacing: -.01em; color: var(--ink); }
.sd-text > p { margin: 0 0 12px; font-size: 1rem; }
.sd-extra { grid-column: 1 / -1; display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.sd-extra .two { margin-top: 0; align-items: start; }
.sd-figs { display: grid; gap: 10px; }
.sd-block h4, .formats + p, .sd-block > p { margin: 0 0 6px; }
.sd-block h4 { font-size: .9rem; color: var(--ink); }
.sd-block > p { font-size: .86rem; }
.edge { margin: 0 0 14px !important; background: radial-gradient(70% 80% at 50% 100%, rgba(133, 168, 255, .28), transparent 70%), var(--soft); border-radius: 16px; padding: 12px 14px; font-size: .92rem; color: var(--ink); }
.edge b { display: block; font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.formats { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.formats li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.formats b { min-width: 210px; font-size: .86rem; color: var(--ink); }
.formats .links { display: flex; flex-wrap: wrap; gap: 6px; }
.step-detail .dg { margin: 0; }
.how-part { margin-top: 44px; scroll-margin-top: calc(var(--head) + 16px); }
.how-part > h2 { margin: 0 0 10px; font-size: clamp(1.3rem, 2.8vw, 1.75rem); font-weight: 400; letter-spacing: -.02em; text-transform: uppercase; line-height: 1.12; color: var(--ink); }
.how-part > p { color: var(--text); max-width: 720px; }
.how-part h3 { margin: 0 0 6px; font-size: .98rem; color: var(--ink); }
.small { font-size: .78rem; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.two > div > p { font-size: .86rem; margin: 0 0 10px; }
.estimate { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-width: 720px; }
.estimate label { display: block; font-weight: 500; color: var(--ink); font-size: .86rem; margin-bottom: 6px; }
.estimate input { width: 180px; max-width: 100%; border: 1.5px solid var(--soft-2); border-radius: 10px; padding: 8px 12px; font-size: 1rem; font-variant-numeric: tabular-nums; }
.estimate-out { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 8px 16px; margin: 14px 0 8px; }
@media (max-width: 560px) { .estimate-out { grid-template-columns: 1fr; gap: 2px; } .estimate-out dd { margin-bottom: 8px; } }
.estimate-out dt { color: var(--muted); font-size: .84rem; }
.estimate-out dd { margin: 0; display: flex; flex-direction: column; }
.estimate-out dd b { color: var(--ink); font-size: 1.05rem; }
.estimate-out dd small { color: var(--muted); font-size: .74rem; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--soft); margin: 4px 0 3px; overflow: hidden; max-width: 360px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

/* Les schémas : du SVG simple aux couleurs de la page. Le style par défaut des
   icônes (18 px, trait) ne s'y applique pas. */
.dg { margin: 0 0 12px; background: var(--bg); border-radius: 16px; padding: 10px; }
.dg svg { width: 100%; height: auto; display: block; stroke: none; fill: none; stroke-width: 1; }
.dg .d-paper { fill: var(--panel); stroke: var(--soft-2); stroke-width: 1.2; }
.dg .d-box { fill: var(--panel); stroke: var(--soft-2); stroke-width: 1.2; }
.dg .d-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; }
.dg .d-ok { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 1.2; }
.dg .d-black { fill: var(--ink); }
.dg .d-line { fill: var(--soft-2); }
.dg .d-wire { stroke: var(--muted); stroke-width: 1.3; fill: none; }
.dg .d-head { fill: var(--muted); }
.dg .d-t { fill: var(--ink); font: 600 11px "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; }
.dg .d-t.b { font-weight: 600; }
.dg .d-t.keep { fill: var(--ok); }
.dg .d-cap { fill: var(--muted); font: 500 10px "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; }
.dg .d-tag { fill: var(--accent); font: 600 9.5px "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; }
.dg .d-tag.ok { fill: var(--ok); }
.dg .d-add { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.3; stroke-dasharray: 4 3; }
.dg .d-t.acc { fill: var(--accent); font-weight: 600; }
.dg .d-on { fill: var(--accent); }
.dg .d-off { fill: var(--soft-2); }
.dg .d-knob { fill: #fff; }
.dg .d-box.dim { fill: var(--bg); stroke-dasharray: 3 3; }
.dg .d-t.dim { fill: var(--muted); }
.dg .d-zone { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 5; }
.dg .d-core { fill: var(--ink); }
.dg .inv { fill: #fff; }
.dg .d-cap.inv { fill: #d5e4ff; }
.panel-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel-card .dg { margin: 0; }
.dg .d-scan { fill: #6b6b6b; font: italic 600 15px Georgia, serif; letter-spacing: .5px; }
.dg .d-t.ko { fill: var(--removed); }
.dg .d-cap.keep { fill: var(--ok); font-weight: 500; }
.dg .d-scan.faint { fill: #b3b3b3; }
.dg .d-stain { fill: #b89b62; opacity: .45; }
.dg .d-wire.dash { stroke-dasharray: 4 3; }

/* Le glossaire : un mot technique souligné en pointillés s'explique sur place. */
.term { text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 3px; cursor: help; border-radius: 3px; }
.term:hover { text-decoration-color: var(--accent); }
/* Les tableaux de la page « Comment ça marche ». */
.dtable, .levels { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .8rem; margin: 0 0 14px; }
.dtable caption, .levels caption { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--accent); padding-bottom: 6px; }
.dtable th, .dtable td, .levels th, .levels td { text-align: left; vertical-align: top; padding: 6px 8px; border-top: 1px solid var(--line); line-height: 1.35; }
.dtable thead th, .levels thead th, .levels thead td { border-top: 0; font-size: .72rem; font-weight: 600; color: var(--muted); }
.dtable tbody th, .levels tbody th { font-weight: 600; color: var(--ink); }
.dtable td { color: var(--text); }
.table-wrap { overflow-x: auto; }
.levels { min-width: 520px; }
.levels thead th { color: var(--ink); }
.lv { display: inline-block; font-weight: 500; font-size: .76rem; }
.lv.m, .lv.k { white-space: nowrap; }
.lv.m { background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 7px; font-weight: 500; }
.lv.k { color: var(--ok); }
.lv.k::before { content: "✓ "; }
.lv.p { color: var(--accent); }
.dg .d-t.faint { fill: #4b5161; }
.dg .d-dot { fill: #a3a9b8; }
.dg .d-hand { fill: var(--ink); font: italic 500 20px "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; }
.dg .d-ink { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.dg .d-scratch { fill: none; stroke: #6b7080; stroke-width: 1.4; }
.dg .d-fold { fill: none; stroke: #c3c8d4; stroke-width: 2.5; }


/* Le choix des pages d'un PDF trop long (`choix-pages.js`, même fichier que la vitrine d'extraction). */
.choix-pages { border: 0; padding: 0; border-radius: var(--radius); background: var(--panel); color: var(--text); box-shadow: var(--shadow); width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.choix-pages::backdrop { background: rgba(3, 3, 30, .45); }
.choix-pages form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.choix-pages h2 { margin: 0; padding: 18px 18px 4px; font-size: 1.15rem; color: var(--ink); }
.choix-pages-texte { margin: 0; padding: 0 18px 12px; color: var(--muted); font-size: .9rem; }
.choix-pages-grille { list-style: none; margin: 0; padding: 4px 18px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; overflow: auto; min-height: 0; flex: 1; }
.choix-pages-grille label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: .84rem; color: var(--muted); }
.choix-pages-grille canvas { width: 100%; height: auto; background: var(--soft); border: 2px solid var(--line); border-radius: 6px; }
.choix-pages-grille canvas.dessinee { background: #fff; }
.choix-pages-grille input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.choix-pages-grille input:checked ~ canvas { border-color: var(--accent); }
.choix-pages-grille input:checked ~ span { color: var(--ink); font-weight: 600; }
.choix-pages-grille input:disabled ~ canvas { opacity: .5; }
.choix-pages-grille input:disabled { cursor: default; }
.choix-pages-grille input:focus-visible ~ canvas { outline: 3px solid var(--accent); outline-offset: 2px; }
.choix-pages-pied { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.choix-pages-compte { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.choix-pages-espace { flex: 1; }
