@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@300;400;600;700;900&display=swap');

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a25;
  --bg-code: #0d1117;
  --cyan: #00d4ff;
  --green: #00ff88;
  --orange: #ff8800;
  --purple: #b366ff;
  --yellow: #ffd700;
  --red: #ff4466;
  --text: #e0e0e8;
  --text-dim: #888899;
  --border: #2a2a3a;
  --bronze: #cd7f32;
  --silver: #c0c0c0;
  --gold: #ffd700;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
}

/* ── Progress bar ── */
#progress-bar {
  position: fixed; top:0; left:0; height:3px; z-index:1000;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--yellow));
  transition: width .4s ease;
  width: 0%;
}

/* ── Header ── */
header {
  position: fixed; top:0; left:0; right:0; z-index:900;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 30px;
  display: flex; align-items: center; justify-content: space-between;
}
header h1 {
  font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.header-actions { display:flex; gap:10px; align-items:center; }
.btn {
  padding: 7px 18px; border-radius: 6px; border:none; cursor:pointer;
  font-family: 'Inter', sans-serif; font-size: .85rem; font-weight: 600;
  transition: all .2s;
}
.btn-run-all {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #000;
}
.btn-run-all:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(0,255,136,.3); }
.btn-reset {
  background: var(--bg3); color: var(--text-dim); border: 1px solid var(--border);
}
.btn-reset:hover { border-color: var(--red); color: var(--red); }
#progress-text { color: var(--text-dim); font-size: .8rem; }

/* ── Side nav ── */
#side-nav {
  position: fixed; left:0; top:60px; bottom:0; width:260px; z-index:800;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto; padding: 20px 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
#side-nav::-webkit-scrollbar { width:4px; }
#side-nav::-webkit-scrollbar-thumb { background: var(--border); }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: .78rem; color: var(--text-dim);
  text-decoration: none; transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.completed { color: var(--green); border-left-color: var(--green); }
