/* ============================================================
   CCNA STUDY PORTAL — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

:root {
  --bg:       #0d0d0f;
  --surface:  #131316;
  --card:     #1a1a1f;
  --card2:    #202026;
  --border:   #2a2a32;
  --border2:  #363640;

  --text:     #e8e8f0;
  --muted:    #5a5a6e;
  --muted2:   #8888a0;

  --cyan:     #00e5ff;
  --cyan-dim: rgba(0,229,255,0.12);
  --cyan-glow:rgba(0,229,255,0.25);

  --violet:   #a855f7;
  --violet-dim:rgba(168,85,247,0.12);

  --green:    #22c55e;
  --green-dim:rgba(34,197,94,0.12);

  --amber:    #f59e0b;
  --amber-dim:rgba(245,158,11,0.12);

  --red:      #ef4444;
  --red-dim:  rgba(239,68,68,0.12);

  --mono: 'JetBrains Mono', monospace;
  --sans: 'Syne', sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --sidebar: 240px;
  --header: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-logo {
  height: var(--header);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo .wordmark {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan);
  text-transform: uppercase;
}

.sidebar-logo .tagline {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 400;
}

.sidebar-section {
  padding: 16px 12px 8px;
}

.sidebar-section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--muted2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover { background: var(--card); color: var(--text); }

.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(0,229,255,0.15);
}

.nav-item .nav-icon { font-size: 14px; width: 18px; text-align: center; }

.nav-progress {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  background: var(--card2);
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--muted);
}

.nav-item.active .nav-progress { background: rgba(0,229,255,0.15); color: var(--cyan); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.overall-progress-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.overall-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.overall-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── Main content ───────────────────────────────────── */
.content {
  margin-left: var(--sidebar);
  flex: 1;
  min-width: 0;
}

