@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;600;700&family=Prompt:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap');

/* =========================================================================
   STUDIOFLOW DRIVEGALLERY — INTERACTIVE VISUAL MANUAL DESIGN SYSTEM (v3.1.5)
   Aesthetic: Tactile Archival Paper (Daylight) & Studio Darkroom (Obsidian)
   ========================================================================= */
:root,
[data-guide-theme="daylight"] {
  --g-bg: #F6F8FB;
  --g-surface: #FFFFFF;
  --g-surface-subtle: #EFF3F9;
  --g-surface-elevated: #FFFFFF;
  --g-header-bg: rgba(255, 255, 255, 0.9);
  --g-ink: #0F172A;
  --g-ink-secondary: #334155;
  --g-ink-muted: #52637A;
  --g-border: #DCE3EE;
  --g-border-strong: #C2CEE0;
  --g-brand: #1849D6;
  --g-brand-hover: #123BB0;
  --g-brand-soft: #EBF1FF;
  --g-brand-ink: #1238A8;
  --g-pro: #B45309;
  --g-pro-soft: #FEF3C7;
  --g-pro-border: #F59E0B;
  --g-free: #047857;
  --g-free-soft: #D1FAE5;
  --g-free-border: #10B981;
  --g-client: #6D28D9;
  --g-client-soft: #EDE9FE;
  --g-code-bg: #0E1424;
  --g-code-ink: #E2E8F0;
  --g-diagram-bg: #F8FAFD;
  --g-diagram-grid: rgba(24, 73, 214, 0.055);
  --g-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  --g-selection-bg: rgba(24, 73, 214, 0.18);
  --g-focus-ring: 0 0 0 3px rgba(24, 73, 214, 0.32);
}

[data-guide-theme="darkroom"] {
  --g-bg: #090D16;
  --g-surface: #111726;
  --g-surface-subtle: #172033;
  --g-surface-elevated: #161E31;
  --g-header-bg: rgba(11, 16, 28, 0.88);
  --g-ink: #F1F5F9;
  --g-ink-secondary: #CBD5E1;
  --g-ink-muted: #94A3B8;
  --g-border: #222E46;
  --g-border-strong: #324363;
  --g-brand: #3B82F6;
  --g-brand-hover: #60A5FA;
  --g-brand-soft: rgba(59, 130, 246, 0.16);
  --g-brand-ink: #93C5FD;
  --g-pro: #FBBF24;
  --g-pro-soft: rgba(245, 158, 11, 0.16);
  --g-pro-border: rgba(251, 191, 36, 0.48);
  --g-free: #34D399;
  --g-free-soft: rgba(16, 185, 129, 0.16);
  --g-free-border: rgba(52, 211, 153, 0.45);
  --g-client: #C4B5FD;
  --g-client-soft: rgba(139, 92, 246, 0.18);
  --g-code-bg: #060911;
  --g-code-ink: #E2E8F0;
  --g-diagram-bg: #0D1322;
  --g-diagram-grid: rgba(96, 165, 250, 0.07);
  --g-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  --g-selection-bg: rgba(59, 130, 246, 0.32);
  --g-focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.42);
}

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

::selection {
  background: var(--g-selection-bg);
  color: var(--g-ink);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: light dark;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--g-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--g-border-strong);
  border-radius: 999px;
  border: 2px solid var(--g-bg);
}

body {
  margin: 0;
  background: var(--g-bg);
  color: var(--g-ink);
  font-family: 'Prompt', system-ui, -apple-system, sans-serif;
  font-size: 15.5px;
  line-height: 1.72;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.2s ease, color 0.2s ease;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--g-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

:focus-visible {
  outline: none;
  box-shadow: var(--g-focus-ring);
}

code,
.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ico {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

/* =========================================================================
   1. STICKY COMMAND TOPBAR
   ========================================================================= */
.guide-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--g-header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--g-border);
}

.guide-topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  min-height: 68px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.guide-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--g-ink);
}

.guide-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #0B0F19;
  color: #FFFFFF;
  border: 1px solid #1E293B;
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  flex-shrink: 0;
}

.guide-brand-mark::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F59E0B;
}

.guide-brand-copy strong {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.guide-brand-copy span {
  display: block;
  font-size: 12px;
  color: var(--g-ink-muted);
  line-height: 1.3;
}

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

.guide-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: min(300px, 68vw);
}

.guide-search-wrap .ico {
  position: absolute;
  left: 12px;
  color: var(--g-ink-muted);
  pointer-events: none;
}

