:root {
  --bg: #0b0b0f;
  --bg-2: #12121a;
  --card: #16161f;
  --border: #262633;
  --text: #f2f2f5;
  --muted: #9d9dab;
  --yellow: #ffd60a;
  --yellow-dim: #b89a00;
  --green: #3ddc84;
  --blue: #5aa9ff;
  --red: #ff6b6b;
  --radius: 14px;
}

html[data-theme="light"] {
  --bg: #f7f6f2;
  --bg-2: #efeee8;
  --card: #ffffff;
  --border: #e0ded4;
  --text: #16161d;
  --muted: #5c5c66;
  --yellow: #d9a700;
  --yellow-dim: #b08c00;
}
html[data-theme="light"] .hero {
  background: radial-gradient(ellipse 60% 50% at 70% 20%, rgba(217, 167, 0, 0.10), transparent), var(--bg);
}
html[data-theme="light"] .nav { background: rgba(247, 246, 242, 0.88); }
html[data-theme="light"] .lesson-body p,
html[data-theme="light"] .lesson-body ul,
html[data-theme="light"] .lesson-body ol { color: #33333c; }
html[data-theme="light"] .lesson-body strong { color: #16161d; }
html[data-theme="light"] .takeaway-box { background: rgba(217, 167, 0, 0.08); border-color: rgba(217, 167, 0, 0.35); }
html[data-theme="light"] .takeaway-box li { color: #33333c; }
html[data-theme="light"] .interview-box { background: rgba(90, 169, 255, 0.08); }
html[data-theme="light"] .interview-box p { color: #2c405c; }
html[data-theme="light"] .kicker { border-color: rgba(217, 167, 0, 0.45); }
html[data-theme="light"] .reel-thumb { background: linear-gradient(145deg, #e6e4da, #d8d6cb); background-size: cover; background-position: center; }
html[data-theme="light"] .topic-num { color: #b08c00; }

.icon-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; min-width: 40px; height: 36px; padding: 0 12px;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--yellow); }

.progress-stats { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.progress-ring {
  width: 74px; height: 74px; border-radius: 50%;
  background: conic-gradient(var(--yellow) 0deg, var(--border) 0deg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  position: relative; transition: background 0.4s ease;
}
.progress-ring::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg);
}
.progress-ring span {
  position: relative; font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 1rem; color: var(--text);
}
.progress-words { display: flex; flex-direction: column; }
.progress-words strong { font-size: 1.3rem; font-weight: 800; }
.progress-words span { color: var(--muted); font-size: 0.9rem; }

.traps-box {
  background: rgba(255, 107, 107, 0.06); border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: var(--radius); padding: 22px 24px; margin-top: 28px;
}
.traps-box h3 { color: var(--red); margin-bottom: 10px; }
.traps-box ul { margin-left: 20px; }
.traps-box li { margin-bottom: 6px; color: #d6d6de; }
html[data-theme="light"] .traps-box li { color: #4c3030; }
.lesson-body figure { margin: 22px 0; }
.lesson-body figure svg { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-2); }
.lesson-body figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 8px; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem;
}
.brand em { font-style: normal; color: var(--yellow); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--yellow); color: #000;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.15rem;
}
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta {
  background: var(--yellow); color: #000 !important;
  padding: 8px 16px; border-radius: 999px; font-weight: 700 !important;
}
.nav-toggle {
  display: none; background: none; border: none; color: var(--text);
  font-size: 1.5rem; cursor: pointer;
}
.progress-bar { height: 3px; background: var(--bg-2); }
.progress-fill { height: 100%; width: 0%; background: var(--yellow); transition: width 0.4s ease; }

/* Buttons */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; cursor: pointer; border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--yellow); color: #000; box-shadow: 0 4px 24px rgba(255, 214, 10, 0.25); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--yellow); }

/* Hero */
.hero {
  padding: 90px 20px 70px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(255, 214, 10, 0.08), transparent),
    var(--bg);
}
.hero-inner { max-width: 820px; margin: 0 auto; text-align: center; }
.kicker {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem; color: var(--yellow); text-transform: uppercase;
  letter-spacing: 0.14em; margin-bottom: 16px;
  border: 1px solid rgba(255, 214, 10, 0.3); border-radius: 999px; padding: 5px 14px;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 900; margin-bottom: 20px; }
.hl { color: var(--yellow); }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.8rem; font-weight: 800; color: var(--yellow); }
.hero-stats span { color: var(--muted); font-size: 0.9rem; }

/* Sections */
.section { max-width: 1100px; margin: 0 auto; padding: 64px 20px; }
.section-head { margin-bottom: 36px; }
.section-head h2 { font-size: 2rem; font-weight: 800; margin: 10px 0 8px; }
.section-head p { color: var(--muted); max-width: 560px; }

/* Filter */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.filter-btn {
  background: var(--card); color: var(--muted); border: 1px solid var(--border);
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.9rem;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--yellow); color: #000; border-color: var(--yellow); }

/* Path sections */
.path-section { margin-bottom: 48px; }
.path-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.path-step {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--yellow);
  border-radius: 10px; padding: 8px 14px; white-space: nowrap; font-size: 0.95rem;
}
.path-head h2 { font-size: 1.5rem; font-weight: 800; }
.path-head p { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

/* Topic cards */
.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.topic-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: block; transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}
.topic-card:hover { border-color: var(--yellow); transform: translateY(-3px); }
.topic-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.topic-num { font-family: 'JetBrains Mono', monospace; color: var(--yellow-dim); font-weight: 700; font-size: 0.9rem; }
.topic-check {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: transparent; transition: all 0.2s ease;
}
.topic-card.done .topic-check { background: var(--green); border-color: var(--green); color: #000; }
.topic-card.done h3 { color: var(--muted); }
.topic-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }
.topic-summary { color: var(--muted); font-size: 0.92rem; margin-bottom: 14px; }
.topic-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.chip {
  font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
}
.chip-b { background: rgba(61, 220, 132, 0.12); color: var(--green); }
.chip-i { background: rgba(90, 169, 255, 0.12); color: var(--blue); }
.chip-a { background: rgba(255, 107, 107, 0.12); color: var(--red); }
.chip-t { background: var(--bg-2); color: var(--muted); }
.video-badge {
  font-size: 0.75rem; font-weight: 700; color: var(--yellow);
  font-family: 'JetBrains Mono', monospace;
}

