/* ============================================
   MBA IA - Design System
   ============================================ */

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

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1624;
  --bg-surface: #141d2e;
  --bg-card: #1a2540;
  --bg-card-hover: #1f2d4a;
  --bg-code: #0d1117;

  --border: #1e2d45;
  --border-light: #243352;

  --accent: #7c3aed;
  --accent-light: #8b5cf6;
  --accent-glow: rgba(124, 58, 237, 0.25);

  --blue: #0ea5e9;
  --blue-glow: rgba(14, 165, 233, 0.2);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.2);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.2);
  --red: #ef4444;
  --pink: #ec4899;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-code: #c9d1d9;

  --sidebar-width: 280px;
  --header-height: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 24px rgba(124,58,237,0.3);

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

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

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Selection ─────────────────────────────── */
::selection { background: var(--accent-glow); color: var(--text-primary); }

/* ── Top Navigation ────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--blue) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  padding: 2px 8px;
  border-radius: 20px;
}

.nav-spacer { flex: 1; }

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  width: 260px;
  transition: var(--transition);
}

.nav-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.nav-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
}

.nav-search input::placeholder { color: var(--text-muted); }

.nav-search-icon { color: var(--text-muted); font-size: 14px; }

.nav-home-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-home-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--accent);
}

.menu-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
}

/* ── Sidebar ───────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 900;
  transition: transform var(--transition-slow);
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 20px 4px;
  margin-top: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.sidebar-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.sidebar-item.active {
  color: var(--accent-light);
  background: rgba(124,58,237,0.1);
  border-left-color: var(--accent);
}

.sidebar-item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-sub {
  padding-left: 52px;
}

.sidebar-sub-item {
  display: block;
  padding: 6px 20px 6px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  transition: var(--transition);
  border-left: none;
}

.sidebar-sub-item:hover { color: var(--accent-light); }
.sidebar-sub-item.active { color: var(--accent-light); font-weight: 600; }

/* ── Main Content ──────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.content-area {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 40px;
}

/* ── Hero (Index) ──────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 40px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 50%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Discipline Grid ───────────────────────── */
.disciplines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 0 40px 60px;
}

.discipline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.discipline-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--card-accent-from), var(--card-accent-to));
  opacity: 0;
  transition: var(--transition);
}

.discipline-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--card-accent-from);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.discipline-card:hover::before { opacity: 1; }

.card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(var(--card-icon-r), var(--card-icon-g), var(--card-icon-b), 0.15);
  border: 1px solid rgba(var(--card-icon-r), var(--card-icon-g), var(--card-icon-b), 0.25);
}

.card-number {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.card-topics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  color: var(--accent-light);
}

.card-arrow {
  color: var(--text-muted);
  font-size: 18px;
  transition: var(--transition);
}

.discipline-card:hover .card-arrow { color: var(--accent-light); transform: translateX(4px); }

/* ── Page Header ───────────────────────────── */
.page-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb-sep { font-size: 10px; }

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 720px;
}

.page-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Table of Contents ─────────────────────── */
.toc {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 40px;
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.toc-item a:hover { color: var(--accent-light); background: rgba(124,58,237,0.08); }
.toc-item.active a { color: var(--accent-light); font-weight: 600; }
.toc-num { font-size: 12px; color: var(--text-muted); min-width: 20px; }

/* ── Sections ──────────────────────────────── */
.section {
  margin-bottom: 60px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.section-number {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: var(--shadow-accent);
}

h2.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

h3.subsection-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h3.subsection-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 20px;
  background: linear-gradient(var(--accent), var(--blue));
  border-radius: 2px;
  flex-shrink: 0;
}

h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 12px;
}

p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.75;
}

ul, ol {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
  padding-left: 24px;
  margin-bottom: 16px;
}

li { margin-bottom: 6px; }