.guide-search-input {
  width: 100%;
  min-height: 40px;
  padding: 0 46px 0 38px;
  border-radius: 10px;
  border: 1px solid var(--g-border);
  background: var(--g-surface);
  color: var(--g-ink);
  font-size: 13.5px;
  transition: border-color 0.15s ease;
}

.guide-search-input::placeholder {
  color: var(--g-ink-muted);
}

.guide-search-input:focus {
  border-color: var(--g-brand);
}

.guide-kbd {
  position: absolute;
  right: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--g-border);
  background: var(--g-surface-subtle);
  color: var(--g-ink-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  pointer-events: none;
}

.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--g-border);
  background: var(--g-surface);
  color: var(--g-ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.g-btn:hover {
  background: var(--g-surface-subtle);
  border-color: var(--g-border-strong);
}

.g-btn:active {
  transform: scale(0.985);
}

.g-btn-primary {
  background: var(--g-brand);
  border-color: var(--g-brand);
  color: #FFFFFF;
}

.g-btn-primary:hover {
  background: var(--g-brand-hover);
  border-color: var(--g-brand-hover);
}

.g-btn-pro {
  background: #F59E0B;
  border-color: #D97706;
  color: #090D16;
  font-weight: 700;
}

.g-btn-pro:hover {
  background: #FBBF24;
}

/* =========================================================================
   2. EDITORIAL HERO & FILTER STRIP
   ========================================================================= */
.guide-hero {
  max-width: 1360px;
  margin: 0 auto;
  padding: 36px 24px 20px;
}

.guide-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: center;
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 16px;
  padding: 32px;
}

.guide-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(23px, 2.9vw, 33px);
  line-height: 1.28;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.guide-hero p {
  margin: 0 0 20px;
  color: var(--g-ink-secondary);
  font-size: 15.5px;
  max-width: 64ch;
}

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

.tier-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--g-border);
  background: var(--g-surface-subtle);
  color: var(--g-ink-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.tier-filter-btn:hover {
  border-color: var(--g-border-strong);
  color: var(--g-ink);
}

.tier-filter-btn.is-active {
  background: var(--g-ink);
  border-color: var(--g-ink);
  color: var(--g-surface);
}

.hero-schematic-box {
  background: var(--g-diagram-bg);
  background-image:
    linear-gradient(to right, var(--g-diagram-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--g-diagram-grid) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid var(--g-border);
  border-radius: 14px;
  padding: 16px;
}

.sf-diagram {
  width: 100%;
  height: auto;
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .signal-flow-line {
    stroke-dasharray: 7 7;
    animation: sf-dash-flow 14s linear infinite;
  }
}

@keyframes sf-dash-flow {
  to {
    stroke-dashoffset: -280;
  }
}

/* =========================================================================
   3. TWO-COLUMN SHELL: STICKY TOC RAIL + PROSE WORKSPACE
   ========================================================================= */
.guide-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 8px 24px 88px;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.guide-toc {
  position: sticky;
  top: 86px;
  max-height: calc(100dvh - 106px);
  overflow-y: auto;
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 14px;
  padding: 18px 14px;
}

.toc-group-title {
  margin: 16px 10px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--g-ink-muted);
  text-transform: uppercase;
}

.toc-group-title:first-child {
  margin-top: 2px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.toc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--g-ink-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.toc-link:hover {
  background: var(--g-surface-subtle);
  color: var(--g-ink);
}

.toc-link.is-active {
  background: var(--g-brand-soft);
  color: var(--g-brand-ink);
  font-weight: 700;
}

.tier-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.tier-tag.free {
  background: var(--g-free-soft);
  color: var(--g-free);
  border: 1px solid var(--g-free-border);
}

.tier-tag.pro {
  background: var(--g-pro-soft);
  color: var(--g-pro);
  border: 1px solid var(--g-pro-border);
}

.tier-tag.client {
  background: var(--g-client-soft);
  color: var(--g-client);
  border: 1px solid var(--g-border);
}

/* =========================================================================
   4. CHAPTER SECTIONS, VISUAL DIAGRAMS & PROCEDURAL STEPS
   ========================================================================= */
.guide-content {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.guide-chapter {
  min-width: 0;
  max-width: 100%;
  scroll-margin-top: 92px;
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-radius: 16px;
  padding: 32px 34px;
}

.chapter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--g-border);
}

.chapter-head h2 {
  margin: 0;
  font-size: clamp(19.5px, 2.15vw, 24.5px);
  line-height: 1.34;
  letter-spacing: -0.015em;
  font-weight: 800;
}

.chapter-lead {
  margin: 8px 0 0;
  color: var(--g-ink-secondary);
  font-size: 15px;
  max-width: 68ch;
}

.guide-chapter h3 {
  margin: 28px 0 10px;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--g-ink);
}