.nav-item.active { color: var(--cyan); background: rgba(0,212,255,.05); border-left-color: var(--cyan); }
.nav-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height:22px; border-radius: 50%; font-size: .65rem;
  background: var(--bg3); font-weight: 700;
}
.nav-item.completed .nav-num { background: var(--green); color: #000; }

/* ── Main content ── */
main {
  margin-left: 260px; padding: 80px 40px 60px 40px;
  max-width: 960px;
}

/* ── Section ── */
.section {
  margin-bottom: 60px;
  border-left: 4px solid var(--border);
  padding-left: 24px;
  scroll-margin-top: 80px;
}
.section.layer-bronze { border-left-color: var(--bronze); }
.section.layer-silver { border-left-color: var(--silver); }
.section.layer-gold { border-left-color: var(--gold); }
.section.layer-general { border-left-color: var(--cyan); }
.section.layer-intro { border-left-color: var(--purple); }

.section-number {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; margin-bottom: 4px;
}
.layer-bronze .section-number { color: var(--bronze); }
.layer-silver .section-number { color: var(--silver); }
.layer-gold .section-number { color: var(--gold); }
.layer-general .section-number { color: var(--cyan); }
.layer-intro .section-number { color: var(--purple); }

.section h2 {
  font-size: 1.6rem; font-weight: 700; margin-bottom: 16px;
  color: #fff;
}
.section h3 {
  font-size: 1.1rem; font-weight: 600; margin: 20px 0 10px;
  color: var(--cyan);
}

/* ── Markdown cells ── */
.md-cell {
  margin-bottom: 16px; line-height: 1.8;
}
.md-cell p { margin-bottom: 12px; }
.md-cell strong { color: #fff; }
.md-cell code {
  background: var(--bg-code); padding: 2px 6px; border-radius: 3px;
  font-family: 'JetBrains Mono', monospace; font-size: .85rem;
  color: var(--cyan);
}
.md-cell pre {
  background: var(--bg-code); padding: 16px; border-radius: 8px;
  overflow-x: auto; margin: 12px 0; font-size: .85rem;
  border: 1px solid var(--border);
}
.md-cell pre code { background:none; padding:0; color: var(--green); }

/* ── Tables ── */
table {
  width:100%; border-collapse: collapse; margin: 12px 0; font-size: .88rem;
}
th {
  background: var(--bg3); padding: 10px 12px; text-align: left;
  font-weight: 600; color: var(--cyan); border-bottom: 2px solid var(--border);
}
td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
tr:nth-child(even) td { background: rgba(255,255,255,.02); }
tr:hover td { background: rgba(0,212,255,.05); }

/* ── Code cells ── */
.code-cell {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden;
  transition: border-color .3s;
}
.code-cell.running { border-color: var(--cyan); box-shadow: 0 0 20px rgba(0,212,255,.15); }
.code-cell.has-output { border-color: rgba(0,255,136,.2); }

.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}
.code-header span { font-size: .75rem; color: var(--text-dim); }
.cell-number { font-family: 'JetBrains Mono', monospace; color: var(--purple); font-weight:700; }

.run-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 14px; border-radius: 5px; border: 1px solid var(--green);
  background: transparent; color: var(--green);
  font-family: 'JetBrains Mono', monospace; font-size: .75rem;
  cursor: pointer; transition: all .2s;
}
.run-btn:hover { background: var(--green); color: #000; }
.run-btn.running-btn {
  border-color: var(--cyan); color: var(--cyan);
  animation: pulse 1s infinite;
}
.run-btn.done-btn { border-color: var(--text-dim); color: var(--text-dim); cursor:default; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

.code-body {
  padding: 16px; overflow-x: auto;
}
.code-body pre {
  margin:0; font-family: 'JetBrains Mono', monospace;
  font-size: .84rem; line-height: 1.6; color: #e6e6e6;
  white-space: pre; overflow-x: auto;
}

/* Syntax highlighting */
.kw { color: #ff79c6; }
.fn { color: #50fa7b; }
.str { color: #f1fa8c; }
.cm { color: #6272a4; }
.num { color: #bd93f9; }
.op { color: #ff79c6; }
.var { color: #8be9fd; }
.type { color: #ffb86c; }

/* ── Output area ── */
.output-area {
  border-top: 1px solid var(--border);
  padding: 16px;
  max-height: 0; overflow: hidden;
  transition: max-height .6s ease, padding .3s;
}
.output-area.visible {
  max-height: 3000px; padding: 16px;
}
.output-label {
  font-size: .7rem; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}

.output-area pre {
  font-family: 'JetBrains Mono', monospace; font-size: .82rem;
  white-space: pre-wrap; color: var(--green); margin: 0;
}
.output-area table { margin: 8px 0; }
.output-area th { background: rgba(0,212,255,.1); color: var(--cyan); font-size: .8rem; }
.output-area td { font-size: .82rem; }

/* ── Tool logos inline ── */
.tool-logo {
  height: 20px; width: 20px; vertical-align: middle;
  display: inline-block; margin-right: 4px;
  filter: brightness(0) invert(1) opacity(.7);
}
.tool-logo-bright { filter: none; }

.tool-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg3); padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; color: var(--text-dim); margin: 2px 4px 2px 0;
  border: 1px solid var(--border);
}
.tool-badge img { height:14px; width:14px; filter: brightness(0) invert(1); }

/* ── Architecture diagram ── */
.arch-flow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 16px 0; justify-content: center;
}
.arch-step {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px; text-align: center;
  min-width: 100px; transition: all .2s;
}
.arch-step:hover { border-color: var(--cyan); transform: translateY(-2px); }
.arch-step .label { font-size: .75rem; color: var(--cyan); font-weight: 600; }
.arch-step .detail { font-size: .68rem; color: var(--text-dim); margin-top: 2px; }
.arch-arrow { color: var(--text-dim); font-size: 1.2rem; }

/* ── Callout boxes ── */
.callout {
  background: rgba(0,212,255,.05); border: 1px solid rgba(0,212,255,.2);
  border-radius: 8px; padding: 16px; margin: 16px 0;
}
.callout.warning {
  background: rgba(255,136,0,.05); border-color: rgba(255,136,0,.2);
}
.callout.success {
  background: rgba(0,255,136,.05); border-color: rgba(0,255,136,.2);
}
.callout-title { font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.callout.warning .callout-title { color: var(--orange); }
.callout.success .callout-title { color: var(--green); }

/* ── Star schema diagram ── */
.star-schema {
  display: flex; align-items: center; justify-content: center;
  gap: 30px; flex-wrap: wrap; margin: 20px 0;
}
.star-entity {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: 12px; padding: 14px 20px; text-align: center;
  min-width: 120px;
}
.star-entity.fact { border-color: var(--yellow); background: rgba(255,215,0,.05); }
.star-entity.dim { border-color: var(--cyan); background: rgba(0,212,255,.05); }
.star-entity .entity-name { font-weight: 700; font-size: .9rem; }
.star-entity.fact .entity-name { color: var(--yellow); }
.star-entity.dim .entity-name { color: var(--cyan); }
.star-entity .entity-cols { font-size: .7rem; color: var(--text-dim); margin-top: 4px; }
.star-arrow { color: var(--text-dim); font-size: 1.5rem; }

/* ── Layer badges ── */
.layer-badge {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px;
}
.layer-badge.bronze { background: rgba(205,127,50,.15); color: var(--bronze); border: 1px solid var(--bronze); }
.layer-badge.silver { background: rgba(192,192,192,.1); color: var(--silver); border: 1px solid var(--silver); }
.layer-badge.gold { background: rgba(255,215,0,.1); color: var(--gold); border: 1px solid var(--gold); }
.layer-badge.landing { background: rgba(136,136,153,.1); color: var(--text-dim); border: 1px solid var(--text-dim); }

/* ── Hero section ── */
.hero {
  text-align: center; padding: 40px 0 60px; margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.8rem; font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--green), var(--yellow));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}
.hero p { color: var(--text-dim); font-size: 1.1rem; max-width: 600px; margin: 0 auto 20px; }
.hero-tools {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 20px;
}
.hero-tool {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hero-tool img { width:36px; height:36px; filter: brightness(0) invert(1) opacity(.85); }
.hero-tool span { font-size: .65rem; color: var(--text-dim); }

/* ── Copy button ── */
.copy-btn {
  padding: 3px 10px; border-radius: 4px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace; font-size: .7rem;
  cursor: pointer; transition: all .2s; margin-left: 8px;
}
.copy-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.copy-btn.copied { border-color: var(--green); color: var(--green); }

/* ── Estimated time badge ── */
.time-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; color: var(--text-dim); margin-left: 12px;
}

/* ── Section completed ── */
.section.completed { opacity: 1; }
.section.completed .section-number::after {
  content: ' ✓'; color: var(--green);
}

/* ── Quiz ── */
.quiz-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; margin: 20px 0;
}
.quiz-box h3 { color: var(--yellow); margin-bottom: 12px; font-size: 1rem; }
.quiz-option {
  display: block; width: 100%; text-align: left;
  padding: 10px 16px; margin: 6px 0; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text); cursor: pointer; font-size: .88rem;
  transition: all .2s; font-family: 'Inter', sans-serif;
}
.quiz-option:hover { border-color: var(--cyan); background: rgba(0,212,255,.05); }
.quiz-option.correct { border-color: var(--green); background: rgba(0,255,136,.1); color: var(--green); }
.quiz-option.wrong { border-color: var(--red); background: rgba(255,68,102,.1); color: var(--red); }
.quiz-feedback { margin-top: 10px; font-size: .85rem; font-weight: 600; }

/* ── Glossary ── */
.glossary-term {
  border-bottom: 1px dashed var(--cyan); cursor: help;
  position: relative;
}
.glossary-term:hover::after {
  content: attr(data-def);
  position: absolute; bottom: 100%; left: 0; z-index: 100;
  background: var(--bg3); border: 1px solid var(--cyan);
  border-radius: 6px; padding: 8px 12px;
  font-size: .78rem; color: var(--text); white-space: normal;
  width: 280px; pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}

/* ── Mobile nav toggle ── */
.nav-toggle {
  display: none; position: fixed; bottom: 20px; right: 20px; z-index: 950;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--cyan); color: var(--bg);
  border: none; font-size: 1.3rem; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,212,255,.4);
  transition: all .2s;
}
.nav-toggle:hover { transform: scale(1.1); }

/* ── Responsive ── */
@media (max-width: 900px) {
  #side-nav { 
    display: none; width: 100%; height: auto; max-height: 50vh;
    position: fixed; bottom: 0; top: auto; left: 0; right: 0;
    z-index: 950; border-right: none; border-top: 1px solid var(--border);
  }
  #side-nav.open { display: block; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  main { margin-left:0; padding: 80px 16px 100px; }
  header { padding: 10px 16px; }
  header h1 { font-size: .9rem; }
  .hero h1 { font-size: 1.8rem; }
  .header-actions .btn { padding: 5px 12px; font-size: .78rem; }
  #progress-text { display: none; }
  .section h2 { font-size: 1.3rem; }
  .code-body pre { font-size: .76rem; }
  .output-area pre { font-size: .76rem; }
  .arch-flow { gap: 4px; }
  .arch-step { padding: 6px 10px; min-width: 70px; font-size: .8rem; }
  .quiz-option { font-size: .82rem; padding: 8px 12px; }
  .cip-project-panel { display:block; padding:14px; }
  .cip-project-shot { display:none !important; }
}

@media (max-width: 600px) {
  main { padding: 70px 12px 100px; }
  .section { padding-left: 16px; border-left-width: 3px; }
  .hero h1 { font-size: 1.4rem; }
  /* Scroll-able tables on mobile */
  .md-cell table,
  .section > table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  table { font-size: .8rem; }
  th, td { padding: 6px 8px; }
  .section h2 { font-size: 1.15rem; line-height: 1.3; }
  .section h2 .tool-badge { font-size: .7rem; vertical-align: middle; }
  .course-intro-panel { padding: 14px 16px; margin-bottom: 28px; }
  .cip-tagline { font-size: .9rem; padding: 10px 12px; }
  .cip-actions { gap: 8px; }
  .cip-action { padding: 9px 14px; font-size: .8rem; flex: 1 1 auto; justify-content: center; }
  .cip-project-copy dl { grid-template-columns:1fr; }
  .cip-block-title { font-size: .78rem; }
  .cip-block-list li { font-size: .83rem; padding: 5px 10px; }
  .fl-topics { grid-template-columns: 1fr; }
  .fl-links { grid-template-columns: 1fr; }
  .section-complete-btn { width: 100%; justify-content: center; margin-top: 14px; }
  /* Preserve code formatting but smaller */
  .code-body pre { font-size: .72rem; padding: 10px; }
  .code-cell { margin: 14px 0; }
  .code-header { padding: 6px 10px; font-size: .72rem; }
  .callout { padding: 12px 14px; }
  /* Header tightened */
  header h1 { font-size: .82rem; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 4px 10px; font-size: .74rem; }
}

/* Prevent horizontal overflow globally on mobile */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  main { overflow-x: hidden; }
  pre, code { word-break: break-word; white-space: pre-wrap; }
  .code-body pre { white-space: pre; overflow-x: auto; word-break: normal; }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.1rem;
  transition: all .2s;
  margin-right: 12px;
  flex-shrink: 0;
}
.back-btn:hover {
  background: var(--accent, var(--cyan));
  color: var(--bg);
  border-color: var(--accent, var(--cyan));
}

