/* ═══════════════════════════════════════════════════
   Pearl Test Environment — Implementation Guide
   Full-Page Reference & Video Learning Hub
   ═══════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-card-hover: #1f2847;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --accent-light: #60a5fa;
  --accent-2: #8b5cf6;
  --accent-2-glow: rgba(139, 92, 246, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --border: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --sidebar-width: 280px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-primary);
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.guide-nav-open {
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ───── Top Bar ───── */
.guide-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.guide-topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}

.guide-topbar-back:hover {
  color: var(--accent-light);
}

.guide-topbar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-topbar-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.guide-topbar-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.guide-mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: auto;
}

/* ───── Sidebar ───── */
.guide-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 900;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  transition: transform 0.3s ease;
}

.guide-sidebar::-webkit-scrollbar { width: 4px; }
.guide-sidebar::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.3); border-radius: 2px; }

.guide-sidebar-section {
  margin-bottom: 8px;
}

.guide-sidebar-heading {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 20px 4px;
}

.guide-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.guide-sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.guide-sidebar-link.active {
  color: var(--accent-light);
  background: rgba(59, 130, 246, 0.08);
  border-left-color: var(--accent);
}

.guide-sidebar-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.guide-sidebar-link small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1px;
}

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

.guide-section {
  padding: 60px 48px 80px;
  border-bottom: 1px solid var(--border);
  max-width: 1100px;
}

.guide-section:last-child {
  border-bottom: none;
}

.guide-section-dark {
  background: var(--bg-secondary);
  max-width: none;
}

.guide-section-dark .guide-section-inner {
  max-width: 1100px;
}

.guide-section-number {
  display: inline-block;
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.3;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.guide-section h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.guide-section h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--text-primary);
}

.guide-section h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--accent-light);
}

.guide-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.guide-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.guide-section strong {
  color: var(--text-primary);
}

.guide-section code {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-light);
}

/* ───── Hero Banner ───── */
.guide-hero {
  position: relative;
  padding: 80px 48px 60px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
  border-bottom: 1px solid var(--border);
  max-width: none;
}

.guide-hero-inner {
  max-width: 800px;
}

.guide-hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 30%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guide-hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.guide-hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

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

.guide-hero-stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-light);
}

.guide-hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ───── Info Box ───── */
.guide-info-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.guide-info-box h4 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--accent-light);
}

.guide-info-box p {
  font-size: 0.9rem;
  margin: 0;
}

.guide-info-box.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(239, 68, 68, 0.05));
  border-color: rgba(245, 158, 11, 0.25);
}

.guide-info-box.warning h4 {
  color: var(--warning);
}

.guide-info-box.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.05));
  border-color: rgba(16, 185, 129, 0.25);
}

.guide-info-box.success h4 {
  color: var(--success);
}

.guide-info-box.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.05));
  border-color: rgba(239, 68, 68, 0.25);
}

.guide-info-box.danger h4 {
  color: var(--danger);
}

/* ───── Checklist ───── */
.guide-checklist {
  list-style: none;
  margin: 1rem 0 1.5rem;
}

.guide-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.guide-checklist li::before {
  content: '☐';
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--accent-light);
  margin-top: 1px;
}

/* ───── Video Cards ───── */
.guide-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.guide-video-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}

.guide-video-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.guide-video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: var(--bg-secondary);
  overflow: hidden;
}

.guide-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.guide-video-embed.is-loaded iframe {
  opacity: 1;
  pointer-events: auto;
}

.guide-video-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 23, 0.08) 0%, rgba(10, 14, 23, 0.5) 100%),
    var(--bg-secondary);
  cursor: pointer;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.guide-video-preview:hover {
  transform: scale(1.01);
}

.guide-video-preview:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: -2px;
}

.guide-video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide-video-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 23, 0.1) 0%, rgba(10, 14, 23, 0.6) 100%),
    radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, transparent 45%);
}

.guide-video-play {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.guide-video-play::before {
  content: '';
  margin-left: 4px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 20px solid white;
}

.guide-video-duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 4px 8px;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.guide-video-embed.is-loaded .guide-video-preview {
  opacity: 0;
  pointer-events: none;
}

.guide-video-info {
  padding: 12px 16px;
}

.guide-video-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.guide-video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-video-channel {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.guide-video-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.guide-video-tag.beginner {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.guide-video-tag.intermediate {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-light);
}

.guide-video-tag.advanced {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #a78bfa;
}

.guide-video-tag.essential {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* ───── Single featured video (full-width) ───── */
.guide-video-featured {
  margin: 1.5rem 0 2rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.guide-video-featured .guide-video-embed {
  padding-bottom: 45%;
  max-height: 480px;
}

.guide-video-featured .guide-video-info {
  padding: 16px 20px;
}

.guide-video-featured .guide-video-title {
  font-size: 1rem;
}

/* ───── Step Block ───── */
.guide-step {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.guide-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.guide-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.guide-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.guide-step p {
  font-size: 0.9rem;
}

.guide-step ol,
.guide-step ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.guide-step li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0.35rem 0;
  line-height: 1.7;
}

/* ───── Command Block ───── */
.guide-cmd {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-light);
  overflow-x: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}

.guide-cmd .comment {
  color: var(--text-muted);
}

/* ───── Phase Header Card ───── */
.guide-phase-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.guide-phase-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.guide-phase-meta h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.guide-phase-meta p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.guide-phase-hours {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}

.guide-phase-hours span {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-light);
}

.guide-phase-hours small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ───── Table ───── */
.guide-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 640px;
}

.guide-table th {
  background: rgba(59, 130, 246, 0.1);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--accent-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.guide-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.guide-table tr:last-child td {
  border-bottom: none;
}

.guide-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ───── Prerequisite Cards ───── */
.guide-prereq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.guide-prereq-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: var(--transition);
}

.guide-prereq-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.guide-prereq-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.guide-prereq-card p {
  font-size: 0.82rem;
  margin: 0;
}

.guide-prereq-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ───── Learning Path ───── */
.learning-path {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1.5rem 0;
  position: relative;
}

.learning-path::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  opacity: 0.3;
}

