/* ============================================================
   builders-theater.css
   Styles specific to the Builders page (technical translation).
   Reuses .fw-* classes from framework-theater.css for hero,
   chapter headers, and primitive grids.
   ============================================================ */

/* ---------- Dual-layer reading blocks ---------- */

.bd-dual {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
}

.bd-plain,
.bd-tech {
  -webkit-flex: 1 1 320px;
  flex: 1 1 320px;
  padding: 1.4rem 1.6rem;
  border-radius: 12px;
  line-height: 1.65;
}

.bd-plain {
  background: #fdf8ef;
  border-left: 4px solid #d4a853;
  color: #3a3a3a;
}

.bd-tech {
  background: #eef4f3;
  border-left: 4px solid #1a5c57;
  color: #2a2a2a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.93rem;
}

.bd-layer-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  opacity: 0.75;
}

.bd-plain .bd-layer-label { color: #b58a3a; }
.bd-tech  .bd-layer-label { color: #1a5c57; }

/* ---------- Mapping table (Chapter 2 centerpiece) ---------- */

.bd-mapping {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 0.9rem;
  margin: 2rem 0;
}

.bd-map-row {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  background: white;
  border: 1px solid #e8e3db;
  border-left: 5px solid #1a5c57;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, -webkit-transform 0.25s ease, transform 0.25s ease;
}

.bd-map-row:hover {
  box-shadow: 0 6px 22px rgba(0,0,0,0.08);
  -webkit-transform: translateY(-2px);
  transform: translateY(-2px);
}

.bd-map-left {
  -webkit-flex: 0 0 220px;
  flex: 0 0 220px;
  background: #f4ebd6;
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: #1a5c57;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
}

.bd-map-arrow {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  padding: 1rem 0.5rem;
  color: #d4a853;
  font-weight: 700;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
}

.bd-map-right {
  -webkit-flex: 1 1 260px;
  flex: 1 1 260px;
  padding: 1rem 1.25rem;
  color: #333;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-justify-content: center;
  justify-content: center;
}

.bd-map-right strong { color: #1a5c57; }
.bd-map-right .bd-map-why {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: #555;
  font-style: italic;
}

/* ---------- Scenario cards (Chapter 3) ---------- */

.bd-scenarios {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.bd-scenario {
  -webkit-flex: 1 1 320px;
  flex: 1 1 320px;
  background: white;
  border: 2px solid #e8e3db;
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  transition: all 0.3s ease;
}

.bd-scenario:hover {
  border-color: #1a5c57;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.bd-scenario-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d4a853;
  margin-bottom: 0.4rem;
}

.bd-scenario h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: #1a5c57;
}

.bd-scenario .bd-scenario-omega {
  font-size: 0.85rem;
  background: #f4ebd6;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: #5a4a1e;
  margin-bottom: 0.9rem;
}

.bd-scenario ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bd-scenario li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: #444;
  border-bottom: 1px dashed #eee;
}
.bd-scenario li:last-child { border-bottom: 0; }
.bd-scenario li strong { color: #1a5c57; display: inline-block; min-width: 90px; }

/* ---------- Grounding diagram (Chapter 5) ---------- */

.bd-grounding-flow {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-align-items: stretch;
  align-items: stretch;
  gap: 0.75rem;
  margin: 2rem 0;
}

.bd-flow-node {
  -webkit-flex: 1 1 140px;
  flex: 1 1 140px;
  background: white;
  border: 2px solid #1a5c57;
  border-radius: 10px;
  padding: 0.9rem 0.8rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a5c57;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
}

.bd-flow-arrow {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  color: #d4a853;
  font-weight: 700;
  font-size: 1.3rem;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
}

/* ---------- Quickstart (Chapter 6) ---------- */

.bd-quickstart {
  counter-reset: bd-step;
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 0.9rem;
}

.bd-quickstart li {
  counter-increment: bd-step;
  position: relative;
  background: white;
  border: 1px solid #e8e3db;
  border-left: 4px solid #1a5c57;
  border-radius: 10px;
  padding: 1rem 1.25rem 1rem 3.5rem;
  font-size: 0.95rem;
  color: #333;
}

.bd-quickstart li::before {
  content: counter(bd-step);
  position: absolute;
  left: 1rem;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  background: #1a5c57;
  color: #d4a853;
  border-radius: 50%;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.bd-quickstart li strong { color: #1a5c57; }

/* ---------- OmegaClaw callout strip ---------- */

.bd-omega-strip {
  background: #1a3d3a;
  color: #f4ebd6;
  padding: 1.2rem 1.5rem;
  border-radius: 12px;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
  line-height: 1.65;
  border-left: 5px solid #d4a853;
}

.bd-omega-strip strong {
  color: #d4a853;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  display: block;
  margin-bottom: 0.4rem;
}

/* ---------- Chapter labels, reuse but tint ---------- */

.bd-hero-sub {
  max-width: 760px;
  margin: 1rem auto 0;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
  font-size: 1.05rem;
}

/* ============================================================
   INTERACTIVE MODULES (Alpine-powered)
   ============================================================ */

/* ---------- Alpine cloak ---------- */
[x-cloak] { display: none !important; }

/* ---------- Mode toggle (Enthusiast / Builder) ---------- */

.bd-mode-toggle {
  display: -webkit-inline-flex;
  display: inline-flex;
  gap: 0;
  margin: 1.5rem auto 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 4px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.bd-mode-toggle button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.75);
  padding: 0.55rem 1.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.bd-mode-toggle button:hover { color: white; }
.bd-mode-toggle button.is-active {
  background: #d4a853;
  color: #1a3d3a;
}
.bd-mode-toggle button:focus-visible {
  outline: 2px solid #d4a853;
  outline-offset: 2px;
}

.bd-mode-caption {
  margin: 0.9rem auto 0;
  max-width: 580px;
  text-align: center;
  color: #f4ebd6;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.9;
}
.bd-mode-caption strong { color: #d4a853; }

/* Mode-aware visibility: hide the inactive reading layer entirely */
[data-mode="enthusiast"] .bd-tech { display: none; }
[data-mode="builder"] .bd-plain { display: none; }
[data-mode="enthusiast"] .bd-plain {
  box-shadow: 0 6px 22px rgba(212,168,83,0.18);
}
[data-mode="builder"] .bd-tech {
  box-shadow: 0 6px 22px rgba(26,92,87,0.18);
}

/* Mode-aware visibility for targeted content */
.bd-mode-only { display: none; }
[data-mode="enthusiast"] .bd-mode-only.bd-for-enthusiast { display: block; }
[data-mode="builder"] .bd-mode-only.bd-for-builder { display: block; }

/* ---------- Progressive mapping explorer ---------- */

.bd-explorer {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
  background: white;
  border: 1px solid #e8e3db;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.bd-explorer-list {
  -webkit-flex: 0 0 260px;
  flex: 0 0 260px;
  list-style: none;
  margin: 0;
  padding: 0;
  border-right: 1px solid #eee;
  padding-right: 1rem;
}

.bd-explorer-list li {
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.3rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  color: #444;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, -webkit-transform 0.2s ease, transform 0.2s ease;
  border: 1px solid transparent;
}
.bd-explorer-list li:hover {
  background: #f4ebd6;
  color: #1a5c57;
}
.bd-explorer-list li.is-active {
  background: #1a5c57;
  color: #f4ebd6;
  border-color: #d4a853;
  -webkit-transform: translateX(4px);
  transform: translateX(4px);
}
.bd-explorer-list li:focus-visible {
  outline: 2px solid #d4a853;
  outline-offset: 2px;
}

.bd-explorer-panel {
  -webkit-flex: 1 1 340px;
  flex: 1 1 340px;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
}

.bd-explorer-panel h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #1a5c57;
}
.bd-explorer-equiv {
  display: inline-block;
  background: #f4ebd6;
  color: #5a4a1e;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin: 0.5rem 0 1rem;
}
.bd-explorer-plain,
.bd-explorer-tech {
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
}
.bd-explorer-plain {
  background: #fdf8ef;
  border-left: 3px solid #d4a853;
}
.bd-explorer-tech {
  background: #eef4f3;
  border-left: 3px solid #1a5c57;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
}
.bd-explorer-omega {
  background: #1a3d3a;
  color: #f4ebd6;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}
.bd-explorer-omega strong {
  color: #d4a853;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  display: block;
  margin-bottom: 0.3rem;
}
.bd-explorer-actions {
  display: -webkit-flex;
  display: flex;
  gap: 0.6rem;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
}

/* ---------- Sticky OmegaClaw walkthrough ---------- */

.bd-sticky-omega {
  background: #1a3d3a;
  color: #f4ebd6;
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  border: 1px solid rgba(212,168,83,0.35);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.bd-sticky-omega h4 {
  margin: 0;
  color: #d4a853;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bd-sticky-omega .bd-sticky-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin: 0.3rem 0 1rem;
}

.bd-sticky-stages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.bd-sticky-stages li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.7rem;
  font-size: 0.85rem;
  color: rgba(244,235,214,0.55);
  cursor: pointer;
  border-left: 2px solid rgba(244,235,214,0.15);
  margin-left: 6px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.bd-sticky-stages li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: rgba(244,235,214,0.2);
  border-radius: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  transition: background 0.25s ease;
}
.bd-sticky-stages li.is-active {
  color: #f4ebd6;
  border-left-color: #d4a853;
}
.bd-sticky-stages li.is-active::before {
  background: #d4a853;
  box-shadow: 0 0 0 4px rgba(212,168,83,0.25);
}
.bd-sticky-stages li:focus-visible {
  outline: 2px solid #d4a853;
  outline-offset: 2px;
}

.bd-sticky-detail {
  background: rgba(0,0,0,0.2);
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(212,168,83,0.2);
  font-size: 0.85rem;
  line-height: 1.6;
}
.bd-sticky-detail strong { color: #d4a853; display: block; margin-bottom: 0.3rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* Layout wrapper for sticky panel + content (software practice section) */
.bd-practice-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 2rem;
  align-items: stretch;
  overflow-anchor: none;
  align-items: flex-start;
  margin-top: 2rem;
}
.bd-practice-main {
  -webkit-flex: 1 1 420px;
  flex: 1 1 420px;
  min-width: 0;
}
.bd-practice-aside {
  -webkit-flex: 0 0 320px;
  flex: 0 0 320px;
  position: -webkit-sticky;
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

@media (max-width: 900px) {
  .bd-practice-grid { grid-template-columns: 1fr; }
  .bd-practice-aside { -webkit-flex: 1 1 100%; flex: 1 1 100%; position: static; max-height: none; overflow: visible; }
  .bd-sticky-omega { position: relative; top: auto; max-height: none; }
}

/* Native <details> artifact drawer — no scroll jumps */
.bd-artifact-details { margin-top: 1rem; border: 1px solid #e8e3db; border-radius: 10px; background: #fff; overflow: hidden; }
.bd-artifact-details > summary { list-style: none; cursor: pointer; padding: 0.85rem 1.1rem; background: #f6f2e9; color: #1a5c57; font-weight: 600; font-size: 0.92rem; display: flex; justify-content: space-between; align-items: center; }
.bd-artifact-details > summary::-webkit-details-marker { display: none; }
.bd-artifact-details > summary::after { content: '▸'; transition: transform 0.2s; color: #d4a853; }
.bd-artifact-details[open] > summary::after { transform: rotate(90deg); }
.bd-artifact-details[open] > summary { background: #1a5c57; color: #d4a853; }
.bd-artifact-details .bd-artifact-body { padding: 1rem 1.1rem; }

/* ---------- Artifact drawers ---------- */

.bd-artifact {
  margin: 1rem 0;
  border: 1px solid #e8e3db;
  border-radius: 10px;
  overflow: hidden;
  background: white;
}

.bd-artifact-trigger {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  width: 100%;
  background: #fdf8ef;
  border: 0;
  color: #1a5c57;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}
.bd-artifact-trigger:hover { background: #f4ebd6; }
.bd-artifact-trigger:focus-visible {
  outline: 2px solid #d4a853;
  outline-offset: -2px;
}
.bd-artifact-chevron {
  font-size: 1.1rem;
  color: #d4a853;
  transition: -webkit-transform 0.3s ease, transform 0.3s ease;
}
.bd-artifact.is-open .bd-artifact-chevron {
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
}

.bd-artifact-body {
  padding: 1.2rem 1.4rem;
  background: #fcfaf5;
  border-top: 1px solid #e8e3db;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #333;
  white-space: pre-wrap;
}
.bd-artifact-body .bd-artifact-field {
  display: -webkit-flex;
  display: flex;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #e8e3db;
}
.bd-artifact-body .bd-artifact-field:last-child { border-bottom: 0; }
.bd-artifact-body .bd-artifact-key {
  -webkit-flex: 0 0 130px;
  flex: 0 0 130px;
  color: #1a5c57;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding-top: 0.15rem;
}
.bd-artifact-body .bd-artifact-val {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  color: #333;
}

/* ---------- Decision simulator ---------- */

.bd-sim {
  background: white;
  border: 2px solid #1a5c57;
  border-radius: 14px;
  padding: 1.5rem 1.7rem;
  margin: 2rem 0 0;
}
.bd-sim-step-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d4a853;
}
.bd-sim h3 {
  margin: 0.3rem 0 1rem;
  color: #1a5c57;
  font-size: 1.2rem;
}
.bd-sim-question {
  font-size: 1rem;
  color: #333;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}
.bd-sim-choices {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 0.6rem;
}
.bd-sim-choice {
  text-align: left;
  background: #fdf8ef;
  border: 1px solid #e8e3db;
  border-left: 4px solid #d4a853;
  color: #333;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.bd-sim-choice:hover {
  background: #f4ebd6;
  -webkit-transform: translateX(3px);
  transform: translateX(3px);
}
.bd-sim-choice:focus-visible {
  outline: 2px solid #1a5c57;
  outline-offset: 2px;
}
.bd-sim-choice.is-selected {
  background: #1a5c57;
  color: #f4ebd6;
  border-left-color: #d4a853;
}
.bd-sim-feedback {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  background: #eef4f3;
  border-left: 4px solid #1a5c57;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #2a2a2a;
  line-height: 1.65;
}
.bd-sim-feedback strong { color: #1a5c57; }
.bd-sim-nav {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  margin-top: 1.2rem;
  gap: 0.6rem;
}
.bd-sim-nav button {
  background: #1a5c57;
  color: white;
  border: 0;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.bd-sim-nav button:disabled { background: #ccc; cursor: not-allowed; }
.bd-sim-nav button.bd-sim-reset { background: transparent; color: #1a5c57; border: 1px solid #1a5c57; }

/* ---------- Interactive systems diagram ---------- */

.bd-diagram {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 1.5rem;
}
.bd-diagram-node {
  -webkit-flex: 1 1 120px;
  flex: 1 1 120px;
  background: white;
  border: 2px solid #1a5c57;
  color: #1a5c57;
  border-radius: 10px;
  padding: 0.85rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}
.bd-diagram-node:hover {
  background: #eef4f3;
  -webkit-transform: translateY(-2px);
  transform: translateY(-2px);
}
.bd-diagram-node.is-active {
  background: #1a5c57;
  color: #f4ebd6;
  border-color: #d4a853;
  box-shadow: 0 6px 18px rgba(26,92,87,0.25);
}
.bd-diagram-node:focus-visible {
  outline: 2px solid #d4a853;
  outline-offset: 2px;
}

.bd-diagram-panel {
  background: white;
  border: 1px solid #e8e3db;
  border-top: 4px solid #1a5c57;
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  margin-top: 0.5rem;
}
.bd-diagram-panel h4 {
  margin: 0 0 0.3rem;
  color: #1a5c57;
  font-size: 1.15rem;
}
.bd-diagram-panel .bd-diagram-role {
  display: inline-block;
  background: #f4ebd6;
  color: #5a4a1e;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.bd-diagram-panel p { margin: 0.4rem 0; line-height: 1.6; font-size: 0.92rem; color: #333; }
.bd-diagram-panel .bd-diagram-omega {
  margin-top: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: #1a3d3a;
  color: #f4ebd6;
  border-radius: 8px;
  font-size: 0.85rem;
}

/* ---------- Glossary chips (inline reveals) ---------- */

.bd-term {
  position: relative;
  display: inline-block;
  color: #1a5c57;
  border-bottom: 2px dotted #d4a853;
  cursor: help;
  font-weight: 600;
}
.bd-term:focus-visible {
  outline: 2px solid #d4a853;
  outline-offset: 2px;
  border-radius: 2px;
}
.bd-term-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  background: #1a3d3a;
  color: #f4ebd6;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  width: 260px;
  max-width: 80vw;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 50;
  border: 1px solid rgba(212,168,83,0.4);
}
.bd-term-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a3d3a;
}
@media (max-width: 720px) {
  .bd-term-popover {
    position: static;
    display: block;
    margin: 0.4rem 0 0.6rem;
    -webkit-transform: none;
    transform: none;
    width: auto;
  }
  .bd-term-popover::after { display: none; }
}

/* ---------- Quick compare tabs ---------- */

.bd-compare {
  background: white;
  border: 1px solid #e8e3db;
  border-radius: 12px;
  padding: 1.2rem 1.3rem;
  margin: 1.5rem 0;
}
.bd-compare-tabs {
  display: -webkit-inline-flex;
  display: inline-flex;
  background: #f4ebd6;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1rem;
}
.bd-compare-tabs button {
  background: transparent;
  border: 0;
  color: #5a4a1e;
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
}
.bd-compare-tabs button.is-active {
  background: #1a5c57;
  color: #f4ebd6;
}
.bd-compare-tabs button:focus-visible {
  outline: 2px solid #1a5c57;
  outline-offset: 2px;
}
.bd-compare-body {
  display: -webkit-flex;
  display: flex;
  gap: 1rem;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
}
.bd-compare-side {
  -webkit-flex: 1 1 220px;
  flex: 1 1 220px;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: #fdf8ef;
  border-left: 4px solid #d4a853;
  font-size: 0.9rem;
  line-height: 1.6;
}
.bd-compare-side.bd-compare-right {
  background: #eef4f3;
  border-left-color: #1a5c57;
}
.bd-compare-side strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  margin-bottom: 0.3rem;
  color: #1a5c57;
}
.bd-compare-side.bd-compare-left strong { color: #b58a3a; }

/* ---------- Checklist with stateful completion ---------- */

.bd-checklist {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.bd-checklist li {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  background: white;
  border: 1px solid #e8e3db;
  border-left: 4px solid #d4a853;
  border-radius: 10px;
  margin-bottom: 0.7rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.bd-checklist li:hover { background: #fdf8ef; }
.bd-checklist li.is-done {
  background: #eef4f3;
  border-left-color: #1a5c57;
  opacity: 0.85;
}
.bd-checklist li.is-done .bd-check-text { text-decoration: line-through; color: #6b6b6b; }
.bd-check-box {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2px solid #1a5c57;
  border-radius: 6px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  color: transparent;
  font-weight: 700;
  font-size: 0.9rem;
  background: white;
  margin-top: 2px;
}
.bd-checklist li.is-done .bd-check-box {
  background: #1a5c57;
  color: #d4a853;
}
.bd-check-text {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  font-size: 0.93rem;
  color: #333;
  line-height: 1.55;
}
.bd-check-text strong { color: #1a5c57; }

/* ---------- Chapter nav / progress rail ---------- */

.bd-chapter-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e8e3db;
  padding: 0.55rem 0;
}
.bd-chapter-nav ol {
  list-style: none;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0 1.5rem;
  margin: 0;
  -webkit-justify-content: center;
  justify-content: center;
}
.bd-chapter-nav a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #1a5c57;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
}
.bd-chapter-nav a:hover { background: #f4ebd6; }
.bd-chapter-nav a.is-active {
  background: #1a5c57;
  color: #d4a853;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    -webkit-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bd-explorer-list li.is-active,
  .bd-diagram-node:hover,
  .bd-sim-choice:hover {
    -webkit-transform: none;
    transform: none;
  }
}

/* ---------- Mobile tweaks ---------- */

@media (max-width: 720px) {
  .bd-map-left { -webkit-flex: 1 1 100%; flex: 1 1 100%; }
  .bd-map-arrow { display: none; }
  .bd-map-right { -webkit-flex: 1 1 100%; flex: 1 1 100%; }
  .bd-flow-arrow { display: none; }
  .bd-explorer-list { -webkit-flex: 1 1 100%; flex: 1 1 100%; border-right: 0; border-bottom: 1px solid #eee; padding-right: 0; padding-bottom: 0.7rem; }
  .bd-explorer-panel { padding: 0.5rem 0; }
}