/* Videos */
.video-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.video-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.yt-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-title { padding: 14px 16px 4px; font-weight: 600; font-size: 0.95rem; }
.video-link { display: inline-block; padding: 6px 16px 14px; color: var(--yellow); font-size: 0.88rem; font-weight: 600; }
.insta-cta { text-align: center; margin-top: 32px; }

/* Instagram */
.reel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.reel-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.15s ease, transform 0.15s ease;
}
.reel-card:hover { border-color: var(--yellow); transform: translateY(-3px); }
.reel-thumb {
  aspect-ratio: 9 / 14; background: linear-gradient(145deg, #1c1c28, #101018);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.reel-thumb span {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--yellow); color: #000; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.reel-card p { padding: 12px 14px; font-size: 0.9rem; font-weight: 600; }

/* About */
.about-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; max-width: 720px;
}
.about-card p { color: var(--muted); margin-bottom: 12px; }
.about-card p:last-child { margin-bottom: 0; }

/* Lesson page */
.lesson { max-width: 760px; margin: 0 auto; padding: 40px 20px 80px; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 28px; }
.breadcrumb a { color: var(--yellow); }
.lesson-head h1 { font-size: 2.2rem; font-weight: 900; margin-bottom: 10px; }
.lesson-sub { color: var(--muted); font-size: 1.08rem; margin-bottom: 16px; }
.lesson-video { margin: 28px 0; }
.lesson-video .yt-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.video-caption { color: var(--muted); font-size: 0.85rem; margin-top: 8px; text-align: center; }
.lesson-body h2 { font-size: 1.45rem; font-weight: 800; margin: 36px 0 12px; color: var(--yellow); }
.lesson-body h3 { font-size: 1.15rem; font-weight: 700; margin: 24px 0 8px; }
.lesson-body p { margin-bottom: 14px; color: #d6d6de; }
.lesson-body ul, .lesson-body ol { margin: 0 0 14px 22px; color: #d6d6de; }
.lesson-body li { margin-bottom: 6px; }
.lesson-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.88em;
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 6px; color: var(--yellow);
}
.lesson-body strong { color: var(--text); }

.takeaway-box, .interview-box {
  border-radius: var(--radius); padding: 22px 24px; margin-top: 28px;
}
.takeaway-box { background: rgba(255, 214, 10, 0.06); border: 1px solid rgba(255, 214, 10, 0.25); }
.takeaway-box h3 { color: var(--yellow); margin-bottom: 10px; }
.takeaway-box ul { margin-left: 20px; }
.takeaway-box li { margin-bottom: 6px; color: #e8e8ee; }
.interview-box { background: rgba(90, 169, 255, 0.06); border: 1px solid rgba(90, 169, 255, 0.25); }
.interview-box h3 { color: var(--blue); margin-bottom: 8px; }
.interview-box p { color: #d6e4f7; }

.lesson-actions { margin: 32px 0 12px; text-align: center; }
.complete-btn.completed { background: var(--green); color: #000; box-shadow: none; }

.prev-next { display: flex; justify-content: space-between; gap: 14px; margin-top: 40px; }
.pn-link {
  flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; font-weight: 700; font-size: 0.95rem;
  display: flex; flex-direction: column; gap: 4px;
}
.pn-link span { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.pn-link:hover { border-color: var(--yellow); }
.pn-next { text-align: right; }

/* Footer */
.footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 48px 20px 24px;
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.footer-tag { color: var(--muted); font-size: 0.9rem; margin-top: 10px; max-width: 320px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--muted); font-size: 0.92rem; }
.footer-links a:hover { color: var(--yellow); }
.footer-note { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 20px 28px; }

@media (max-width: 720px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-2); flex-direction: column; align-items: flex-start;
    padding: 16px 20px; gap: 14px; border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: 60px 20px 50px; }
  .hero-stats { gap: 28px; }
  .prev-next { flex-direction: column; }
}

/* Front-page preference toggles (segmented, fully labeled) */
.hero-prefs { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin: 26px 0 6px; }
.pref-group { display: flex; align-items: center; gap: 10px; }
.pref-label { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg-btn { background: none; border: none; color: var(--muted); font: inherit; font-size: 0.92rem; font-weight: 600; padding: 7px 18px; border-radius: 999px; cursor: pointer; }
.seg-btn.active { background: var(--yellow); color: #16161d; }
.lesson-prefs { justify-content: flex-start; margin: 14px 0 0; }

/* ---- Interactive labs ---- */
.lab { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin: 28px 0; }
.lab-badge { display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; color: #000; background: var(--yellow); border-radius: 999px; padding: 3px 10px; margin-bottom: 8px; }
.lab-head h3 { margin: 4px 0 6px; }
.lab-sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 14px; }
.lab-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.lab-controls .btn { padding: 8px 16px; font-size: 0.88rem; }
.lab-seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.lab-stats { display: flex; flex-wrap: wrap; gap: 18px; margin: 12px 0 4px; }
.lab-stat strong { font-family: 'JetBrains Mono', monospace; font-size: 1.05rem; display: block; color: var(--yellow); }
.lab-stat span { font-size: 0.78rem; color: var(--muted); }
.lab-log { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; min-height: 1.2em; }
.lab-log-line { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--muted); }
.lab-log-line.ok { color: var(--green); }
.lab-log-line.warn { color: var(--yellow); }
.lab-log-line.bad { color: var(--red); }

.lb-lb-stage { display: flex; flex-direction: column; gap: 14px; }
.lb-client { display: flex; align-items: center; gap: 10px; }
.lb-arrow { color: var(--muted); font-size: 1.2rem; }
.lb-node-box { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 0.85rem; text-align: center; }
.lb-lb-box { border-color: var(--yellow); color: var(--yellow); }
.lb-servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.lb-server { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; transition: border-color 0.2s, opacity 0.3s; }
.lb-server.flash { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.25); }
.lb-server.down { opacity: 0.45; border-color: var(--red); }
.lb-server.down .lb-node-box { text-decoration: line-through; }
.lb-meter { height: 6px; background: var(--bg); border-radius: 999px; margin: 10px 0 6px; overflow: hidden; }
.lb-meter-fill { height: 100%; width: 0; background: var(--yellow); border-radius: 999px; transition: width 0.3s; }
.lb-counts { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.lb-kill { margin-top: 8px; width: 100%; background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 5px; font-size: 0.75rem; cursor: pointer; }
.lb-kill:hover { border-color: var(--red); color: var(--red); }

.cache-keys { display: flex; gap: 8px; flex-wrap: wrap; }
.cache-key { min-width: 44px; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.cache-stage { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cache-slots { display: grid; grid-template-columns: repeat(4, minmax(76px, 1fr)); gap: 10px; flex: 1; min-width: 260px; }
.cache-slot { background: var(--card); border: 1px dashed var(--border); border-radius: 10px; padding: 12px 8px; text-align: center; min-height: 58px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.cache-slot.filled { border-style: solid; border-color: var(--green); }
.cache-slot strong { font-family: 'JetBrains Mono', monospace; font-size: 1.2rem; color: var(--green); }
.cache-slot span { font-size: 0.68rem; color: var(--muted); }
.cache-db { text-align: center; }
.cache-db-box { border-color: var(--red); color: var(--red); }
.cache-db-note { font-size: 0.72rem; color: var(--muted); display: block; margin-top: 6px; }

.bucket-stage { display: flex; justify-content: center; }
.bucket-visual { text-align: center; }
.bucket-tokens { display: flex; gap: 8px; justify-content: center; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); border-radius: 12px 12px 20px 20px; }
.bucket-token { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--yellow); background: transparent; transition: background 0.3s; }
.bucket-token.full { background: var(--yellow); }
.bucket-cap { font-size: 0.75rem; color: var(--muted); margin-top: 8px; font-family: 'JetBrains Mono', monospace; }
.lab.shake { animation: labshake 0.3s; }
@keyframes labshake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.ring-stage { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.ring-svg { width: 320px; max-width: 100%; flex-shrink: 0; }
.ring-side { flex: 1; min-width: 220px; }

.cap-stage { display: flex; align-items: center; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cap-dc { text-align: center; }
.cap-val { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; margin-top: 8px; color: var(--green); }
.cap-link { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 90px; }
.cap-link-line { display: block; width: 90px; height: 3px; background: var(--green); border-radius: 2px; transition: background 0.3s; }
.lab.partitioned .cap-link-line { background: repeating-linear-gradient(90deg, var(--red) 0 8px, transparent 8px 14px); height: 3px; }
.cap-link-label { font-size: 0.7rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.lab.partitioned .cap-link-label { color: var(--red); font-weight: 700; }

.queue-stage { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.queue-arrow { color: var(--muted); font-size: 1.3rem; }
.queue-box { flex: 1; min-width: 180px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.queue-msgs { display: flex; gap: 5px; flex-wrap: wrap; min-height: 22px; }
.queue-msg { width: 18px; height: 18px; border-radius: 5px; background: var(--blue); }
.queue-more { font-size: 0.75rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; align-self: center; }
.queue-label { font-size: 0.7rem; color: var(--muted); margin-top: 6px; display: block; }
.queue-consumers { display: flex; flex-direction: column; gap: 8px; }
.queue-consumer.crashed { border-color: var(--red); color: var(--red); text-decoration: line-through; }

.repl-stage { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.repl-val { font-family: 'JetBrains Mono', monospace; font-size: 1.05rem; margin-top: 8px; text-align: center; color: var(--green); }
.repl-node.stale .repl-val { color: var(--red); }
.repl-node.stale .lb-node-box { border-color: var(--red); }
.repl-primary .lb-node-box { border-color: var(--yellow); color: var(--yellow); }
.repl-arrows { display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 1.3rem; }
.repl-replicas { display: flex; flex-direction: column; gap: 12px; }
.lab-slider { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); min-width: 180px; }
.lab-slider input[type=range] { accent-color: var(--yellow); }

.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 22px; margin-bottom: 16px; }
.calc-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.calc-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.calc-card span { font-size: 0.75rem; color: var(--muted); display: block; margin-bottom: 4px; }
.calc-card strong { font-family: 'JetBrains Mono', monospace; font-size: 1.3rem; color: var(--yellow); }
