/* ==========================================================================
   TzdLang Interactive Tour & Comprehensive Guide Stylesheet (tour.css)
   Apple Developer & Liquid Glassmorphism System
   Three-Column Layout: Catalog (260px) + Tutorial + Interactive Playground (460px)
   ========================================================================== */

:root {
  --bg-base: #090A0F;
  --bg-panel: rgba(18, 20, 29, 0.65);
  --bg-panel-solid: #0E1017;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(56, 189, 248, 0.35);

  --text-primary: #F5F5F7;
  --text-secondary: #86868B;
  --text-tertiary: #52525A;
  --text-accent: #38BDF8;
  --text-accent-glow: #00F2FE;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --nav-height: 60px;
  --sidebar-w: 260px;
  --playground-w: 460px;
}

/* --------------------------------------------------------------------------
   Reset & Global Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* 4px Ultra-Thin Frosted Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* --------------------------------------------------------------------------
   Ambient Lights (Cyan + Indigo)
   -------------------------------------------------------------------------- */
.ambient-glow-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-light-teal {
  position: absolute;
  top: -80px;
  right: -60px;
  width: 700px;
  height: 650px;
  background: radial-gradient(circle, #0F2A38 0%, rgba(15, 42, 56, 0) 70%);
  filter: blur(140px);
  opacity: 0.5;
}

.ambient-light-indigo {
  position: absolute;
  bottom: -100px;
  left: -80px;
  width: 740px;
  height: 700px;
  background: radial-gradient(circle, #1E1035 0%, rgba(30, 16, 53, 0) 70%);
  filter: blur(140px);
  opacity: 0.45;
}

/* --------------------------------------------------------------------------
   Top Sticky Navigation (60px)
   -------------------------------------------------------------------------- */
.tour-header {
  position: relative;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(9, 10, 15, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.brand-icon svg {
  width: 16px;
  height: 16px;
  color: #38BDF8;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.version-badge {
  font-size: 0.68rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.breadcrumb-sep {
  color: var(--text-tertiary);
}

.breadcrumb-active {
  color: var(--text-primary);
  font-weight: 500;
}

/* Global Search Bar (Cmd + K) */
.header-center {
  flex: 1;
  max-width: 380px;
  margin: 0 1.5rem;
}

.search-trigger-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.search-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-glass);
  color: var(--text-primary);
}

.search-left-part {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-left-part svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  transition: all 0.15s ease;
}

.btn-github:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-github svg {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Three-Column Layout Engine
   -------------------------------------------------------------------------- */
.tour-workspace {
  position: relative;
  z-index: 10;
  height: calc(100vh - var(--nav-height));
  display: flex;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Column 1: Left Catalog Navigator (260px)
   -------------------------------------------------------------------------- */
.tour-catalog {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(11, 13, 19, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.catalog-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.catalog-group-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 0 0.5rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-nav-item {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.75rem;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  position: relative;
  transition: all 0.15s ease;
}

.catalog-nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.catalog-nav-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.65;
}

.catalog-nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.catalog-nav-item.active svg {
  opacity: 1;
  color: #38BDF8;
}

/* 2px Bright Blue Vertical Indicator Bar */
.catalog-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background-color: #38BDF8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

/* --------------------------------------------------------------------------
   Column 2: Middle Tutorial & Explanation (Fluid width, independent scroll)
   -------------------------------------------------------------------------- */
.tour-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 2.5rem 3rem 5rem;
  background: rgba(9, 10, 15, 0.3);
}

.content-crossfade-wrapper {
  max-width: 780px;
  margin: 0 auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-crossfade-wrapper.fade-out {
  opacity: 0;
  transform: translateY(6px);
}

.tour-chapter-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38BDF8;
  margin-bottom: 0.6rem;
}

.tour-chapter-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.tour-lead-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.doc-section-heading {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-body-text {
  font-size: 0.94rem;
  color: #B0B5C0;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.apple-info-callout {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  color: #BAE6FD;
  line-height: 1.6;
}

.apple-info-callout strong {
  color: #FFFFFF;
}

/* Language Comparison Cards (Apple Frosted Split Table) */
.comparison-card-container {
  margin: 2rem 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.comparison-header {
  background: rgba(14, 16, 23, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  divide-x: 1px solid var(--border-subtle);
}

.comparison-col {
  padding: 1.25rem;
  border-right: 1px solid var(--border-subtle);
}

.comparison-col:last-child {
  border-right: none;
}

.comparison-lang-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.lang-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.badge-tzd {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-cpp {
  background: rgba(96, 165, 250, 0.15);
  color: #93C5FD;
}

.badge-py {
  background: rgba(251, 191, 36, 0.15);
  color: #FCD34D;
}

.badge-rust {
  background: rgba(249, 115, 22, 0.15);
  color: #FDBA74;
}

.comparison-snippet {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: #D1D5DB;
  white-space: pre-wrap;
  word-break: break-all;
}

.comparison-verdict {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Column 3: Right Interactive Playground (460px)
   -------------------------------------------------------------------------- */
.tour-playground {
  width: var(--playground-w);
  flex-shrink: 0;
  background: rgba(12, 14, 21, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Playground Titlebar */
.playground-titlebar {
  height: 44px;
  background: rgba(14, 16, 23, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 7px;
}

.traffic-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.traffic-light.red { background-color: #FF5F56; }
.traffic-light.yellow { background-color: #FFBD2E; }
.traffic-light.green { background-color: #27C93F; }

.playground-file-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.playground-file-pill svg {
  width: 12px;
  height: 12px;
  color: #38BDF8;
}

.playground-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-pg-run {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #090A0F;
  background: #38BDF8;
  padding: 0.28rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.btn-pg-run:hover {
  background: #7DD3FC;
  transform: translateY(-1px);
}

.btn-pg-run svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.btn-pg-reset {
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-pg-reset:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Code Editor Zone */
.playground-editor-zone {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  background: rgba(10, 11, 17, 0.6);
}

.pg-line-numbers {
  padding: 1rem 0.6rem 1rem 0.85rem;
  text-align: right;
  user-select: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-tertiary);
  min-width: 38px;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.pg-code-textarea {
  flex: 1;
  padding: 1rem 1rem;
  margin: 0;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: #E2E8F0;
  white-space: pre;
  overflow: auto;
}

/* Bottom Output & JIT Status Viewport */
.playground-terminal {
  height: 210px;
  background: rgba(7, 8, 12, 0.95);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-header {
  height: 32px;
  background: rgba(14, 16, 23, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.terminal-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #34D399;
  box-shadow: 0 0 6px #34D399;
}

.terminal-screen {
  flex: 1;
  padding: 0.75rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #94A3B8;
  overflow-y: auto;
  white-space: pre-wrap;
}

.terminal-success {
  color: #34D399;
}

.terminal-accent {
  color: #38BDF8;
}

/* --------------------------------------------------------------------------
   Quick Search Modal (Cmd + K)
   -------------------------------------------------------------------------- */
.search-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal-box {
  width: 100%;
  max-width: 580px;
  background: rgba(18, 20, 29, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.search-input-wrapper {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-input-wrapper svg {
  width: 18px;
  height: 18px;
  color: #38BDF8;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #FFFFFF;
}

.search-results-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-result-item:hover,
.search-result-item.selected {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.search-result-group {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Mobile View Switcher & Action Styles
   -------------------------------------------------------------------------- */
.mobile-search-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.mobile-search-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glass);
}

.mobile-view-tabs {
  display: none; /* Only active on screens <= 1024px */
  background: rgba(10, 12, 18, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.45rem 1rem;
  gap: 0.5rem;
  z-index: 90;
}

.mobile-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 36px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-tab-btn.active {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.mobile-tab-btn.active svg {
  color: #38BDF8;
}

.tab-indicator-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #34D399;
  box-shadow: 0 0 6px #34D399;
}

.btn-jump-to-playground {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38BDF8;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-jump-to-playground:hover {
  background: rgba(56, 189, 248, 0.22);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Responsive Adaptations (Tablet & Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .mobile-view-tabs {
    display: flex;
  }

  .tour-workspace {
    flex-direction: column;
    height: calc(100dvh - var(--nav-height) - 49px);
    overflow: hidden;
  }

  /* Catalog: Horizontal iOS Pill Track */
  .tour-catalog {
    width: 100%;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.45rem 0.85rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 0.45rem;
    background: rgba(11, 13, 19, 0.92);
  }

  .tour-catalog::-webkit-scrollbar {
    display: none;
  }

  .catalog-group-title {
    display: none;
  }

  .catalog-group {
    flex-direction: row;
    gap: 0.4rem;
  }

  .catalog-nav-item {
    flex: 0 0 auto;
    width: auto;
    height: 32px;
    padding: 0 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .catalog-nav-item.active::before {
    display: none;
  }

  .catalog-nav-item.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  /* Two-Tab View Switching Engine */
  .tour-content {
    flex: 1;
    width: 100%;
    padding: 1.5rem 1.25rem 4rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
  }

  .tour-playground {
    flex: 1;
    width: 100%;
    border-left: none;
    display: none; /* Controlled by active tab */
    height: 100%;
  }

  /* When Playground tab is active on mobile */
  .tour-workspace.mobile-mode-playground .tour-content {
    display: none;
  }

  .tour-workspace.mobile-mode-playground .tour-playground {
    display: flex;
  }

  /* Comparison Cards on Mobile */
  .comparison-grid {
    grid-template-columns: 1fr;
    divide-x: none;
  }

  .comparison-col {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem;
  }

  .comparison-col:last-child {
    border-bottom: none;
  }

  .comparison-snippet {
    font-size: 11px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  .header-center {
    display: none;
  }

  .mobile-search-btn {
    display: flex;
  }

  .breadcrumb-nav {
    display: none;
  }

  .tour-header {
    padding: 0 1rem;
  }

  .btn-back-home span {
    font-size: 0.76rem;
  }

  .github-text {
    display: none;
  }

  .btn-github {
    padding: 0.4rem 0.6rem;
  }

  .tour-chapter-title {
    font-size: 1.6rem;
    line-height: 1.25;
  }

  .tour-lead-text {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .doc-section-heading {
    font-size: 1.15rem;
  }

  .doc-body-text {
    font-size: 0.88rem;
  }

  /* Playground adjustments on smaller mobile screens */
  .playground-titlebar {
    padding: 0 0.75rem;
  }

  .playground-file-pill {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pg-code-textarea {
    font-size: 12.5px;
    padding: 0.85rem;
    -webkit-text-size-adjust: 100%;
  }

  .pg-line-numbers {
    padding: 0.85rem 0.45rem;
    min-width: 32px;
    font-size: 11.5px;
  }

  .playground-terminal {
    height: 180px;
  }

  /* Search modal */
  .search-modal-box {
    margin: 0 1rem;
    max-width: calc(100% - 2rem);
  }
}