strong { color: var(--text-primary); font-weight: 600; }

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Code Blocks ───────────────────────────── */
.code-block {
  margin: 24px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-code);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.code-lang {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-lang-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.code-lang-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.code-title {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.code-copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.code-copy-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.code-copy-btn.copied { color: var(--green); border-color: var(--green); }

.code-block pre {
  padding: 20px;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-code);
}

/* Code execution steps */
.code-steps {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 16px 0;
}

.code-steps-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-list {
  list-style: none;
  padding: 0;
  counter-reset: steps;
}

.step-list li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.step-list li:last-child { border-bottom: none; }

.step-list li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  min-width: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  margin-top: 1px;
}

/* ── Info Boxes ────────────────────────────── */
.info-box {
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 20px 0;
  display: flex;
  gap: 16px;
  border-left: 4px solid;
}

.info-box.info {
  background: rgba(14,165,233,0.08);
  border-color: var(--blue);
}

.info-box.success {
  background: rgba(16,185,129,0.08);
  border-color: var(--green);
}

.info-box.warning {
  background: rgba(245,158,11,0.08);
  border-color: var(--amber);
}

.info-box.danger {
  background: rgba(239,68,68,0.08);
  border-color: var(--red);
}

.info-box.tip {
  background: rgba(124,58,237,0.08);
  border-color: var(--accent);
}

.info-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }

.info-content { flex: 1; }

.info-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.info-content p { margin: 0; font-size: 14px; }

/* ── Concept Cards ─────────────────────────── */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.concept-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.concept-icon { font-size: 24px; margin-bottom: 12px; }

.concept-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.concept-desc { font-size: 13.5px; color: var(--text-secondary); margin: 0; }

/* ── Comparison Tables ─────────────────────── */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.comparison-table th {
  background: var(--bg-surface);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  font-size: 13px;
}

.comparison-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.comparison-table tr:hover td { background: var(--bg-surface); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 24px 0;
}

/* ── Progress Steps ────────────────────────── */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
}

.flow-step {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  position: relative;
}

.flow-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 56px;
  bottom: -12px;
  width: 2px;
  background: linear-gradient(var(--border-light), transparent);
}

.flow-step-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  z-index: 1;
}

.flow-step.active .flow-step-icon {
  border-color: var(--accent);
  background: rgba(124,58,237,0.15);
}

.flow-step-content { flex: 1; padding-top: 8px; }

.flow-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.flow-step-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Navigation Arrows ─────────────────────── */
.page-navigation {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: var(--transition);
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.nav-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateX(3px);
}

.nav-btn.prev:hover { transform: translateX(-3px); }

.nav-btn-icon { font-size: 20px; flex-shrink: 0; }

.nav-btn-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.nav-btn-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-btn.next { margin-left: auto; text-align: right; flex-direction: row-reverse; }

/* ── Inline Code ───────────────────────────── */
code:not([class]) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.2);
  color: var(--accent-light);
  padding: 2px 7px;
  border-radius: 4px;
}

