/* ============================================================
   Well-Architected Azure Container Apps — microsite styles
   Dark-default theme with light toggle. No build step.
   ============================================================ */

:root {
  --bg: #0b1020;
  --bg-alt: #0f1730;
  --surface: #131c38;
  --surface-2: #182247;
  --border: #26325c;
  --border-soft: #1d2748;
  --text: #e8ecf7;
  --text-dim: #a6b0cf;
  --text-faint: #6f7aa0;
  --accent: #4aa8ff;
  --accent-2: #7c5cff;
  --accent-soft: rgba(74, 168, 255, 0.14);
  --good: #43d17a;
  --warn: #f6c945;
  --bad: #ff6b6b;
  --l300: #43d17a;
  --l400: #f6a54a;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1120px;
  --page-gutter: clamp(16px, 4vw, 22px);
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-alt: #eaeef7;
  --surface: #ffffff;
  --surface-2: #f0f3fa;
  --border: #d5dcec;
  --border-soft: #e3e8f4;
  --text: #14203d;
  --text-dim: #47536f;
  --text-faint: #66728f;
  --accent: #1a73e8;
  --accent-2: #6a45e0;
  --accent-soft: rgba(26, 115, 232, 0.10);
  --shadow: 0 16px 34px -22px rgba(20, 32, 61, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(74, 168, 255, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--page-gutter); }

/* ---------- Top navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .logo {
  display: block;
  width: 34px; height: 34px;
  flex: 0 0 34px;
}
.brand small { display: block; font-size: 11px; color: var(--text-faint); font-weight: 500; letter-spacing: 0.4px; }
.navlinks { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.navlinks a {
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.navlinks a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.navlinks a.active { color: var(--text); background: var(--accent-soft); }

.menu-toggle {
  display: none; width: 40px; height: 40px; margin-left: auto; padding: 9px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); cursor: pointer;
}
.menu-toggle span {
  display: block; width: 20px; height: 2px; margin: 4px 0;
  border-radius: 2px; background: currentColor; transition: transform 0.18s ease, opacity 0.18s ease;
}
.menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar.menu-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topbar.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.topbar.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 8px;
  height: 34px; padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all 0.15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Kicker / eyebrow labels ---------- */
.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 14px;
}