.learning-path-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  position: relative;
}

.learning-path-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  z-index: 1;
}

.learning-path-dot.step-1 { background: linear-gradient(135deg, #10b981, #059669); }
.learning-path-dot.step-2 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.learning-path-dot.step-3 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.learning-path-dot.step-4 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.learning-path-dot.step-5 { background: linear-gradient(135deg, #ef4444, #dc2626); }

.learning-path-content h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.learning-path-content p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ───── Deployment Deep Dive Banner ───── */
.guide-deep-dive-banner {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(245, 158, 11, 0.08));
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  text-align: center;
}

.guide-deep-dive-banner h3 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
  color: var(--danger);
}

.guide-deep-dive-banner p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* ───── Progress tracker (top of page) ───── */
.guide-progress {
  position: fixed;
  top: 56px;
  left: var(--sidebar-width);
  right: 0;
  height: 3px;
  z-index: 999;
}

.guide-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ───── Responsive ───── */
@media (max-width: 1024px) {
  .guide-sidebar {
    width: min(88vw, 320px);
    transform: translateX(-100%);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  }

  .guide-sidebar.open {
    transform: translateX(0);
  }

  .guide-video-card:hover,
  .guide-video-card:active {
    transform: none;
  }

  .guide-main {
    margin-left: 0;
    width: 100%;
  }

  .guide-progress {
    left: 0;
  }

  .guide-mobile-toggle {
    display: block;
  }

  .guide-topbar-title {
    flex: 1;
    min-width: 0;
  }

  .guide-section {
    padding: 40px 24px 60px;
    max-width: 100%;
  }

  .guide-hero {
    padding: 60px 24px 40px;
  }

  .guide-hero h1 {
    font-size: 2rem;
  }

  .guide-video-grid {
    grid-template-columns: 1fr;
  }

  .guide-prereq-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 600px) {
  .guide-topbar {
    gap: 8px;
    padding: 0 12px;
  }

  .guide-topbar-back {
    font-size: 0.78rem;
  }

  .guide-topbar-title {
    font-size: 0.8rem;
    max-width: 140px;
  }

  .guide-mobile-toggle {
    padding: 6px 8px;
    min-height: 44px;
    min-width: 44px;
  }

  .guide-hero h1 {
    font-size: 1.6rem;
  }

  .guide-section h2 {
    font-size: 1.6rem;
  }

  .guide-phase-banner {
    flex-direction: column;
    text-align: center;
  }

  .guide-phase-hours {
    margin-left: 0;
  }

  .guide-hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .guide-prereq-grid {
    grid-template-columns: 1fr;
  }

  .guide-section {
    padding: 32px 16px 48px;
  }

  .guide-hero {
    padding: 48px 16px 32px;
  }

  .guide-step,
  .guide-info-box,
  .guide-phase-banner,
  .guide-prereq-card {
    padding: 1rem;
  }

  .guide-table {
    min-width: 560px;
  }

  .guide-topbar-badge,
  .guide-topbar-sep {
    display: none;
  }
}

@media (max-width: 420px) {
  .guide-hero-stats {
    grid-template-columns: 1fr;
  }

  .guide-step-header {
    align-items: flex-start;
  }

  .guide-video-play {
    width: 60px;
    height: 60px;
  }

  .guide-video-play::before {
    border-top-width: 10px;
    border-bottom-width: 10px;
    border-left-width: 16px;
  }

  .guide-section h2 {
    font-size: 1.35rem;
  }

  .guide-hero h1 {
    font-size: 1.35rem;
  }

  .guide-section {
    padding: 24px 12px 36px;
  }

  .guide-hero {
    padding: 40px 12px 24px;
  }

  .guide-topbar {
    padding: 0 8px;
  }

  .guide-topbar-back {
    font-size: 0.72rem;
    gap: 4px;
  }

  .guide-topbar-title {
    font-size: 0.72rem;
    max-width: 100px;
  }

  .guide-cmd {
    font-size: 0.72rem;
    padding: 10px 12px;
  }

  .guide-table {
    min-width: 480px;
    font-size: 0.75rem;
  }

  .guide-sidebar-link {
    min-height: 44px;
    padding: 10px 20px;
  }
}

/* ───── Global Touch & Accessibility ───── */
.guide-sidebar-link {
  -webkit-tap-highlight-color: transparent;
}

.guide-video-preview:focus-visible,
.guide-sidebar-link:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}