/* ── Highlight.js theme override ───────────── */
.hljs { background: transparent !important; padding: 0 !important; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in { color: #c678dd; }
.hljs-string, .hljs-attr { color: #98c379; }
.hljs-number, .hljs-literal { color: #d19a66; }
.hljs-comment { color: #5c6370; font-style: italic; }
.hljs-function, .hljs-title { color: #61afef; }
.hljs-params { color: #abb2bf; }
.hljs-variable { color: #e06c75; }
.hljs-type { color: #e5c07b; }
.hljs-meta { color: #56b6c2; }
.hljs-tag { color: #e06c75; }
.hljs-name { color: #56b6c2; }
.hljs-attribute { color: #d19a66; }
.hljs-operator { color: #56b6c2; }
.hljs-punctuation { color: #abb2bf; }

/* ── Search Results ────────────────────────── */
.search-results {
  position: absolute;
  top: calc(var(--header-height) - 2px);
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1100;
  display: none;
}

.search-results.show { display: block; }
.search-result-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: var(--transition);
  color: inherit;
}
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-icon { font-size: 18px; }
.search-result-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.search-result-desc { font-size: 12px; color: var(--text-muted); }

/* ── Progress Bar ──────────────────────────── */
.reading-progress {
  position: fixed;
  top: var(--header-height);
  left: var(--sidebar-width);
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 999;
}

.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  width: 0%;
  transition: width 0.1s ease;
}

/* ── Footer ────────────────────────────────── */
.page-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Divider ───────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 40px 0;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 260px; }
  .disciplines-grid { padding: 0 24px 48px; }
  .content-area { padding: 36px 28px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .reading-progress { left: 0; }
  .menu-toggle { display: flex; }
  .nav-search { display: none; }
  .disciplines-grid { grid-template-columns: 1fr; padding: 0 16px 40px; }
  .content-area { padding: 24px 16px; }
  .hero { padding: 48px 16px 40px; }
  .hero-stats { gap: 24px; }
  .page-navigation { flex-direction: column; }
  .nav-btn { max-width: 100%; }
  .nav-btn.next { flex-direction: row; text-align: left; }
}

/* ── Animations ────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(124,58,237,0.3); }
  50% { box-shadow: 0 0 40px rgba(124,58,237,0.6); }
}

.fade-in {
  animation: fadeInUp 0.5s ease both;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* ── Utility ───────────────────────────────── */
.text-accent { color: var(--accent-light); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }

/* ============================================
   EXTENSIONS — v2 (features)
   ============================================ */

/* ── Light Mode ───────────────────────────── */
body.light-mode {
  --bg-primary: #f7f8fc;
  --bg-secondary: #ffffff;
  --bg-surface: #f1f3f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f9;
  --bg-code: #f7f8fc;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-code: #1e293b;
  --accent-glow: rgba(124, 58, 237, 0.12);
}

body.light-mode .top-nav {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

body.light-mode .hljs {
  color: #1e293b;
}
body.light-mode .hljs-keyword { color: #7c3aed; }
body.light-mode .hljs-string { color: #16a34a; }
body.light-mode .hljs-number { color: #ea580c; }
body.light-mode .hljs-comment { color: #94a3b8; }
body.light-mode .hljs-function, body.light-mode .hljs-title { color: #2563eb; }

body.light-mode .hero-title,
body.light-mode .nav-logo-text {
  background: linear-gradient(135deg, #1e293b 0%, #7c3aed 50%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Theme toggle button */
.theme-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); background: var(--bg-card); }

/* ── Progress Checkpoint (localStorage) ───── */
.sidebar-progress {
  padding: 16px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.progress-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 0.5s ease;
}

.check-mark {
  font-size: 12px;
  color: var(--green);
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-item.completed .check-mark { opacity: 1; }

/* TOC checkmarks — indica seções lidas */
.toc-item.read a::after {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  margin-left: 8px;
  font-size: 12px;
}
.toc-item.read a {
  opacity: 0.75;
}
.toc-item.read a .toc-num {
  background: var(--green);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  padding: 0;
}

/* Sidebar sub-item checkmark */
.sidebar-sub-item.read::after {
  content: '✓';
  color: var(--green);
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
}
.sidebar-sub-item.read {
  opacity: 0.7;
}

/* ── Acessibilidade ─────────────────────────── */

/* Skip-link: primeiro foco da página, visível apenas no foco */
.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 2000;
  background: var(--accent);
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
  box-shadow: var(--shadow-md);
}
.skip-link:focus {
  top: 12px;
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* focus-visible consistente em todos os interativos */
:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove outline padrão feio; mantém via focus-visible */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
summary:focus:not(:focus-visible) {
  outline: none;
}

/* Respeita prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Alto contraste (Windows forced-colors) */
@media (forced-colors: active) {
  .top-nav, .sidebar, .discipline-card, .resource-card,
  .code-block, .info-box, .faq-item, .exercise, .quiz-container {
    border: 1px solid CanvasText !important;
  }
  .quiz-option.correct, .quiz-option.incorrect {
    forced-color-adjust: none;
  }
}

/* Screen reader-only text */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mark-read-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin: 24px 0;
  transition: var(--transition);
}
.mark-read-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.mark-read-btn.completed {
  background: rgba(16,185,129,0.1);
  border-color: var(--green);
  color: var(--green);
}

/* ── Output Blocks ────────────────────────── */
.code-output {
  margin: -8px 0 24px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

body.light-mode .code-output { background: #1e293b; }

.code-output-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: #7fffa1;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16,185,129,0.06);
}

.code-output-header::before {
  content: '▶';
  color: #7fffa1;
}

.code-output pre {
  padding: 16px 20px;
  margin: 0;
  overflow-x: auto;
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.65;
}

.code-output .comment { color: #64748b; font-style: italic; }
.code-output .highlight { color: #7fffa1; font-weight: 600; }
.code-output .error { color: #f87171; }

/* ── Diagrams (SVG container) ─────────────── */
.diagram {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin: 24px 0;
  text-align: center;
}

.diagram svg {
  max-width: 100%;
  height: auto;
}

.diagram-caption {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.diagram-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── FAQ Accordion ────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover { border-color: var(--border-light); }
.faq-item[open] { border-color: var(--accent); background: var(--bg-card); }

.faq-question {
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::before {
  content: '+';
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  color: var(--accent-light);
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}

.faq-item[open] .faq-question::before {
  content: '−';
  background: var(--accent);
  color: white;
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 20px 54px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.faq-answer p { margin-bottom: 10px; font-size: 14px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer ul { font-size: 14px; padding-left: 20px; }

.faq-category {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(124,58,237,0.12);
  color: var(--accent-light);
  border: 1px solid rgba(124,58,237,0.25);
  margin-left: auto;
}

/* ── Exercise Cards ───────────────────────── */
.exercise {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 20px 0;
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.exercise-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  color: var(--accent-light);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.exercise-difficulty {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exercise-difficulty.easy { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.exercise-difficulty.medium { background: rgba(245,158,11,0.15); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.exercise-difficulty.hard { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

.exercise-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0;
}

.exercise-body {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.exercise-hint {
  font-size: 13px;
  color: var(--text-muted);
  padding: 10px 14px;
  background: rgba(245,158,11,0.08);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  margin: 10px 0;
}

.exercise-solution {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.exercise-solution summary {
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--accent-light);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exercise-solution summary::-webkit-details-marker { display: none; }
.exercise-solution summary::before { content: '🔓'; }
.exercise-solution[open] summary::before { content: '🔒'; }

.exercise-solution-content {
  padding: 0 18px 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ── Interactive Quiz ─────────────────────── */
.quiz-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}

.quiz-question {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.quiz-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 20px;
}

.quiz-progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 0.4s;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.quiz-option {
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  color: var(--text-primary);
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.quiz-option-letter {
  width: 28px; height: 28px;
  min-width: 28px;
  background: var(--accent-glow);
  color: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.quiz-option.correct {
  border-color: var(--green);
  background: rgba(16,185,129,0.1);
}
.quiz-option.correct .quiz-option-letter { background: var(--green); color: white; }

.quiz-option.incorrect {
  border-color: var(--red);
  background: rgba(239,68,68,0.1);
}
.quiz-option.incorrect .quiz-option-letter { background: var(--red); color: white; }

.quiz-feedback {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.7;
  display: none;
}

.quiz-feedback.show { display: block; }
.quiz-feedback.correct {
  background: rgba(16,185,129,0.1);
  border-left: 4px solid var(--green);
  color: var(--text-primary);
}
.quiz-feedback.incorrect {
  background: rgba(239,68,68,0.1);
  border-left: 4px solid var(--red);
  color: var(--text-primary);
}

.quiz-feedback-title { font-weight: 700; margin-bottom: 6px; }

.quiz-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.quiz-btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.quiz-btn:hover:not(:disabled) { background: var(--bg-card); border-color: var(--accent); }
.quiz-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border: none;
  color: white;
}
.quiz-btn.primary:hover { box-shadow: var(--shadow-accent); }
.quiz-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.quiz-result {
  text-align: center;
  padding: 40px 20px;
}
.quiz-result-score {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 64px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.quiz-result-label { font-size: 16px; color: var(--text-secondary); margin-bottom: 20px; }

/* ── Template Download Cards ─────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.template-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.template-card .icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-card .title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.template-card .desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.template-card .download {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent-light);
  font-weight: 600;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── Case Study Cards ─────────────────────── */
.case-study {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 20px 0;
}

.case-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.case-logo {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.case-title-block h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.case-subtitle { font-size: 13px; color: var(--text-muted); }

.case-section { margin: 16px 0; }

.case-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 6px;
}

.case-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0 10px;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
}

.case-metric { text-align: center; }
.case-metric-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
}
.case-metric-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Print Styles (polido) ─────────────────── */
@media print {
  /* Tamanho e margens da página */
  @page {
    size: A4;
    margin: 18mm 15mm 22mm 15mm;
  }
  @page:first {
    margin-top: 30mm;
  }

  /* Header/footer automáticos */
  @page {
    @top-right {
      content: "MBA em IA Generativa";
      font-family: 'Inter', sans-serif;
      font-size: 9pt;
      color: #94a3b8;
    }
    @bottom-center {
      content: "Página " counter(page) " de " counter(pages);
      font-family: 'Inter', sans-serif;
      font-size: 9pt;
      color: #94a3b8;
    }
    @bottom-right {
      content: "mba-ia.local";
      font-family: 'Inter', sans-serif;
      font-size: 8pt;
      color: #cbd5e1;
    }
  }

  /* Esconder elementos não-imprimíveis */
  .top-nav, .sidebar, .reading-progress, .menu-toggle,
  .theme-toggle, .nav-search, .nav-home-btn,
  .page-navigation, .mark-read-btn, .code-copy-btn,
  .back-to-top, .faq-chips, .diff-chips,
  #searchResults, .nav-home-btn, #printBtn {
    display: none !important;
  }

  /* Base tipográfica */
  body {
    background: white !important;
    color: #1e293b !important;
    font-size: 10.5pt;
    line-height: 1.55;
    font-family: 'Inter', Georgia, serif;
  }
  .main-wrapper { margin: 0 !important; }
  .content-area { max-width: 100% !important; padding: 0 !important; }

  /* Capa imprimível no topo do primeiro documento */
  .page-header::before {
    content: "";
    display: block;
    height: 40pt;
  }

  /* Títulos */
  .page-title {
    background: none !important;
    -webkit-text-fill-color: #0f172a !important;
    color: #0f172a !important;
    font-size: 28pt;
    page-break-after: avoid;
    margin-top: 0;
  }
  .page-subtitle {
    color: #475569 !important;
    font-size: 12pt;
    margin-bottom: 16pt;
  }
  h1, h2, h3, h4 {
    color: #0f172a !important;
    page-break-after: avoid;
    break-after: avoid-page;
  }
  h2.section-title { font-size: 18pt; margin-top: 24pt; }
  h3.subsection-title { font-size: 13pt; margin-top: 18pt; }
  .section-number {
    background: #7c3aed !important;
    color: white !important;
    box-shadow: none !important;
  }

  /* Quebras de página */
  .section {
    page-break-inside: auto;
    break-inside: auto;
    margin-bottom: 18pt;
  }
  .code-block, .info-box, .exercise, .quiz-container,
  .case-study, .concept-card, .diagram, .code-steps {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 1px solid #cbd5e1 !important;
    background: white !important;
    box-shadow: none !important;
  }

  /* Code blocks legíveis em papel */
  .code-block {
    background: #f8fafc !important;
  }
  .code-header {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }
  .code-block pre, .code-block code, .hljs {
    color: #1e293b !important;
    background: #f8fafc !important;
    font-size: 9pt;
  }
  .hljs-keyword { color: #7c3aed !important; }
  .hljs-string { color: #059669 !important; }
  .hljs-number { color: #ea580c !important; }
  .hljs-comment { color: #64748b !important; font-style: italic; }
  .hljs-function, .hljs-title { color: #2563eb !important; }

  /* Output blocks */
  .code-output { background: #f1f5f9 !important; border-color: #cbd5e1 !important; }
  .code-output pre { color: #0f172a !important; }
  .code-output .comment { color: #64748b !important; }
  .code-output .highlight { color: #059669 !important; font-weight: 700; }

  /* Info boxes legíveis */
  .info-box { border-width: 2px !important; }
  .info-box.tip { background: #faf5ff !important; border-color: #a78bfa !important; }
  .info-box.info { background: #eff6ff !important; border-color: #3b82f6 !important; }
  .info-box.warning { background: #fffbeb !important; border-color: #f59e0b !important; }
  .info-box.danger { background: #fef2f2 !important; border-color: #ef4444 !important; }
  .info-box.success { background: #f0fdf4 !important; border-color: #10b981 !important; }

  /* Links com URL visível */
  a {
    color: #2563eb !important;
    text-decoration: underline;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #94a3b8;
    word-break: break-all;
  }
  /* Não mostra URL de âncoras internas nem imagens */
  a[href^="#"]::after, a[href^="mailto:"]::after,
  a.card-arrow::after, .nav-btn::after { content: ""; }

  /* Tabelas limpas */
  .comparison-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
  }
  .comparison-table td {
    color: #334155 !important;
  }

  /* Diagramas SVG imprimem melhor com fundo branco */
  .diagram {
    background: white !important;
    border-color: #cbd5e1 !important;
  }
  .diagram svg {
    max-width: 100% !important;
    background: white !important;
  }
  .diagram svg rect[fill="#0f1624"] { fill: #f8fafc !important; }
  .diagram svg text[fill="#e2e8f0"] { fill: #0f172a !important; }
  .diagram svg text[fill="#94a3b8"] { fill: #475569 !important; }
  .diagram svg text[fill="#64748b"] { fill: #64748b !important; }

  /* FAQs abertos automaticamente ao imprimir */
  details { page-break-inside: avoid; }
  details summary { cursor: default; }
  details > summary::before { content: "" !important; }
  details > *:not(summary) { display: block !important; }

  /* Breadcrumb e badges sutis */
  .breadcrumb, .page-badge { color: #64748b !important; }
  .page-badge { background: #f1f5f9 !important; border-color: #cbd5e1 !important; }
  .page-meta-item { color: #64748b !important; }

  /* Cover page hint */
  .page-header {
    border-bottom: 2px solid #cbd5e1 !important;
    padding-bottom: 20pt !important;
    margin-bottom: 30pt !important;
  }
}

/* ── Search highlight ─────────────────────── */
mark.search-hit {
  background: rgba(245,158,11,0.3);
  color: var(--text-primary);
  padding: 0 3px;
  border-radius: 2px;
}

/* ── Back to top ──────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 20px;
  box-shadow: var(--shadow-accent);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); }

/* ── Resource Hub Cards ───────────────────── */
.resource-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 20px 40px 40px;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.resource-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.resource-icon {
  font-size: 28px;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.resource-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.resource-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

@media (max-width: 768px) {
  .resource-hub { padding: 16px; grid-template-columns: 1fr 1fr; }
  .quiz-result-score { font-size: 48px; }
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}
