.wrap {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 20px 60px;
}

.lead {
  text-align: center;
  color: var(--muted-color);
  margin-top: -8px;
  line-height: 1.7;
}

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: 0.78rem; font-weight: 700; }
.bdg-basic  { background: #fff7ed; color: #c2410c; }
.bdg-teeth  { background: #eff6ff; color: #1d4ed8; }
.bdg-idler  { background: #faf5ff; color: #7c3aed; }
.bdg-calc   { background: #f0fdf4; color: #15803d; }

/* ---- Section headers ---- */
.sec-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sec-header h2 { font-size: 1.1rem; margin: 0; }

.concept-desc { color: #374151; line-height: 1.75; margin-bottom: 14px; }

/* ---- Legend ---- */
.legend-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.leg-dot  { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.leg-text { font-size: 0.85rem; color: #374151; }

/* ---- Canvas ---- */
.canvas-wrap {
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  margin-bottom: 14px;
}
.canvas-wrap canvas { display: block; width: 100%; height: auto; }

/* ---- Controls ---- */
.controls-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.action-btn { padding: 8px 20px; border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.btn-orange { background: #f97316; color: #fff; }
.btn-orange:hover { background: #ea6a05; }

.inline-note { font-size: 0.88rem; color: #374151; }
.concept-note {
  background: #f0f9ff;
  border-left: 4px solid var(--brand);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #1e3a5f;
}

/* ---- Sliders (Section 2) ---- */
.slider-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.slider-row { display: flex; align-items: center; gap: 10px; }
.slab { font-size: 0.88rem; font-weight: 600; min-width: 80px; }
.sval { font-size: 1rem; font-weight: 700; min-width: 28px; text-align: right; }
input[type=range] { flex: 1; accent-color: var(--brand); }

.ratio-box {
  background: #fafafa;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  color: #1e293b;
  margin-bottom: 10px;
}
.ratio-val { font-size: 1.4rem; color: #0f172a; }

/* ---- Step tabs (Section 3) ---- */
.step-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.stab {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  color: #374151;
}
.stab:hover { border-color: #a855f7; color: #7c3aed; }
.stab.active { background: #a855f7; color: #fff; border-color: #a855f7; }

.idler-note {
  background: #faf5ff;
  border-left: 4px solid #a855f7;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #3b0764;
  min-height: 44px;
}

/* ---- Formula (Section 4) ---- */
.formula-card {
  background: #f8fafc;
  border: 1.5px solid var(--border-soft);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
  text-align: center;
}
.formula-main { display: inline-flex; align-items: center; gap: 16px; font-size: 1.1rem; font-weight: 600; }
.formula-label { color: #1e293b; }
.frac { display: flex; flex-direction: column; align-items: center; }
.frac-top, .frac-bot { padding: 2px 16px; font-size: 0.95rem; font-weight: 700; }
.frac-line { width: 100%; height: 2.5px; background: #1e293b; margin: 4px 0; }

/* ---- Calc row ---- */
.calc-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.calc-group { display: flex; flex-direction: column; gap: 4px; }
.calc-group label { font-size: 0.8rem; font-weight: 600; }
.demo-input { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; width: 90px; font-size: 1rem; }
.calc-op { font-size: 1.4rem; font-weight: 700; color: #64748b; padding-bottom: 4px; }
.calc-result { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.calc-rlabel { font-size: 0.8rem; color: #64748b; }
.calc-rval { font-size: 2rem; font-weight: 800; color: #0f172a; line-height: 1; }

/* ---- Speed bars ---- */
.speed-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.speed-row { display: flex; align-items: center; gap: 10px; }
.speed-lbl { font-size: 0.82rem; font-weight: 700; min-width: 76px; }
.speed-track { flex: 1; height: 16px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.speed-fill { height: 100%; border-radius: 99px; transition: width 0.3s ease; }
.speed-text { font-size: 0.82rem; color: #374151; min-width: 90px; text-align: right; }
