/*
 * InPAT lab content components
 * Shared by the developer editor (/developer/editor.html) and the student lab (/student/lab1.html),
 * so infographics, interactive widgets, math and layout blocks look the same while editing and learning.
 *
 * Interactive widgets only hide/flip/slide content after the runtime script has marked them
 * `.lab-ix-ready`; without the script every panel stays visible, so nothing is ever lost.
 */

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */
.infographic-wrapper,
.lab-ix,
.lab-columns,
.lab-box,
.lab-shape,
.lab-quote {
  --ig-accent: #305cde;
  --ig-surface: #ffffff;
  --ig-surface-2: #f1f5fb;
  --ig-border: #dbe3f0;
  --ig-text: #0f172a;
  --ig-muted: #475569;
  --ig-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 18px rgba(15, 23, 42, 0.06);
  --ig-good: #10b981;
  --ig-bad: #ef4444;
}

[data-theme='dark'] .infographic-wrapper,
[data-theme='dark'] .lab-ix,
[data-theme='dark'] .lab-columns,
[data-theme='dark'] .lab-box,
[data-theme='dark'] .lab-shape,
[data-theme='dark'] .lab-quote,
body.dark-mode .infographic-wrapper,
body.dark-mode .lab-ix,
body.dark-mode .lab-columns,
body.dark-mode .lab-box,
body.dark-mode .lab-shape,
body.dark-mode .lab-quote {
  --ig-surface: #161d29;
  --ig-surface-2: #1d2636;
  --ig-border: rgba(255, 255, 255, 0.1);
  --ig-text: #e2e8f0;
  --ig-muted: #94a3b8;
  --ig-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 22px rgba(0, 0, 0, 0.25);
}

