/* ═══════════════════════════════════════════════════════════════
   cours.css — Feuille de styles partagée (IFM025921)
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. Variables ────────────────────────────────────────────── */
:root {
  --bg:          #f5f5f7;
  --surface:     #ffffff;
  --border:      #e2e2e7;
  --text:        #1d1d1f;
  --text-soft:   #6e6e73;
  --accent:      #e8590c;
  --accent-dark: #bf4809;
  --accent-bg:   #fff4ee;
  --blue:        #0071e3;
  --blue-bg:     #eef5fd;
  --blue-dark:   #004fa3;
  --green:       #1d8348;
  --green-bg:    #eafaf1;
  --purple:      #6f42c1;
  --purple-bg:   #f5f0ff;
  --yellow-bg:   #fdfbe4;
  --yellow-bdr:  #f5d234;
  --code-bg:     #1c1c1e;
  --code-text:   #f2f2f7;
  --code-comment:#7d8590;
  --code-key:    #ff7ab2;
  --code-str:    #fc6;
  --code-num:    #d9c97c;
  --code-type:   #dabaff;
  --code-call:   #67b7a4;
  --code-annot:  #ff8170;
  --teal:        #0e7c6e;
  --teal-bg:     #e6f7f5;
  --step-size:   28px;
  --radius:      12px;
  --radius-sm:   8px;
}

/* ─── 2. Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

/* ─── 3. Layout ───────────────────────────────────────────────── */
.page-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  gap: 0 28px;
  padding: 0 16px 80px;
}

/* ─── 4. Top Header ───────────────────────────────────────────── */
.top-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--accent-bg);
  transition: background .2s;
}
.back-btn:hover { background: #fde3d4; }
.page-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* ─── 5. Sidebar TOC ──────────────────────────────────────────── */
.toc {
  grid-column: 1;
  position: sticky;
  top: 24px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  font-size: 13px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.toc ul { list-style: none; }
.toc > ul > li { margin-bottom: 4px; }
.toc a {
  color: var(--text-soft);
  text-decoration: none;
  display: block;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  transition: all .15s;
}
.toc a:hover, .toc a.active { color: var(--accent); background: var(--accent-bg); }
.toc ul ul { margin-left: 12px; }
.toc ul ul a { font-weight: 500; font-size: 12px; }

/* ─── 6. Mobile TOC Toggle ────────────────────────────────────── */
.toc-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 20px;
  padding: 4px 10px;
  cursor: pointer;
  margin-left: auto;
  color: var(--text);
  line-height: 1;
}
.toc-toggle:hover { background: var(--accent-bg); color: var(--accent); }

/* ─── 7. Contenu principal ────────────────────────────────────── */
.content { grid-column: 2; }

h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}
.subtitle {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 40px;
  font-weight: 500;
}

h2 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 800;
  margin: 56px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
h2 .sec-num {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .05em;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}

p { margin-bottom: 14px; }

/* ─── 8. Code inline ──────────────────────────────────────────── */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(0,0,0,.06);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ─── 9. Blocs de code ────────────────────────────────────────── */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.dots { display: flex; gap: 6px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; }
.dots .r { background: #ff5f57; }
.dots .y { background: #ffbd2e; }
.dots .g { background: #28c840; }
.code-block-header .filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,.4);
}
.code-block pre {
  padding: 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--code-text);
}