.topbar {
  height: var(--header);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.topbar-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  color: var(--muted2);
  letter-spacing: 1px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-body {
  padding: 32px;
  max-width: 1200px;
}

/* ── Tab system ─────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.25s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}

.card-sm { padding: 16px; }
.card-accent-cyan { border-color: rgba(0,229,255,0.2); }
.card-accent-violet { border-color: rgba(168,85,247,0.2); }

.card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--cyan);
  border-radius: 2px;
  display: inline-block;
}

.card-sub {
  font-size: 12px;
  color: var(--muted2);
  margin-bottom: 16px;
  font-weight: 400;
}

/* ── Grid helpers ───────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.col-span-2 { grid-column: 1 / -1; }

/* ── Code blocks ────────────────────────────────────── */
.code-block {
  background: #0a0a0c;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  overflow-x: auto;
  white-space: pre;
  color: #a8d8b0;
}

.code-block .c { color: #4a5a4e; }   /* comment */
.code-block .k { color: #00e5ff; }   /* keyword / command */
.code-block .v { color: #f59e0b; }   /* value */
.code-block .o { color: #a855f7; }   /* output */
.code-block .e { color: #ef4444; }   /* error */
.code-block .s { color: #22c55e; }   /* success */

.code-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ── Tables ─────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  background: var(--card2);
  padding: 10px 14px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted2);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badges & pills ─────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-cyan   { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid rgba(0,229,255,0.2); }
.badge-violet { background: var(--violet-dim); color: var(--violet); border: 1px solid rgba(168,85,247,0.2); }
.badge-green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(34,197,94,0.2); }
.badge-amber  { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(245,158,11,0.2); }
.badge-red    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(239,68,68,0.2); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-sm);
  border: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--cyan); color: #000; }
.btn-primary:hover { filter: brightness(1.1); }

.btn-ghost {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted2);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-danger {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
}

/* ── Form inputs ─────────────────────────────────────── */
.field-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

input[type="text"], input[type="number"], textarea, select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

input.correct { border-color: var(--green); background: var(--green-dim); }
input.wrong   { border-color: var(--red);   background: var(--red-dim); }

input[type="range"] {
  accent-color: var(--cyan);
  padding: 0;
  height: 4px;
  cursor: pointer;
}

/* ── Progress bars ───────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.fill-cyan   { background: linear-gradient(90deg, var(--cyan), #00b4cc); }
.fill-violet { background: linear-gradient(90deg, var(--violet), #7c3aed); }
.fill-green  { background: var(--green); }
.fill-amber  { background: var(--amber); }

/* ── Stat chips ──────────────────────────────────────── */
.stat-chip {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 18px;
  text-align: center;
}

.stat-chip .sv {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-chip .sl {
  font-size: 10px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Quiz / Drill elements ────────────────────────────── */
.question-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  animation: fadeUp 0.25s ease;
}

.question-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.question-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.question-highlight {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--cyan);
  background: var(--cyan-dim);
  border-left: 3px solid var(--cyan);
  padding: 10px 16px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 24px;
  font-weight: 600;
}

.answer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.answer-field { position: relative; }
.feedback-icon {
  position: absolute;
  right: 12px; top: 33px;
  font-size: 13px;
}

.result-box {
  display: none;
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  margin-top: 16px;
  animation: fadeUp 0.2s ease;
}

.result-box.show { display: block; }
.result-box.ok  { background: var(--green-dim);  border: 1px solid rgba(34,197,94,0.3);  color: var(--green); }
.result-box.err { background: var(--red-dim);    border: 1px solid rgba(239,68,68,0.3);  color: var(--red);   }
.result-box .detail { color: var(--text); margin-top: 6px; }

/* ── Step labs ───────────────────────────────────────── */
.lab-step {
  display: flex;
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.lab-step:last-child { border-bottom: none; }

.step-num {
  width: 30px; height: 30px;
  background: var(--cyan);
  color: #000;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-body h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.step-body p  { font-size: 13px; color: var(--muted2); line-height: 1.65; margin-bottom: 10px; }

/* ── SVG topology styles ──────────────────────────────── */
.topo-svg { width: 100%; overflow-x: auto; }
.topo-svg svg text { font-family: 'JetBrains Mono', monospace; }

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--card2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 13px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 9999;
  font-family: var(--sans);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.toast-ok  { border-color: rgba(34,197,94,0.4);  color: var(--green); }
.toast.toast-err { border-color: rgba(239,68,68,0.4);  color: var(--red); }

/* ── Checklist ───────────────────────────────────────── */
.checklist { list-style: none; }

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}

.checklist li:last-child { border-bottom: none; }
.checklist li:hover { color: var(--cyan); }

.check-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border2);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  margin-top: 1px;
}

.checklist li.done .check-box {
  background: var(--green);
  border-color: var(--green);
}

.checklist li.done .check-box::after { content: '✓'; color: #000; font-size: 11px; font-weight: 700; }
.checklist li.done .check-text { color: var(--muted); text-decoration: line-through; }

/* ── Info rows ───────────────────────────────────────── */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-row .ik { color: var(--muted2); font-family: var(--mono); }
.info-row .iv { font-family: var(--mono); font-weight: 600; color: var(--text); }

/* ── Section headers ─────────────────────────────────── */
.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
}

.section-header h2 span { color: var(--cyan); }

.section-header p {
  font-size: 13px;
  color: var(--muted2);
  margin-top: 6px;
  font-weight: 400;
  line-height: 1.6;
}

/* ── Callout boxes ───────────────────────────────────── */
.callout {
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.65;
  margin: 12px 0;
}

.callout-cyan   { background: var(--cyan-dim);   border-left: 3px solid var(--cyan);   color: var(--text); }
.callout-amber  { background: var(--amber-dim);  border-left: 3px solid var(--amber);  color: var(--text); }
.callout-green  { background: var(--green-dim);  border-left: 3px solid var(--green);  color: var(--text); }
.callout-red    { background: var(--red-dim);    border-left: 3px solid var(--red);    color: var(--text); }
.callout-violet { background: var(--violet-dim); border-left: 3px solid var(--violet); color: var(--text); }

.callout strong { color: var(--cyan); }
.callout-amber strong { color: var(--amber); }
.callout-green strong { color: var(--green); }
.callout-red   strong { color: var(--red); }
.callout-violet strong { color: var(--violet); }


/* ============================================================
   LIGHT MODE
   ============================================================ */

body.light {
  --bg:       #f4f4f8;
  --surface:  #ffffff;
  --card:     #ffffff;
  --card2:    #f0f0f5;
  --border:   #d8d8e4;
  --border2:  #c4c4d4;

  --text:     #1a1a2e;
  --muted:    #8888a4;
  --muted2:   #5a5a78;

  --cyan:     #0099bb;
  --cyan-dim: rgba(0,153,187,0.1);
  --cyan-glow:rgba(0,153,187,0.22);

  --violet:   #7c3aed;
  --violet-dim:rgba(124,58,237,0.1);

  --green:    #16a34a;
  --green-dim:rgba(22,163,74,0.1);

  --amber:    #d97706;
  --amber-dim:rgba(217,119,6,0.1);

  --red:      #dc2626;
  --red-dim:  rgba(220,38,38,0.1);
}

/* Fix scrollbar for light mode */
body.light ::-webkit-scrollbar-track { background: var(--card2); }
body.light ::-webkit-scrollbar-thumb { background: var(--border2); }

/* Fix code block for light mode */
body.light .code-block {
  background: #1e1e2e;
  color: #cdd6f4;
}

/* Fix code comments/keywords stay same (already hardcoded hex) */

/* Fix data-table hover for light */
body.light .data-table tr:hover td { background: rgba(0,0,0,0.03); }

/* Fix question box */
body.light .question-box { background: var(--card); border-color: var(--border); }

/* Fix toast */
body.light .toast { background: var(--surface); color: var(--text); }

/* Hero gradient stays readable */
body.light .hero { background: linear-gradient(135deg, rgba(0,153,187,0.07) 0%, rgba(124,58,237,0.07) 100%); }

/* Nav active state */
body.light .nav-item.active { color: var(--cyan); background: var(--cyan-dim); }

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: all 0.2s;
}
.theme-toggle:hover {
  border-color: var(--cyan);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ── Hamburger menu button (mobile only) ─────────────── */
.menu-btn {
  display: none;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--muted2);
  font-size: 14px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  letter-spacing: 0;
  line-height: 1;
}
.menu-btn:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }

/* ── Sidebar overlay (mobile) ────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Responsive grid helpers ─────────────────────────── */
.rg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rg-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.rg-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

/* ── Breakpoint: Tablet (≤ 960px) ───────────────────── */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .rg-3   { grid-template-columns: 1fr 1fr; }
  .rg-4   { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 24px 20px; }
  .topbar { padding: 0 20px; }
}

/* ── Breakpoint: Mobile (≤ 700px) ───────────────────── */
@media (max-width: 700px) {
  /* Sidebar: slides off-screen, opens as drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }

  /* Content fills full width */
  .content { margin-left: 0; }

  /* Topbar */
  .topbar { padding: 0 16px; gap: 10px; }
  .menu-btn { display: flex; }
  .topbar-badge { display: none; }

  /* Page body */
  .page-body { padding: 20px 14px; }

  /* Grids → single column */
  .grid-2, .grid-3, .rg-2, .rg-3, .rg-4 { grid-template-columns: 1fr; }
  .answer-row { grid-template-columns: 1fr; }

  /* Cards */
  .card { padding: 16px; }

  /* Lab grid: 1 column */
  #lab-list { grid-template-columns: 1fr !important; }

  /* Data tables: allow horizontal scroll */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 480px; }

  /* SVG topologies */
  .topo-svg svg, svg[viewBox] { width: 100% !important; max-width: 100% !important; height: auto; }

  /* Code blocks */
  .code-block { font-size: 11px; padding: 12px 14px; }

  /* Hero section */
  .hero { padding: 24px 0 20px; }
  .hero h1 { font-size: clamp(22px, 6vw, 36px); }

  /* Step layout in labs */
  .lab-step { gap: 12px; }
  .step-num { width: 26px; height: 26px; font-size: 10px; flex-shrink: 0; }

  /* Drill question */
  .question-box { padding: 16px; }

  /* Topology diagram horizontal scroll */
  .topo-svg { overflow-x: auto; }

  /* Tab buttons smaller on mobile */
  .tab-btn { font-size: 12px; padding: 9px 12px; }
}

/* ── Breakpoint: Small mobile (≤ 400px) ─────────────── */
@media (max-width: 400px) {
  .page-body { padding: 16px 10px; }
  .topbar { padding: 0 12px; }
  .tab-btn { font-size: 11px; padding: 8px 10px; }
  .card { padding: 12px; }
  .topbar-title { font-size: 13px; }
}