.guide-chapter p {
  margin: 0 0 14px;
  max-width: 70ch;
  color: var(--g-ink-secondary);
}

/* Step-by-Step Procedural Rail (Numbered ONLY where sequence matters) */
.step-sequence {
  list-style: none;
  margin: 18px 0 22px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.step-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--g-surface-subtle);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--g-brand);
  color: #FFFFFF;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.step-row.pro-step .step-num {
  background: #D97706;
  color: #FFFFFF;
}

.step-body > strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--g-ink);
  margin-bottom: 3px;
}

.step-body p {
  margin: 0;
  font-size: 14.2px;
  color: var(--g-ink-secondary);
}

.step-body p strong {
  font-weight: 700;
  color: var(--g-ink);
}

/* Graphic Schematic Frame */
.visual-frame {
  margin: 20px 0;
  border-radius: 14px;
  border: 1px solid var(--g-border);
  background: var(--g-diagram-bg);
  background-image:
    linear-gradient(to right, var(--g-diagram-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--g-diagram-grid) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 20px;
  overflow: hidden;
}

.visual-caption {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--g-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--g-ink-muted);
}

/* Comparison Table (Free vs PRO) */
.compare-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--g-border);
  border-radius: 14px;
  margin-top: 14px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  font-size: 14px;
}

.compare-table th,
.compare-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--g-border);
}

.compare-table thead th {
  background: var(--g-surface-subtle);
  font-weight: 700;
  color: var(--g-ink);
}

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

.compare-table td.col-center,
.compare-table th.col-center {
  text-align: center;
  width: 165px;
}

.chk-yes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--g-free);
}

.chk-pro {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--g-pro);
}

.chk-dash {
  color: var(--g-ink-muted);
}

/* Interactive Cloud Switcher Tabs */
.cloud-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: var(--g-surface-subtle);
  border: 1px solid var(--g-border);
  margin-bottom: 18px;
}

.cloud-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--g-ink-secondary);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.cloud-tab-btn.is-active {
  background: var(--g-surface);
  border-color: var(--g-border);
  color: var(--g-ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* Interactive Layout & Ratio Wireframe Simulator */
.sim-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: center;
}

.sim-controls {
  display: grid;
  gap: 16px;
}

.sim-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.sim-pill {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--g-border);
  background: var(--g-surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--g-ink-secondary);
}

.sim-pill.is-active {
  background: var(--g-brand);
  border-color: var(--g-brand);
  color: #FFFFFF;
}

.sim-phone-frame {
  border-radius: 24px;
  border: 6px solid #1E293B;
  background: #FFFFFF;
  color: #0F172A;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sim-phone-frame[data-sim-theme="obsidian"] {
  background: #0B0E16;
  color: #F8FAFC;
}

.sim-phone-frame[data-sim-theme="slate"] {
  background: #F1F5F9;
  color: #0F172A;
}

.sim-phone-frame[data-sim-theme="ivory"] {
  background: #FAF8F2;
  color: #1E293B;
}