/* Coloration syntaxique Swift */
.kw  { color: var(--code-key);     font-weight: 500; }
.st  { color: var(--code-str); }
.cm  { color: var(--code-comment); font-style: italic; }
.ty  { color: var(--code-type); }
.fn  { color: var(--code-call); }
.nu  { color: var(--code-num); }
.an  { color: var(--code-annot); }
.new { background: rgba(40,200,100,.12); border-left: 3px solid #28c840; padding-left: 4px; }

/* ─── 10. Callouts ────────────────────────────────────────────── */
.callout {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 14.5px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.callout-icon { font-size: 18px; flex-shrink: 0; line-height: 1.6; }
.callout.info    { background: var(--blue-bg);   border-left: 4px solid var(--blue); }
.callout.tip     { background: var(--green-bg);  border-left: 4px solid var(--green); }
.callout.warn    { background: var(--yellow-bg); border-left: 4px solid var(--yellow-bdr); }
.callout.fix     { background: var(--accent-bg); border-left: 4px solid var(--accent); }
.callout.analogy { background: var(--purple-bg); border-left: 4px solid var(--purple); }
.callout strong  { font-weight: 700; }

/* ─── 11. Explain Grid ────────────────────────────────────────── */
.explain-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0;
  font-size: 14px;
}
.explain-grid .eg-row { display: contents; }
.eg-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.eg-val {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  color: var(--text);
  line-height: 1.5;
}
.eg-key:last-of-type, .eg-val:last-child,
.explain-grid .eg-row:last-child .eg-key,
.explain-grid .eg-row:last-child .eg-val { border-bottom: none; }

/* ─── 12. Steps (exercices) ───────────────────────────────────── */
.steps { list-style: none; counter-reset: step-ctr; }
.steps li {
  counter-increment: step-ctr;
  position: relative;
  padding: 0 0 20px 52px;
}
.steps li::before {
  content: counter(step-ctr);
  position: absolute;
  left: 0; top: 0;
  width: var(--step-size);
  height: var(--step-size);
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.steps li:last-child { padding-bottom: 0; }
.steps li strong { font-weight: 700; }

/* ─── 13. Section Card (exercices) ────────────────────────────── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 16px;
}

/* ─── 14. Component Cards (notes) ─────────────────────────────── */
.comp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.comp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  border-top: 4px solid var(--accent);
}
.comp-card.blue   { border-top-color: var(--blue); }
.comp-card.green  { border-top-color: var(--green); }
.comp-card.purple { border-top-color: var(--purple); }
.comp-card.orange { border-top-color: var(--accent); }
.comp-card h4 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.comp-card .role {
  font-size: 13px; color: var(--text-soft); margin-bottom: 10px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.comp-card p  { font-size: 14px; margin-bottom: 8px; }
.comp-card ul { list-style: none; padding: 0; }
.comp-card ul li { font-size: 13.5px; padding: 3px 0 3px 18px; position: relative; }
.comp-card ul li::before { content: "\2192"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ─── 15. Stack Diagram (notes) ───────────────────────────────── */
.stack-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.stack-diagram .sd-title {
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-soft); margin-bottom: 20px;
}
.stack-row { display: flex; align-items: center; gap: 16px; width: 100%; justify-content: center; }
.stack-box {
  border-radius: 10px; padding: 12px 20px; text-align: center;
  font-weight: 700; font-size: 14px; min-width: 200px; max-width: 260px;
  border: 2px solid transparent; transition: transform .2s;
}
.stack-row:has(.stack-arrow-h) .stack-box {
  flex: 1; min-width: 0;
}
.stack-box:hover { transform: scale(1.03); }
.stack-box.app { background: #eef5fd; border-color: var(--blue);   color: var(--blue-dark); }
.stack-box.pc  { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-dark); }
.stack-box.moc { background: #fdf5ff; border-color: var(--purple); color: var(--purple); }
.stack-box.mom { background: var(--green-bg); border-color: var(--green);  color: var(--green); font-size: 13px; }
.stack-box.psc { background: #fafafa; border-color: #aaa; color: #555; font-size: 13px; }
.stack-box.pso { background: #f0f0f0; border-color: #999; color: #444; font-size: 13px; }
.stack-box.db  { background: #1c1c1e; border-color: #444; color: #f2f2f7; }
.stack-box sub { display: block; font-size: 11px; font-weight: 500; opacity: .7; margin-top: 2px; }
.stack-arrow   { font-size: 22px; color: var(--text-soft); line-height: 1; margin: 6px 0; }
.stack-arrow-h { font-size: 22px; color: var(--text-soft); }
.stack-note    { font-size: 12px; color: var(--text-soft); margin-top: 16px; font-style: italic; }

/* ─── 16. Data Lifecycle (notes) ──────────────────────────────── */
.lifecycle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
}
.lifecycle-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 16px;
  flex-wrap: wrap;
}
.lc-step {
  flex: 1; min-width: 130px; text-align: center;
  padding: 0 8px; position: relative;
}
.lc-step:not(:last-child)::after {
  content: "\2192"; position: absolute; right: -8px; top: 14px;
  font-size: 20px; color: var(--accent); font-weight: 700;
}
.lc-label {
  font-size: 14px; font-weight: 700; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.lc-label::before {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.lc-step:nth-child(1) .lc-label::before { content: "1"; background: var(--blue); }
.lc-step:nth-child(2) .lc-label::before { content: "2"; background: var(--purple); }
.lc-step:nth-child(3) .lc-label::before { content: "3"; background: var(--accent); }
.lc-step:nth-child(4) .lc-label::before { content: "4"; background: var(--green); }
.lc-sub   { font-size: 12px; color: var(--text-soft); line-height: 1.4; }

/* ─── 17. Table attributs (notes) ─────────────────────────────── */
.attr-table {
  width: 100%; border-collapse: collapse; margin: 20px 0;
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
}
.attr-table th {
  background: var(--code-bg); color: var(--code-text);
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 12px 16px; text-align: left;
}
.attr-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.attr-table tr:last-child td { border-bottom: none; }
.attr-table tr:hover td { background: #fafafa; }
.attr-table .type-badge {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; background: var(--accent-bg); color: var(--accent);
}

/* ─── 18. Lab CTA (notes) ─────────────────────────────────────── */
.lab-cta {
  background: linear-gradient(135deg, #e8590c 0%, #bf4809 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 40px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  text-decoration: none;
  transition: opacity .2s;
}
.lab-cta:hover { opacity: .9; }
.lab-cta .lab-text h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; color: #fff; }
.lab-cta .lab-text p  { font-size: 14px; opacity: .85; margin: 0; color: #fff; }
.lab-cta .lab-arrow   { font-size: 32px; flex-shrink: 0; }

/* ─── 19. Footer ──────────────────────────────────────────────── */
.page-footer {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
  padding-top: 40px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}
.page-footer a { color: var(--accent); text-decoration: none; }

/* ─── 20. iOS Badge ──────────────────────────────────────────── */
.ios-badge {
  margin-left: auto;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-bg); padding: 4px 10px;
  border-radius: 20px;
}

/* ─── 21. Requirement Badge ──────────────────────────────────── */
.req-badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  background: var(--blue-bg); color: var(--blue);
  padding: 3px 10px; border-radius: 20px; margin-bottom: 32px;
}

/* ─── 22. File Tree (exercices) ──────────────────────────────── */
.file-tree {
  background: var(--code-bg); border-radius: var(--radius);
  padding: 20px 24px; margin: 20px 0;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  line-height: 2; color: var(--code-text);
}
.file-tree .folder { color: #fc6; }
.file-tree .file   { color: var(--code-call); padding-left: 20px; }
.file-tree .file.new-file { color: #67d4c0; }
.file-tree .file.new-file::after {
  content: " — nouveau"; font-size: 11px; color: #67d4c0;
  font-weight: 600; margin-left: 6px; opacity: .7;
}

/* ─── 23. Highlighted code lines ─────────────────────────────── */
.hl, .hi {
  background: rgba(255,255,255,.07); border-left: 3px solid var(--accent);
  padding-left: 4px; display: block;
}

/* ─── 24. Extra callout variants ─────────────────────────────── */
.callout.new    { background: var(--teal-bg);   border-left: 4px solid var(--teal); }
.callout.purple { background: var(--purple-bg); border-left: 4px solid var(--purple); }

/* ─── 25. Comparison Table (notes) ───────────────────────────── */
.compare-table {
  width: 100%; border-collapse: collapse; margin: 20px 0;
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
}
.compare-table th {
  padding: 12px 16px; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; text-align: left;
}
.compare-table th:first-child { background: #f7f7f7; color: var(--text-soft); }
.compare-table th:nth-child(2) { background: #fff8e7; color: #7a5500; }
.compare-table th:nth-child(3) { background: var(--teal-bg); color: var(--teal); }
.compare-table td {
  padding: 11px 16px; font-size: 14px; border-top: 1px solid var(--border);
}
.compare-table td:nth-child(2) { border-left: 1px solid var(--border); }
.compare-table td:nth-child(3) { border-left: 1px solid var(--border); }
.compare-table tr:hover td { background: #fafafa; }
.tag-old {
  font-size: 12px; background: #fff8e7; color: #7a5500; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; font-family: 'JetBrains Mono', monospace;
}
.tag-new {
  font-size: 12px; background: var(--teal-bg); color: var(--teal); font-weight: 600;
  padding: 2px 7px; border-radius: 4px; font-family: 'JetBrains Mono', monospace;
}

/* ─── 26. Macro Cards (notes) ────────────────────────────────── */
.macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.macro-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  border-top: 4px solid var(--accent);
}
.macro-card.blue   { border-top-color: var(--blue); }
.macro-card.green  { border-top-color: var(--green); }
.macro-card.purple { border-top-color: var(--purple); }
.macro-card.teal   { border-top-color: var(--teal); }
.macro-card .macro-name {
  font-family: 'JetBrains Mono', monospace; font-size: 1rem;
  font-weight: 700; margin-bottom: 6px;
}
.macro-card .macro-name.orange { color: var(--accent); }
.macro-card .macro-name.blue   { color: var(--blue); }
.macro-card .macro-name.green  { color: var(--green); }
.macro-card .macro-name.purple { color: var(--purple); }
.macro-card .macro-name.teal   { color: var(--teal); }
.macro-card .role {
  font-size: 12px; color: var(--text-soft); margin-bottom: 10px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.macro-card p { font-size: 14px; margin-bottom: 0; }

/* ─── 27. Rules Table (notes) ────────────────────────────────── */
.rules-table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
}
.rules-table th {
  background: var(--code-bg); color: var(--code-text);
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 11px 16px; text-align: left;
}
.rules-table td {
  padding: 11px 16px; font-size: 14px; border-bottom: 1px solid var(--border);
}
.rules-table tr:last-child td { border-bottom: none; }
.rules-table tr:hover td { background: #fafafa; }
.rule-badge {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 12px;
  font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: var(--accent-bg); color: var(--accent);
}

/* ─── 28. Lifecycle Icons (notes) ────────────────────────────── */
.lc-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 10px;
}
.lc-step:nth-child(1) .lc-icon { background: var(--blue-bg); }
.lc-step:nth-child(2) .lc-icon { background: var(--purple-bg); }
.lc-step:nth-child(3) .lc-icon { background: var(--yellow-bg); }
.lc-step:nth-child(4) .lc-icon { background: var(--green-bg); }

/* ─── 29. SwiftData Stack boxes (notes) ──────────────────────── */
.stack-box.cont { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-dark); }
.stack-box.ctx  { background: var(--purple-bg); border-color: var(--purple); color: var(--purple); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* ─── 20. Tablette (max 1024px) ───────────────────────────────── */
@media (max-width: 1024px) {
  .page-wrap {
    grid-template-columns: 1fr;
    padding: 0 16px 48px;
  }
  .toc {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    max-height: 100vh;
    border-radius: 0;
    padding: 72px 24px 24px;
    overflow-y: auto;
  }
  .toc.open { display: block; }
  .toc-toggle { display: block; }
  .content, .top-bar { grid-column: 1; }

  .stack-row { flex-wrap: wrap; }
  .stack-box { min-width: 160px; }
  .stack-row:has(.stack-arrow-h) .stack-box { min-width: 120px; }
  .lab-cta { flex-direction: column; text-align: center; }
}

/* ─── 21. Mobile (max 768px) ──────────────────────────────────── */
@media (max-width: 768px) {
  .page-wrap { padding: 0 12px 40px; }
  .top-bar { margin-bottom: 24px; }
  h2 { margin-top: 40px; }
  .subtitle { margin-bottom: 28px; }

  .code-block pre { font-size: 12.5px; padding: 14px; }

  .explain-grid { grid-template-columns: 1fr; }
  .eg-key { white-space: normal; border-left: none; }
  .eg-val { border-left: none; }

  .comp-grid { grid-template-columns: 1fr; }
  .macro-grid { grid-template-columns: 1fr; }

  .lifecycle-steps { flex-direction: column; align-items: center; }
  .lc-step:not(:last-child)::after {
    content: "\2193"; right: auto; top: auto; bottom: -16px;
    left: 50%; transform: translateX(-50%);
  }
  .lc-step { margin-bottom: 32px; }

  .steps li { padding-left: 42px; }
  .section-card { padding: 20px 18px; }

  .attr-table { display: block; overflow-x: auto; }

  .stack-diagram { padding: 20px 12px; }
  .stack-box { min-width: 140px; font-size: 13px; padding: 10px 14px; }
}

/* ─── 22. Petit mobile (max 480px) ────────────────────────────── */
@media (max-width: 480px) {
  .page-wrap { padding: 0 8px 32px; }
  .top-bar { flex-wrap: wrap; gap: 8px; }
  .page-badge { font-size: 11px; }

  .code-block pre { font-size: 11.5px; padding: 10px; line-height: 1.6; }
  .code-block-header { padding: 8px 12px 6px; }

  .callout { padding: 10px 12px; font-size: 13.5px; }

  .steps li { padding-left: 36px; }
  .steps li::before { width: 24px; height: 24px; font-size: 11px; }

  .stack-box { min-width: 100%; }
  .stack-row { flex-direction: column; gap: 0; }
  .stack-arrow-h { display: none; }

  .lab-cta { padding: 20px; }
  .lab-cta .lab-arrow { font-size: 24px; }

  .lifecycle { padding: 16px; }
}