/* Five-colour cycle used by every multi-item design */
:is(.ig-timeline, .ig-roadmap, .ig-process, .ig-cycle, .ig-pyramid, .ig-funnel, .ig-stats, .ig-matrix, .ig-hub, .ig-checklist, .ig-bars) > :nth-child(5n + 1) { --ig-accent: #305cde; }
:is(.ig-timeline, .ig-roadmap, .ig-process, .ig-cycle, .ig-pyramid, .ig-funnel, .ig-stats, .ig-matrix, .ig-hub, .ig-checklist, .ig-bars) > :nth-child(5n + 2) { --ig-accent: #10b981; }
:is(.ig-timeline, .ig-roadmap, .ig-process, .ig-cycle, .ig-pyramid, .ig-funnel, .ig-stats, .ig-matrix, .ig-hub, .ig-checklist, .ig-bars) > :nth-child(5n + 3) { --ig-accent: #f97316; }
:is(.ig-timeline, .ig-roadmap, .ig-process, .ig-cycle, .ig-pyramid, .ig-funnel, .ig-stats, .ig-matrix, .ig-hub, .ig-checklist, .ig-bars) > :nth-child(5n + 4) { --ig-accent: #8b5cf6; }
:is(.ig-timeline, .ig-roadmap, .ig-process, .ig-cycle, .ig-pyramid, .ig-funnel, .ig-stats, .ig-matrix, .ig-hub, .ig-checklist, .ig-bars) > :nth-child(5n + 5) { --ig-accent: #ec4899; }

/* ------------------------------------------------------------------ */
/* Original infographics (moved from editor.css so students see them)  */
/* ------------------------------------------------------------------ */
.infographic-wrapper { margin: 2.25rem 0; width: 100%; color: var(--ig-text); }
.infographic-wrapper h5 { color: inherit; }

.ig-container { display: flex; flex-direction: column; gap: 1.25rem; }
.ig-list-item {
  display: flex; align-items: center; background: #e0e5ec; border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px; padding: 1.25rem 1.5rem;
  box-shadow: 6px 6px 14px rgba(163, 177, 198, 0.5), -6px -6px 14px rgba(255, 255, 255, 0.8);
  transition: box-shadow 0.25s ease; position: relative; overflow: hidden;
}
.ig-list-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: #305cde; }
.ig-container .ig-list-item:nth-child(2)::before { background: #10b981; }
.ig-container .ig-list-item:nth-child(3)::before { background: #f97316; }
.ig-container .ig-list-item:nth-child(4)::before { background: #8b5cf6; }
.ig-container .ig-list-item:nth-child(5)::before { background: #ec4899; }
.ig-list-item:hover { box-shadow: 8px 8px 18px rgba(163, 177, 198, 0.6), -8px -8px 18px rgba(255, 255, 255, 0.9); }
[data-theme='dark'] .ig-list-item, body.dark-mode .ig-list-item {
  background: #181f2a; border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 6px 6px 14px rgba(10, 14, 23, 0.7), -6px -6px 14px rgba(35, 45, 60, 0.4); color: #f8fafc;
}
.ig-list-number {
  font-size: 1.1rem; font-weight: 800; font-family: monospace; color: #305cde; background: #e0e5ec;
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 14px; width: 44px; height: 44px; min-width: 44px;
  display: flex; align-items: center; justify-content: center; margin-right: 1.25rem;
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.5), inset -3px -3px 6px rgba(255, 255, 255, 0.8);
}
.ig-container .ig-list-item:nth-child(2) .ig-list-number { color: #10b981; }
.ig-container .ig-list-item:nth-child(3) .ig-list-number { color: #f97316; }
.ig-container .ig-list-item:nth-child(4) .ig-list-number { color: #8b5cf6; }
.ig-container .ig-list-item:nth-child(5) .ig-list-number { color: #ec4899; }
[data-theme='dark'] .ig-list-number, body.dark-mode .ig-list-number {
  background: #181f2a; border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 3px 6px rgba(10, 14, 23, 0.7), inset -3px -3px 6px rgba(35, 45, 60, 0.4);
}
.ig-list-content { flex: 1; }
.ig-list-content h5 { margin: 0 0 4px 0; font-size: 1.1rem; font-weight: 700; color: inherit; }
.ig-list-content p { margin: 0; font-size: 0.92rem; line-height: 1.5; opacity: 0.85; }

.ig-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.ig-comp-card {
  padding: 1.75rem; border-radius: 20px; background: #e0e5ec; border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 6px 6px 14px rgba(163, 177, 198, 0.5), -6px -6px 14px rgba(255, 255, 255, 0.8); position: relative;
}
[data-theme='dark'] .ig-comp-card, body.dark-mode .ig-comp-card {
  background: #181f2a; border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 6px 6px 14px rgba(10, 14, 23, 0.7), -6px -6px 14px rgba(35, 45, 60, 0.4); color: #f8fafc;
}
.ig-comp-card.highlight { border-color: rgba(48, 92, 222, 0.5); box-shadow: 6px 6px 14px rgba(48, 92, 222, 0.2), -6px -6px 14px rgba(255, 255, 255, 0.8); }
[data-theme='dark'] .ig-comp-card.highlight, body.dark-mode .ig-comp-card.highlight {
  border-color: rgba(56, 189, 248, 0.4); box-shadow: 6px 6px 14px rgba(10, 14, 23, 0.8), -6px -6px 14px rgba(56, 189, 248, 0.15);
}
.ig-comp-card.highlight::before {
  content: 'Difference'; position: absolute; top: -12px; right: 16px; background: #305cde; color: #fff;
  font-size: 0.65rem; font-weight: 700; font-family: monospace; padding: 3px 10px; border-radius: 20px; letter-spacing: 0.8px;
}
.ig-comp-header {
  font-weight: 700; margin-bottom: 1.25rem; text-align: center; font-size: 1.15rem; padding: 0.6rem 1rem;
  background: #e0e5ec; border-radius: 12px; color: #1e293b; font-family: monospace; text-transform: uppercase; letter-spacing: 0.5px;
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.4), inset -3px -3px 6px rgba(255, 255, 255, 0.8);
}
.ig-comp-card.highlight .ig-comp-header { color: #305cde; }
[data-theme='dark'] .ig-comp-header, body.dark-mode .ig-comp-header {
  background: #181f2a; color: #f8fafc; box-shadow: inset 3px 3px 6px rgba(10, 14, 23, 0.7), inset -3px -3px 6px rgba(35, 45, 60, 0.4);
}

.ig-tree { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.ig-tree-node {
  padding: 0.85rem 2rem; border-radius: 24px; background: #e0e5ec; color: #305cde; font-weight: 800; font-size: 1rem;
  font-family: monospace; text-transform: uppercase; margin-bottom: 2rem; border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 5px 5px 12px rgba(163, 177, 198, 0.5), -5px -5px 12px rgba(255, 255, 255, 0.8); position: relative;
}
.ig-tree-node::after { content: ''; position: absolute; bottom: -2rem; left: 50%; transform: translateX(-50%); width: 2px; height: 2rem; background: #305cde; opacity: 0.5; }
.ig-tree-children { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; width: 100%; }
.ig-tree-child {
  padding: 0.85rem 1.5rem; border-radius: 16px; background: #e0e5ec; color: #1e293b; border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 4px 4px 10px rgba(163, 177, 198, 0.4), -4px -4px 10px rgba(255, 255, 255, 0.8); font-size: 0.92rem; font-weight: 600;
}
[data-theme='dark'] .ig-tree-node, body.dark-mode .ig-tree-node {
  background: #181f2a; color: #60a5fa; border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 5px 5px 12px rgba(10, 14, 23, 0.7), -5px -5px 12px rgba(35, 45, 60, 0.4);
}
[data-theme='dark'] .ig-tree-child, body.dark-mode .ig-tree-child {
  background: #181f2a; color: #f8fafc; border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 4px 4px 10px rgba(10, 14, 23, 0.7), -4px -4px 10px rgba(35, 45, 60, 0.4);
}

.ig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.ig-grid-card {
  padding: 1.5rem; border-radius: 20px; background: #e0e5ec; border: 1px solid rgba(255, 255, 255, 0.7); text-align: center;
  box-shadow: 6px 6px 14px rgba(163, 177, 198, 0.5), -6px -6px 14px rgba(255, 255, 255, 0.8); position: relative;
}
[data-theme='dark'] .ig-grid-card, body.dark-mode .ig-grid-card {
  background: #181f2a; border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 6px 6px 14px rgba(10, 14, 23, 0.7), -6px -6px 14px rgba(35, 45, 60, 0.4); color: #f8fafc;
}
.ig-grid-icon {
  font-size: 1.8rem; margin-bottom: 0.85rem; display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; background: #e0e5ec; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 50%;
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.5), inset -3px -3px 6px rgba(255, 255, 255, 0.8); color: #305cde;
}
[data-theme='dark'] .ig-grid-icon, body.dark-mode .ig-grid-icon {
  background: #181f2a; border-color: rgba(255, 255, 255, 0.08); color: #60a5fa;
  box-shadow: inset 3px 3px 6px rgba(10, 14, 23, 0.7), inset -3px -3px 6px rgba(35, 45, 60, 0.4);
}
.ig-grid-card h5 { font-size: 1.1rem; font-weight: 700; margin: 0.5rem 0; }
.ig-grid-card p { font-size: 0.88rem; opacity: 0.85; margin: 0; }

/* ------------------------------------------------------------------ */
/* New infographic designs                                             */
/* ------------------------------------------------------------------ */
.infographic-wrapper h5 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
.infographic-wrapper p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--ig-muted); }

/* Vertical timeline */
.ig-timeline { position: relative; padding-left: 2.25rem; display: flex; flex-direction: column; gap: 1.1rem; }
.ig-timeline::before { content: ''; position: absolute; left: 0.7rem; top: 0.4rem; bottom: 0.4rem; width: 3px; border-radius: 3px; background: linear-gradient(#305cde, #8b5cf6); opacity: 0.35; }
.ig-tl-item { position: relative; background: var(--ig-surface); border: 1px solid var(--ig-border); border-left: 4px solid var(--ig-accent); border-radius: 12px; padding: 0.9rem 1.1rem; box-shadow: var(--ig-shadow); }
.ig-tl-item::before { content: ''; position: absolute; left: -2.02rem; top: 1.05rem; width: 15px; height: 15px; border-radius: 50%; background: var(--ig-surface); border: 4px solid var(--ig-accent); box-sizing: border-box; }
.ig-tl-date { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ig-accent); margin-bottom: 4px; }

/* Horizontal roadmap */
.ig-roadmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; position: relative; }
.ig-rm-item { position: relative; padding: 2.4rem 0.9rem 0.6rem; text-align: center; }
.ig-rm-item::before { content: ''; position: absolute; top: 0.95rem; left: 0; right: 0; height: 4px; background: var(--ig-accent); opacity: 0.85; }
.ig-rm-item:first-child::before { left: 50%; border-radius: 4px 0 0 4px; }
.ig-rm-item:last-child::before { right: 50%; }
.ig-rm-item::after { content: ''; position: absolute; top: 0.45rem; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--ig-surface); border: 5px solid var(--ig-accent); box-sizing: border-box; }
.ig-rm-item .ig-tl-date { display: block; }

/* Process flow (chevrons) */
.ig-process { display: flex; gap: 0; flex-wrap: wrap; }
.ig-process-step { flex: 1 1 150px; min-width: 150px; position: relative; background: var(--ig-accent); color: #fff; padding: 1rem 1.6rem 1rem 2.1rem; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); margin-right: -6px; }
.ig-process-step:first-child { clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); padding-left: 1.2rem; border-radius: 10px 0 0 10px; }
.ig-process-step:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); border-radius: 0 10px 10px 0; margin-right: 0; }
.ig-process-step h5, .ig-process-step p { color: #fff; }
.ig-process-step p { opacity: 0.92; font-size: 0.84rem; }
.ig-process-num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; margin-bottom: 6px; }

/* Cycle */
.ig-cycle { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.6rem; position: relative; padding-bottom: 2.4rem; }
.ig-cycle-item { position: relative; background: var(--ig-surface); border: 2px solid var(--ig-accent); border-radius: 999px; padding: 1.1rem 1.2rem; text-align: center; box-shadow: var(--ig-shadow); }
.ig-cycle-item:not(:last-child)::after { content: '\2192'; position: absolute; right: -1.35rem; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 1.2rem; color: var(--ig-muted); }
.ig-cycle::after { content: '\21BA  repeats'; position: absolute; left: 50%; bottom: 0.2rem; transform: translateX(-50%); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ig-muted); border: 1px dashed var(--ig-border); padding: 2px 14px; border-radius: 999px; }

/* Pyramid (first item = top) */
.ig-pyramid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ig-pyr-level { background: var(--ig-accent); color: #fff; text-align: center; padding: 0.75rem 1rem; border-radius: 8px; box-sizing: border-box; }
.ig-pyr-level h5, .ig-pyr-level p { color: #fff; }
.ig-pyr-level:nth-child(1) { width: 34%; }
.ig-pyr-level:nth-child(2) { width: 50%; }
.ig-pyr-level:nth-child(3) { width: 66%; }
.ig-pyr-level:nth-child(4) { width: 82%; }
.ig-pyr-level:nth-child(n + 5) { width: 100%; }

/* Funnel (first item = widest) */
.ig-funnel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ig-funnel-stage { background: var(--ig-accent); color: #fff; text-align: center; padding: 0.75rem 2rem; box-sizing: border-box; clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 22px 100%); }
.ig-funnel-stage h5, .ig-funnel-stage p { color: #fff; }
.ig-funnel-stage:nth-child(1) { width: 100%; }
.ig-funnel-stage:nth-child(2) { width: 86%; }
.ig-funnel-stage:nth-child(3) { width: 72%; }
.ig-funnel-stage:nth-child(4) { width: 58%; }
.ig-funnel-stage:nth-child(n + 5) { width: 46%; }

/* KPI / stat cards */
.ig-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.ig-stat { background: var(--ig-surface); border: 1px solid var(--ig-border); border-top: 4px solid var(--ig-accent); border-radius: 14px; padding: 1.1rem; text-align: center; box-shadow: var(--ig-shadow); }
.ig-stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--ig-accent); letter-spacing: -0.02em; }
.ig-stat-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; color: var(--ig-text); }

/* Pros & cons / Do's & don'ts */
.ig-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ig-pc-col { background: var(--ig-surface); border: 1px solid var(--ig-border); border-radius: 14px; padding: 1rem 1.2rem; box-shadow: var(--ig-shadow); }
.ig-pc-col h5 { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid currentColor; margin-bottom: 8px; }
.ig-pc-col.pros h5 { color: #059669; }
.ig-pc-col.cons h5 { color: #dc2626; }
.ig-pc-col ul { margin: 0; padding-left: 0; list-style: none; }
.ig-pc-col li { position: relative; padding: 4px 0 4px 26px; font-size: 0.9rem; color: var(--ig-text); }
.ig-pc-col.pros li::before { content: '\2714'; position: absolute; left: 4px; color: #10b981; font-weight: 800; }
.ig-pc-col.cons li::before { content: '\2716'; position: absolute; left: 4px; color: #ef4444; font-weight: 800; }

/* Venn (two sets) */
.ig-venn { position: relative; display: grid; grid-template-columns: 1fr 0.7fr 1fr; align-items: center; min-height: 240px; max-width: 540px; margin: 0 auto; }
.ig-venn-circle { grid-row: 1; aspect-ratio: 1 / 1; border-radius: 50%; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 14% 18%; box-sizing: border-box; }
.ig-venn-circle.a { grid-column: 1 / 3; background: rgba(48, 92, 222, 0.16); border: 2px solid rgba(48, 92, 222, 0.55); padding-right: 40%; padding-left: 12%; }
.ig-venn-circle.b { grid-column: 2 / 4; background: rgba(16, 185, 129, 0.16); border: 2px solid rgba(16, 185, 129, 0.55); padding-left: 40%; padding-right: 12%; }
.ig-venn-overlap { grid-column: 2; grid-row: 1; z-index: 1; text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--ig-text); padding: 0 8px; line-height: 1.3; }

/* 2x2 matrix / SWOT */
.ig-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ig-matrix-cell { background: var(--ig-surface); border: 1px solid var(--ig-border); border-radius: 14px; padding: 1rem 1.1rem; position: relative; overflow: hidden; box-shadow: var(--ig-shadow); }
.ig-matrix-cell::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--ig-accent); }
.ig-matrix-cell h5 { color: var(--ig-accent); }
.ig-matrix-cell ul { margin: 4px 0 0; padding-left: 18px; font-size: 0.88rem; color: var(--ig-muted); }

/* Hub & spoke (mind map) */
.ig-hub { display: grid; grid-template-columns: 1fr minmax(150px, 0.8fr) 1fr; grid-auto-flow: dense; gap: 0.8rem 2.2rem; align-items: center; }
.ig-hub-center { grid-column: 2; grid-row: 1 / span 3; align-self: center; text-align: center; background: linear-gradient(135deg, #305cde, #8b5cf6); color: #fff; border-radius: 50%; aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: center; padding: 1rem; box-shadow: 0 10px 28px rgba(48, 92, 222, 0.35); }
.ig-hub-center h5, .ig-hub-center p { color: #fff; }
.ig-hub-spoke { position: relative; background: var(--ig-surface); border: 1px solid var(--ig-border); border-radius: 12px; padding: 0.7rem 0.9rem; box-shadow: var(--ig-shadow); border-left: 4px solid var(--ig-accent); }
.ig-hub-spoke:nth-child(odd)::after, .ig-hub-spoke:nth-child(even)::after { content: ''; position: absolute; top: 50%; width: 2.2rem; height: 2px; background: var(--ig-border); }
.ig-hub-spoke:nth-child(odd)::after { right: -2.25rem; }
.ig-hub-spoke:nth-child(even)::after { left: -2.25rem; }

/* Checklist */
.ig-checklist { display: grid; gap: 8px; }
.ig-check-item { display: flex; gap: 12px; align-items: flex-start; background: var(--ig-surface); border: 1px solid var(--ig-border); border-radius: 12px; padding: 0.75rem 1rem; box-shadow: var(--ig-shadow); }
.ig-check-item::before { content: '\2713'; flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--ig-good); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.ig-check-item > div { flex: 1; }

/* Bar chart / progress */
.ig-bars { display: grid; gap: 12px; }
.ig-bar { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; gap: 12px; align-items: center; }
.ig-bar-label { font-weight: 600; font-size: 0.9rem; color: var(--ig-text); }
.ig-bar-track { height: 14px; background: var(--ig-surface-2); border: 1px solid var(--ig-border); border-radius: 999px; overflow: hidden; }
.ig-bar-fill { height: 100%; background: var(--ig-accent); border-radius: 999px; width: 50%; transition: width 0.6s ease; }
.ig-bar-value { font-weight: 800; font-size: 0.9rem; color: var(--ig-accent); min-width: 3ch; text-align: right; }

@media (max-width: 640px) {
  .ig-comparison, .ig-proscons, .ig-matrix { grid-template-columns: 1fr; }
  .ig-process { flex-direction: column; gap: 6px; }
  .ig-process-step, .ig-process-step:first-child, .ig-process-step:last-child { clip-path: none; border-radius: 10px; margin: 0; padding-left: 1.2rem; }
  .ig-cycle-item:not(:last-child)::after { display: none; }
  .ig-hub { grid-template-columns: 1fr; }
  .ig-hub-center { grid-column: 1; grid-row: auto; width: 60%; margin: 0 auto; }
  .ig-hub-spoke::after { display: none; }
  .ig-roadmap { grid-template-columns: 1fr; }
  .ig-venn { grid-template-columns: 1fr; }
  .ig-venn-circle.a, .ig-venn-circle.b { grid-column: 1; grid-row: auto; padding: 12%; aspect-ratio: auto; border-radius: 18px; }
  .ig-venn-overlap { grid-column: 1; grid-row: auto; padding: 6px; }
}

/* ------------------------------------------------------------------ */
/* Layout blocks: columns, quote, boxes, shapes, buttons, sim links    */
/* ------------------------------------------------------------------ */
.lab-columns { display: grid; gap: 1.25rem; margin: 1.25rem 0; }
.lab-columns.cols-2 { grid-template-columns: 1fr 1fr; }
.lab-columns.cols-3 { grid-template-columns: repeat(3, 1fr); }
.lab-columns.cols-1-2 { grid-template-columns: 1fr 2fr; }
.lab-col { min-width: 0; }
@media (max-width: 760px) { .lab-columns.cols-2, .lab-columns.cols-3, .lab-columns.cols-1-2 { grid-template-columns: 1fr; } }

.lab-quote { margin: 1.4rem 0; padding: 1rem 1.3rem 1rem 3.2rem; position: relative; border-radius: 12px; background: var(--ig-surface-2); color: var(--ig-text); font-size: 1.05rem; font-style: italic; border-left: 4px solid var(--ig-accent); }
.lab-quote::before { content: '\201C'; position: absolute; left: 0.8rem; top: -0.2rem; font-size: 3.4rem; line-height: 1; color: var(--ig-accent); opacity: 0.5; font-style: normal; }
.lab-quote cite { display: block; margin-top: 6px; font-size: 0.82rem; font-style: normal; font-weight: 600; color: var(--ig-muted); }

.lab-box { margin: 1rem 0; padding: 1rem 1.2rem; border-radius: 12px; color: var(--ig-text); }
.lab-box--card { background: var(--ig-surface); border: 1px solid var(--ig-border); box-shadow: var(--ig-shadow); }
.lab-box--outline { border: 2px solid var(--ig-accent); }
.lab-box--accent { border-left: 5px solid var(--ig-accent); background: var(--ig-surface-2); }
.lab-box--blue { background: rgba(48, 92, 222, 0.1); border: 1px solid rgba(48, 92, 222, 0.25); }
.lab-box--green { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.28); }
.lab-box--orange { background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.28); }
.lab-box--purple { background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.28); }
.lab-box--shadow { box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14); background: var(--ig-surface); }

.lab-shape { margin: 1rem 0; color: var(--ig-text); }
.lab-shape--banner { background: linear-gradient(120deg, #305cde, #8b5cf6); color: #fff; padding: 1.1rem 1.4rem; border-radius: 14px; font-weight: 600; box-shadow: 0 10px 26px rgba(48, 92, 222, 0.28); }
.lab-shape--banner * { color: #fff !important; }
.lab-shape--arrow { display: inline-block; background: var(--ig-accent); color: #fff; padding: 0.6rem 2.2rem 0.6rem 1.2rem; font-weight: 700; clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 0 100%); }
.lab-shape--pill { display: inline-block; padding: 0.35rem 1rem; border-radius: 999px; background: rgba(48, 92, 222, 0.12); color: #305cde; font-weight: 700; font-size: 0.85rem; }
.lab-shape--circle { width: 110px; height: 110px; border-radius: 50%; background: var(--ig-accent); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; padding: 10px; box-sizing: border-box; }
.lab-shape--sticky { max-width: 340px; background: #fef08a; color: #422006; padding: 1rem 1.1rem; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); transform: rotate(-1.2deg); border-radius: 2px 2px 14px 2px; }
.lab-shape--sticky * { color: #422006 !important; }
.lab-shape--takeaway { display: flex; gap: 14px; align-items: flex-start; border: 2px dashed var(--ig-accent); border-radius: 14px; padding: 1rem 1.2rem; background: var(--ig-surface); }
.lab-shape--takeaway::before { content: '\1F4A1'; font-size: 1.6rem; line-height: 1; }

.lab-button { display: inline-flex; align-items: center; gap: 6px; padding: 0.6rem 1.2rem; border-radius: 10px; background: #305cde; color: #fff !important; font-weight: 700; text-decoration: none !important; box-shadow: 0 6px 16px rgba(48, 92, 222, 0.3); }
.lab-button:hover { background: #2448b8; }

.lab-sim-link { display: inline-flex; align-items: center; gap: 10px; padding: 0.6rem 1rem; border: 1px solid #c7d2fe; background: rgba(48, 92, 222, 0.06); border-radius: 12px; margin: 0.6rem 0; }
.lab-sim-link img { width: 28px !important; height: 28px; margin: 0 !important; }

.lab-code { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 1rem 1.2rem; overflow-x: auto; font-family: 'Courier New', Courier, monospace; font-size: 0.88rem; line-height: 1.5; border: 1px solid #1e293b; }
.lab-code code { background: none; color: inherit; padding: 0; font-family: inherit; white-space: pre; }

.lab-table { width: 100%; border-collapse: collapse; }

/* ------------------------------------------------------------------ */
/* Math & chemistry formulas                                           */
/* ------------------------------------------------------------------ */
.lab-math { display: inline-block; max-width: 100%; vertical-align: middle; }
.lab-math-block { display: block; text-align: center; margin: 1rem 0; overflow-x: auto; overflow-y: hidden; padding: 0.4rem 0; }

/* ------------------------------------------------------------------ */
/* Interactive widgets                                                 */
/* ------------------------------------------------------------------ */
.lab-ix { margin: 1.5rem 0; color: var(--ig-text); }
.lab-ix-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 0.75rem; display: flex; align-items: center; gap: 8px; }
.lab-ix-hint { font-size: 0.75rem; color: var(--ig-muted); margin-top: 6px; }
.lab-ix-btn { appearance: none; border: 1px solid var(--ig-border); background: var(--ig-surface); color: var(--ig-text); border-radius: 9px; padding: 0.45rem 0.95rem; font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.lab-ix-btn:hover { border-color: var(--ig-accent); color: var(--ig-accent); }
.lab-ix-btn.primary { background: var(--ig-accent); border-color: var(--ig-accent); color: #fff; }
.lab-ix-btn.primary:hover { filter: brightness(1.08); color: #fff; }
.lab-ix-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 0.9rem; }
.lab-ix-result { font-weight: 700; font-size: 0.9rem; }
.lab-ix-result.good { color: #059669; }
.lab-ix-result.bad { color: #dc2626; }

/* Flip cards */
.lab-flipcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.lab-flip-card { perspective: 1000px; min-height: 170px; cursor: pointer; outline: none; }
.lab-flip-inner { position: relative; width: 100%; height: 100%; min-height: 170px; transition: transform 0.55s ease; transform-style: preserve-3d; }
.lab-flip-front, .lab-flip-back { border-radius: 14px; padding: 1.1rem; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; text-align: center; box-shadow: var(--ig-shadow); }
.lab-flip-front { background: var(--ig-surface); border: 1px solid var(--ig-border); border-top: 4px solid var(--ig-accent); font-weight: 700; }
.lab-flip-back { background: var(--ig-accent); color: #fff; margin-top: 8px; font-size: 0.92rem; }
.lab-flip-back * { color: #fff; }
.lab-ix-ready .lab-flip-front, .lab-ix-ready .lab-flip-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; margin: 0; }
.lab-ix-ready .lab-flip-back { transform: rotateY(180deg); }
.lab-ix-ready .lab-flip-card.is-flipped .lab-flip-inner { transform: rotateY(180deg); }
.lab-flip-front::after { content: 'Tap to flip \21BB'; display: block; margin-top: 10px; font-size: 0.7rem; font-weight: 600; color: var(--ig-muted); letter-spacing: 0.04em; }
.lab-flipcards > .lab-flip-card:nth-child(5n + 2) { --ig-accent: #10b981; }
.lab-flipcards > .lab-flip-card:nth-child(5n + 3) { --ig-accent: #f97316; }
.lab-flipcards > .lab-flip-card:nth-child(5n + 4) { --ig-accent: #8b5cf6; }
.lab-flipcards > .lab-flip-card:nth-child(5n + 5) { --ig-accent: #ec4899; }

/* Accordion & reveal (native <details>) */
.lab-accordion { border: 1px solid var(--ig-border); border-radius: 14px; overflow: hidden; background: var(--ig-surface); box-shadow: var(--ig-shadow); }
.lab-acc-item + .lab-acc-item { border-top: 1px solid var(--ig-border); }
.lab-acc-item > summary, .lab-reveal > summary { cursor: pointer; list-style: none; padding: 0.85rem 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.lab-acc-item > summary::-webkit-details-marker, .lab-reveal > summary::-webkit-details-marker { display: none; }
.lab-acc-item > summary::before, .lab-reveal > summary::before { content: '+'; flex: 0 0 24px; height: 24px; border-radius: 7px; background: rgba(48, 92, 222, 0.12); color: #305cde; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.lab-acc-item[open] > summary::before, .lab-reveal[open] > summary::before { content: '\2212'; background: #305cde; color: #fff; }
.lab-acc-body { padding: 0 1.1rem 1rem 3.2rem; color: var(--ig-text); }
.lab-reveal { border: 1px dashed #305cde; border-radius: 14px; background: rgba(48, 92, 222, 0.05); }
.lab-reveal-body { padding: 0 1.1rem 1rem 3.2rem; }

/* Tabs */
.lab-tabs { border: 1px solid var(--ig-border); border-radius: 14px; background: var(--ig-surface); box-shadow: var(--ig-shadow); overflow: hidden; }
.lab-tabs-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--ig-surface-2); border-bottom: 1px solid var(--ig-border); }
.lab-tab { appearance: none; border: 0; background: transparent; color: var(--ig-muted); font: inherit; font-weight: 700; font-size: 0.88rem; padding: 0.5rem 0.95rem; border-radius: 9px; cursor: pointer; }
.lab-tab.is-active { background: var(--ig-surface); color: #305cde; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1); }
.lab-tab-panel { padding: 1rem 1.2rem; }
.lab-ix-ready .lab-tab-panel:not(.is-active) { display: none; }

/* Flashcard deck & step carousel */
.lab-flashcards, .lab-stepper { border: 1px solid var(--ig-border); border-radius: 16px; background: var(--ig-surface); box-shadow: var(--ig-shadow); padding: 1rem; }
.lab-fc-card { border-radius: 14px; padding: 1.4rem; text-align: center; min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 10px; background: var(--ig-surface-2); margin-bottom: 8px; }
.lab-fc-front { font-size: 1.2rem; font-weight: 800; }
.lab-fc-back { font-size: 0.95rem; color: var(--ig-muted); border-top: 1px dashed var(--ig-border); padding-top: 10px; }
.lab-ix-ready .lab-fc-card { display: none; margin: 0; cursor: pointer; }
.lab-ix-ready .lab-fc-card.is-current { display: flex; }
.lab-ix-ready .lab-fc-card:not(.is-flipped) .lab-fc-back { display: none; }
.lab-ix-ready .lab-fc-card.is-flipped .lab-fc-front { font-size: 0.85rem; color: var(--ig-muted); }
.lab-ix-ready .lab-fc-card.is-flipped .lab-fc-back { border-top: 0; padding-top: 0; color: var(--ig-text); font-size: 1.05rem; }
.lab-step { padding: 0.4rem 0.4rem 0.8rem; border-bottom: 1px dashed var(--ig-border); margin-bottom: 8px; }
.lab-step-num { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #305cde; margin-bottom: 4px; }
.lab-ix-ready .lab-step { display: none; border: 0; margin: 0; }
.lab-ix-ready .lab-step.is-current { display: block; animation: labFadeIn 0.35s ease; }
.lab-ix-nav { display: none; align-items: center; justify-content: space-between; gap: 10px; margin-top: 0.6rem; }
.lab-ix-ready .lab-ix-nav { display: flex; }
.lab-ix-counter { font-size: 0.8rem; font-weight: 700; color: var(--ig-muted); }
.lab-ix-dots { display: flex; gap: 6px; }
.lab-ix-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--ig-border); }
.lab-ix-dots span.is-on { background: #305cde; }

/* Fill in the blanks */
.lab-fillblanks { border: 1px solid var(--ig-border); border-radius: 14px; padding: 1rem 1.2rem; background: var(--ig-surface); box-shadow: var(--ig-shadow); }
.lab-fb-line { line-height: 2.2; margin: 0 0 0.4rem; }
.lab-blank { display: inline-block; min-width: 90px; border: 0; border-bottom: 2px solid #305cde; background: rgba(48, 92, 222, 0.06); padding: 2px 8px; font: inherit; color: var(--ig-text); border-radius: 6px 6px 0 0; text-align: center; }
.lab-blank:focus { outline: none; background: rgba(48, 92, 222, 0.12); }
.lab-blank.is-right { border-color: #10b981; background: rgba(16, 185, 129, 0.12); }
.lab-blank.is-wrong { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* True / False */
.lab-truefalse { display: grid; gap: 10px; }
.lab-tf-item { border: 1px solid var(--ig-border); border-radius: 12px; padding: 0.8rem 1rem; background: var(--ig-surface); box-shadow: var(--ig-shadow); }
.lab-tf-statement { margin: 0 0 8px; font-weight: 600; }
.lab-tf-buttons { display: flex; gap: 8px; }
.lab-tf-item.is-right { border-color: #10b981; }
.lab-tf-item.is-wrong { border-color: #ef4444; }
.lab-tf-btn.is-picked { background: #305cde; color: #fff; border-color: #305cde; }
.lab-tf-feedback { margin-top: 8px; font-size: 0.88rem; }
.lab-ix-ready .lab-tf-feedback { display: none; }
.lab-ix-ready .lab-tf-item.is-answered .lab-tf-feedback { display: block; }

/* Match the following */
.lab-match { border: 1px solid var(--ig-border); border-radius: 14px; padding: 1rem 1.2rem; background: var(--ig-surface); box-shadow: var(--ig-shadow); }
.lab-match-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--ig-border); }
.lab-match-row::after { content: none; }
.lab-match-left { font-weight: 600; }
.lab-match-arrow { color: var(--ig-muted); }
.lab-match-select { width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--ig-border); background: var(--ig-surface-2); color: var(--ig-text); font: inherit; font-size: 0.88rem; }
.lab-match-row.is-right .lab-match-select { border-color: #10b981; background: rgba(16, 185, 129, 0.1); }
.lab-match-row.is-wrong .lab-match-select { border-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.lab-match-answer { font-size: 0.8rem; color: var(--ig-muted); }
.lab-ix-ready .lab-match-answer { display: none; }

/* Formula calculator */
.lab-calc { border: 1px solid var(--ig-border); border-radius: 16px; padding: 1.1rem 1.2rem; background: var(--ig-surface); box-shadow: var(--ig-shadow); border-top: 4px solid #305cde; }
.lab-calc-formula { font-family: 'Courier New', Courier, monospace; font-size: 0.85rem; background: var(--ig-surface-2); border-radius: 8px; padding: 6px 10px; display: inline-block; margin-bottom: 10px; color: var(--ig-muted); }
.lab-calc-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.lab-calc-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 700; color: var(--ig-muted); }
.lab-calc-inputs input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--ig-border); background: var(--ig-surface-2); color: var(--ig-text); font: inherit; font-size: 0.95rem; }
.lab-calc-output { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(48, 92, 222, 0.08); font-weight: 700; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lab-calc-value { color: #305cde; font-size: 1.15rem; }

[data-theme='dark'] .lab-tab.is-active, body.dark-mode .lab-tab.is-active,
[data-theme='dark'] .lab-calc-value, body.dark-mode .lab-calc-value,
[data-theme='dark'] .lab-step-num, body.dark-mode .lab-step-num { color: #7aa2ff; }
[data-theme='dark'] .lab-shape--pill, body.dark-mode .lab-shape--pill { color: #a5b8ff; }

/* ------------------------------------------------------------------ */
/* Entrance animations (PowerPoint-style), only once the runtime runs  */
/* ------------------------------------------------------------------ */
@keyframes labFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes labFadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes labZoomIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes labSlideLeft { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes labSlideRight { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
.lab-anim-armed [data-anim]:not(.lab-anim-in) { opacity: 0; }
.lab-anim-armed [data-anim].lab-anim-in { animation-duration: 0.7s; animation-fill-mode: both; animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
.lab-anim-armed [data-anim='fade'].lab-anim-in { animation-name: labFadeIn; }
.lab-anim-armed [data-anim='fade-up'].lab-anim-in { animation-name: labFadeUp; }
.lab-anim-armed [data-anim='zoom'].lab-anim-in { animation-name: labZoomIn; }
.lab-anim-armed [data-anim='slide-left'].lab-anim-in { animation-name: labSlideLeft; }
.lab-anim-armed [data-anim='slide-right'].lab-anim-in { animation-name: labSlideRight; }
@media (prefers-reduced-motion: reduce) {
  .lab-anim-armed [data-anim]:not(.lab-anim-in) { opacity: 1; }
  .lab-anim-armed [data-anim].lab-anim-in { animation: none; }
  .lab-flip-inner { transition: none; }
}

/* Page / slide break: invisible to students on screen, starts a new page when printed */
.lab-page-break { height: 0; margin: 0; border: 0; break-after: page; page-break-after: always; }

/* ------------------------------------------------------------------ */
/* Typography inside components. The lab page and the editor style     */
/* every h5/p/li through #sectionContent / .editor-content selectors,  */
/* so these few rules need !important to keep the designs intact.      */
/* ------------------------------------------------------------------ */
:is(.ig-timeline, .ig-roadmap, .ig-process, .ig-cycle, .ig-pyramid, .ig-funnel, .ig-stats, .ig-proscons, .ig-venn, .ig-matrix, .ig-hub, .ig-checklist, .ig-bars) :is(h5, p) {
  margin: 0 0 4px !important;
  line-height: 1.35 !important;
}
:is(.ig-timeline, .ig-roadmap, .ig-cycle, .ig-stats, .ig-proscons, .ig-venn, .ig-matrix, .ig-hub-spoke, .ig-checklist) h5 { color: var(--ig-text) !important; font-size: 1.02rem !important; font-weight: 700 !important; }
:is(.ig-timeline, .ig-roadmap, .ig-cycle, .ig-stats, .ig-venn, .ig-matrix, .ig-hub-spoke, .ig-checklist) p { color: var(--ig-muted) !important; font-size: 0.88rem !important; }
.ig-matrix-cell h5 { color: var(--ig-accent) !important; }
:is(.ig-process-step, .ig-pyr-level, .ig-funnel-stage, .ig-hub-center) :is(h5, p, li, span) { color: #fff !important; }
:is(.ig-process-step, .ig-pyr-level, .ig-funnel-stage, .ig-hub-center) h5 { font-size: 1rem !important; font-weight: 700 !important; }
:is(.ig-process-step, .ig-pyr-level, .ig-funnel-stage, .ig-hub-center) p { font-size: 0.84rem !important; opacity: 0.95; }
.ig-pc-col ul, .ig-matrix-cell ul { padding-left: 0 !important; margin: 0 !important; list-style: none !important; }
.ig-matrix-cell ul { padding-left: 18px !important; list-style: disc !important; }
.ig-pc-col li, .ig-matrix-cell li { margin: 0 !important; font-size: 0.9rem !important; color: var(--ig-text) !important; }
.ig-pc-col.pros h5 { color: #059669 !important; }
.ig-pc-col.cons h5 { color: #dc2626 !important; }
.ig-stat-value { color: var(--ig-accent) !important; }
.ig-tl-date { color: var(--ig-accent) !important; margin-bottom: 2px !important; }

.lab-ix h5.lab-ix-title { margin: 0 0 0.75rem !important; font-size: 1.02rem !important; color: var(--ig-text) !important; }
.lab-ix :is(.lab-acc-body, .lab-reveal-body, .lab-tab-panel, .lab-step) p { margin: 0 0 0.5em !important; }
.lab-step h5 { margin: 0 0 6px !important; font-size: 1.1rem !important; color: var(--ig-text) !important; }
.lab-flip-back, .lab-flip-back * { color: #fff !important; }
.lab-flip-front { color: var(--ig-text) !important; }
.lab-fb-line { margin: 0 0 0.4rem !important; color: var(--ig-text) !important; }
.lab-tf-statement { margin: 0 0 8px !important; color: var(--ig-text) !important; font-size: 0.95rem !important; }
.lab-tf-feedback { color: var(--ig-text) !important; }
.lab-shape--banner, .lab-shape--banner :is(p, h4, h5, strong, span) { color: #fff !important; margin: 0 !important; }
.lab-shape--sticky, .lab-shape--sticky :is(p, strong, span) { color: #422006 !important; }
.lab-columns .lab-col > :first-child { margin-top: 0 !important; }

/* Learning blocks (Oct 2026): runnable code, download cards, coded diagrams */
.run-code-block { margin: 0.6rem 0; }
.run-code-block .lab-code { margin-bottom: 0; }
.lab-button.run-code-btn { background: #059669; box-shadow: 0 6px 16px rgba(5, 150, 105, 0.28); font-size: 0.92rem; padding: 0.5rem 1rem; }
.lab-button.run-code-btn:hover { background: #047857; }
.dl-card h5 { font-weight: 700; }
.dl-card .lab-button { margin-top: 2px; }
.lab-figure svg { max-width: 100%; height: auto; }
@media (max-width: 600px) { .dl-card { flex-direction: column; } }

/* ------------------------------------------------------------------ */
/* Oct 2026: sort, order, multi-select, branching scenario, worked     */
/* example, common mistakes, charts, interactive tables, glossary      */
/* ------------------------------------------------------------------ */
.lab-sort, .lab-order, .lab-multi, .lab-branch, .lab-worked, .lab-mistakes, .lab-chart { border: 1px solid var(--ig-border); border-radius: 16px; padding: 1rem 1.2rem; background: var(--ig-surface); box-shadow: var(--ig-shadow); }
.lab-ix .lab-ix-hint { margin: -0.3rem 0 0.8rem !important; font-size: 0.8rem !important; color: var(--ig-muted) !important; }

/* Sort into groups */
.lab-sort-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; padding: 10px; border: 2px dashed var(--ig-border); border-radius: 12px; background: var(--ig-surface-2); margin-bottom: 12px; }
.lab-sort-item { padding: 8px 12px; border-radius: 10px; background: var(--ig-surface); border: 1px solid var(--ig-border); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); font-size: 0.9rem; font-weight: 600; color: var(--ig-text); }
.lab-ix-ready .lab-sort-item { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.lab-sort-item.is-selected { outline: 3px solid var(--ig-accent); outline-offset: 1px; }
.lab-sort-item.is-dragging { opacity: 0.45; }
.lab-sort-item.is-right { border-color: var(--ig-good); background: rgba(16, 185, 129, 0.12); }
.lab-sort-item.is-wrong { border-color: var(--ig-bad); background: rgba(239, 68, 68, 0.1); }
.lab-sort:not(.lab-ix-ready) .lab-sort-item::after { content: ' → ' attr(data-group); font-weight: 400; color: var(--ig-muted); font-size: 0.8rem; }
.lab-sort-buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.lab-sort-bucket { border: 1px solid var(--ig-border); border-top: 4px solid var(--ig-accent); border-radius: 12px; padding: 8px; background: var(--ig-surface); min-height: 110px; }
.lab-ix-ready .lab-sort-bucket { cursor: pointer; }
.lab-sort-buckets > .lab-sort-bucket:nth-child(4n + 2) { border-top-color: #10b981; }
.lab-sort-buckets > .lab-sort-bucket:nth-child(4n + 3) { border-top-color: #f97316; }
.lab-sort-buckets > .lab-sort-bucket:nth-child(4n + 4) { border-top-color: #8b5cf6; }
.lab-sort-bucket-title { font-weight: 800; font-size: 0.88rem; margin-bottom: 6px; color: var(--ig-text); }
.lab-sort-drop { display: flex; flex-direction: column; gap: 6px; min-height: 60px; }
.lab-sort-bucket.lab-drop-hover, .lab-sort-pool.lab-drop-hover { background: rgba(48, 92, 222, 0.08); }

/* Put in order */
.lab-order-list { list-style: none; counter-reset: lab-ord; padding: 0 !important; margin: 0 !important; display: grid; gap: 8px; }
.lab-order-item { counter-increment: lab-ord; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--ig-border); border-radius: 10px; background: var(--ig-surface-2); margin: 0 !important; color: var(--ig-text); }
.lab-order-item::before { content: counter(lab-ord); flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--ig-accent); color: #fff; font-weight: 800; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
.lab-order-text { flex: 1; font-weight: 600; font-size: 0.92rem; }
.lab-order-ctrl { display: none; gap: 4px; }
.lab-ix-ready .lab-order-ctrl { display: flex; }
.lab-order-ctrl .lab-ix-btn { padding: 0.2rem 0.55rem; font-size: 0.75rem; }
.lab-ix-ready .lab-order-item { cursor: grab; user-select: none; -webkit-user-select: none; }
.lab-order-item.is-dragging { opacity: 0.45; }
.lab-order-item.is-right { border-color: var(--ig-good); background: rgba(16, 185, 129, 0.12); }
.lab-order-item.is-wrong { border-color: var(--ig-bad); background: rgba(239, 68, 68, 0.1); }

/* Multi-select */
.lab-ms-q + .lab-ms-q { border-top: 1px dashed var(--ig-border); margin-top: 1rem; padding-top: 1rem; }
.lab-ix .lab-ms-question { font-weight: 700 !important; margin: 0 0 4px !important; color: var(--ig-text) !important; }
.lab-ms-question::after { content: 'Select all that apply'; display: block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ig-accent); margin-top: 2px; }
.lab-ms-options { display: grid; gap: 6px; margin-top: 8px; }
.lab-ms-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--ig-border); border-radius: 10px; background: var(--ig-surface-2); cursor: pointer; font-size: 0.92rem; color: var(--ig-text); margin: 0; }
.lab-ms-opt input { width: 18px; height: 18px; accent-color: #305cde; flex: 0 0 auto; margin: 0; }
.lab-multi:not(.lab-ix-ready) .lab-ms-opt[data-correct='1'] { border-color: var(--ig-good); }
.lab-multi:not(.lab-ix-ready) .lab-ms-opt[data-correct='1']::after { content: '✓ correct'; margin-left: auto; font-size: 0.75rem; font-weight: 700; color: #059669; }
.lab-ms-opt.is-right { border-color: var(--ig-good); background: rgba(16, 185, 129, 0.12); }
.lab-ms-opt.is-wrong { border-color: var(--ig-bad); background: rgba(239, 68, 68, 0.1); }
.lab-ms-opt.is-missed { border: 2px dashed var(--ig-good); }
.lab-ms-feedback { margin-top: 8px; font-size: 0.88rem; color: var(--ig-text); }
.lab-ms-feedback:empty { display: none; }
.lab-ix-ready .lab-ms-feedback { display: none; }
.lab-ix-ready .lab-ms-q.is-checked .lab-ms-feedback:not(:empty) { display: block; }

/* Branching scenario */
.lab-br-node { border: 1px solid var(--ig-border); border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 10px; background: var(--ig-surface-2); }
.lab-ix .lab-br-text { margin: 0 0 10px !important; color: var(--ig-text) !important; font-size: 0.98rem !important; }
.lab-br-choices { display: grid; gap: 8px; }
.lab-br-choice { text-align: left; white-space: normal; }
.lab-br-id { display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ig-muted); background: var(--ig-surface); border: 1px solid var(--ig-border); border-radius: 6px; padding: 1px 6px; margin-bottom: 6px; }
.lab-branch:not(.lab-ix-ready) .lab-br-choice::after { content: ' → ' attr(data-target); color: var(--ig-muted); font-weight: 400; }
.lab-br-outcome { display: block; font-weight: 800; margin-bottom: 6px; }
.lab-br-end[data-outcome='good'] { border-color: var(--ig-good); background: rgba(16, 185, 129, 0.1); }
.lab-br-end[data-outcome='bad'] { border-color: var(--ig-bad); background: rgba(239, 68, 68, 0.08); }
.lab-br-end[data-outcome='okay'] { border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.lab-ix-ready .lab-br-id { display: none; }
.lab-ix-ready .lab-br-node { display: none; }
.lab-ix-ready .lab-br-node.is-current { display: block; animation: labFadeIn 0.35s ease; }
.lab-br-trail { display: grid; gap: 6px; margin-bottom: 10px; }
.lab-br-trail:empty { display: none; }
.lab-br-step { font-size: 0.82rem; border-left: 3px solid var(--ig-accent); padding: 2px 10px; color: var(--ig-muted); }
.lab-br-step-q { display: block; }
.lab-br-step-a { display: block; font-weight: 700; color: var(--ig-text); }
.lab-ix-ready.lab-branch:not(.has-trail) .lab-br-actions { display: none; }

/* Worked example */
.lab-worked { border-top: 4px solid #8b5cf6; }
.lab-wk-label { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #8b5cf6; margin-bottom: 4px; }
.lab-wk-problem { background: rgba(139, 92, 246, 0.08); border-radius: 10px; padding: 0.7rem 0.9rem; margin-bottom: 10px; }
.lab-ix .lab-wk-problem p, .lab-ix .lab-wk-try p { margin: 0 !important; color: var(--ig-text) !important; }
.lab-wk-steps { padding-left: 1.4rem !important; margin: 0 0 4px !important; }
.lab-wk-step { margin: 0 0 8px !important; padding-left: 4px; }
.lab-ix .lab-wk-step h5 { margin: 0 0 2px !important; font-size: 0.98rem !important; color: var(--ig-text) !important; }
.lab-ix .lab-wk-step p { margin: 0 !important; }
.lab-ix-ready .lab-wk-step:not(.is-shown) { display: none; }
.lab-ix-ready .lab-wk-step.is-shown { animation: labFadeIn 0.35s ease; }
.lab-wk-actions { display: none; }
.lab-ix-ready .lab-wk-actions { display: flex; }
.lab-ix-ready.lab-worked.is-complete .lab-wk-actions .lab-ix-btn { display: none; }
.lab-wk-try { margin-top: 12px; border: 1px dashed #8b5cf6; border-radius: 10px; padding: 0.7rem 0.9rem; }
.lab-ix-ready.lab-worked:not(.is-complete) .lab-wk-try { display: none; }
.lab-wk-answer { margin-top: 8px; }
.lab-wk-answer > summary { cursor: pointer; font-weight: 700; color: #8b5cf6; }
[data-theme='dark'] .lab-wk-label, body.dark-mode .lab-wk-label, [data-theme='dark'] .lab-wk-answer > summary, body.dark-mode .lab-wk-answer > summary { color: #b79cff; }

/* Common mistakes */
.lab-mk-item { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--ig-border); }
.lab-mk-item:last-child { border-bottom: 0; }
.lab-mk-wrong, .lab-mk-right { border-radius: 10px; padding: 0.6rem 0.8rem; }
.lab-mk-wrong { background: rgba(239, 68, 68, 0.08); border-left: 4px solid var(--ig-bad); }
.lab-mk-right { background: rgba(16, 185, 129, 0.1); border-left: 4px solid var(--ig-good); }
.lab-mk-label { display: block; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 2px; }
.lab-mk-wrong .lab-mk-label { color: #dc2626; }
.lab-mk-right .lab-mk-label { color: #059669; }
.lab-ix .lab-mk-item p { margin: 0 !important; color: var(--ig-text) !important; font-size: 0.92rem !important; }
.lab-ix .lab-mk-item .lab-mk-why { grid-column: 1 / -1; font-size: 0.86rem !important; color: var(--ig-muted) !important; }
@media (max-width: 640px) { .lab-mk-item { grid-template-columns: 1fr; } }

/* Interactive chart */
.lab-ch-canvas svg { display: block; width: 100%; height: auto; max-height: 420px; overflow: visible; }
.lab-ch-grid { stroke: var(--ig-border); stroke-width: 1; }
.lab-ch-axis { stroke: var(--ig-muted); }
.lab-ch-yl, .lab-ch-xl { fill: var(--ig-muted); font-size: 12px; font-family: inherit; }
.lab-ch-val { fill: var(--ig-text); font-size: 11px; font-weight: 700; font-family: inherit; }
.lab-ch-pct { fill: #fff; font-size: 14px; font-weight: 800; font-family: inherit; pointer-events: none; }
.lab-ch-bar, .lab-ch-slice { stroke: none; transition: opacity 0.15s; cursor: default; }
.lab-ch-slice { stroke: var(--ig-surface); stroke-width: 2; }
.lab-ch-bar:hover, .lab-ch-slice:hover, .lab-ch-dot:hover { opacity: 0.75; }
.lab-ch-line { fill: none !important; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.lab-ch-dot { stroke: var(--ig-surface) !important; stroke-width: 2; }
.lab-ch-c0 { fill: #305cde; stroke: #305cde; } .lab-ch-swatch.lab-ch-c0 { background: #305cde; }
.lab-ch-c1 { fill: #10b981; stroke: #10b981; } .lab-ch-swatch.lab-ch-c1 { background: #10b981; }
.lab-ch-c2 { fill: #f97316; stroke: #f97316; } .lab-ch-swatch.lab-ch-c2 { background: #f97316; }
.lab-ch-c3 { fill: #8b5cf6; stroke: #8b5cf6; } .lab-ch-swatch.lab-ch-c3 { background: #8b5cf6; }
.lab-ch-c4 { fill: #ec4899; stroke: #ec4899; } .lab-ch-swatch.lab-ch-c4 { background: #ec4899; }
.lab-ch-c5 { fill: #0ea5e9; stroke: #0ea5e9; } .lab-ch-swatch.lab-ch-c5 { background: #0ea5e9; }
.lab-chart.is-off-0 .lab-ch-s0, .lab-chart.is-off-1 .lab-ch-s1, .lab-chart.is-off-2 .lab-ch-s2, .lab-chart.is-off-3 .lab-ch-s3, .lab-chart.is-off-4 .lab-ch-s4, .lab-chart.is-off-5 .lab-ch-s5, .lab-chart.is-off-6 .lab-ch-s6, .lab-chart.is-off-7 .lab-ch-s7 { display: none; }
.lab-ch-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.lab-ch-key { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ig-border); background: var(--ig-surface); color: var(--ig-text); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.lab-ch-key.is-static { cursor: default; }
.lab-ch-key.is-off { opacity: 0.45; text-decoration: line-through; }
.lab-ch-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lab-ch-tablebtn { margin-left: auto; padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.lab-ch-tablebtn { display: none; }
.lab-ix-ready .lab-ch-tablebtn { display: inline-block; }
.lab-ch-table { margin-top: 10px; overflow-x: auto; }
.lab-ix-ready.lab-chart:not(.show-table) .lab-ch-table { display: none; }

/* Interactive tables (sortable columns + filter) */
.lab-tbl-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 1rem 0 6px; }
.lab-tbl-search { flex: 0 1 260px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border, #dbe3f0); background: transparent; color: inherit; font: inherit; font-size: 0.88rem; }
.lab-tbl-count { font-size: 0.78rem; opacity: 0.7; }
table.lab-tbl-ready th { cursor: pointer; user-select: none; -webkit-user-select: none; white-space: nowrap; }
table.lab-tbl-ready th::after { content: ' \2195'; opacity: 0.35; font-size: 0.85em; }
table.lab-tbl-ready th.is-asc::after { content: ' \25B2'; opacity: 0.9; }
table.lab-tbl-ready th.is-desc::after { content: ' \25BC'; opacity: 0.9; }
table.lab-table-interactive:not(.lab-tbl-ready) { outline: 2px dashed rgba(48, 92, 222, 0.35); outline-offset: 2px; }
#sectionContent table.lab-table-interactive { outline: 0; }

/* Glossary terms */
.lab-term { border-bottom: 2px dotted #305cde; cursor: help; position: relative; outline: none; }
.lab-term:hover::after, .lab-term:focus::after {
  content: attr(data-def); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: min(280px, 80vw); padding: 8px 12px; border-radius: 10px; background: #0f172a; color: #fff;
  font-size: 0.82rem; font-weight: 500; line-height: 1.4; text-align: left; white-space: normal; z-index: 50; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25); pointer-events: none;
}
.lab-term:hover::before, .lab-term:focus::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); border: 6px solid transparent; border-top-color: #0f172a; z-index: 50; }
[data-theme='dark'] .lab-term, body.dark-mode .lab-term { border-bottom-color: #7aa2ff; }

.lab-sort, .lab-order, .lab-multi, .lab-branch, .lab-worked, .lab-mistakes, .lab-chart { color: var(--ig-text); }

/* Data display blocks (Nov 2026): KPI tiles, bar chart, prompt card, before/after, timeline */
.lab-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.lab-kpi { border: 1px solid rgba(127, 127, 127, 0.28); border-radius: 14px; padding: 14px 16px; background: rgba(48, 92, 222, 0.05); }
.lab-kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1.15; color: #305cde; font-variant-numeric: tabular-nums; }
.lab-kpi-label { font-weight: 700; margin-top: 4px; }
.lab-kpi-sub { font-size: 0.85em; opacity: 0.72; margin-top: 2px; }
.lab-bars { border: 1px solid rgba(127, 127, 127, 0.28); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.lab-bars-title { font-weight: 700; margin-bottom: 10px; }
.lab-bar-row { display: grid; grid-template-columns: minmax(90px, 28%) 1fr auto; gap: 10px; align-items: center; margin: 7px 0; font-size: 0.93em; }
.lab-bar-track { display: block; height: 14px; border-radius: 999px; background: rgba(127, 127, 127, 0.18); overflow: hidden; }
.lab-bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #305cde, #6d8df0); }
.lab-bar-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lab-prompt { border: 1px solid rgba(124, 58, 237, 0.35); border-left: 5px solid #7c3aed; border-radius: 12px; padding: 12px 14px; margin: 14px 0; background: rgba(124, 58, 237, 0.05); }
.lab-prompt-head { font-weight: 700; margin-bottom: 8px; }
.lab-prompt .lab-code { margin: 0; white-space: pre-wrap; }
.lab-prompt .lab-code code { white-space: pre-wrap; }
.lab-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.lab-compare-col { border-radius: 14px; padding: 14px 16px; border: 1px solid rgba(127, 127, 127, 0.28); }
.lab-compare-col h5 { margin: 0 0 8px; font-weight: 700; }
.lab-compare-col ul { margin: 0; padding-left: 1.1em; }
.lab-compare-before { background: rgba(239, 68, 68, 0.06); border-color: rgba(239, 68, 68, 0.3); }
.lab-compare-after { background: rgba(16, 185, 129, 0.07); border-color: rgba(16, 185, 129, 0.35); }
.lab-timeline { margin: 14px 0; padding-left: 6px; }
.lab-tl-item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; position: relative; padding-bottom: 14px; }
.lab-tl-when { font-weight: 700; color: #305cde; text-align: right; font-size: 0.92em; padding-top: 2px; }
.lab-tl-body { border-left: 2px solid rgba(48, 92, 222, 0.35); padding-left: 16px; position: relative; }
.lab-tl-body::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #305cde; }
.lab-tl-body h5 { margin: 0 0 3px; font-weight: 700; }
.lab-tl-body p { margin: 0; }
@media (max-width: 600px) { .lab-compare { grid-template-columns: 1fr; } .lab-tl-item { grid-template-columns: 78px 1fr; gap: 10px; } }