.sim-hero-preview {
  padding: 16px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(145deg, #1E3A8A 0%, #0F172A 100%);
  color: #FFFFFF;
  position: relative;
  transition: all 0.2s ease;
}

.sim-hero-preview[data-sim-cover="split"] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: inherit;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.sim-hero-preview[data-sim-cover="minimal"] {
  background: transparent;
  color: inherit;
  min-height: 92px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.sim-hero-preview[data-sim-cover="compact"] {
  min-height: 62px;
  padding: 12px 16px;
}

.sim-photo-cells {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.sim-cell {
  border-radius: 5px;
  background: linear-gradient(135deg, #94A3B8, #64748B);
  aspect-ratio: 4 / 5;
  transition: all 0.2s ease;
}

.sim-photo-cells[data-sim-ratio="justified"] {
  grid-template-columns: repeat(6, 1fr);
}
.sim-photo-cells[data-sim-ratio="justified"] .sim-cell:nth-child(1) { grid-column: span 4; aspect-ratio: 16 / 9; }
.sim-photo-cells[data-sim-ratio="justified"] .sim-cell:nth-child(2) { grid-column: span 2; aspect-ratio: 3 / 4; }
.sim-photo-cells[data-sim-ratio="justified"] .sim-cell:nth-child(3) { grid-column: span 2; aspect-ratio: 3 / 4; }
.sim-photo-cells[data-sim-ratio="justified"] .sim-cell:nth-child(4) { grid-column: span 4; aspect-ratio: 16 / 9; }
.sim-photo-cells[data-sim-ratio="justified"] .sim-cell:nth-child(5),
.sim-photo-cells[data-sim-ratio="justified"] .sim-cell:nth-child(6) { grid-column: span 3; aspect-ratio: 3 / 2; }

.sim-photo-cells[data-sim-ratio="16:9"] .sim-cell { aspect-ratio: 16 / 9; }
.sim-photo-cells[data-sim-ratio="1:1"] .sim-cell { aspect-ratio: 1 / 1; }
.sim-photo-cells[data-sim-ratio="natural"] .sim-cell {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  padding: 5px;
  aspect-ratio: 1 / 1;
  position: relative;
}
.sim-photo-cells[data-sim-ratio="natural"] .sim-cell::after {
  content: '';
  display: block;
  width: 100%;
  height: 68%;
  margin-top: 14%;
  border-radius: 3px;
  background: linear-gradient(135deg, #64748B, #475569);
}

/* Code & Formula Copy Blocks */
.code-box {
  background: var(--g-code-bg);
  color: var(--g-code-ink);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid #1E293B;
}

.code-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  word-break: break-all;
}

.copy-mini-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.copy-mini-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Interactive Telegram Webhook URL Assembler */
.tg-builder-box {
  margin-top: 16px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--g-border);
  background: var(--g-surface-subtle);
}

.tg-inputs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.tg-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--g-ink);
  margin-bottom: 5px;
}

.tg-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--g-border-strong);
  background: var(--g-surface);
  color: var(--g-ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

/* Two-Column Feature Highlights inside Prose (Not nested cards — clean Hairline Grid) */
.spec-matrix-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--g-border);
  border: 1px solid var(--g-border);
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}

.spec-cell {
  background: var(--g-surface);
  padding: 18px 20px;
}

.spec-cell > strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--g-ink);
  margin-bottom: 6px;
}

.spec-cell p {
  margin: 0;
  font-size: 13.8px;
  color: var(--g-ink-secondary);
}

.spec-cell p strong {
  font-weight: 700;
  color: var(--g-ink);
}

/* FAQ Accordion */
.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.faq-item {
  border: 1px solid var(--g-border);
  border-radius: 12px;
  background: var(--g-surface-subtle);
  overflow: hidden;
}

.faq-item summary {
  padding: 15px 18px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.faq-answer {
  padding: 0 18px 16px;
  font-size: 14.3px;
  color: var(--g-ink-secondary);
}

/* Empty Search State */
.guide-empty-state {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--g-border-strong);
  border-radius: 16px;
  background: var(--g-surface);
}

/* Mobile Floating TOC Trigger */
.mobile-toc-fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 75;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #0F172A;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
  align-items: center;
  gap: 8px;
}

.guide-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

/* =========================================================================
   5. RESPONSIVE & PRINT STYLES
   ========================================================================= */
@media (max-width: 1024px) {
  .guide-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-toc {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 74px;
    top: auto;
    max-height: 68dvh;
    z-index: 70;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.38);
    display: none;
  }

  .guide-toc.is-open {
    display: block;
  }

  .mobile-toc-fab {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  .guide-topbar-inner,
  .guide-hero,
  .guide-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .guide-brand-copy span,
  #btnPrintGuide,
  .guide-kbd {
    display: none;
  }

  .guide-top-controls {
    width: 100%;
    justify-content: space-between;
  }

  .guide-hero-grid,
  .guide-chapter {
    padding: 22px 18px;
  }

  .sim-grid,
  .tg-inputs-grid,
  .spec-matrix-2col {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-search-wrap {
    width: 100%;
    order: 3;
  }
}

@media print {
  .guide-topbar,
  .guide-toc,
  .mobile-toc-fab,
  .guide-filter-row {
    display: none !important;
  }

  body {
    background: #FFFFFF;
    color: #000000;
  }

  .guide-shell {
    display: block;
    padding: 0;
  }

  .guide-chapter {
    break-inside: avoid;
    box-shadow: none;
    margin-bottom: 20px;
  }
}