.log-airflow { color: #017cee; font-weight: 600; }
.log-dbt { color: #ff694a; font-weight: 600; }
.log-delta { color: #48b984; font-weight: 600; }
.log-spark { color: #f0883e; font-weight: 600; }
.log-kafka { color: #b0b8c4; font-weight: 600; }
.log-info { color: #58a6ff; }
.log-warn { color: #d29922; }
.log-ok { color: #3fb950; font-weight: 600; }
.log-dim { color: #6e7681; }
.log-cmd { color: #79c0ff; }
.log-time { color: #8b949e; }
.log-step { color: #f0883e; font-weight: 600; }

/* ── Section mark-complete button ── */
.section-complete-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 18px; padding: 8px 16px;
  border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,.03); color: var(--text-dim);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.section-complete-btn:hover {
  border-color: rgba(0,255,136,.4); color: var(--green);
  background: rgba(0,255,136,.05);
}
.section-complete-btn.done {
  background: rgba(0,255,136,.12); color: var(--green);
  border-color: rgba(0,255,136,.35);
}
.section-complete-btn.done:hover {
  background: rgba(255,68,102,.1); color: var(--red);
  border-color: rgba(255,68,102,.35);
}
.section.completed {
  position: relative;
}
.section.completed > h2::before {
  content: '';
  position: absolute;
  left: -28px; top: 12px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ── Course intro panel (auto-injected from courses-detail.js) ── */
.course-intro-panel {
  margin-bottom: 40px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(0,212,255,.06), rgba(179,102,255,.06));
  border: 1px solid rgba(0,212,255,.2);
  border-radius: 12px;
}
.cip-tagline {
  font-size: 1.02rem;
  color: var(--text);
  font-style: italic;
  padding: 12px 16px;
  background: rgba(0,0,0,.25);
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.cip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 4px;
}
.cip-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  transition: all .15s;
}
.cip-action:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,212,255,.08);
  transform: translateY(-1px);
  text-decoration: none;
}
.cip-action-primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #000 !important;
  border-color: transparent;
}
.cip-action-primary:hover {
  color: #000 !important;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 20px rgba(0,212,255,.3);
}
.cip-action span { font-size: 1.1em; }

.cip-project-panel {
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(260px,.9fr);
  gap:18px;
  align-items:stretch;
  margin: 20px 0;
  padding:18px;
  background:linear-gradient(135deg,rgba(88,166,255,.10),rgba(188,140,255,.08));
  border:1px solid rgba(88,166,255,.28);
  border-radius:14px;
}
.cip-project-copy p {
  margin:8px 0 12px;
  color:var(--text);
}
.cip-project-copy dl {
  display:grid;
  grid-template-columns:150px minmax(0,1fr);
  gap:8px 14px;
  margin:0 0 14px;
}
.cip-project-copy dt {
  color:var(--text-dim);
  font-size:.78rem;
  font-weight:700;
}
.cip-project-copy dd {
  margin:0;
  color:var(--text);
  font-size:.9rem;
}
.cip-project-tools {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-bottom:14px;
}
.cip-project-tools span {
  padding:4px 9px;
  border:1px solid rgba(88,166,255,.24);
  border-radius:999px;
  background:rgba(88,166,255,.08);
  color:var(--cyan);
  font-family:'JetBrains Mono',monospace;
  font-size:.7rem;
}
.cip-lab-services {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  align-items:center;
  margin:0 0 12px;
}
.cip-lab-services strong {
  width:100%;
  color:var(--text);
  font-size:.78rem;
}
.cip-lab-services span,
.fl-lab-services span {
  padding:4px 9px;
  border:1px solid rgba(63,185,80,.24);
  border-radius:999px;
  background:rgba(63,185,80,.08);
  color:var(--green);
  font-family:'JetBrains Mono',monospace;
  font-size:.7rem;
}
.cip-lab-command {
  margin:0 0 14px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  background:rgba(0,0,0,.22);
  overflow:auto;
}
.cip-lab-command code {
  color:var(--text);
  font-family:'JetBrains Mono',monospace;
  font-size:.78rem;
  white-space:nowrap;
}
.cip-project-actions {
  margin-top:0;
}
.cip-project-shot {
  min-height:210px;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--bg2);
}
.cip-project-shot img {
  width:100%;
  height:100%;
  object-fit:cover;
}

.cip-diagram {
  margin-top: 18px;
  padding: 16px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.cip-diagram-svg {
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cip-diagram-svg svg {
  width: 100%;
  height: auto;
  min-width: 600px;
  display: block;
}
@media (max-width: 768px) {
  .cip-diagram { padding: 10px; }
  .cip-diagram-svg svg { min-width: 500px; }
}

.cip-block { margin-top: 12px; }
.cip-block-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 8px;
  letter-spacing: .3px;
}
.cip-block-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cip-block-list li {
  padding: 6px 12px;
  background: rgba(255,255,255,.03);
  border-radius: 5px;
  font-size: .88rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.cip-block-list li::before {
  content: '›';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}
/* ── Further learning (auto-injected from courses-detail.js) ── */
#further-learning-section h3 { margin-top: 24px; font-size: 1rem; color: var(--text); font-weight: 700; }
.fl-list { list-style:none; padding:0; margin:0 0 16px; display:flex; flex-direction:column; gap:6px; }
.fl-list li {
  padding: 8px 14px; background: rgba(255,255,255,.03); border-radius: 6px;
  font-size: .9rem; color: var(--text); display:flex; align-items:flex-start; gap:8px;
}
.fl-list li::before { content:'›'; color: var(--green); font-weight:700; flex-shrink:0; }

.fl-topics {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:10px; margin-bottom:16px;
}
.fl-topic {
  background: rgba(255,255,255,.03); border:1px solid var(--border);
  border-radius:8px; padding:12px 14px;
}
.fl-topic strong { display:block; color: var(--text); font-size:.9rem; margin-bottom:2px; }
.fl-topic span { font-size:.8rem; color: var(--text-dim); }

.fl-links {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:8px; margin-bottom:16px;
}
.fl-link {
  display:flex; align-items:center; gap:8px;
  padding:10px 12px; background: rgba(0,212,255,.06);
  border:1px solid rgba(0,212,255,.2); border-radius:8px;
  color: var(--cyan); font-size:.82rem; font-weight:500;
  text-decoration:none; transition:all .15s;
}
.fl-link:hover { background: rgba(0,212,255,.12); transform: translateX(2px); }
.fl-link-type {
  font-size:.62rem; text-transform:uppercase; letter-spacing:.5px;
  padding:2px 6px; border-radius:4px; background: rgba(0,212,255,.15);
  flex-shrink:0; font-weight:700;
}
.fl-link-title { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.fl-related { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.fl-related-chip {
  padding:7px 14px; background: rgba(179,102,255,.08);
  border:1px solid rgba(179,102,255,.3); border-radius:20px;
  font-size:.82rem; color: var(--purple); font-weight:600;
  text-decoration:none; transition:all .15s;
}
.fl-related-chip:hover { background: rgba(179,102,255,.2); transform: translateY(-1px); }

.fl-back { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); text-align:center; }
.fl-back-btn {
  display:inline-block; padding:10px 24px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color:#000; border-radius:8px; font-weight:700; font-size:.88rem;
  text-decoration:none; transition: transform .15s;
}
.fl-back-btn:hover { transform: translateY(-2px); color:#000; }

.fl-project-recap {
  margin:18px 0 24px;
  padding:18px;
  border:1px solid rgba(88,166,255,.28);
  border-left:3px solid var(--cyan);
  border-radius:12px;
  background:rgba(88,166,255,.08);
}
.fl-project-recap strong {
  display:block;
  margin-bottom:6px;
  color:var(--text);
}
.fl-project-recap p {
  margin:0 0 10px;
  color:var(--text-dim);
}
.fl-project-recap a {
  display:inline-flex;
  margin-right:14px;
  color:var(--cyan);
  font-weight:700;
}
.fl-lab-services {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:0 0 12px;
}