/* ---------- Hero ---------- */
.hero { padding: 68px 0 40px; }
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  line-height: 1.08;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: 1.15rem; color: var(--text-dim); max-width: 720px; margin: 0 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600; font-size: 15px;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { padding: 8px 15px; font-size: 13.5px; border-radius: 8px; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 40px 0; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 18px;
}
.stat .num { font-size: 1.85rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.stat .lbl { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.8px; }

/* ---------- Sections ---------- */
section { padding: 46px 0; }
.section-title { font-size: 1.75rem; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.3px; }
.section-sub { color: var(--text-dim); margin: 0 0 28px; max-width: 760px; }

.divider { height: 1px; background: var(--border-soft); border: 0; margin: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ---------- Scenario / architecture ---------- */
.scenario-card { border-left: 3px solid var(--accent); }
.scenario-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.scenario-card .tagline { color: var(--accent); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.scenario-card ul { margin: 12px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 14.5px; }
.scenario-card li { margin-bottom: 5px; }

.arch { font-family: var(--mono); font-size: 13px; color: var(--text-dim); background: var(--bg-alt); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 18px; overflow-x: auto; white-space: pre; }

/* ---------- Reference topology diagram ---------- */
.topology {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-alt); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 26px 20px;
}
.topo-tier { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.topo-caption {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-faint);
}
.topo-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: 100%; }
.topo-flow {
  color: var(--accent); font-size: 20px; line-height: 1;
  padding: 10px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.topo-flow small { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.5px; color: var(--text-faint); text-transform: uppercase; }
.node {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 14px 12px; width: 140px; box-sizing: border-box;
}
.node img { width: 40px; height: 40px; display: block; }
.node .n-title { font-size: 13px; font-weight: 600; color: var(--text); }
.node .n-sub { font-size: 11px; color: var(--text-faint); font-family: var(--mono); line-height: 1.4; }
.node.accent { border-color: rgba(74, 168, 255, 0.4); }
.topo-env {
  width: 100%; border: 1px dashed var(--accent); border-radius: var(--radius);
  background: var(--accent-soft); padding: 16px 14px; box-sizing: border-box;
}
.topo-env-head {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px; display: flex; align-items: center;
  gap: 8px; justify-content: center; flex-wrap: wrap; text-align: center;
}
.topo-env-head img { width: 18px; height: 18px; }
.node.plain { background: var(--bg-alt); }

/* ---------- Landing zone placement ---------- */
.lz-tag {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono);
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; margin: 0 0 12px;
}
.lz-tag.hub { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(74, 168, 255, 0.35); }
.lz-tag.spoke { color: var(--good); background: rgba(67, 209, 122, 0.12); border: 1px solid rgba(67, 209, 122, 0.35); }
.lz-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.lz-card .lz-scope { color: var(--text-faint); font-family: var(--mono); font-size: 12px; margin: 0 0 14px; }
.lz-list { list-style: none; margin: 0; padding: 0; }
.lz-list li { padding: 9px 0; border-top: 1px solid var(--border-soft); font-size: 14px; color: var(--text-dim); }
.lz-list li:first-child { border-top: 0; }
.lz-list li strong { color: var(--text); font-weight: 600; }
.lz-list li span { display: block; color: var(--text-faint); font-size: 12.5px; margin-top: 2px; }

.placement-scroll { overflow-x: auto; margin-top: 6px; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); }
.placement { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.placement th, .placement td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.placement thead th { background: var(--bg-alt); font-family: var(--mono); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-faint); }
.placement tbody tr:last-child td { border-bottom: 0; }
.placement td strong { color: var(--text); }
.placement td .why { color: var(--text-faint); }
.zone-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-family: var(--mono); white-space: nowrap; }
.zone-badge.hub { color: var(--accent); background: var(--accent-soft); }
.zone-badge.spoke { color: var(--good); background: rgba(67, 209, 122, 0.12); }
.zone-badge.either { color: var(--l400); background: rgba(246, 165, 74, 0.14); }
.lz-refs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.lz-refs a {
  display: inline-block; font-size: 12.5px; font-family: var(--mono);
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  color: var(--text-dim); background: var(--surface); border: 1px solid var(--border-soft);
}
.lz-refs a:hover { color: var(--accent); border-color: var(--accent); }

/* landing zone diagrams */
.lz-diagram {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  background: var(--bg-alt); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 24px 20px; margin: 6px 0 28px;
}
.lz-sub {
  width: 100%; box-sizing: border-box; border-radius: var(--radius);
  border: 1px solid var(--border-soft); background: var(--surface); padding: 14px 14px 16px;
}
.lz-sub.platform { border-color: rgba(74, 168, 255, 0.4); background: var(--accent-soft); }
.lz-sub.workload { border-color: rgba(67, 209, 122, 0.35); background: rgba(67, 209, 122, 0.07); }
.lz-sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lz-sub-head img { width: 24px; height: 24px; flex-shrink: 0; }
.lz-sub-head .t { font-weight: 700; font-size: 14px; color: var(--text); }
.lz-sub-head .s { font-family: var(--mono); font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.lz-peer small { text-transform: none; }
.lz-fleet { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; width: 100%; }
.lz-fleet .lz-sub { padding: 12px; }
.node.mini { width: 66px; padding: 10px 6px; gap: 5px; }
.node.mini img { width: 30px; height: 30px; }
.node.mini .n-title { font-size: 11px; line-height: 1.2; }

/* ---------- Module list ---------- */
.modlist { display: flex; flex-direction: column; gap: 12px; }
.mod {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.mod:hover { border-color: var(--accent); transform: translateX(2px); text-decoration: none; }
.mod .idx {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-weight: 800; font-size: 1.05rem;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono);
}
.mod .body h3 { margin: 0 0 3px; font-size: 1.06rem; color: var(--text); }
.mod .body p { margin: 0; font-size: 13.8px; color: var(--text-dim); }
.mod .meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.mod .dur { font-size: 12.5px; color: var(--text-faint); font-family: var(--mono); }

/* ---------- Badges / tags ---------- */
.badge {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.8px;
  font-family: var(--mono);
}
.badge-l300 { background: rgba(67, 209, 122, 0.15); color: var(--l300); }
.badge-l400 { background: rgba(246, 165, 74, 0.16); color: var(--l400); }
.badge-pts { background: var(--accent-soft); color: var(--accent); }
.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 9px; border-radius: 7px;
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border-soft);
  margin: 0 5px 5px 0;
}
.tagrow { display: flex; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Delivery-mode selector cards ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mode-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: flex; flex-direction: column;
}
.mode-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mode-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mode-card .mode-icon { font-size: 1.9rem; margin-bottom: 10px; }
.mode-card h3 { margin: 0 0 6px; font-size: 1.2rem; }
.mode-card .mode-time { font-family: var(--mono); font-size: 12.5px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.mode-card p { color: var(--text-dim); font-size: 14px; margin: 0 0 14px; }
.mode-card ul { margin: 0 0 16px; padding-left: 18px; color: var(--text-dim); font-size: 13.5px; }
.mode-card .selected-flag {
  position: absolute; top: 16px; right: 16px;
  font-size: 11px; font-weight: 700; color: var(--good);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px;
  display: none;
}
.mode-card.selected .selected-flag { display: block; }
.mode-note { text-align: center; color: var(--text-faint); font-size: 13.5px; margin-top: 16px; }

/* ---------- WAF pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.pillar { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.pillar .p-ico { font-size: 1.5rem; }
.pillar h4 { margin: 8px 0 4px; font-size: 14px; }
.pillar p { margin: 0; font-size: 12px; color: var(--text-faint); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border-soft); padding: 34px 0; margin-top: 30px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.footer .fnote { color: var(--text-faint); font-size: 13px; }
.footer a { color: var(--text-dim); font-size: 13px; }
.footer .disclaimer {
  flex-basis: 100%; width: 100%; margin: 0;
  color: var(--text-faint); font-size: 12.5px; line-height: 1.6;
  padding: 14px 16px; border: 1px solid var(--border-soft);
  border-radius: var(--radius); background: var(--bg-alt);
}
.footer .disclaimer strong { color: var(--text-dim); }

/* ============================================================
   LAB PAGE
   ============================================================ */
.lab-header { padding-block: 30px 10px; }
.lab-header .kicker { margin-bottom: 8px; }
.mode-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--border-soft);
}
.lab-layout { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: start; }

