/* =========================================================
   Les briques du Web — feuille de style
   DA : néo-brutalisme coloré (contours épais, ombres décalées,
   une couleur par famille de technologies)
   ========================================================= */

:root {
  --ink: #15131f;
  --paper: #fff6e6;
  --paper-2: #ffeccc;
  --white: #ffffff;
  --muted: #55506a;

  /* Familles de technologies */
  --c-builder: #ff5c4d;   /* Product Builder, archi, agent IA */
  --c-net: #16c2d5;       /* Réseau, HTTP, DNS */
  --c-front: #ffcf33;     /* HTML, CSS, JS */
  --c-back: #9a6bff;      /* Serveur, PHP, Node, Symfony */
  --c-data: #2fc574;      /* Bases de données */
  --c-api: #ff8a1f;       /* API */
  --c-3d: #ff5cad;        /* WebGL, Three.js */
  --c-tools: #4b86ff;     /* Git, Docker, outils */
  --c-ops: #a6e24a;       /* Serveur, hébergement, DevOps */

  --ok: #2fc574;
  --ko: #ff5c4d;

  --bw: 3px;
  --radius: 18px;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);

  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "DM Sans", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --topbar-h: 64px;
}

.fam-builder { --c: var(--c-builder); }
.fam-net     { --c: var(--c-net); }
.fam-front   { --c: var(--c-front); }
.fam-back    { --c: var(--c-back); }
.fam-data    { --c: var(--c-data); }
.fam-api     { --c: var(--c-api); }
.fam-3d      { --c: var(--c-3d); }
.fam-tools   { --c: var(--c-tools); }
.fam-ops     { --c: var(--c-ops); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(21, 19, 31, .12) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; margin: 0 0 .4em; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
a { color: inherit; }
code, pre { font-family: var(--f-mono); }
code { background: var(--paper-2); border: 2px solid var(--ink); border-radius: 6px; padding: 0 .3em; font-size: .88em; }
mark { background: var(--c, var(--c-front)); color: var(--ink); padding: 0 .2em; border-radius: 4px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.kicker { font-family: var(--f-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: .6em; }

.card {
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: 700 1rem/1 var(--f-body);
  color: var(--ink); text-decoration: none;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  padding: .75em 1.2em;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--c, var(--c-front)); }
.btn-small { font-size: .88rem; padding: .55em .95em; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid var(--c-tools); outline-offset: 3px; }

/* ---------- Barre du haut ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 5px; width: 100%;
  background: linear-gradient(90deg, var(--c-builder), var(--c-net), var(--c-front), var(--c-back), var(--c-data), var(--c-api), var(--c-3d), var(--c-tools), var(--c-ops));
  transform-origin: 0 50%; transform: scaleX(0); z-index: 60;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--paper);
  border-bottom: var(--bw) solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.brand em { font-style: normal; background: var(--c-front); padding: 0 .25em; border-radius: 4px; }
.brand-logo { width: 30px; height: 30px; }
.chapnav { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px; justify-content: center; }
.chapnav::-webkit-scrollbar { display: none; }
.chapnav a {
  flex: none;
  min-width: 36px; height: 36px; padding: 0 10px;
  display: grid; place-items: center;
  font: 700 .9rem/1 var(--f-body);
  text-decoration: none;
  background: var(--white);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  transition: transform .12s, background .15s, box-shadow .12s;
}
.chapnav a:hover { transform: translateY(-2px); }
.chapnav a.active { background: var(--c, var(--c-front)); box-shadow: var(--shadow-sm); transform: translate(-1px, -1px); }
.speed { display: flex; align-items: center; gap: 2px; border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 6px; background: var(--white); }
.speed button { border: 0; background: none; font: 700 .8rem/1 var(--f-mono); padding: 6px 6px; border-radius: 999px; cursor: pointer; color: var(--ink); }
.speed button.on { background: var(--ink); color: var(--paper); }
.speed-ico { font-size: .9rem; }

/* ---------- Héros ---------- */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(3.2rem, 8vw, 6.4rem); font-weight: 800; letter-spacing: -.03em; }
.h1-alt { display: inline-block; background: var(--c-front); border: var(--bw) solid var(--ink); border-radius: 14px; padding: 0 .18em .04em; box-shadow: var(--shadow); transform: rotate(-2deg); margin-top: .1em; }
.hero-lead { font-size: 1.2rem; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-cta .btn-primary { --c: var(--c-builder); }

.brick-wall { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-content: center; }
.brick {
  flex: 1 1 28%;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 74px; padding: 10px 14px;
  text-decoration: none;
  background: var(--c, var(--c-front));
  border: var(--bw) solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  animation: brickDrop .7s cubic-bezier(.3, 1.4, .5, 1) both;
  animation-delay: calc(var(--i) * 70ms + 200ms);
  transition: transform .15s, box-shadow .15s;
}
.brick b { font-family: var(--f-display); font-size: 1.25rem; }
.brick small { font-family: var(--f-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.brick:hover { transform: translate(-2px, -4px) rotate(-1.5deg); box-shadow: 5px 7px 0 var(--ink); }
.brick-wide { flex-basis: 100%; flex-direction: row; align-items: baseline; justify-content: center; gap: 12px; }
@keyframes brickDrop { from { transform: translateY(-90px) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

.howto { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border: var(--bw) solid var(--ink); border-radius: 14px; padding: 14px; font-size: .92rem; }
.howto b { display: block; font-family: var(--f-display); font-size: 1.02rem; }
.howto-ico { font-size: 1.5rem; line-height: 1; }

/* ---------- Chapitres ---------- */
.chapter { padding: 88px 0; border-top: var(--bw) solid var(--ink); position: relative; }
.chapter:nth-of-type(even) { background: rgba(255, 255, 255, .45); }
.ch-head { display: flex; gap: 20px; align-items: center; margin-bottom: 40px; }
.ch-num {
  flex: none;
  width: 84px; height: 84px; display: grid; place-items: center;
  font: 800 2.6rem/1 var(--f-display);
  background: var(--c); border: var(--bw) solid var(--ink); border-radius: 22px;
  box-shadow: var(--shadow); transform: rotate(-4deg);
}
.ch-head h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0; }
.ch-keys { font-family: var(--f-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 .5em; color: var(--muted); }
.section-head { margin-bottom: 36px; }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }

.block { margin-top: 56px; }
.block:first-of-type { margin-top: 0; }
.block-tag {
  display: inline-block; margin-bottom: 14px;
  font: 700 .82rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em;
  background: var(--c); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 14px;
}
.block-intro { font-size: 1.08rem; max-width: 46em; }

.problem { padding: 28px 30px; font-size: 1.1rem; max-width: 820px; }
.big-idea { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; line-height: 1.25; margin: .6em 0; }
.chat-bubble {
  display: inline-block; font-family: var(--f-mono); font-size: 1rem;
  background: var(--ink); color: var(--paper);
  padding: 12px 18px; border-radius: 16px 16px 16px 4px;
}
.takeaway { font-size: 1.12rem; margin: 28px 0 22px; max-width: 46em; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.col-card { padding: 24px 26px; }
.col-card h3 { font-size: 1.45rem; }
.col-accent { background: color-mix(in srgb, var(--c) 22%, white); }
.ticks, .pros, .cons { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li, .pros li, .cons li { position: relative; padding-left: 1.7em; margin-bottom: .45em; }
.ticks li::before { content: "→"; position: absolute; left: 0; font-weight: 700; }
.pros li::before { content: "＋"; position: absolute; left: 0; font-weight: 800; color: #12924f; }
.cons li::before { content: "－"; position: absolute; left: 0; font-weight: 800; color: #d23a2c; }
.ex { font-size: .95rem; background: var(--paper); border: 2px dashed var(--ink); border-radius: 10px; padding: 8px 12px; }

/* ---------- Léa ---------- */
.lea-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 28px; align-items: start; }
.lea-card { padding: 28px; display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: start; transform: rotate(-.6deg); }
.lea-avatar { width: 120px; height: 120px; }
.lea-title { font-size: 2.6rem; }
.needs { padding: 26px; }
.needs h3 { font-size: 1.5rem; }
.needs-list { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; }
.needs-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  text-decoration: none; padding: 10px 12px;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--paper);
  transition: transform .12s, background .12s;
}
.needs-list a:hover { transform: translateX(4px); background: var(--white); }
.chip {
  flex: none; font: 700 .72rem/1 var(--f-mono); font-style: normal; text-transform: uppercase; letter-spacing: .04em;
  background: var(--c); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 9px; white-space: nowrap;
}
.needs-foot { margin: 0; padding-top: 14px; border-top: 2px dashed var(--ink); }

/* ---------- Chapitre 0 : cycle ---------- */
.cycle { display: grid; grid-template-columns: 340px 1fr; gap: 36px; align-items: center; }
.cycle-ring { position: relative; width: 320px; height: 320px; margin: 0 auto; }
.cycle-arrows { position: absolute; inset: 10px; width: 300px; height: 300px; }
.cycle-dash { animation: dashSpin 18s linear infinite; transform-origin: 150px 150px; }
@keyframes dashSpin { to { transform: rotate(360deg); } }
.cycle-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 128px; height: 128px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: var(--ink); color: var(--paper); font-family: var(--f-display); font-size: 1.1rem; line-height: 1.1;
}
.cycle-center small { font-family: var(--f-mono); font-size: .7rem; color: var(--c-front); margin-top: 6px; }
.cycle-step {
  position: absolute; width: 112px; height: 74px; margin: -37px 0 0 -56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: 700 .92rem/1 var(--f-body); color: var(--ink);
  background: var(--white); border: var(--bw) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s;
}
.cycle-step span { font-size: 1.4rem; }
.cycle-step:hover { transform: scale(1.06); }
.cycle-step.on { background: var(--c); transform: scale(1.1) rotate(-3deg); box-shadow: 5px 5px 0 var(--ink); }
.cycle-step.s1 { left: 50%; top: 12%; }
.cycle-step.s2 { left: 88%; top: 50%; }
.cycle-step.s3 { left: 50%; top: 88%; }
.cycle-step.s4 { left: 12%; top: 50%; }
.cycle-detail { padding: 26px 28px; min-height: 230px; }
.cycle-detail h3 { font-size: 1.7rem; }
.cycle-detail .lea-says { background: var(--paper); border-left: 6px solid var(--c); border-radius: 0 10px 10px 0; padding: 10px 14px; margin: 12px 0 0; }
.cycle-detail .ai-says { font-size: .95rem; color: var(--muted); margin-top: 12px; }
.cycle-detail.swap { animation: pop .35s ease; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Chapitre 1 : analogie à retourner ---------- */
.flip-toolbar { margin-bottom: 16px; }
.flip-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; position: relative; }
.flip { perspective: 900px; background: none; border: 0; padding: 0; height: 168px; cursor: pointer; font: inherit; color: inherit; text-align: center; }
.flip-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.4, 1.5, .5, 1); transform-style: preserve-3d; }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px;
  border: var(--bw) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.face.front { background: var(--paper-2); }
.face.back { background: var(--c); transform: rotateY(180deg); }
.face i { font-style: normal; font-size: 2.2rem; line-height: 1.1; }
.face b { font-family: var(--f-display); font-size: 1.05rem; line-height: 1.1; }
.face small { font-size: .8rem; color: var(--muted); }
.face.back small { color: var(--ink); }
.flip-grid::before {
  content: ""; position: absolute; left: 4%; right: 4%; top: 50%; height: 3px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 18px); z-index: -1;
}

/* ---------- Chapitre 1 : l'expérience « voyage » ---------- */
.voyage { padding: 20px; overflow: hidden; }
.scenarios { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.scenarios button {
  font: 700 .9rem/1 var(--f-body); color: var(--ink);
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 9px 14px; cursor: pointer;
  transition: background .15s, transform .12s;
}
.scenarios button:hover { transform: translateY(-2px); }
.scenarios button.on { background: var(--ink); color: var(--paper); }

.stage {
  position: relative;
  display: grid; grid-template-columns: 1.55fr 1fr 1fr 1fr; grid-template-rows: auto;
  column-gap: 14px; padding: 76px 10px 0;
  min-height: 380px;
}
.zone { grid-row: 1; border: 2.5px dashed rgba(21, 19, 31, .45); border-radius: 18px; margin-top: -60px; position: relative; z-index: 0; }
.zone-client { grid-column: 1; background: rgba(255, 207, 51, .14); }
.zone-net { grid-column: 2; background: rgba(22, 194, 213, .12); }
.zone-host { grid-column: 3 / 5; background: rgba(154, 107, 255, .12); }
.zone-label { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font: 700 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; color: var(--muted); }

.actor { grid-row: 1; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0 4px 44px; transition: opacity .3s, filter .3s; }
.actor-browser { grid-column: 1; }
.actor-dns { grid-column: 2; }
.actor-server { grid-column: 3; }
.actor-db { grid-column: 4; }
.actor-icon { position: relative; width: 96px; height: 96px; transition: transform .25s; }
.actor-icon svg { width: 100%; height: 100%; }
.actor-name { margin-top: 10px; font: 700 .9rem/1.2 var(--f-body); text-align: center; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.actor.is-active .actor-icon { transform: scale(1.1) translateY(-4px); }
.actor.is-active .actor-name { background: var(--ink); color: var(--paper); }
.actor.is-idle { opacity: .35; filter: grayscale(1); }
.actor-server .led { fill: #2fc574; }
.actor-server.is-active .led { animation: blink .35s steps(2) infinite; }
.actor-server.is-active .led.l2 { animation-delay: .12s; }
.actor-server.is-active .led.l3 { animation-delay: .24s; }
@keyframes blink { 50% { fill: #ffcf33; } }
.zzz { position: absolute; right: -10px; top: -14px; font-size: 1.6rem; display: none; animation: float 2s ease-in-out infinite; }
.actor-server.is-down .zzz { display: block; }
.actor-server.is-down .actor-icon svg { filter: grayscale(1) brightness(.85); }
.actor-server.is-down .led { fill: #ff5c4d; animation: none; }
@keyframes float { 50% { transform: translateY(-6px); } }

.bubble {
  position: absolute; left: 50%; top: -12px; z-index: 3;
  transform: translate(-50%, -100%) scale(.6); opacity: 0;
  max-width: 220px; width: max-content;
  font: 600 .8rem/1.3 var(--f-mono); text-align: center;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 12px; padding: 7px 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), opacity .2s;
  pointer-events: none;
}
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 12px; background: var(--white); border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.bubble.show { transform: translate(-50%, -100%) scale(1); opacity: 1; }
.actor-browser .bubble { top: -12px; }

/* Mini navigateur */
.mini-browser {
  width: 100%; max-width: 290px; height: 200px;
  background: var(--white); border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm);
  overflow: hidden; display: flex; flex-direction: column;
}
.actor-browser.is-active .mini-browser { transform: translateY(-4px); }
.mb-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 2.5px solid var(--ink); background: var(--paper-2); }
.mb-dots { display: flex; gap: 3px; }
.mb-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--white); }
.mb-dots i:nth-child(1) { background: var(--c-builder); }
.mb-dots i:nth-child(2) { background: var(--c-front); }
.mb-dots i:nth-child(3) { background: var(--c-data); }
.mb-url { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; font: 600 .7rem/1 var(--f-mono); background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 8px; white-space: nowrap; overflow: hidden; }
.mb-lock { font-size: .6rem; }
.mb-caret { width: 2px; height: 11px; background: var(--ink); display: none; animation: caret .8s steps(2) infinite; }
.mini-browser[data-state="typing"] .mb-caret { display: inline-block; }
@keyframes caret { 50% { opacity: 0; } }
.mb-spin { width: 14px; height: 14px; border: 2.5px solid var(--ink); border-right-color: transparent; border-radius: 50%; visibility: hidden; animation: spin .7s linear infinite; }
.mini-browser[data-state="loading"] .mb-spin { visibility: visible; }
@keyframes spin { to { transform: rotate(360deg); } }
.mb-view { flex: 1; overflow: hidden; position: relative; font-size: .72rem; }
.mini-browser[data-state="loading"] .mb-view::after {
  content: ""; position: absolute; inset: 10px;
  background: repeating-linear-gradient(180deg, #eee 0 10px, transparent 10px 20px);
  animation: shimmer 1s ease-in-out infinite alternate;
}
@keyframes shimmer { from { opacity: .4; } to { opacity: 1; } }

/* La page dans le mini navigateur : 3 couches (HTML brut → CSS → JS) */
.mbp { padding: 8px 10px; height: 100%; }
.mbp.raw { font-family: "Times New Roman", serif; font-size: .78rem; line-height: 1.25; }
.mbp.raw h4 { font-size: 1.05rem; margin: 0 0 2px; font-weight: 700; }
.mbp.raw p { margin: 0 0 4px; }
.mbp.raw ul { margin: 0; padding-left: 16px; }
.mbp.raw button { all: unset; color: #0000ee; text-decoration: underline; font-size: .74rem; }
.mbp.styled { font-family: var(--f-body); background: linear-gradient(160deg, #fff6e6, #ffeccc); }
.mbp.styled h4 { font: 800 .95rem/1 var(--f-display); margin: 0 0 2px; }
.mbp.styled h4::before { content: "🥁 "; }
.mbp.styled p { font-size: .66rem; color: var(--muted); margin: 0 0 6px; }
.mbp.styled ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.mbp.styled li { display: flex; justify-content: space-between; align-items: center; background: var(--white); border: 2px solid var(--ink); border-radius: 8px; padding: 3px 6px; font-size: .68rem; font-weight: 700; }
.mbp.styled button { font: 700 .6rem/1 var(--f-body); background: var(--c-front); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 6px; color: var(--ink); }
.mbp.interactive button { cursor: pointer; animation: nudge 1.4s ease-in-out infinite; }
.mbp.interactive li:nth-child(2) button { animation-delay: .2s; }
.mbp.interactive li:nth-child(3) button { animation-delay: .4s; }
.mbp.interactive button.done { background: var(--c-data); animation: none; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: scale(1.12); } }
.mbp-error { display: grid; place-content: center; text-align: center; height: 100%; padding: 10px; font-family: var(--f-body); }
.mbp-error .big { font: 800 1.9rem/1 var(--f-display); }
.mbp-error small { color: var(--muted); font-size: .66rem; }
.mbp-error.e404 { background: #fff1d6; }
.mbp-error.down { background: #f1f1f4; }
.layer-badge { position: absolute; right: 6px; top: 6px; font: 700 .58rem/1 var(--f-mono); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 3px 6px; }

/* Paquets qui voyagent */
.packet-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.packet {
  position: absolute; left: 0; top: 0;
  font: 700 .74rem/1 var(--f-mono); white-space: nowrap;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 10px;
  padding: 7px 10px; box-shadow: var(--shadow-sm);
  will-change: transform;
}
.packet::before { margin-right: 5px; }
.packet.req { background: var(--c-front); }
.packet.req::before { content: "✉️"; }
.packet.res { background: var(--c-data); }
.packet.res::before { content: "📦"; }
.packet.dns { background: var(--c-net); }
.packet.dns::before { content: "❓"; }
.packet.dnsr { background: var(--c-net); }
.packet.dnsr::before { content: "📍"; }
.packet.sql { background: #c8f5dc; }
.packet.sql::before { content: "🔎"; }
.packet.warn { background: #ffd79a; }
.packet.warn::before { content: "📦"; }
.packet.lost { background: var(--white); border-style: dashed; }
.packet.lost::before { content: "✉️"; }
.packet.mini { font-size: .64rem; padding: 4px 7px; }
.packet.mini::before { content: ""; margin: 0; }

/* Narration */
.narration { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-top: 18px; padding-top: 18px; border-top: 2.5px dashed var(--ink); }
.narr-step { font: 700 .78rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; display: inline-block; background: var(--c); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 10px; margin-bottom: 10px; }
.narration h3 { font-size: 1.55rem; }
.narr-side { display: grid; gap: 10px; align-content: start; }
.narr-analogy { background: var(--paper-2); border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; font-size: .95rem; }
.narr-analogy b, .narr-msg b { display: block; font: 700 .74rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.narr-msg { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 10px 12px; }
.narr-msg b { color: var(--c-front); }
.narr-msg pre { margin: 0; font-size: .78rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.narration.swap .narr-main, .narration.swap .narr-side { animation: pop .3s ease; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.controls #vNext { --c: var(--c-net); }
.dots { display: flex; gap: 6px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.dots li { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--white); transition: background .2s, transform .2s; }
.dots li.done { background: var(--c); }
.dots li.now { background: var(--ink); transform: scale(1.25); }

/* ---------- Tri navigateur / serveur ---------- */
.sorter { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.sort-item { padding: 16px 18px; border: var(--bw) solid var(--ink); border-radius: 16px; background: var(--white); box-shadow: var(--shadow-sm); transition: background .2s; }
.sort-item p { font-weight: 700; margin: 0 0 10px; }
.sort-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sort-btns button { font: 700 .86rem/1 var(--f-body); color: var(--ink); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.sort-btns button:hover:not(:disabled) { background: var(--paper-2); }
.sort-btns button:disabled { cursor: default; }
.sort-btns button.pick-ok { background: var(--ok); }
.sort-btns button.pick-ko { background: var(--ko); }
.sort-btns button.is-answer { outline: 3px dashed var(--ink); outline-offset: 2px; }
.sort-item .why { display: none; margin: 10px 0 0; font-size: .93rem; }
.sort-item.answered .why { display: block; animation: pop .3s ease; }
.sort-item.right { background: #e7fbef; }
.sort-item.wrong { background: #ffe9e6; }
.sorter-score { font: 700 1.05rem/1.3 var(--f-display); margin-top: 16px; min-height: 1.3em; }

/* ---------- À retenir ---------- */
.remember { padding: 22px 26px; background: color-mix(in srgb, var(--c) 18%, white); }
.remember ul { margin: 0; padding-left: 1.2em; }
.remember li { margin-bottom: .55em; }
.code { font: 700 .82rem/1 var(--f-mono); border: 2px solid var(--ink); border-radius: 6px; padding: 2px 6px; }
.code.ok { background: var(--c-data); }
.code.warn { background: var(--c-front); }
.code.err { background: var(--c-builder); }

/* ---------- Prompt annoté ---------- */
.prompt { padding: 0; overflow: hidden; max-width: 860px; }
.prompt-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--ink); color: var(--paper); font: 700 .78rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; }
.prompt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-data); }
.prompt-body { padding: 20px 22px 6px; font-size: 1.08rem; line-height: 1.85; margin: 0; }
.anno { background: color-mix(in srgb, var(--c) 30%, white); border-bottom: 3px solid var(--c); border-radius: 4px; padding: 1px 3px; cursor: pointer; transition: background .15s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.anno:hover, .anno.on { background: var(--c); }
.anno-note { margin: 12px 22px 20px; padding: 12px 14px; border: 2.5px dashed var(--ink); border-radius: 12px; background: var(--paper); font-size: .98rem; }
.anno-note.swap { animation: pop .3s ease; }

/* ---------- Quiz ---------- */
.quiz { display: grid; gap: 18px; max-width: 860px; }
.q { padding: 20px 22px; }
.q-num { font: 700 .74rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.q h4 { font: 700 1.2rem/1.3 var(--f-display); margin: 6px 0 14px; }
.q-choices { display: grid; gap: 8px; }
.q-choices button {
  text-align: left; font: 500 1rem/1.35 var(--f-body); color: var(--ink);
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; padding: 11px 14px; cursor: pointer;
  transition: transform .12s, background .15s;
}
.q-choices button:hover:not(:disabled) { transform: translateX(4px); background: var(--white); }
.q-choices button:disabled { cursor: default; }
.q-choices button.good { background: var(--ok); font-weight: 700; }
.q-choices button.bad { background: var(--ko); }
.q-choices button.dim { opacity: .55; }
.q-why { margin: 12px 0 0; padding: 10px 14px; border-left: 6px solid var(--ink); background: var(--paper-2); border-radius: 0 10px 10px 0; font-size: .97rem; animation: pop .3s ease; }
.q-why.good { border-color: #12924f; }
.q-why.bad { border-color: #d23a2c; }
.q-retry { margin-top: 10px; }
.quiz-end { padding: 22px; text-align: center; background: var(--c); }
.quiz-end h4 { font: 800 1.6rem/1.1 var(--f-display); margin: 0 0 6px; }

/* ---------- Chapitres à venir ---------- */
.upcoming { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.up { padding: 22px 22px 20px; position: relative; overflow: hidden; }
.up::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 10px; background: var(--c); border-bottom: 2.5px solid var(--ink); }
.up-num { display: inline-grid; place-items: center; width: 46px; height: 46px; margin: 10px 0 12px; font: 800 1.4rem/1 var(--f-display); background: var(--c); border: var(--bw) solid var(--ink); border-radius: 12px; }
.up h3 { font-size: 1.35rem; }
.up-pb { font-style: italic; color: var(--muted); }
.soon { font: 700 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; border: 2px dashed var(--ink); border-radius: 999px; padding: 5px 9px; }
.up-foot { margin-top: 30px; }

/* ---------- Pied de page ---------- */
.footer { border-top: var(--bw) solid var(--ink); padding: 32px 0 96px; background: var(--ink); color: var(--paper); }
.footer .muted { color: #b9b4c9; font-size: .9rem; }

/* ---------- Carte (tiroir) ---------- */
.map-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  font: 700 1rem/1 var(--f-body); color: var(--ink);
  background: var(--c-front); border: var(--bw) solid var(--ink); border-radius: 999px; padding: 12px 16px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s;
}
.map-fab:hover { transform: translate(-2px, -2px) rotate(-2deg); }
.map-fab b { font-family: var(--f-mono); font-size: .85rem; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 8px; }
.map-fab.bump { animation: bump .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 40% { transform: scale(1.25) rotate(-6deg); } }

.drawer-overlay { position: fixed; inset: 0; background: rgba(21, 19, 31, .45); z-index: 70; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(480px, 100%); overflow-y: auto;
  background: var(--paper); border-left: var(--bw) solid var(--ink);
  padding: 22px 22px 32px;
  animation: slideIn .35s cubic-bezier(.3, 1.2, .5, 1);
}
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer-head h2 { font-size: 1.7rem; margin: 0; }
.map-progress { display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; }
.map-bar { flex: 1; height: 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; }
.map-bar span { display: block; height: 100%; width: 0; background: var(--c-data); transition: width .5s; }
.map { display: grid; gap: 12px; margin-bottom: 18px; }
.map-zone { border: 2.5px dashed var(--ink); border-radius: 16px; padding: 12px; background: rgba(255, 255, 255, .6); }
.map-zone h3 { font: 700 .74rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; margin: 0 0 10px; }
.map-zone.solo { border-style: solid; text-align: center; }
.map-bricks { display: flex; flex-wrap: wrap; gap: 8px; }
.map-zone.solo .map-bricks { justify-content: center; }
.map-arrow { text-align: center; font: 700 .8rem/1 var(--f-mono); color: var(--muted); }
.mb-brick {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 .86rem/1 var(--f-body);
  padding: 8px 10px; border-radius: 10px;
  border: 2.5px dashed rgba(21, 19, 31, .4); color: rgba(21, 19, 31, .45); background: transparent;
}
.mb-brick small { font: 600 .66rem/1 var(--f-mono); }
.mb-brick.on { border: 2.5px solid var(--ink); color: var(--ink); background: var(--c); box-shadow: var(--shadow-sm); }
.mb-brick.fresh { animation: brickDrop .7s cubic-bezier(.3, 1.4, .5, 1) both; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 999px; padding: 10px 10px 10px 18px;
  box-shadow: 6px 6px 0 var(--c-front);
  font-weight: 700;
  animation: toastIn .45s cubic-bezier(.3, 1.5, .5, 1);
}
.toast .btn { padding: .45em .9em; font-size: .85rem; }
@keyframes toastIn { from { transform: translate(-50%, 120%); } }

/* ---------- Apparition au défilement ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .3, 1); }
.reveal.in { opacity: 1; transform: none; }
.lea-card.reveal.in { transform: rotate(-.6deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .howto { grid-template-columns: repeat(2, 1fr); }
  .lea-grid { grid-template-columns: 1fr; }
  .flip-grid { grid-template-columns: repeat(3, 1fr); }
  .flip-grid::before { display: none; }
  .cycle { grid-template-columns: 1fr; }
  .chapnav { justify-content: flex-start; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .brand span { display: none; }
  .speed-ico { display: none; }
  .speed button { padding: 5px 4px; }
  .hero { padding: 36px 0 52px; }
  .howto { grid-template-columns: 1fr; margin-top: 40px; }
  .chapter { padding: 64px 0; }
  .ch-num { width: 64px; height: 64px; font-size: 2rem; border-radius: 16px; }
  .ch-head { gap: 14px; }
  .lea-card { grid-template-columns: 1fr; transform: none; }
  .lea-card.reveal.in { transform: none; }
  .lea-avatar { width: 96px; height: 96px; }
  .needs-list a { flex-direction: column; align-items: flex-start; gap: 6px; }
  .two-col, .sorter, .narration { grid-template-columns: 1fr; }
  .flip-grid { grid-template-columns: repeat(2, 1fr); }
  .problem { padding: 22px 20px; }
  .big-idea { font-size: 1.25rem; }
  .voyage { padding: 14px; }

  .stage { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto auto; padding: 70px 4px 0; row-gap: 74px; column-gap: 8px; min-height: 0; }
  .zone { margin-top: -58px; }
  .zone-client { grid-column: 1 / 4; grid-row: 1; }
  .zone-net { grid-column: 1; grid-row: 2; }
  .zone-host { grid-column: 2 / 4; grid-row: 2; }
  .actor-browser { grid-column: 1 / 4; grid-row: 1; }
  .actor-dns { grid-column: 1; grid-row: 2; }
  .actor-server { grid-column: 2; grid-row: 2; }
  .actor-db { grid-column: 3; grid-row: 2; }
  .actor { padding-bottom: 36px; }
  .actor-icon { width: 64px; height: 64px; }
  .actor-icon.mini-browser { width: 100%; height: 180px; max-width: 300px; }
  .actor-name { font-size: .72rem; padding: 4px 7px; white-space: normal; }
  .bubble { max-width: 150px; font-size: .7rem; }
  .packet { font-size: .64rem; padding: 5px 7px; }
  .dots { margin-left: 0; width: 100%; }
  .controls .btn { flex: 1 1 auto; }
  .map-fab span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brick, .mb-brick.fresh { animation: none; }
  .cycle-dash, .zzz, .mbp.interactive button { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   Composants des chapitres 2 à 12
   ========================================================= */
.small { font-size: .88rem; }
.mini-title { font: 700 .74rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
.swap { animation: pop .3s ease; }

/* Sélecteurs et interrupteurs */
.seg, .api-reqs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.seg button, .api-reqs button {
  font: 700 .9rem/1 var(--f-body); color: var(--ink);
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 9px 14px; cursor: pointer;
  transition: background .15s, transform .12s;
}
.seg button:hover, .api-reqs button:hover { transform: translateY(-2px); }
.seg button.on, .api-reqs button.on { background: var(--ink); color: var(--paper); }
.tog { position: relative; display: inline-flex; cursor: pointer; }
.tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tog span { font: 700 .92rem/1 var(--f-body); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 9px 14px; transition: background .15s; }
.tog input:checked + span { background: var(--c, var(--c-front)); box-shadow: var(--shadow-sm); }
.tog input:not(:checked) + span { text-decoration: line-through; opacity: .7; }
.tog.small-tog input:not(:checked) + span, .brief-tog input:not(:checked) + span { text-decoration: none; opacity: 1; }
.tog input:focus-visible + span { outline: 3px solid var(--c-tools); outline-offset: 3px; }

/* Analogies */
.ana-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ana-grid.five { grid-template-columns: repeat(5, 1fr); }
.ana { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 14px; background: var(--white); border: var(--bw) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm); }
.ana i { font-style: normal; font-size: 2.3rem; line-height: 1; }
.ana b { font-family: var(--f-display); font-size: 1.05rem; line-height: 1.15; }
.ana-arrow { font-weight: 800; color: var(--muted); }
.ana small { color: var(--muted); font-size: .84rem; line-height: 1.35; }

/* Fiches d'identité */
.id-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.id-grid.two { grid-template-columns: 1fr 1fr; }
.idcard { padding: 20px 22px; }
.idcard header { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2.5px dashed var(--ink); }
.idcard h3 { margin: 0; font-size: 1.5rem; }
.idcard header small { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); }
.id-logo { flex: none; width: 54px; height: 54px; display: grid; place-items: center; font-size: 1.8rem; background: var(--c); border: var(--bw) solid var(--ink); border-radius: 14px; transform: rotate(-4deg); }
.idcard dl { margin: 0; display: grid; grid-template-columns: 7.5em 1fr; gap: 8px 12px; font-size: .95rem; }
.idcard dt { font: 700 .72rem/1.5 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.idcard dd { margin: 0; }
.choose { padding: 20px 24px; margin-top: 20px; }
.choose-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.choose-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); }

/* Code */
.codebox { margin: 0; background: var(--ink); color: #f4f1ff; border-radius: 12px; padding: 12px 14px; font-size: .74rem; line-height: 1.55; overflow-x: auto; white-space: pre; }

/* Ch2 · laboratoire */
.lab { padding: 20px; }
.lab-toggles { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.lab-main { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.lab-page { position: relative; min-height: 280px; background: var(--white); border: var(--bw) solid var(--ink); border-radius: 14px; overflow: hidden; }
.lp { height: 100%; background: linear-gradient(160deg, #fff6e6, #ffeccc); font-family: var(--f-body); }
.lp-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--ink); color: var(--paper); }
.lp-logo { font-family: var(--f-display); }
.lp-nav a { color: var(--c-front); font-size: .82rem; margin-left: 10px; text-decoration: none; }
.lp-main { padding: 16px; }
.lp-main h3 { font-size: 1.5rem; margin: 0 0 2px; }
.lp-main p { margin: 0 0 12px; color: var(--muted); }
.lp-slots { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.slot { font: 700 .95rem/1 var(--f-body); color: var(--ink); background: var(--c-front); border: 2.5px solid var(--ink); border-radius: 999px; padding: 9px 14px; cursor: pointer; transition: transform .12s, background .15s; }
.slot:hover { transform: translateY(-2px); }
.slot.selected { background: var(--c-data); box-shadow: var(--shadow-sm); }
.slot.selected::before { content: "✓ "; }
.lp-count { font-weight: 700; color: var(--ink) !important; }
.lp-empty { display: none; position: absolute; inset: 0; place-content: center; text-align: center; font: 700 1.2rem/1.3 var(--f-display); padding: 20px; }
.lab-page.nohtml .lp { display: none; }
.lab-page.nohtml .lp-empty { display: grid; }
.lab-page.nocss .lp, .lab-page.nocss .lp * { all: revert; }
.lab-page.nocss .lp { display: block; padding: 8px; font-family: "Times New Roman", serif; background: #fff; }
.lab-page.nocss .lp .slot { cursor: pointer; }
.dom-hl { outline: 3px dashed var(--c-builder) !important; outline-offset: 2px !important; }
.lab-dom { background: var(--ink); color: #d9d4f1; border-radius: 14px; padding: 14px; overflow: auto; }
.lab-dom .mini-title { color: var(--c-front); }
.dom-tree { list-style: none; margin: 0; padding: 0; font: .74rem/1.7 var(--f-mono); }
.dom-tree li { padding-left: calc(var(--d, 0) * 14px); border-radius: 4px; cursor: default; white-space: nowrap; }
.dom-tree li:hover, .dom-tree li:focus { background: rgba(255, 255, 255, .12); outline: none; }
.dom-tree i { font-style: normal; color: #c9a7ff; }
.dom-tree span { color: #7ee0a8; }
.dom-tree li.flash { animation: flashBg 1.4s ease; }
@keyframes flashBg { 0%, 40% { background: rgba(255, 207, 51, .55); } 100% { background: transparent; } }
.lab-msg { margin: 14px 0; padding: 10px 14px; border: 2.5px dashed var(--ink); border-radius: 12px; background: var(--paper); }
.lab-code { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.code-card { background: var(--ink); color: #f4f1ff; border-radius: 12px; padding: 10px 12px; transition: opacity .2s; }
.code-card b { display: block; font: 700 .72rem/1 var(--f-mono); color: var(--c-front); margin-bottom: 6px; }
.code-card pre { margin: 0; font-size: .72rem; line-height: 1.45; }
.code-card.off { opacity: .25; }

/* Ch3 · fabrique de pages */
.fab { padding: 20px; }
.fab-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.fab-cols { display: grid; grid-template-columns: 1.45fr auto 1fr 1fr; gap: 12px; align-items: start; }
.fab-col { min-width: 0; }
.fab .codebox { min-height: 250px; }
.ln { display: block; padding: 0 6px; border-left: 3px solid transparent; border-radius: 3px; transition: background .2s, opacity .2s; }
.ln.run { background: rgba(255, 207, 51, .18); border-left-color: var(--c-front); }
.ln.skip { opacity: .3; }
.codebox.out { color: #7ee0a8; white-space: pre-wrap; }
.fab-gear { align-self: center; font-size: 2rem; }
.fab-gear.spin { animation: spin 1s linear infinite; }
.fab-view { min-height: 250px; background: var(--white); border: var(--bw) solid var(--ink); border-radius: 12px; padding: 14px; opacity: .3; }
.fab-view.show { opacity: 1; animation: pop .35s ease; }
.fab-view h4 { font: 800 1.2rem/1.1 var(--f-display); margin: 0 0 10px; }
.fab-view ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.fab-view li { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 10px; font-size: .9rem; font-weight: 700; }
.fv-btn { display: inline-block; margin-top: 8px; background: var(--c-back); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 700; }
.fab-note { margin: 14px 0 0; padding: 10px 14px; background: color-mix(in srgb, var(--c) 18%, white); border-radius: 12px; border: 2px solid var(--ink); }
.fab-note:empty { display: none; }

/* Ch4 · framework */
.fw { padding: 20px 22px; }
.fw-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.fw-list li { display: grid; grid-template-columns: 1fr 140px 190px; gap: 12px; align-items: center; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); transition: background .25s; }
.fw-list li.given { background: #eafbf0; }
.fw-list li.core { background: #fff3c4; }
.fw-mini { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; }
.fw-mini i { display: block; height: 100%; background: var(--c-builder); transition: width .5s cubic-bezier(.3, 1.2, .5, 1); }
.fw-list li.given .fw-mini i { background: var(--c-data); }
.fw-list li.core .fw-mini i { background: var(--c-front); }
.fw-st { font: 700 .72rem/1 var(--f-mono); font-style: normal; text-align: center; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 8px; }
.fw-st.todo { background: #ffd9d4; }
.fw-st.ok { background: var(--c-data); }
.fw-st.core { background: var(--c-front); }
.fw-total { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font-weight: 700; }
.fw-bar { height: 22px; border: var(--bw) solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; }
.fw-bar span { display: block; height: 100%; background: var(--c-builder); transition: width .6s cubic-bezier(.3, 1.2, .5, 1), background .3s; }
.fw-bar span.low { background: var(--c-data); }
.fw-total b { font: 800 1.3rem/1 var(--f-display); }

/* Moteur flow */
.flow { padding: 20px; overflow: hidden; }
.flow-stage { position: relative; padding: 46px 0 10px; }
.flow-nodes { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; }
.fnode { width: 128px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px 8px; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 16px; transition: background .2s, transform .2s, box-shadow .2s; }
.fnode span { font-size: 1.8rem; line-height: 1; }
.fnode b { font-size: .84rem; line-height: 1.2; }
.fnode.on { background: var(--c); transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.fnode.ping { animation: ping .45s ease; }
@keyframes ping { 50% { transform: translateY(-4px) scale(1.08); } }
.flow-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.flow-cap { margin-top: 14px; padding-top: 14px; border-top: 2.5px dashed var(--ink); min-height: 120px; }
.flow-cap h3 { font-size: 1.4rem; }
.flow-cap p:last-child { margin: 0; }
.flow .controls .btn-primary { --c: inherit; }

/* Ch5 · base de données */
.db { padding: 20px; }
.db-query { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; font-weight: 700; }
.db-query select { font: 700 .92rem/1 var(--f-body); color: var(--ink); background: var(--white); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 12px; }
.db-tables { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 12px; }
.dbt { background: var(--white); border: 2.5px solid var(--ink); border-radius: 12px; padding: 10px; min-width: 0; }
.dbt-name { font: 700 .8rem/1 var(--f-mono); margin: 0 0 8px; }
.dbt-scroll { overflow-x: auto; }
.dbt table, .db-result table { width: 100%; border-collapse: collapse; font: .76rem/1.3 var(--f-mono); }
.dbt th, .db-result th { text-align: left; background: var(--c); border-bottom: 2px solid var(--ink); padding: 5px 6px; white-space: nowrap; }
.dbt td, .db-result td { padding: 5px 6px; border-bottom: 1px solid #ddd; white-space: nowrap; }
.dbt tr { transition: opacity .25s, background .25s; }
.dbt tr.hit { background: #d8f7e4; }
.dbt tr.miss { opacity: .3; }
.dbt tr.rel { background: var(--c-front) !important; opacity: 1; }
[data-table="reservations"] tbody tr { cursor: pointer; }
.db-out { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.db-sql { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 12px; }
.db-sql b, .db-result > b { display: block; font: 700 .74rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.db-sql b { color: var(--c-data); }
.db-sql pre { margin: 0; font-size: .8rem; line-height: 1.5; white-space: pre-wrap; }
.db-result { background: var(--white); border: 2.5px solid var(--ink); border-radius: 12px; padding: 12px; min-width: 0; }
.db-hint { margin: 14px 0 0; padding: 10px 14px; border: 2.5px dashed var(--ink); border-radius: 12px; background: var(--paper); }
.dbl { padding: 20px; }
.dbl-stage { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 14px; align-items: center; margin-bottom: 16px; }
.dbl-phone { display: flex; flex-direction: column; gap: 4px; text-align: center; padding: 16px 12px; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 22px; min-height: 130px; justify-content: center; transition: background .25s; }
.dbl-phone span { font-size: .85rem; color: var(--muted); }
.dbl-phone em { font-style: normal; font-weight: 700; min-height: 1.4em; }
.dbl-phone.sending { animation: float 1s ease-in-out infinite; }
.dbl-phone.ok { background: #d8f7e4; animation: none; }
.dbl-phone.ko { background: #ffd9d4; animation: none; }
.dbl-store { background: var(--white); border: var(--bw) solid var(--ink); border-radius: 14px; padding: 14px; min-height: 150px; }
.dbl-cell { font: 700 .95rem/1.3 var(--f-mono); padding: 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); }
.dbl-cell.flash { animation: flashBg 1s ease; }
.dbl-cell.bad { background: #ffd9d4; }
.dbl-cell.good { background: #d8f7e4; }
.dbl-log p { margin: 8px 0 0; font-size: .85rem; }
.dbl-msg { margin: 14px 0 0; font-weight: 700; min-height: 1.4em; text-align: center; }

/* Ch6 · console API */
.api { padding: 20px; }
.api-stage { display: grid; grid-template-columns: 150px 1fr 150px; gap: 10px; align-items: center; margin: 6px 0 18px; }
.api-node { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 8px; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 16px; }
.api-node span { font-size: 1.9rem; line-height: 1; }
.api-node b { font-size: .9rem; }
.api-node small { font-size: .72rem; color: var(--muted); }
.api-wire { position: relative; height: 44px; }
.api-wire::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 3px dashed var(--ink); }
.api-packet { position: absolute; left: 0; top: 50%; margin-top: -15px; height: 30px; display: none; align-items: center; font: 700 .72rem/1 var(--f-mono); white-space: nowrap; padding: 0 10px; border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow-sm); background: var(--white); }
.api-packet.show { display: inline-flex; }
.api-packet.req { background: var(--c-front); }
.api-packet.res { background: var(--c-data); }
.api-packet.ko { background: var(--c-builder); }
.api-panels { display: grid; grid-template-columns: 1.2fr 1fr .9fr; gap: 12px; }
.api-panel { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 12px; min-width: 0; }
.api-panel b { display: block; font: 700 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--c-front); margin-bottom: 8px; }
.api-panel pre { margin: 0; font-size: .74rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.api-result { background: var(--white); color: var(--ink); border: 2.5px solid var(--ink); }
.api-result b { color: var(--ink); }
.api-note { margin: 14px 0 0; min-height: 1.4em; }
.ao-card { text-align: center; font-weight: 700; padding: 14px; border: 2.5px solid var(--ink); border-radius: 12px; }
.ao-card b { font: 800 1.5rem/1.2 var(--f-display); }
.ao-card.ok { background: #d8f7e4; }
.ao-card.ko { background: #ffd9d4; }
.ao-phone { width: 140px; margin: 0 auto; padding: 18px 10px; border: var(--bw) solid var(--ink); border-radius: 22px; background: var(--paper); }
.ao-sms { background: var(--c-tools); color: #fff; border-radius: 14px 14px 14px 4px; padding: 8px 10px; font-size: .78rem; }
.ao-map { position: relative; height: 120px; border: 2.5px solid var(--ink); border-radius: 12px; background: #e9f3e1; background-image: linear-gradient(90deg, rgba(0,0,0,.08) 2px, transparent 2px), linear-gradient(rgba(0,0,0,.08) 2px, transparent 2px); background-size: 26px 26px; display: grid; place-content: center; text-align: center; }
.ao-pin { font-size: 2rem; animation: float 1.6s ease-in-out infinite; }
.ao-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ao-mini { display: flex; flex-direction: column; gap: 4px; font-size: .74rem; padding: 8px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); }
.ao-mini.app { border-radius: 16px; background: #eef3ff; }
.json-explain { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; align-items: center; padding: 18px 22px; margin-top: 20px; }
.json-explain h3 { grid-column: 1 / -1; margin: 0; }

/* Ch7 · 3D */
.three { padding: 16px; }
.three-view { position: relative; height: 440px; border: var(--bw) solid var(--ink); border-radius: 14px; overflow: hidden; background: #1c1930; }
.three-view canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.three-view canvas:active { cursor: grabbing; }
.three-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; font-size: .8rem; color: #fff; background: rgba(0, 0, 0, .45); border-radius: 999px; padding: 6px 12px; pointer-events: none; white-space: nowrap; }
.three-fallback, .three-loading { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 20px; color: #fff; font-weight: 700; }
.three-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.range { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.range input { accent-color: var(--c-3d); width: 130px; }
.three-stats { margin: 0 0 0 auto; font: 600 .8rem/1 var(--f-mono); }
.three-explain { margin: 12px 0 0; padding: 10px 14px; border: 2.5px dashed var(--ink); border-radius: 12px; background: var(--paper); }
.loc-bars { display: grid; gap: 12px; margin: 10px 0; }
.loc { display: grid; grid-template-columns: 1fr; gap: 4px; }
.loc span { font-weight: 700; font-size: .92rem; }
.loc b { font-family: var(--f-mono); font-size: .8rem; }
.loc-bar { height: 18px; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--white); }
.loc-bar i { display: block; height: 100%; width: var(--w); background: var(--c); }

/* Ch8 · Git */
.tl { display: grid; grid-template-columns: 1fr 1.05fr; gap: 18px; padding: 20px; }
.tl-commits { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; display: grid; gap: 8px; }
.tl-commits::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; border-left: 3px solid var(--ink); }
.tl-commits button { position: relative; width: 100%; text-align: left; display: grid; gap: 2px; font: inherit; color: var(--ink); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; padding: 8px 12px; cursor: pointer; transition: transform .12s, background .15s; }
.tl-commits button::before { content: ""; position: absolute; left: -19px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--white); border: 3px solid var(--ink); }
.tl-commits button:hover { transform: translateX(3px); }
.tl-commits button.on { background: var(--c); box-shadow: var(--shadow-sm); }
.tl-commits button.on::before { background: var(--ink); }
.tl-commits button.bad { border-color: #d23a2c; }
.tl-commits code { border: 0; background: none; padding: 0; font-size: .74rem; }
.tl-commits b { font-size: .95rem; }
.tl-commits small { color: var(--muted); }
.tl-view { display: flex; flex-direction: column; gap: 10px; }
.tl-preview { height: 230px; border: var(--bw) solid var(--ink); border-radius: 14px; overflow: hidden; background: #fff; }
.tlp { height: 100%; padding: 0 0 12px; font-family: Arial, sans-serif; background: #f3f3f3; }
.tlp-head { display: flex; justify-content: space-between; padding: 10px 12px; background: #ccc; font-weight: 700; }
.tlp-head span { font-weight: 400; font-size: .8rem; }
.tlp-h { font-size: 1.2rem; font-weight: 700; margin: 12px; }
.tlp-txt { margin: 0 12px; color: #666; }
.tlp-cal { display: flex; gap: 8px; margin: 0 12px 12px; }
.tlp-cal i { font-style: normal; border: 1px solid #999; padding: 6px 10px; background: #fff; }
.tlp-btn { display: inline-block; margin: 0 12px; padding: 8px 14px; background: #888; color: #fff; }
.tlp.color { background: linear-gradient(160deg, #fff6e6, #ffeccc); font-family: var(--f-body); }
.tlp.color .tlp-head { background: var(--ink); color: var(--paper); }
.tlp.color .tlp-h { font-family: var(--f-display); }
.tlp.color .tlp-cal i { background: var(--c-front); border: 2px solid var(--ink); border-radius: 999px; font-weight: 700; }
.tlp.color .tlp-btn { background: var(--c-builder); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 999px; font-weight: 700; }
.tlp.broken { position: relative; background: #fff; }
.tlp-err { position: absolute; left: 12px; right: 12px; bottom: 12px; font: 700 .78rem/1.4 var(--f-mono); color: #b3261e; background: #fde7e5; border: 2px solid #b3261e; border-radius: 8px; padding: 8px; }
.tlp-ghost { position: absolute; top: 30px; left: 40px; transform: rotate(-14deg); font-size: 1.4rem; font-weight: 700; color: #bbb; }
.tl-info { margin: 0; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.tool { padding: 0; overflow: hidden; }
.tool summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font: 700 1.05rem/1.2 var(--f-display); }
.tool summary::-webkit-details-marker { display: none; }
.tool summary::after { content: "+"; margin-left: auto; font: 800 1.3rem/1 var(--f-mono); }
.tool[open] summary { background: var(--c); border-bottom: 2.5px solid var(--ink); }
.tool[open] summary::after { content: "−"; }
.tool summary span { font-size: 1.5rem; }
.tool p { margin: 0; padding: 12px 16px 16px; font-size: .95rem; }

/* Ch9 · Docker */
.dk { padding: 20px; }
.dk-machines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.dk-m { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 16px; transition: background .3s; }
.dk-m.ok { background: #d8f7e4; }
.dk-m.ko { background: #ffd9d4; }
.dk-name { margin: 0; font: 700 1.05rem/1.2 var(--f-display); }
.dk-env { display: flex; flex-wrap: wrap; gap: 6px; }
.dk-env span { font: 600 .72rem/1 var(--f-mono); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 8px; background: var(--white); }
.dk-m.docker .dk-env span:not(.dk-has) { opacity: .35; text-decoration: line-through; }
.dk-env .dk-has { background: var(--c-tools); color: #fff; }
.dk-slot { min-height: 104px; display: grid; }
.dk-code { display: grid; place-content: center; font: 700 .9rem/1.2 var(--f-body); border: 2.5px dashed var(--ink); border-radius: 12px; }
.dk-box { display: flex; flex-direction: column; gap: 4px; padding: 10px; color: #fff; border: var(--bw) solid var(--ink); border-radius: 8px; box-shadow: var(--shadow-sm); background: repeating-linear-gradient(90deg, #3d6fe0 0 12px, #335fc8 12px 16px); }
.dk-box b { font-size: .9rem; }
.dk-box span { font: 600 .7rem/1 var(--f-mono); background: rgba(0, 0, 0, .28); border-radius: 4px; padding: 4px 6px; }
.dk-box.drop { animation: brickDrop .7s cubic-bezier(.3, 1.4, .5, 1) both; }
.dk-res { margin: 0; font-weight: 700; min-height: 1.4em; font-size: .92rem; }
.dk-msg { text-align: center; font-weight: 700; margin: 14px 0 0; }

/* Ch10 · hébergement, terminal, supervision */
.host-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.hcard { position: relative; padding: 16px 14px; transition: transform .2s, background .2s, opacity .2s; }
.hcard-ico { font-size: 2rem; margin: 0; line-height: 1; }
.hcard h3 { font-size: 1.15rem; margin: 8px 0 2px; }
.hcard-ana { font-style: italic; color: var(--muted); font-size: .88rem; }
.hcard dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; font-size: .8rem; margin: 0 0 10px; }
.hcard dt { font-weight: 700; }
.hcard dd { margin: 0; }
.hcard .dots { font-family: var(--f-mono); letter-spacing: 1px; }
.hcard-you { font-size: .84rem; margin-bottom: 6px; }
.host-grid:has(.pick) .hcard:not(.pick) { opacity: .55; }
.hcard.pick { background: color-mix(in srgb, var(--c) 30%, white); transform: translateY(-6px) rotate(-1deg); box-shadow: 8px 8px 0 var(--ink); }
.hcard.pick::after { content: "✓ conseillé"; position: absolute; top: -12px; right: 10px; font: 700 .72rem/1 var(--f-mono); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 5px 9px; }
.host-msg { margin: 16px 0 0; padding: 10px 14px; border: 2.5px dashed var(--ink); border-radius: 12px; background: var(--paper); }
.term { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 16px; padding: 18px; }
.term-cmds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; }
.term-cmds button { width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 10px; padding: 7px 10px; cursor: pointer; transition: transform .12s, background .15s; }
.term-cmds button code { border: 0; background: none; padding: 0; font-size: .74rem; word-break: break-all; }
.term-cmds button:hover:not(:disabled) { transform: translateX(3px); }
.term-cmds button:disabled { opacity: .35; cursor: not-allowed; }
.term-cmds button.next { background: var(--c); box-shadow: var(--shadow-sm); animation: nudge 1.6s ease-in-out infinite; }
.term-cmds button.done::after { content: " ✓"; font-weight: 800; }
.term-cmds .t-reset { font-weight: 700; font-size: .85rem; text-align: center; }
.term-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.term-screen { background: #0f0e17; border: var(--bw) solid var(--ink); border-radius: 12px; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #2a2738; color: #c9c4dc; font: 600 .72rem/1 var(--f-mono); }
.term-out { margin: 0; height: 290px; overflow: auto; padding: 12px; color: #9ff59f; font: .76rem/1.5 var(--f-mono); white-space: pre-wrap; word-break: break-word; }
.term-explain { margin: 0; padding: 10px 14px; border: 2.5px dashed var(--ink); border-radius: 12px; background: var(--paper); }
.real-note { margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); }
.real-note b { color: var(--c-ops); }
.ops { padding: 20px; }
.ops-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ops-head b { font: 800 1.3rem/1 var(--f-display); }
.ops-head small { margin-left: auto; font-family: var(--f-mono); color: var(--muted); }
.ops-dot { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--c-data); }
.ops[data-state="alert"] .ops-dot, .ops[data-state="down"] .ops-dot { background: var(--c-builder); animation: blink .8s steps(2) infinite; }
.ops[data-state="warn"] .ops-dot { background: var(--c-api); }
.ops-gauges { display: grid; gap: 8px; margin-bottom: 14px; }
.gauge { display: grid; grid-template-columns: 150px 1fr 80px; gap: 10px; align-items: center; font-size: .9rem; font-weight: 700; }
.gauge b { font-family: var(--f-mono); font-size: .82rem; text-align: right; }
.g-bar { height: 16px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; }
.g-bar i { display: block; height: 100%; background: var(--c-data); transition: width .6s cubic-bezier(.3, 1.2, .5, 1), background .3s; }
.gauge.hot .g-bar i { background: var(--c-builder); }
.ops-events { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ops-msg { padding: 12px 16px; border: 2.5px dashed var(--ink); border-radius: 12px; background: var(--paper); }
.ops-msg p:last-child { margin: 0; }
.ops[data-state="alert"] .ops-msg, .ops[data-state="down"] .ops-msg { background: #ffe9e6; }

/* Ch11 · architectures */
.archi { padding: 20px; }
.archi-body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px; align-items: start; }
.archi-diagram { display: grid; gap: 6px; }
.ad-row { padding: 10px 12px; border: var(--bw) solid var(--ink); border-radius: 14px; background: color-mix(in srgb, var(--c) 25%, white); }
.ad-row small { display: block; font: 700 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.ad-row div { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-row .chip { font-size: .76rem; }
.ad-link { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.ad-link i { font-style: normal; font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.archi-info h3 { font-size: 1.5rem; }
.archi-info .pro { color: #0f7a40; }
.archi-info .con { color: #b3261e; }
.crit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.crit { padding: 14px 16px; display: grid; gap: 4px; }
.crit b { font-family: var(--f-display); font-size: 1.05rem; }
.crit span { font-size: .92rem; color: var(--muted); }

/* Ch12 · brief et checklist */
.brief { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 18px; padding: 20px; }
.brief-ing { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.brief-out { border: var(--bw) solid var(--ink); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.brief-out > *:not(.prompt-head) { margin-left: 16px; margin-right: 16px; }
.brief-text { margin-top: 14px; font-size: 1.02rem; line-height: 1.6; min-height: 3.2em; }
.brief-meter { height: 16px; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--white); }
.brief-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c-builder), var(--c-front), var(--c-data)); transition: width .4s; }
.brief-label { font-weight: 700; margin: 8px 16px 14px; }
.brief-risks { margin-top: 0; margin-bottom: 16px; padding-left: 1.2em; }
.brief-risks li { margin-bottom: 4px; font-size: .93rem; }
.brief-risks li::marker { content: "⚠️ "; }
.brief-risks li.none::marker { content: ""; }
.check { padding: 20px 22px; max-width: 860px; transition: background .3s; }
.check.ready { background: #e7fbef; }
.check-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.check-list label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); }
.check-list input { width: 20px; height: 20px; accent-color: var(--c-data); flex: none; margin-top: 2px; }
.check-bar { height: 16px; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--white); }
.check-bar span { display: block; height: 100%; width: 0; background: var(--c-data); transition: width .4s; }
.check-msg { font-weight: 700; margin: 10px 0 0; }
.trap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.trap { padding: 16px; display: grid; gap: 6px; align-content: start; background: #fff1ee; }
.trap b { font-family: var(--f-display); font-size: 1.05rem; }
.trap span { font-size: .92rem; }

/* Récapitulatif */
.plan { display: grid; grid-template-columns: 1fr auto 1.3fr auto 1fr; gap: 12px; align-items: center; padding: 22px; }
.plan-col { display: grid; gap: 10px; align-content: center; }
.plan-title { font: 700 .76rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; margin: 0; text-align: center; }
.plan-box { display: grid; gap: 2px; padding: 10px 12px; border: var(--bw) solid var(--ink); border-radius: 12px; background: color-mix(in srgb, var(--c) 28%, white); }
.plan-box b { font-family: var(--f-display); font-size: 1.02rem; }
.plan-box span { font-size: .82rem; }
.plan-docker { gap: 8px; }
.plan-docker .plan-box { background: var(--white); }
.plan-link { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.plan-link span { font: 700 .72rem/1 var(--f-mono); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 8px; }
.plan-link i { font-style: normal; font-size: 1.8rem; font-weight: 800; }
.plan-link small { font-size: .72rem; color: var(--muted); max-width: 90px; }
.plan-foot { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }

/* Antisèche */
.cheat { display: grid; border: var(--bw) solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--white); }
.cheat-row { display: grid; grid-template-columns: 1fr auto 2fr; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 2px solid var(--ink); }
.cheat-row:last-child { border-bottom: 0; }
.cheat-row:nth-child(odd):not(.cheat-head) { background: var(--paper); }
.cheat-head { background: var(--ink); color: var(--paper); font: 700 .76rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; }
.cheat-row > span:first-child { font-weight: 700; }
.cheat-say { display: flex; gap: 10px; align-items: center; }
.cheat-say q { flex: 1; font-size: .92rem; quotes: "« " " »"; }
.copy { flex: none; width: 38px; height: 38px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--c-front); cursor: pointer; font-size: 1rem; }
.copy:hover { transform: translateY(-2px); }

/* Glossaire */
.gloss-search { display: flex; align-items: center; gap: 10px; max-width: 520px; margin-top: 18px; padding: 4px 6px 4px 16px; background: var(--white); border: var(--bw) solid var(--ink); border-radius: 999px; box-shadow: var(--shadow-sm); }
.gloss-search input { flex: 1; border: 0; outline: 0; font: 500 1rem/1 var(--f-body); padding: 10px 6px; background: transparent; color: var(--ink); }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 0; }
.gloss > div { padding: 12px 16px; background: var(--white); border: 2.5px solid var(--ink); border-radius: 14px; }
.gloss dt { font: 800 1.05rem/1.2 var(--f-display); margin-bottom: 4px; }
.gloss dd { margin: 0; font-size: .92rem; }

/* Responsive des composants */
@media (max-width: 1000px) {
  .ana-grid, .ana-grid.five { grid-template-columns: repeat(3, 1fr); }
  .id-grid { grid-template-columns: 1fr; }
  .fab-cols { grid-template-columns: 1fr 1fr; }
  .fab-cols .fab-col:first-child { grid-column: 1 / -1; }
  .fab-gear { display: none; }
  .host-grid { grid-template-columns: repeat(3, 1fr); }
  .trap-grid { grid-template-columns: 1fr 1fr; }
  .plan { grid-template-columns: 1fr; }
  .plan-link { flex-direction: row; justify-content: center; }
  .plan-link i { transform: rotate(90deg); }
  .plan-link small { max-width: none; }
  .db-tables { grid-template-columns: 1fr 1fr; }
  .db-tables .dbt:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ana-grid, .ana-grid.five { grid-template-columns: 1fr 1fr; }
  .ana { padding: 14px 10px; }
  .id-grid.two, .lab-main, .lab-code, .fab-cols, .db-out, .dbl-stage, .api-panels, .json-explain, .tl, .dk-machines, .term, .archi-body, .brief, .trap-grid, .plan-foot, .db-tables { grid-template-columns: 1fr; }
  .db-tables .dbt:last-child { grid-column: auto; }
  .idcard dl { grid-template-columns: 1fr; gap: 2px; }
  .idcard dd { margin-bottom: 8px; }
  .choose-list li { flex-direction: column; align-items: flex-start; }
  .fw-list li { grid-template-columns: 1fr auto; }
  .fw-list li .fw-mini { display: none; }
  .fw-total { grid-template-columns: 1fr auto; }
  .fw-total .fw-bar { grid-column: 1 / -1; grid-row: 2; }
  .fnode { width: 96px; padding: 10px 4px; }
  .fnode span { font-size: 1.4rem; }
  .fnode b { font-size: .72rem; }
  .api-stage { grid-template-columns: 90px 1fr 90px; }
  .api-node span { font-size: 1.4rem; }
  .api-node small { display: none; }
  .three-view { height: 320px; }
  .three-stats { margin-left: 0; }
  .host-grid { grid-template-columns: 1fr 1fr; }
  .gauge { grid-template-columns: 110px 1fr 64px; font-size: .8rem; }
  .cheat-row { grid-template-columns: 1fr; gap: 6px; }
  .cheat-head { display: none; }
  .term-out { height: 240px; }
}
.lab-page.nocss .slot.selected::before { content: none; }