/* progress rail */
.rail {
  position: sticky; top: 78px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.rail h4 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); font-family: var(--mono); }
.rail-mod { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text-dim); font-size: 13.5px; margin-bottom: 3px; cursor: pointer; }
.rail-mod:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.rail-mod.done { color: var(--good); }
.rail-mod .rail-check { font-family: var(--mono); margin-right: 6px; opacity: 0.7; }

.meter-wrap { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.meter-label { font-size: 12px; color: var(--text-faint); display: flex; justify-content: space-between; margin-bottom: 6px; }
.meter { height: 9px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-soft); }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width 0.4s ease; }
.meter-fill.pass { background: linear-gradient(90deg, var(--good), #2fae63); }

/* module blocks */
.mod-block { padding: 0; margin-bottom: 34px; scroll-margin-top: 80px; }
.mod-block > header { margin-bottom: 16px; }
.mod-block .mod-num { font-family: var(--mono); color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.mod-block h2 { margin: 4px 0 6px; font-size: 1.5rem; }
.mod-block .mod-summary { color: var(--text-dim); margin: 0 0 12px; }
.gate {
  background: var(--accent-soft);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 15px; margin: 12px 0;
  font-size: 14px; color: var(--text-dim);
}
.gate strong { color: var(--text); }
.outcomes { margin: 10px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 14px; }

/* activity accordion */
.activity {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.activity.completed { border-color: rgba(67, 209, 122, 0.4); }
.act-head {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; cursor: pointer;
  width: 100%; border: 0; background: transparent; color: var(--text); text-align: left;
  font: inherit;
  -webkit-user-select: none;
  user-select: none;
}
.act-head:hover { background: var(--surface-2); }
.act-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.act-check {
  width: 22px; height: 22px; flex: 0 0 22px;
  border-radius: 6px; border: 2px solid var(--border);
  display: grid; place-items: center;
  font-size: 13px; color: transparent;
  transition: all 0.15s ease;
}
.activity.completed .act-check { background: var(--good); border-color: var(--good); color: #04220f; }
.act-head .act-title { flex: 1; font-weight: 600; font-size: 15px; }
.act-head .act-time { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.act-head .chev { color: var(--text-faint); transition: transform 0.2s ease; font-size: 12px; }
.activity.open .chev { transform: rotate(90deg); }

.act-body { display: none; padding: 0 18px 18px; border-top: 1px solid var(--border-soft); }
.activity.open .act-body { display: block; }

.step-group { margin-top: 16px; }
.step-label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--accent); font-weight: 600;
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.step-label .num { background: var(--accent-soft); border-radius: 5px; padding: 1px 7px; }
.step-group ol, .step-group ul { margin: 0; padding-left: 20px; color: var(--text-dim); font-size: 14.2px; }
.step-group li { margin-bottom: 6px; }
.step-group p { margin: 0; color: var(--text-dim); font-size: 14.2px; }

pre.cmd {
  font-family: var(--mono); font-size: 12.6px;
  background: var(--bg-alt); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 14px 16px;
  overflow-x: auto; color: #cdd6f4; margin: 8px 0 0;
  line-height: 1.55;
}

.validation-box {
  background: rgba(67, 209, 122, 0.08);
  border: 1px solid rgba(67, 209, 122, 0.25);
  border-radius: var(--radius-sm); padding: 12px 15px; margin-top: 16px;
  font-size: 14px; color: var(--text-dim);
}
.validation-box .step-label { color: var(--good); }
.evidence-box {
  background: var(--bg-alt); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); padding: 12px 15px; margin-top: 12px;
  font-size: 13.5px; color: var(--text-dim); font-family: var(--mono);
}

/* instructor-only callouts */
.instructor {
  background: rgba(124, 92, 255, 0.10);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-sm); padding: 12px 15px; margin-top: 16px;
  font-size: 14px; color: var(--text-dim);
}
.instructor .step-label { color: var(--accent-2); }
.stretch {
  border: 1px solid var(--border-soft); border-left: 3px solid var(--l400);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 12px;
  font-size: 13.8px; color: var(--text-dim);
}
.stretch .step-label { color: var(--l400); }

/* self-paced hides instructor blocks */
body[data-mode="self"] .instructor { display: none; }

.evidence-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; font-size: 13.5px; color: var(--text-dim);
  cursor: pointer; -webkit-user-select: none; user-select: none;
}
.evidence-toggle input { width: 17px; height: 17px; accent-color: var(--good); cursor: pointer; }
.evidence-toggle input:disabled { cursor: not-allowed; }
.evidence-record {
  display: grid; gap: 12px; margin: 16px 0 0; padding: 14px 15px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.evidence-record legend { padding: 0 6px; color: var(--text); font-weight: 600; font-size: 14px; }
.evidence-record label { display: grid; gap: 6px; color: var(--text-dim); font-size: 13px; }
.evidence-record input[type="text"], .evidence-record input[type="url"], .evidence-record textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 9px 10px;
  background: var(--bg-alt); color: var(--text); font: 13px var(--mono); resize: vertical;
}
.evidence-record input:focus, .evidence-record textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.evidence-record .evidence-toggle { display: flex; grid-template-columns: auto 1fr; margin-top: 2px; }

/* ============================================================
   KNOWLEDGE CHECK
   ============================================================ */
.kc-intro { max-width: 760px; }
.kc-card { max-width: 800px; margin: 0 auto; }
.q-counter { font-family: var(--mono); font-size: 12px; color: var(--text-faint); letter-spacing: 1px; text-transform: uppercase; }
.q-cat { display: inline-block; font-size: 11px; font-family: var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin: 8px 0; }
.q-stem { font-size: 1.15rem; font-weight: 600; margin: 6px 0 20px; line-height: 1.45; }
.opt {
  display: block; width: 100%; text-align: left;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 11px;
  color: var(--text); cursor: pointer; font-size: 15px;
  transition: all 0.12s ease;
}
.opt:hover { border-color: var(--accent); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt.correct { border-color: var(--good); background: rgba(67, 209, 122, 0.12); }
.opt.wrong { border-color: var(--bad); background: rgba(255, 107, 107, 0.10); }
.opt .opt-key { font-family: var(--mono); font-weight: 700; margin-right: 10px; color: var(--accent); }
.opt:disabled { cursor: default; }

.explain {
  margin-top: 6px; padding: 14px 16px;
  background: var(--bg-alt); border: 1px solid var(--border-soft);
  border-radius: 10px; font-size: 14px; color: var(--text-dim);
  display: none;
}
.explain.show { display: block; }
.explain .src { display: block; margin-top: 8px; font-size: 12.5px; }

.kc-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.kc-progress { height: 6px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; margin-bottom: 22px; border: 1px solid var(--border-soft); }
.kc-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width 0.3s ease; }

.result { text-align: center; max-width: 620px; margin: 0 auto; }
.result .score-ring {
  width: 160px; height: 160px; margin: 0 auto 20px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 2.6rem; font-weight: 800;
  background: conic-gradient(var(--accent) var(--pct, 0%), var(--bg-alt) 0);
  position: relative;
}
.result .score-ring::before {
  content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface);
}
.result .score-ring span { position: relative; z-index: 1; }
.result.pass .score-ring { background: conic-gradient(var(--good) var(--pct, 0%), var(--bg-alt) 0); }
.result .verdict { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.result.pass .verdict { color: var(--good); }
.result.fail .verdict { color: var(--warn); }
.cat-breakdown { text-align: left; margin: 24px 0; }
.cat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.cat-row .cat-name { color: var(--text-dim); }
.cat-row .cat-score { font-family: var(--mono); font-weight: 700; }

/* ---------- misc ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.hidden { display: none !important; }
.center { text-align: center; }
.mt-24 { margin-top: 24px; }
.loading { text-align: center; color: var(--text-faint); padding: 60px 0; font-family: var(--mono); }

/* ---------- utility classes (replace inline styles) ---------- */
.section-pad { padding-block: 48px; }
.section-pad-sm { padding-block: 40px; }
.page-title { font-size: 1.9rem; margin: 2px 0 12px; }
.text-dim { color: var(--text-dim); }
.text-white { color: #fff; }
.lede-narrow { color: var(--text-dim); max-width: 760px; margin: 0 0 14px; }
.card-title-sm { margin: 12px 0 6px; font-size: 1.05rem; }
.card-copy { color: var(--text-dim); font-size: 14px; margin: 0; }
.row-center { display: flex; gap: 16px; align-items: center; }
.row-wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.lab-layout-pad { padding-top: 22px; padding-bottom: 60px; }
.meter-note { font-size: 12px; color: var(--text-faint); margin: 10px 0 0; }
.rail-cta { width: 100%; justify-content: center; }
.stat-num-sm { font-size: 1.6rem; font-weight: 800; }
.stat-lbl-sm { color: var(--text-faint); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.8px; }
.q-hint { color: var(--text-faint); font-size: 13px; }
.split-center { display: flex; justify-content: space-between; align-items: center; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .modes { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .lab-layout { grid-template-columns: 1fr; }
  .rail { position: relative; top: 0; max-height: none; }
  .topbar .wrap { height: 58px; gap: 12px; }
  .brand { min-width: 0; }
  .menu-toggle { display: block; flex: 0 0 40px; }
  .navlinks {
    position: fixed; z-index: 60; top: 66px; right: var(--page-gutter);
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    width: min(320px, calc(100vw - (2 * var(--page-gutter))));
    margin: 0; padding: 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-8px) scale(0.98); transform-origin: top right;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  }
  .topbar.menu-open .navlinks { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
  .navlinks a, .navlinks .icon-btn { width: 100%; min-height: 42px; justify-content: flex-start; padding: 9px 12px; }
  .navlinks .nav-cta { justify-content: center; order: -1; }
  .lab-header { padding-block: 24px 8px; }
}
@media (max-width: 560px) {
  section { padding: 36px 0; }
  .stats { grid-template-columns: 1fr; }
  .stats, .grid-2, .grid-3, .modes { gap: 16px; }
  .card, .stat, .mode-card { padding: 16px; }
  .topology, .lz-diagram { padding: 16px; }
  .mod { grid-template-columns: 44px 1fr; }
  .mod { gap: 12px; padding: 16px; }
  .mod .meta { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; }
  .hero { padding: 44px 0 30px; }
  /* lab page: keep gutters and card padding uniform on phones */
  .lab-header { padding-block: 20px 6px; }
  .page-title { font-size: 1.55rem; }
  .lab-layout-pad { padding-top: 18px; padding-bottom: 44px; }
  .rail { padding: 16px; }
  .mod-block h2 { font-size: 1.3rem; }
  .act-head { padding: 14px 16px; gap: 10px; }
  .act-body { padding: 0 16px 16px; }
  pre.cmd { font-size: 12px; padding: 12px 14px; }
}
