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

html {
  overscroll-behavior: none; /* Prevent scroll bounce/chaining globally */
  scrollbar-gutter: stable; /* Prevent layout shift when scrollbar appears/disappears */
}

:root {
  --bg: #ffffff;
  --bg-card: #12121a;
  --bg-hover: #1a1a25;
  --bg-selected: #011939;
  --border: #2a2a3a;
  --border-selected: #1e3a5f;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.2);
  --yellow: #eab308;
  --yellow-glow: rgba(234, 179, 8, 0.2);
  --red: #ef4444;
  --purple: #a855f7;
  --gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #d946ef 100%);
  
  /* Code highlighting colors */
  --code-bg: #1a1a2e;
  --code-border: #2d2d44;
  --code-keyword: #ff79c6;
  --code-string: #50fa7b;
  --code-number: #bd93f9;
  --code-comment: #6272a4;
  --code-function: #8be9fd;
  --code-variable: #f8f8f2;
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-selected: #e0f2fe;
  --border: #e2e8f0;
  --border-selected: #7dd3fc;
  --text: rgb(65, 69, 82);
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.2);
  --green: #16a34a;
  --green-glow: rgba(22, 163, 74, 0.15);
  --yellow: #ca8a04;
  --yellow-glow: rgba(202, 138, 4, 0.15);
  --red: #dc2626;
  --purple: #9333ea;
  --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #c026d3 100%);
  
  /* Code highlighting colors for light theme */
  --code-bg: #f4f4f8;
  --code-border: #e2e8f0;
  --code-keyword: #d6336c;
  --code-string: #0d9488;
  --code-number: #7c3aed;
  --code-comment: #6b7280;
  --code-function: #0284c7;
  --code-variable: #1e293b;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  /* Allow normal scroll by default */
  overscroll-behavior: none; /* Prevent scroll bounce/chaining */
}

/* Only lock scroll when guides view is active */
body.guides-view-active {
  height: 100vh;
  overflow-y: hidden;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

:root[data-theme="light"] .header {
  background: rgba(248, 250, 252, 0.9);
}


.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: filter 0.3s ease;
}



.brand {
  font-weight: 600;
  font-size: 1.125rem;
}

/* Page title transition effect */
#page-title {
  display: inline-block;
  transition: opacity 0.15s ease, transform 0.15s ease;
  opacity: 1;
  transform: scale(1) translateY(0);
}

#page-title.page-title-fade-out {
  opacity: 0;
  transform: scale(0.95) translateY(-2px);
}

#page-title.page-title-fade-in {
  opacity: 0;
  transform: scale(1.05) translateY(2px);
  animation: pageTitleFadeIn 0.2s ease forwards;
}

@keyframes pageTitleFadeIn {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.header-search-container {
  flex: 1;
  max-width: 500px;
  margin: 0 2rem;
  position: relative;
}

.search-bar-wrapper {
  position: relative;
  width: 100%;
}

.global-search-input {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.2s;
  outline: none;
}

.global-search-input:focus {
  border-color: var(--accent);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.6;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 500px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.search-results.active {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-results-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.search-results-loading {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.search-results-section {
  border-bottom: 1px solid var(--border);
}

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

.search-results-section-title {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-result-item {
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-title-text {
  display: inline;
  white-space: normal;
}

.search-result-item-title .search-highlight,
.search-result-title-text .search-highlight {
  background: rgba(59, 130, 246, 0.3);
  color: var(--accent);
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  font-weight: inherit !important;
  display: inline !important;
  box-shadow: none !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  word-spacing: inherit !important;
  white-space: normal !important;
}

.search-result-item-type {
  font-size: 0.7rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-result-item-type.api {
  background: rgba(255, 140, 66, 0.15);
  color: #ff8c42;
}

.search-result-item-type.guide-general {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

.search-result-item-type.guide-specific {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

.search-result-item-type.feature {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.search-result-item-path {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
}

.search-result-item-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-highlight {
  background: rgba(59, 130, 246, 0.3);
  color: var(--accent);
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  font-weight: inherit !important;
  display: inline !important;
  box-shadow: none !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  word-spacing: inherit !important;
}

.header-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-item {
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--text);
  background: var(--bg-card);
}

/* Main */
.main {
  min-height: calc(100vh - 64px);
  /* Allow normal scroll by default */
}

/* Only lock main scroll when guides view is active */
body.guides-view-active .main {
  height: calc(100vh - 112px); /* Header (64px) + Tabs bar (48px) */
  overflow: hidden;
  /* Ensure main content starts at correct position */
  margin-top: 0;
  padding-top: 0;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Wizard Styles */
.wizard-progress {
  padding: 1.5rem 3rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-steps {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
}

.progress-step {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.progress-step.completed {
  cursor: pointer;
}

.progress-step.completed:hover {
  background: var(--bg-card);
}

.progress-step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s;
  flex-shrink: 0;
  margin-top: 1px; /* Align with first line of text */
}

.progress-step.active .progress-step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.progress-step.completed .progress-step-dot {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.progress-step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.progress-step.active .progress-step-label {
  color: var(--accent);
  font-weight: 500;
}

.progress-step.completed .progress-step-label {
  color: var(--text);
}

/* Wizard Layout - expanded panels */
.wizard-layout {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 0;
  min-height: calc(100vh - 140px);
}

/* Wizard complete - full width centered */
.wizard-layout.wizard-complete {
  grid-template-columns: 1fr;
}

.wizard-layout.wizard-complete .wizard-main {
  display: block;
  padding: 2rem;
}

.wizard-layout.wizard-complete .wizard-example {
  display: none;
}

.wizard-main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 3rem;
  overflow-y: auto;
  overscroll-behavior: contain; /* Prevent scroll bounce */
}

.wizard-example {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 2rem;
  overflow-y: auto;
  position: sticky;
  overscroll-behavior: contain; /* Prevent scroll bounce */
  top: 60px;
  height: calc(100vh - 140px);
}

/* Wizard Container */
.wizard-container {
  width: 100%;
  max-width: 720px;
}

/* Integration Plan - full width when complete */
.wizard-layout.wizard-complete .wizard-container {
  max-width: none;
  width: 100%;
}

.wizard-layout.wizard-complete .integration-plan {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.wizard-step {
  display: block;
}

.step-header {
  margin-bottom: 2rem;
}

.step-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.step-entity-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.step-question {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.step-description {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Example Panel */
.example-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
}

.example-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.example-placeholder p {
  font-size: 0.875rem;
}

.example-content {
  font-size: 0.875rem;
  line-height: 1.6;
}

.example-content h1,
.example-content h2,
.example-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.example-content h1 { font-size: 1.25rem; }
.example-content h2 { font-size: 1.125rem; }
.example-content h3 { font-size: 1rem; color: var(--accent); }

.example-content p {
  margin-bottom: 0.75rem;
}

.example-content img,
.example-img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.example-code {
  background: #1a1a25;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  margin: 1rem 0;
}

.inline-code {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
}

/* Option Cards */
.step-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.option-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.option-card.selected {
  border-color: var(--border-selected);
  background: var(--bg-selected);
}

.option-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.option-radio {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}

.option-card.selected .option-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.option-card.selected .option-radio::after {
  content: '✓';
  color: white;
  font-size: 14px;
}

.option-info { flex: 1; }
.option-title { 
  font-size: 1.125rem; 
  font-weight: 600; 
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.option-desc { color: var(--text-muted); font-size: 0.9375rem; }

.option-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0;
  vertical-align: baseline;
}

.option-badge.recommended { background: var(--green-glow); color: var(--green); }
.option-badge.warning { background: var(--yellow-glow); color: var(--yellow); }

/* Disabled option card */
.option-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(18, 18, 26, 0.5);
  border-color: var(--border);
  position: relative;
}

.option-card.disabled:hover {
  transform: none;
  border-color: var(--border);
}

.option-card.disabled .option-selector {
  opacity: 0.4;
}

.option-exclusion-message {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.exclusion-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.exclusion-content {
  flex: 1;
}

.exclusion-content strong {
  display: block;
  color: var(--red);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.exclusion-reason {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Navigation */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 0.875rem 2rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg-hover); }

.btn-primary {
  background: #007aff;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
  background: #0056cc;
  transform: translateY(-2px);
}

.btn-success {
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  border: 1px solid rgba(0, 122, 255, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.2));
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Integration Plan */
.integration-plan {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 3rem;
}

.integration-plan.hidden { display: none; }

.plan-header { text-align: center; margin-bottom: 3rem; }

.plan-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
}

.plan-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.plan-subtitle { color: var(--text-muted); font-size: 1.125rem; }

.plan-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.summary-value { font-size: 1rem; font-weight: 600; }

.plan-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.plan-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.plan-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.plan-section-icon.blue { background: rgba(59, 130, 246, 0.2); }
.plan-section-icon.green { background: var(--green-glow); }
.plan-section-icon.purple { background: rgba(168, 85, 247, 0.2); }
.plan-section-icon.yellow { background: var(--yellow-glow); }

.plan-section-title { font-size: 1.125rem; font-weight: 600; }

.plan-section-content {
  padding: 1.5rem;
}

.plan-section-content p { color: var(--text-muted); margin-bottom: 1rem; }
.plan-section-content h4 {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
.plan-section-content h4:first-child { margin-top: 0; }

/* Code Block */
pre {
  background: #0d0d12;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Callout */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin: 1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.callout.info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); }
.callout.warning { background: var(--yellow-glow); border: 1px solid rgba(234, 179, 8, 0.3); }
.callout.success { background: var(--green-glow); border: 1px solid rgba(34, 197, 94, 0.3); }

.callout-icon { font-size: 1.25rem; flex-shrink: 0; }
.callout-content { font-size: 0.9375rem; }

/* ============================================
   API REFERENCE - STRIPE STYLE 3-COLUMN
   ============================================ */

.api-layout {
  display: grid;
  grid-template-columns: min(362px, 28%) 1fr; /* Responsive: max 362px or 28% of viewport */
  min-height: calc(100vh - 60px);
  max-width: 100%;
  /* Note: overflow-x removed to preserve sticky behavior of sidebar */
}

/* API Info Section - Introduction */
.api-info-section {
  padding: 3rem 4rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-card) 100%);
}

.api-info-header {
  margin-bottom: 2rem;
}

.api-info-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.api-info-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.025em;
}

.api-info-version {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.api-info-base-url {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

.api-info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.api-info-base-url code {
  background: var(--bg-code);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--accent);
}

/* Two-column layout for description and image */
.api-info-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.api-info-description-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.api-info-description {
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

.api-info-description p {
  margin: 0 0 1rem;
}

.api-info-description p:last-child {
  margin-bottom: 0;
}

.api-info-description br {
  display: block;
  content: "";
  margin-top: 0.5em;
}

.api-info-description strong {
  font-weight: 600;
  color: var(--text);
}

.api-info-description em {
  font-style: italic;
  color: var(--text-muted);
}

.api-info-description code {
  background: var(--bg-code);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
}

.api-info-description a {
  color: var(--accent);
  text-decoration: none;
}

.api-info-description a:hover {
  text-decoration: underline;
}

.api-info-image-column {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.api-info-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

.api-info-image-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg-code);
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.api-info-image-placeholder-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-style: italic;
}

.api-info-contact {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.api-info-contact-name {
  color: var(--text-muted);
  font-weight: 500;
}

.api-info-contact-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9375rem;
}

.api-info-contact-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .api-info-section {
    padding: 2rem 1.5rem;
  }
  
  .api-info-title {
    font-size: 1.75rem;
  }
  
  .api-info-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .api-info-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .api-info-image-column {
    order: -1; /* Image first on mobile */
    min-height: 150px;
  }
  
  .api-info-image-placeholder {
    height: 150px;
  }
}

/* API Sidebar */
.api-sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.5rem 0;
  position: sticky;
  overscroll-behavior: contain; /* Prevent scroll bounce */
  top: 60px;
  height: calc(100vh - 60px);
  /* Hide scrollbar but keep scrolling */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.api-sidebar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.api-category {
  margin-bottom: 1.5rem;
}

.api-category-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  margin-bottom: 0.25rem;
}

.api-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.api-sidebar-item:hover {
  background: var(--bg-hover);
}

.api-sidebar-item.active {
  background: var(--bg-hover);
  border-left-color: var(--accent);
}

/* Method Badges - Fixed Width */
.api-method-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.1875rem 0;
  border-radius: 3px;
  text-transform: uppercase;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.api-method-badge.method-get {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.api-method-badge.method-post {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.api-method-badge.method-put {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.api-method-badge.method-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.api-method-badge.method-patch {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.api-endpoint-name {
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* API Content - Stripe-style Layout */
.api-content {
  background: var(--bg);
  padding: 0;
  overscroll-behavior: contain; /* Prevent scroll bounce */
  max-width: 100%;
  overflow-x: clip; /* Use clip instead of hidden to preserve sticky behavior */
}

.api-endpoint-detail {
  display: flex;
  flex-direction: column;
}

/* Stripe-style paired rows */
.api-stripe-row {
  display: grid;
  grid-template-columns: 1fr min(662px, 45%); /* Responsive: max 662px or 45% of container */
  max-width: 100%;
  overflow-x: clip; /* Use clip instead of hidden to preserve sticky behavior */
}

/* Endpoint wrapper for continuous scroll */
.api-endpoint-wrapper {
  scroll-margin-top: 60px;
  border-bottom: 3px solid var(--border);
}

.api-endpoint-wrapper:last-child {
  border-bottom: none;
}

/* Slide-in animation - only applied when navigating from sidebar */
.api-endpoint-wrapper.endpoint-slide-in {
  transform: translateX(0);
  opacity: 1;
}

/* Header row styling */
.api-header-row .api-stripe-left {
  padding-top: 2.5rem;
}

/* Final end of docs message */
.api-end-of-docs-final {
  padding: 4rem 2.5rem;
  text-align: center;
  color: #22c55e;
  font-weight: 500;
  font-size: 1.1rem;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(34, 197, 94, 0.05) 100%);
  border-top: 1px solid var(--border);
}

/* Left column - Documentation */
.api-stripe-left {
  padding: 2rem 2.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 0; /* Allow flex/grid items to shrink below content size */
  overflow-x: hidden;
}

/* Remove border from last row's left column */
.api-stripe-row:last-child .api-stripe-left {
  border-bottom: none;
}

/* Right column - Code examples */
.api-stripe-right {
  background: #0d0d12;
  padding: 2rem 1.5rem;
  min-height: 100%;
  min-width: 0; /* Allow flex/grid items to shrink below content size */
  overflow-x: clip; /* Use clip instead of hidden to preserve sticky behavior */
}

/* Sticky wrapper for code - THIS is the key to Stripe's behavior */
.api-code-sticky {
  position: sticky;
  top: 80px;
}

/* Custom scrollbar for code blocks */
.api-code-block::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.api-code-block::-webkit-scrollbar-track {
  background: transparent;
}

.api-code-block::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.api-code-block::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Code section styling */
.api-code-section {
  margin-bottom: 1rem;
  max-width: 100%;
  overflow-x: hidden;
}

.api-code-section:last-child {
  margin-bottom: 0;
}

/* Make code blocks scrollable but not too tall */
.api-code-block {
  max-height: 500px;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: auto;
  word-break: break-word;
}


.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Method Pill (larger, in content) */
.api-method-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.3rem 0.625rem;
  border-radius: 4px;
  text-transform: uppercase;
  color: white;
}

.api-method-pill.method-get { background: #22c55e; }
.api-method-pill.method-post { background: #3b82f6; }
.api-method-pill.method-put { background: #eab308; }
.api-method-pill.method-delete { background: #ef4444; }
.api-method-pill.method-patch { background: #a855f7; }

.api-path {
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.3rem 0.625rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
}

.api-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.api-description {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.api-section {
  margin-bottom: 2rem;
}

.api-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Parameters */
.api-params {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
}

.api-params-group {
  border-bottom: 1px solid var(--border);
}

.api-params-group:last-child {
  border-bottom: none;
}

.api-params-group-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.625rem 1rem;
  background: var(--bg-hover);
}

.api-param {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}

.api-param:last-child {
  border-bottom: none;
}

.api-param-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.api-param {
  transition: background 0.3s;
}

/* Only final properties (non-expandable) have pointer cursor and highlight on hover */
.api-param:not(:has(.api-param-header.expandable)) {
  cursor: pointer;
}

.api-param:not(:has(.api-param-header.expandable)):hover {
  background: rgba(139, 233, 253, 0.08);
}

/* Expandable properties don't highlight on hover (only their header is clickable) */
.api-param:has(.api-param-header.expandable):hover {
  background: transparent;
}

.api-param.highlight-flash {
  animation: paramHighlightPulse 1s ease-out;
}

@keyframes paramHighlightPulse {
  0% { background: rgba(80, 250, 123, 0.4); }
  50% { background: rgba(80, 250, 123, 0.2); }
  100% { background: transparent; }
}

.api-param-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: #9ca3af; /* Light gray like Stripe */
}

.api-param-required {
  font-size: 0.5625rem;
  font-weight: 700;
  color: #f97316; /* Orange like Stripe */
  text-transform: uppercase;
  background: transparent;
  padding: 0;
}

.api-param-type {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.api-param-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Enum values display */
.api-enum-container {
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: rgba(139, 233, 253, 0.05);
  border-left: 2px solid #00abd1;
  border-radius: 0 4px 4px 0;
}

.api-enum-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #00abd1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.api-enum-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.api-enum-value {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  background: #50fa7a49;
  border: 1px solid rgba(80, 250, 123, 0.25);
  border-radius: 4px;
  color: #00b02c;
}

/* Array indicator for root-level arrays */
.api-array-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: rgba(139, 233, 253, 0.08);
  border: 1px solid rgba(139, 233, 253, 0.2);
  border-radius: 6px;
}

.api-array-badge {
  font-size: 0.625rem;
  font-weight: 700;
  color: #00b1d7;
  text-transform: uppercase;
  background: rgba(139, 233, 253, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.api-array-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Code Section */
.api-code-section {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.api-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: #21222c;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.api-code-lang {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.api-code-block {
  margin: 0;
  border-radius: 0 0 8px 8px;
  border-top: none;
  background: #0d0d12; /* Stripe-style dark background */
  font-size: 0.75rem;
  line-height: 1.15;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  flex: 1;
}

.api-code-block code {
  display: block;
}

/* Code line for highlighting - controls spacing between properties */
.code-line {
  display: block;
  padding: 0.25em 0;
  margin: -5px -0.45rem;
  border-radius: 2px;
  transition: background 0.2s ease;
  cursor: pointer;
  /* Hanging indent for wrapped lines */
  padding-left: 1.5em;
  text-indent: -0em;
}

.code-line:hover {
  background: rgba(168, 168, 255, 0.1); /* Stripe-style hover */
}

/* Highlight flash animation */
.code-line.highlight-flash {
  animation: highlightPulse 1s ease-out;
}

@keyframes highlightPulse {
  0% { background: rgba(125, 216, 125, 0.4); } /* Stripe-style green */
  50% { background: rgba(125, 216, 125, 0.2); }
  100% { background: transparent; }
}

/* ============================================
   DRACULA THEME - JSON Syntax Highlighting
   ============================================ */
.json-key { 
  color: #ffffff; /* White for properties */
  font-weight: 500;
}
.json-string { 
  color: #7dd87d; /* Green for strings */
}
.json-number { 
  color: #ff8c42; /* Orange for numbers */
}
.json-boolean { 
  color: #6fb3d2; /* Light blue for booleans */
}
.json-null { 
  color: #6fb3d2; /* Light blue for null (same as boolean) */
}

/* ============================================
   JSON Collapsible/Expandable
   ============================================ */
.json-toggle {
  display: inline-block;
  width: 1em;
  text-align: center;
  cursor: pointer;
  user-select: none;
  color: #6272a4;
  font-family: monospace;
  font-size: 0.85em;
  transition: color 0.15s ease;
  margin-right: 0.2em;
  vertical-align: baseline;
}

.json-toggle:hover {
  color: #8be9fd;
}

.json-toggle.collapsed {
  color: #ff79c6;
}

.json-toggle.collapsed:hover {
  color: #ff92d0;
}

/* Prevent highlight effect on toggle lines when clicking toggle */
.json-toggle-line .json-toggle {
  position: relative;
  z-index: 2;
}

.json-collapsible-content {
  display: inline;
}

.json-collapsed-preview {
  display: none;
  color: #6272a4;
  font-style: italic;
  font-size: 0.9em;
  margin-left: 0.5em;
}

.json-bracket {
  color: #f8f8f2;
}

.json-ellipsis {
  color: #6272a4;
}

/* ============================================
   DRACULA THEME - cURL Syntax Highlighting
   ============================================ */
.curl-keyword {
  color: #50fa7b; /* Green */
  font-weight: 600;
}
.curl-cmd {
  color: #50fa7b; /* Green */
  font-weight: 600;
}
.curl-flag {
  color: #ff79c6; /* Pink */
}
.curl-method {
  color: #ffb86c; /* Orange */
  font-weight: 700;
}
.curl-url {
  color: #8be9fd; /* Cyan */
}
.curl-header {
  color: #f1fa8c; /* Yellow */
}
.curl-header-name {
  color: #bd93f9; /* Purple */
}
.curl-header-value {
  color: #f1fa8c; /* Yellow */
}
.curl-token {
  color: #ff79c6; /* Pink */
  font-style: italic;
}
.curl-continuation {
  color: #6272a4; /* Comment gray */
}

/* cURL block specific styling */
.api-curl-block {
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Clickable cURL parameters */
.curl-param {
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  transition: background 0.2s, box-shadow 0.2s;
}

.curl-param:hover {
  background: rgba(168, 168, 255, 0.2); /* Stripe-style hover */
}

.curl-path-param {
  color: #a8a8ff; /* Stripe-style purple-blue for path params */
  font-weight: 600;
}

.curl-query-param {
  color: #7dd87d; /* Stripe-style green for query params */
}

.curl-param.highlight-flash {
  animation: curlHighlightPulse 1s ease-out;
}

@keyframes curlHighlightPulse {
  0% { background: rgba(125, 216, 125, 0.5); box-shadow: 0 0 8px rgba(125, 216, 125, 0.4); } /* Stripe-style green */
  50% { background: rgba(125, 216, 125, 0.3); }
  100% { background: transparent; box-shadow: none; }
}

/* Features - Two Column Layout */
.features-layout {
  display: grid;
  grid-template-columns: 30% 70%;
  min-height: calc(100vh - 60px);
}

/* Left Sidebar - Integration Summary */
.features-sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 2rem;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain; /* Prevent scroll bounce */
  /* Hide scrollbar but keep scrolling */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.features-sidebar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.features-sidebar-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.features-sidebar-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.features-sidebar-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Integration Summary - Compact Version */
.integration-summary {
  margin-bottom: 1.5rem;
}

.no-config {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Compact Entity */
.summary-entity-compact {
  margin-bottom: 0.875rem;
}

.summary-entity-header {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Compact Group */
.summary-group-compact {
  margin-bottom: 0.625rem;
}

.summary-group-name {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Option Buttons - Inline compact */
.summary-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.summary-option-btn {
  padding: 0.3rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.6875rem;
  font-family: inherit;
  color: var(--text-secondary);
  white-space: nowrap;
}

.summary-option-btn:hover {
  border-color: var(--border-selected);
  background: var(--bg-selected);
  color: var(--text);
}

.summary-option-btn.selected {
  background: var(--bg-selected);
  border-color: var(--border-selected);
  color: var(--accent);
  font-weight: 600;
}

.summary-option-btn:active {
  transform: scale(0.97);
}

/* Animation for feature updates */
.features-grid {
  transition: opacity 0.15s ease;
}

/* Feature Stats */
.features-stats {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.stat-count {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-item.enabled .stat-count { color: var(--green); }
.stat-item.conditional .stat-count { color: var(--yellow); }
.stat-item.disabled .stat-count { color: var(--red); }

.btn-reconfigure {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-reconfigure:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

/* No selections message */
.no-selections-message {
  text-align: center;
  padding: 2rem 1rem;
}

.no-selections-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.no-selections-message p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-start-wizard {
  padding: 0.75rem 1.5rem;
  background: #007aff;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-start-wizard:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* Right Column - Features Main */
.features-main {
  padding: 2rem;
  overflow-y: auto;
  overscroll-behavior: contain; /* Prevent scroll bounce */
}

.features-header {
  text-align: left;
  margin-bottom: 2rem;
}

.features-header h1 { 
  font-size: 1.75rem; 
  margin-bottom: 0.5rem; 
}
.features-header p { 
  color: var(--text-muted); 
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.feature-card.enabled::before { background: var(--green); }
.feature-card.conditional::before { background: var(--yellow); }
.feature-card.disabled::before { background: var(--red); }
/* Removed opacity: 0.6 for disabled - they should be fully visible and clickable */

.feature-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.feature-status-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.feature-status-icon.enabled {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.feature-status-icon.conditional {
  background: rgba(234, 179, 8, 0.2);
  color: var(--yellow);
}

.feature-status-icon.disabled {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.feature-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
}

.feature-status.enabled { background: var(--green-glow); color: var(--green); }
.feature-status.conditional { background: var(--yellow-glow); color: var(--yellow); }
.feature-status.disabled { background: rgba(239, 68, 68, 0.2); color: var(--red); }

.feature-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.feature-name { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.feature-desc { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; }
.feature-message { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }

.feature-footer {
  margin-top: auto;
  padding-top: 1rem;
}

/* Restart Button */
.btn-restart {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  z-index: 50;
}

.btn-restart:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.api-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--text-muted);
}

/* Expandable Nested Properties */
.api-param {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
}



.api-param-header.expandable {
  cursor: pointer;
  user-select: none;
}

.api-param-header.expandable:hover {
  color: var(--accent);
}

.expand-icon {
  font-size: 0.625rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  margin-right: 0.25rem;
}

.api-param-header.expandable:hover .expand-icon {
  color: var(--accent);
}

.api-param-children {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.api-param-children.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.api-param-children:not(.collapsed) {
  max-height: 5000px;
  opacity: 1;
}

.api-param-array-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 0.25rem;
}

/* Nested depth visual indicators */
.api-param.depth-1 { border-left: 2px solid rgba(59, 130, 246, 0.7); }
.api-param.depth-2 { border-left: 2px solid rgba(168, 85, 247, 0.7); }
.api-param.depth-3 { border-left: 2px solid rgba(34, 197, 94, 0.7); }
.api-param.depth-4 { border-left: 2px solid rgba(234, 179, 8, 0.7); }

/* Responsive */
@media (max-width: 1500px) {
  .api-row {
    grid-template-columns: 1fr min(400px, 40%);
  }
  
  .api-stripe-row {
    grid-template-columns: 1fr min(575px, 42%); /* Reducido proporcionalmente para pantallas medianas */
  }
}

@media (max-width: 1200px) {
  .api-row {
    grid-template-columns: 1fr;
  }
  
  .api-stripe-row {
    grid-template-columns: 1fr; /* Columna derecha debajo en pantallas pequeñas */
  }
  
  .api-col-right {
    border-top: 1px solid var(--border);
    position: relative;
    top: 0;
    max-height: none;
    overflow: visible;
  }
  
  .api-col-left {
    border-right: none;
  }
}

/* API Mobile Selector */
.api-mobile-selector {
  display: none;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9375rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.api-mobile-selector:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.api-mobile-selector option {
  background: var(--bg-card);
  padding: 0.5rem;
}

.api-mobile-selector optgroup {
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
}

.api-container {
  width: 100%;
  max-width: 100%;
  /* Note: overflow-x removed to preserve sticky behavior of sidebar */
}

@media (max-width: 900px) {
  .api-layout {
    grid-template-columns: 1fr;
  }
  
  .api-sidebar {
    display: none;
  }
  
  .api-mobile-selector {
    display: block;
    margin: 0;
    width: 100%;
    position: fixed;
    top: 57px; /* Height of the mobile header (padding 24px + logo 32px + border 1px) */
    left: 0;
    right: 0;
    z-index: 99;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-top: none;
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
  }
  
  /* Add padding to compensate for fixed selector */
  .api-container {
    padding-top: 50px; /* Height of the fixed selector */
  }
  
  .api-content {
    padding: 0 1rem;
  }
}

@media (max-width: 1000px) {
  .features-layout {
    grid-template-columns: 1fr;
  }
  
  .features-sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .features-stats {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .step-question {
    font-size: 1.5rem;
  }
  
  .plan-title {
    font-size: 1.75rem;
  }
  
  .progress-step-label {
    display: none;
  }
  
  .api-col-left {
    padding: 1.5rem;
  }
  
  .api-col-right {
    padding: 1.5rem;
  }
  
  .features-main {
    padding: 1.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   LOCALE SELECTOR
   ============================================ */

.locale-selector {
  padding: 0.375rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  margin-left: 1rem;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  opacity: 1;
  visibility: visible;
}

.locale-selector:hover {
  border-color: var(--accent);
}

.locale-selector option {
  background: var(--bg-card);
}

.locale-selector.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Keep the space occupied */
  position: relative;
}

.locale-selector.fade-in {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================
   WIZARD STEP - NEW STYLES
   ============================================ */

.step-entity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.step-entity-icon {
  font-size: 1.5rem;
}

.step-entity-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-multiselect-hint {
  display: inline-block;
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

/* Multi-select options */
.step-options.multi-select .option-card {
  border: 1px solid var(--border);
}

.step-options.multi-select .option-card.selected {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.1);
}

.option-selector {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.option-card.selected .option-selector {
  color: var(--accent);
}

.step-options.multi-select .option-card.selected .option-selector {
  color: var(--purple);
}

.option-selector.checkbox {
  color: var(--purple);
}

.option-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0;
  vertical-align: baseline;
}

.option-badge.recommended {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.option-badge.recommended::before {
  content: '★';
  font-size: 0.5rem;
}

.option-badge.highlight {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.option-badge.highlight::before {
  content: '✦';
  font-size: 0.5rem;
}

.option-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(234, 179, 8, 0.06));
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--yellow);
  line-height: 1.4;
}

.warning-icon {
  flex-shrink: 0;
  font-size: 0.875rem;
}

/* ============================================
   INTEGRATION PLAN - NEW STYLES
   ============================================ */

.plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.plan-entity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.plan-entity-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.plan-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.plan-group:last-child {
  margin-bottom: 0;
}

.plan-group-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.plan-group-values {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.plan-features-summary {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-count-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  min-width: 120px;
}

.feature-count-card.enabled {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.feature-count-card.conditional {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.feature-count-card.disabled {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.feature-count-card .count {
  font-size: 2rem;
  font-weight: 700;
}

.feature-count-card.enabled .count { color: var(--green); }
.feature-count-card.conditional .count { color: var(--yellow); }
.feature-count-card.disabled .count { color: var(--red); }

.feature-count-card .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.plan-save-config {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.plan-save-config h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.plan-save-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.plan-save-form {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.config-slug-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: all 0.2s;
}

.config-slug-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.config-slug-input:invalid {
  border-color: var(--red);
}

.config-save-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

.config-save-message.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--green);
}

.config-save-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
}

.config-save-message.success a {
  color: var(--green);
  text-decoration: underline;
}

.config-save-message.success a:hover {
  color: var(--green);
  opacity: 0.8;
}

.plan-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* ============================================
   CONFIGS MANAGER STYLES
   ============================================ */

.configs-manager {
  padding: 2rem;
}

.configs-manager-header {
  margin-bottom: 2rem;
}

.configs-manager-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.configs-manager-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.configs-search-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.configs-search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: all 0.2s;
}

.configs-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.configs-search-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.configs-search-count.filtered {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.configs-manager-content {
  min-height: 400px;
}

.configs-empty,
.configs-error {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.configs-list {
  display: grid;
  gap: 1.5rem;
}

.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.config-card:hover {
  border-color: var(--border-selected);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.config-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.config-card-title {
  flex: 1;
}

.config-card-title h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.config-card-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.config-card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--red);
}

.config-card-body {
  display: grid;
  gap: 1.5rem;
}

.config-card-info {
  display: grid;
  gap: 0.75rem;
}

.config-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.config-info-item:last-child {
  border-bottom: none;
}

.config-info-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.config-info-value {
  font-size: 0.875rem;
  color: var(--text);
  font-family: 'Courier New', monospace;
}

.config-card-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.config-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.config-preview-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.config-preview-content {
  margin-bottom: 1rem;
}

.config-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.config-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
}

.config-tag-more {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.75rem;
}

.config-card-url {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.config-url-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.config-url-value {
  flex: 1;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  color: var(--text);
  overflow-x: auto;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

.btn-link:hover {
  color: var(--text);
}

/* Config Modal */
.config-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.config-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.config-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.config-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.config-modal-body {
  padding: 1.5rem;
}

.config-full-info {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.config-full-options h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.config-options-list {
  display: grid;
  gap: 0.5rem;
}

.config-option-item {
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text);
}

/* ============================================
   FEATURES VIEW - SECTIONS
   ============================================ */

.features-section {
  margin-bottom: 2rem;
}

.features-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.features-section-title.enabled {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
}

.features-section-title.conditional {
  background: rgba(234, 179, 8, 0.1);
  color: var(--yellow);
}

.features-section-title.disabled {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

.feature-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ============================================
   EDITOR STYLES
   ============================================ */

.editor-container {
  width: 100%;
  margin: 0;
  padding: 2rem;
  min-height: calc(100vh - 60px);
}

.editor-header {
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1.5rem;
}

.editor-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.editor-download-actions {
  display: flex;
  gap: 0.75rem;
}

.editor-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.editor-tabs {
  display: flex;
  gap: 0.5rem;
}

.editor-tab {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.editor-tab:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.editor-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.editor-panel {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  min-height: calc(100vh - 200px);
  width: 100%;
}

.editor-sidebar {
  grid-column: span 2;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 150, 150, 0.4) transparent;
}

.editor-sidebar::-webkit-scrollbar {
  width: 6px;
}

.editor-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.editor-sidebar::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 3px;
}

.editor-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

.editor-sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.editor-sidebar-header h2 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-small {
  padding: 0.375rem 0.5rem;
  font-size: 0.6875rem;
  white-space: nowrap;
  line-height: 1.2;
}

.editor-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.editor-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  font-size: 0.75rem;
}

.editor-list-item.dragging {
  opacity: 0.5;
  border: 2px dashed var(--accent);
}

.editor-list-item.drag-over {
  border-top: 3px solid var(--accent);
  margin-top: 0.5rem;
}

.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 0.875rem;
  user-select: none;
  padding: 0.125rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover {
  color: var(--accent);
}

.editor-list-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.editor-list-item.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.editor-list-item.active .editor-list-item-name {
  color: white;
}

.editor-list-item-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.editor-list-item-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-size: 1rem;
}

.btn-icon:hover {
  opacity: 1;
}

.btn-delete:hover {
  opacity: 1;
  transform: scale(1.1);
}

.editor-main {
  grid-column: span 10;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overscroll-behavior: contain; /* Prevent scroll bounce */
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 150, 150, 0.4) transparent;
}

.editor-main::-webkit-scrollbar {
  width: 8px;
}

.editor-main::-webkit-scrollbar-track {
  background: transparent;
}

.editor-main::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 4px;
}

.editor-main::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

.editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--text-muted);
}

.editor-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.editor-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.editor-form-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.editor-form-actions {
  display: flex;
  gap: 0.75rem;
}

.editor-form-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--text);
  font-size: 0.875rem;
}

.form-input,
.form-textarea,
.form-select {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.readonly {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-textarea-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

.form-select {
  cursor: pointer;
}

.form-group small {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-required {
  color: #ef4444;
  font-weight: 600;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}

.form-checkbox-label input[type="checkbox"] {
  cursor: pointer;
  margin: 0;
}

.form-section-nested {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.entity-group-key-section,
.entity-option-key-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.entity-group-key-label,
.entity-option-key-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.form-section {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.form-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.form-help {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.include-group {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.include-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.include-group-label {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.875rem;
}

.include-group-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.include-option-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.include-option {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.include-option .form-select {
  flex: 1;
}

.include-or-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 auto;
  width: fit-content;
  align-self: center;
}

.exclude-option {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.exclude-option .form-select {
  flex: 1;
}

/* Exclude rules editor styles */
.exclude-rules-list {
  margin: 0.75rem 0;
}

.exclude-rules-and-list {
  margin: 0.75rem 0;
}

.exclude-rules-and-condition {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.exclude-rules-condition-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.exclude-rules-condition-header strong {
  color: var(--text);
  font-size: 0.875rem;
}

.exclude-rules-or-list {
  margin: 0.5rem 0;
}

.entity-group {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  position: relative;
  cursor: pointer;
}

.entity-group.dragging {
  opacity: 0.5;
  border: 2px dashed var(--accent);
}

.entity-group.drag-over {
  border-top: 3px solid var(--accent);
  margin-top: 0.5rem;
}

.entity-group-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.entity-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.entity-group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-input-inline {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

.entity-group-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.group-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entity-option {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.entity-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.entity-option-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Preview Panel */
.editor-panel-with-preview {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  min-height: calc(100vh - 200px);
  width: 100%;
}

.editor-panel-with-preview .editor-sidebar {
  grid-column: span 2;
}

.editor-panel-with-preview .editor-main {
  grid-column: span 7;
}

.editor-preview {
  grid-column: span 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 150, 150, 0.4) transparent;
}

.editor-preview::-webkit-scrollbar {
  width: 8px;
}

.editor-preview::-webkit-scrollbar-track {
  background: transparent;
}

.editor-preview::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 4px;
}

.editor-preview::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

.preview-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.preview-header h2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.25rem 0;
}

.preview-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.preview-progress {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Preview Wizard Styles */
.preview-wizard {
  margin-top: 1rem;
}

.preview-wizard-step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.preview-wizard .step-header {
  margin-bottom: 1rem;
}

.preview-wizard .step-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.preview-wizard .step-entity-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-wizard .step-question {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.preview-wizard .step-multiselect-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

.preview-wizard .step-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.preview-wizard .option-card {
  padding: 0.75rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.preview-wizard .option-card.selected {
  background: #011939;
  border-color: #1e3a5f;
}

.preview-wizard .option-content {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.preview-wizard .option-selector {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--accent);
  transition: all 0.2s;
}

.preview-wizard .option-card.selected .option-selector {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.preview-wizard .option-selector.checkbox {
  border-radius: 4px;
}

.preview-wizard .option-info {
  flex: 1;
  min-width: 0;
}

.preview-wizard .option-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.preview-wizard .option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.preview-wizard .option-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.preview-wizard .option-badge.recommended {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.preview-wizard .option-badge.highlight {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.preview-wizard .option-warning {
  margin-top: 0.375rem;
  padding: 0.375rem;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 4px;
  font-size: 0.6875rem;
  color: #eab308;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.preview-wizard .warning-icon {
  font-size: 1rem;
}

.preview-navigation {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.preview-navigation .btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.preview-navigation .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.preview-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.empty-groups-message {
  padding: 1rem;
  background: var(--bg-hover);
  border-radius: 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.empty-options-message {
  padding: 0.75rem;
  background: var(--bg-hover);
  border-radius: 6px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
}

.form-section-header {
  margin-bottom: 1rem;
}

.form-help-inline {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

.include-group-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.include-group-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

/* Responsive */
@media (max-width: 1600px) {
  .editor-panel-with-preview {
    grid-template-columns: repeat(12, 1fr);
  }
  
  .editor-panel-with-preview .editor-sidebar {
    grid-column: span 2;
  }
  
  .editor-panel-with-preview .editor-main {
    grid-column: span 7;
  }
  
  .editor-panel-with-preview .editor-preview {
    grid-column: span 3;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .editor-panel {
    grid-template-columns: 1fr;
  }

  .editor-panel-with-preview {
    grid-template-columns: 1fr;
  }

  .editor-sidebar {
    position: relative;
    top: 0;
    max-height: none;
  }

  .editor-preview {
    position: relative;
    top: 0;
    max-height: none;
  }
  
  .editor-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .editor-download-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   FEATURE MODAL
   ============================================ */

.feature-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.feature-modal.active {
  opacity: 1;
  visibility: visible;
}

.feature-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.feature-modal-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  padding: 2px;
  background: transparent;
}

.feature-modal.active .feature-modal-container {
  transform: scale(1);
}

/* Animated Border - Gemini Style */
.feature-modal-border-animated {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    #60afdc 0%,
    #8b5cf6 25%,
    #ec4899 50%,
    #f59e0b 75%,
    #60afdc 100%
  );
  background-size: 200% 200%;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
}

.feature-modal-border-animated.animating {
  animation: borderGradientMove 3s linear;
}

.feature-modal.active .feature-modal-border-animated {
  animation: borderGradientMove 3s linear infinite;
}

@keyframes borderGradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.feature-modal-content {
  position: relative;
  background: var(--bg);
  border-radius: 14px;
  height: calc(100% - 8px);
  display: flex;
  flex-direction: column;
  z-index: 1;
  overflow: hidden;
}

.feature-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.feature-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.feature-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.feature-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.feature-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  max-height: 50vh;
}

/* Custom scrollbar for feature modal - subtle but visible */
.feature-modal-body::-webkit-scrollbar {
  width: 8px;
}

.feature-modal-body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

.feature-modal-body::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.feature-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

/* Firefox scrollbar */
.feature-modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 150, 150, 0.4) transparent;
}

/* Skeleton Loader */
.feature-modal-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
}

.skeleton-line {
  height: 1.25rem;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--bg-hover) 100%, #000 0%) 0%,
    color-mix(in srgb, var(--bg-hover) 85%, #000 15%) 50%,
    color-mix(in srgb, var(--bg-hover) 100%, #000 0%) 100%
  );
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line-title {
  height: 2rem;
  width: 60%;
  margin-bottom: 0.5rem;
}

.skeleton-line-medium {
  width: 75%;
}

.skeleton-line-long {
  width: 90%;
}

.skeleton-line-short {
  width: 50%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Cascade-in Animation */
.cascade-in {
  animation: cascadeIn 0.6s ease-out forwards;
  opacity: 0;
}

.cascade-in > * {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.cascade-in > *:nth-child(1) { animation-delay: 0.1s; }
.cascade-in > *:nth-child(2) { animation-delay: 0.15s; }
.cascade-in > *:nth-child(3) { animation-delay: 0.2s; }
.cascade-in > *:nth-child(4) { animation-delay: 0.25s; }
.cascade-in > *:nth-child(5) { animation-delay: 0.3s; }
.cascade-in > *:nth-child(6) { animation-delay: 0.35s; }
.cascade-in > *:nth-child(7) { animation-delay: 0.4s; }
.cascade-in > *:nth-child(8) { animation-delay: 0.45s; }
.cascade-in > *:nth-child(n+9) { animation-delay: 0.5s; }

@keyframes cascadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-modal-markdown {
  color: var(--text);
  line-height: 1.6;
}

.feature-modal-markdown h1,
.feature-modal-markdown h2,
.feature-modal-markdown h3 {
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.feature-modal-markdown h1 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.feature-modal-markdown h2 {
  font-size: 1.5rem;
}

.feature-modal-markdown h3 {
  font-size: 1.25rem;
}

.feature-modal-markdown p {
  margin-bottom: 1rem;
}

.feature-modal-markdown code {
  background: var(--bg-card);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: var(--accent);
}

.feature-modal-markdown pre {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.feature-modal-markdown pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.feature-modal-markdown ul,
.feature-modal-markdown ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.feature-modal-markdown li {
  margin-bottom: 0.5rem;
}

.feature-modal-markdown blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.feature-modal-markdown .error-message {
  color: var(--red);
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Button in Feature Card */
.btn-feature-details {
  margin-top: 1rem;
  padding: 0.625rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-feature-details:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Removed disabled styles for button - all buttons should be clickable */

/* ============================================
   HOME PAGE
   ============================================ */

.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.home-hero {
  text-align: center;
  margin-bottom: 4rem;
}

.home-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, #60afdc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.home-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.home-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.home-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #60afdc);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.home-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

.home-card:hover::before {
  transform: scaleX(1);
}

.home-card-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: block;
}

.home-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.home-card-description {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.home-card-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  margin-top: auto;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.home-card-button:hover {
  background: var(--accent-hover);
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .home-container {
    padding: 2rem 1rem;
  }
  
  .home-title {
    font-size: 2rem;
  }
  
  .home-subtitle {
    font-size: 1rem;
  }
  
  .home-sections {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .home-card {
    padding: 2rem;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .feature-modal-container {
    width: 95%;
    max-height: 95vh;
  }

  .feature-modal-header {
    padding: 1rem 1.5rem;
  }

  .feature-modal-title {
    font-size: 1.25rem;
  }

  .feature-modal-body {
    padding: 1.5rem;
  }
}

/* ============================================
   LOADING SCREEN
   ============================================ */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  transition: opacity 0.3s ease;
}

.loading-screen.fade-out {
  opacity: 0;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loading-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.loading-text {
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.loading-dots::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%, 100% {
    content: '...';
  }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 80px;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left: 4px solid #22c55e;
}

.toast-success::before {
  content: '✓';
  color: #22c55e;
  font-weight: bold;
  font-size: 1.25rem;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-error::before {
  content: '✕';
  color: #ef4444;
  font-weight: bold;
  font-size: 1.25rem;
}

.toast-info {
  border-left: 4px solid #007aff;
}

.toast-info::before {
  content: 'ℹ';
  color: #007aff;
  font-weight: bold;
  font-size: 1.25rem;
}

/* ============================================
   MARKDOWN EDITOR
   ============================================ */

.markdown-editor-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 250px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.markdown-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.markdown-editor-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.markdown-editor-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6px minmax(0, 1fr);
  gap: 0;
  height: 100%;
  overflow: hidden;
}

.markdown-editor-panel,
.markdown-preview-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.markdown-editor-panel {
  border-right: 1px solid var(--border);
}

.markdown-resizer {
  cursor: col-resize;
  background: var(--bg-tertiary);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: relative;
}

.markdown-resizer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 40px;
  background: var(--border);
  border-radius: 2px;
}

.markdown-editor-split.resizing .markdown-resizer {
  background: var(--accent);
}

.markdown-editor-toolbar,
.markdown-preview-toolbar {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.markdown-fullscreen-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.markdown-fullscreen-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.markdown-editor-textarea {
  flex: 1;
  width: 100%;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--text);
  border: none;
  outline: none;
  resize: none;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
  font-size: 0.9375rem;
  line-height: 1.6;
  overflow-y: auto;
}

.markdown-editor-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.markdown-preview-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.markdown-preview-content h1,
.markdown-preview-content h2,
.markdown-preview-content h3,
.markdown-preview-content h4,
.markdown-preview-content h5,
.markdown-preview-content h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.markdown-preview-content h1 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.markdown-preview-content h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.markdown-preview-content h3 {
  font-size: 1.25rem;
}

.markdown-preview-content p {
  margin-bottom: 1rem;
}

.markdown-preview-content ul,
.markdown-preview-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.markdown-preview-content li {
  margin-bottom: 0.5rem;
}

.markdown-preview-content code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
  font-size: 0.875rem;
  color: var(--accent);
}

.markdown-preview-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.markdown-preview-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
}

.markdown-preview-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   STRIPE-STYLE TABLES
   ============================================ */

/* Base table styles - applies to all tables */
.markdown-preview-content table,
.guides-content-markdown table,
.feature-modal-markdown table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.markdown-preview-content table th,
.markdown-preview-content table td,
.guides-content-markdown table th,
.guides-content-markdown table td,
.feature-modal-markdown table th,
.feature-modal-markdown table td {
  padding: 0.875rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

/* Header styles */
.markdown-preview-content table th,
.guides-content-markdown table th,
.feature-modal-markdown table th {
  background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* First header cell border radius */
.markdown-preview-content table th:first-child,
.guides-content-markdown table th:first-child,
.feature-modal-markdown table th:first-child {
  border-top-left-radius: 7px;
}

.markdown-preview-content table th:last-child,
.guides-content-markdown table th:last-child,
.feature-modal-markdown table th:last-child {
  border-top-right-radius: 7px;
}

/* Remove border from last row */
.markdown-preview-content table tr:last-child td,
.guides-content-markdown table tr:last-child td,
.feature-modal-markdown table tr:last-child td {
  border-bottom: none;
}

/* Zebra striping - odd rows */
.markdown-preview-content table tbody tr:nth-child(odd),
.guides-content-markdown table tbody tr:nth-child(odd),
.feature-modal-markdown table tbody tr:nth-child(odd) {
  background: var(--bg);
}

/* Even rows */
.markdown-preview-content table tbody tr:nth-child(even),
.guides-content-markdown table tbody tr:nth-child(even),
.feature-modal-markdown table tbody tr:nth-child(even) {
  background: var(--bg-card);
}

/* Hover effect */
.markdown-preview-content table tbody tr:hover,
.guides-content-markdown table tbody tr:hover,
.feature-modal-markdown table tbody tr:hover {
  background: rgba(96, 175, 220, 0.08);
}

/* Column borders for better readability */
.markdown-preview-content table td:not(:last-child),
.markdown-preview-content table th:not(:last-child),
.guides-content-markdown table td:not(:last-child),
.guides-content-markdown table th:not(:last-child),
.feature-modal-markdown table td:not(:last-child),
.feature-modal-markdown table th:not(:last-child) {
  border-right: 1px solid var(--border);
}

/* Code in tables */
.markdown-preview-content table code,
.guides-content-markdown table code,
.feature-modal-markdown table code {
  background: rgba(96, 175, 220, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', monospace;
}

/* Links in tables */
.markdown-preview-content table a,
.guides-content-markdown table a,
.feature-modal-markdown table a {
  color: var(--accent);
  text-decoration: none;
}

.markdown-preview-content table a:hover,
.guides-content-markdown table a:hover,
.feature-modal-markdown table a:hover {
  text-decoration: underline;
}

/* ============================================
   CONFIGURABLE TABLE VARIANTS (via Markdoc)
   Use: {% table variant="striped" %} or class="table-striped"
   ============================================ */

/* No striping variant */
.table-plain table tbody tr:nth-child(odd),
.table-plain table tbody tr:nth-child(even),
table.table-plain tbody tr:nth-child(odd),
table.table-plain tbody tr:nth-child(even) {
  background: var(--bg-card);
}

/* No column borders variant */
.table-no-borders table td:not(:last-child),
.table-no-borders table th:not(:last-child),
table.table-no-borders td:not(:last-child),
table.table-no-borders th:not(:last-child) {
  border-right: none;
}

/* Compact variant */
.table-compact table th,
.table-compact table td,
table.table-compact th,
table.table-compact td {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

/* No hover variant */
.table-no-hover table tbody tr:hover,
table.table-no-hover tbody tr:hover {
  background: inherit;
}

/* Highlight first column */
.table-highlight-first table td:first-child,
table.table-highlight-first td:first-child {
  font-weight: 600;
  background: rgba(96, 175, 220, 0.08) !important;
  color: var(--text);
  border-right: 2px solid var(--accent) !important;
}

.table-highlight-first table th:first-child,
table.table-highlight-first th:first-child {
  background: rgba(96, 175, 220, 0.12) !important;
  border-right: 2px solid var(--accent) !important;
}

/* Highlight specific row - featured/plan style */
.markdoc-table table tr.table-row-highlighted,
.markdoc-table table thead tr.table-row-highlighted,
.markdoc-table table tbody tr.table-row-highlighted {
  position: relative;
  z-index: 1;
}

.markdoc-table table tr.table-row-highlighted th,
.markdoc-table table tr.table-row-highlighted td {
  background: #315DF4 !important;
  color: #f9fafb;
  border-bottom-color: transparent;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.4);
  transition: box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.markdoc-table table tr.table-row-highlighted th:first-child,
.markdoc-table table tr.table-row-highlighted td:first-child {
  border-left: none;
  border-radius: 10px 0 0 10px;
}

.markdoc-table table tr.table-row-highlighted th:last-child,
.markdoc-table table tr.table-row-highlighted td:last-child {
  border-radius: 0 10px 10px 0;
}

/* Keep highlight color on hover and lift slightly */
.markdoc-table table tbody tr.table-row-highlighted:hover th,
.markdoc-table table tbody tr.table-row-highlighted:hover td,
.markdoc-table table thead tr.table-row-highlighted:hover th,
.markdoc-table table thead tr.table-row-highlighted:hover td {
  background: #3053D4 !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);
}

/* Links and emphasis inside highlighted row */
.markdoc-table table tr.table-row-highlighted a {
  color: #E5EDFF;
}

.markdoc-table table tr.table-row-highlighted a:hover {
  color: #ffffff;
}

.markdoc-table table tr.table-row-highlighted strong {
  color: #ffffff;
}

/* Centered content */
.table-centered table th,
.table-centered table td,
table.table-centered th,
table.table-centered td {
  text-align: center;
}

/* Wide table - full width with scroll */
.table-wide {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.table-wide table {
  white-space: nowrap;
}

/* Status indicators in tables */
.markdown-preview-content table .status-yes,
.guides-content-markdown table .status-yes,
.feature-modal-markdown table .status-yes {
  color: var(--green);
  font-weight: 600;
}

.markdown-preview-content table .status-no,
.guides-content-markdown table .status-no,
.feature-modal-markdown table .status-no {
  color: var(--text-muted);
}

/* Checkmark/X icons for comparison tables */
.markdown-preview-content table td:has(> strong:only-child),
.guides-content-markdown table td:has(> strong:only-child),
.feature-modal-markdown table td:has(> strong:only-child) {
  text-align: center;
}

/* Responsive table on mobile - Horizontal scroll with max cell width */
@media (max-width: 768px) {
  /* Table wrapper for scroll */
  .markdown-preview-content table,
  .guides-content-markdown table,
  .feature-modal-markdown table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 8px;
  }
  
  .markdown-preview-content table thead,
  .markdown-preview-content table tbody,
  .markdown-preview-content table tr,
  .guides-content-markdown table thead,
  .guides-content-markdown table tbody,
  .guides-content-markdown table tr,
  .feature-modal-markdown table thead,
  .feature-modal-markdown table tbody,
  .feature-modal-markdown table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
  
  .markdown-preview-content table thead,
  .guides-content-markdown table thead,
  .feature-modal-markdown table thead {
    display: table-header-group;
  }
  
  .markdown-preview-content table tbody,
  .guides-content-markdown table tbody,
  .feature-modal-markdown table tbody {
    display: table-row-group;
  }
  
  .markdown-preview-content table tr,
  .guides-content-markdown table tr,
  .feature-modal-markdown table tr {
    display: table-row;
  }
  
  .markdown-preview-content table th,
  .markdown-preview-content table td,
  .guides-content-markdown table th,
  .guides-content-markdown table td,
  .feature-modal-markdown table th,
  .feature-modal-markdown table td {
    display: table-cell;
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    max-width: 180px;
    min-width: 100px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .markdown-preview-content table th,
  .guides-content-markdown table th,
  .feature-modal-markdown table th {
    font-size: 0.7rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Code in mobile tables */
  .markdown-preview-content table code,
  .guides-content-markdown table code,
  .feature-modal-markdown table code {
    font-size: 0.75em;
    word-break: break-all;
  }
}

/* ============================================
   MARKDOC TABLE WRAPPER
   ============================================ */

.markdoc-table {
  margin: 1.5rem 0;
}

.markdoc-table table {
  margin: 0; /* Remove margin since wrapper handles it */
}

/* Comparison table variant (like Stripe's feature comparison) */
.table-comparison table,
table.table-comparison {
  table-layout: fixed;
}

.table-comparison table th:first-child,
table.table-comparison th:first-child {
  width: 40%;
  text-align: left;
}

.table-comparison table td:not(:first-child),
.table-comparison table th:not(:first-child),
table.table-comparison td:not(:first-child),
table.table-comparison th:not(:first-child) {
  text-align: center;
  width: auto;
}

.table-comparison table tbody td:not(:first-child),
table.table-comparison tbody td:not(:first-child) {
  font-weight: 500;
}

/* Comparison table first column styling */
.table-comparison table td:first-child,
table.table-comparison td:first-child {
  font-weight: 500;
  color: var(--text);
}

/* Checkmark style for comparison tables */
.table-comparison td:not(:first-child):not(:empty) {
  position: relative;
}

/* Special styling for ✓ and ✗ symbols */
.markdown-preview-content table td,
.guides-content-markdown table td,
.feature-modal-markdown table td {
  transition: background-color 0.15s ease;
}

/* Green checkmark cells */
.markdown-preview-content table td:has(> :is(strong, span):only-child:is(:contains("✓"), :contains("✔"))),
.guides-content-markdown table td:has(> :is(strong, span):only-child:is(:contains("✓"), :contains("✔"))),
.feature-modal-markdown table td:has(> :is(strong, span):only-child:is(:contains("✓"), :contains("✔"))) {
  color: var(--green);
  text-align: center;
}

.markdown-preview-empty,
.markdown-preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.markdown-preview-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0.75rem;
  padding: 2rem;
}

.markdown-loading-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
  opacity: 0.7;
  animation: markdown-loading-pulse 2s ease-in-out infinite;
}

@keyframes markdown-loading-pulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.95);
  }
}

.markdown-loading-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  letter-spacing: 0.025em;
}

.markdown-loading-dots::after {
  content: '...';
  animation: markdown-loading-dots 1.5s steps(4, end) infinite;
}

@keyframes markdown-loading-dots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%, 100% {
    content: '...';
  }
}

.markdown-preview-rendered {
  max-width: 100%;
}

/* ============================================
   EDITOR FULL WIDTH (VSCode Style)
   ============================================ */

.editor-panel-full {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  min-height: calc(100vh - 200px);
  background: var(--bg);
  width: 100%;
}

.editor-sidebar-vscode {
  grid-column: span 2;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
  overflow: hidden;
}

.editor-sidebar-vscode .editor-sidebar-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.editor-sidebar-vscode .editor-sidebar-header h2 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  flex: 1;
}

.file-tree-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.btn-new-file,
.btn-new-folder,
.btn-new-section,
.btn-save {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  opacity: 0.7;
  transition: all 0.2s;
  font-size: 1rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-new-file:hover,
.btn-new-folder:hover,
.btn-new-section:hover,
.btn-save:hover {
  opacity: 1;
  background: var(--bg-hover);
}

.btn-new-file:active,
.btn-new-folder:active,
.btn-new-section:active,
.btn-save:active {
  transform: scale(0.95);
}

.editor-file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
}

/* Drop zones for start/end */
.file-tree-drop-zone {
  height: 4px;
  margin: 2px 0;
  background: transparent;
  transition: background 0.2s;
  border-radius: 2px;
}

.file-tree-drop-zone.drag-over {
  background: var(--accent);
  height: 3px;
}

.file-tree-folder {
  position: relative;
}

.file-tree-folder.dragging {
  opacity: 0.5;
}

.file-tree-folder.drag-over {
  background: rgba(59, 130, 246, 0.1);
}

.file-tree-folder-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  user-select: none;
  transition: background 0.15s;
  position: relative;
  font-size: 0.75rem;
  cursor: pointer;
}

.file-tree-folder-header:hover {
  background: var(--bg-hover);
}

.file-tree-arrow {
  font-size: 0.625rem;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.15s;
}

.file-tree-arrow:hover {
  color: var(--text);
}

.file-tree-item {
  position: relative;
  cursor: pointer;
}

.file-tree-item:hover {
  background: var(--bg-hover);
}

/* Section - Non-collapsible separator/header in file tree editor */
.file-tree-section {
  position: relative;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.file-tree-section:first-child {
  margin-top: 0.25rem;
}

.file-tree-section-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.5rem;
  user-select: none;
  cursor: pointer;
  border-top: 1px solid var(--border);
  padding-top: 0.625rem;
}

.file-tree-section:first-child .file-tree-section-header {
  border-top: none;
  padding-top: 0.375rem;
}

.file-tree-section-header:hover {
  background: var(--bg-hover);
}

.file-tree-section-header.selected {
  background: var(--bg-selected);
}

.file-tree-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  flex: 1;
}

.file-tree-section-header .drag-handle {
  cursor: grab;
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.625rem;
  margin-right: 0.25rem;
}

.file-tree-section-header:hover .drag-handle {
  opacity: 1;
}

/* Simple modal for guide actions (delete confirmation) */
.guide-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.guide-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  animation: contextMenuFadeIn 0.16s ease;
}

.guide-modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.guide-modal-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

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

.guide-modal-warning {
  font-size: 0.8rem;
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.guide-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 180px;
  animation: contextMenuFadeIn 0.15s ease;
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  font-size: 0.8125rem;
  color: var(--text);
}

.context-menu-item:hover {
  background: var(--bg-hover);
}

.context-menu-icon {
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.file-tree-icon {
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.file-tree-folder-name {
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.file-tree-folder-content {
  padding-left: 0.5rem;
}

.file-tree-folder-children {
  margin-left: 0;
  position: relative;
}

.file-tree-folder-children.drag-over {
  background: rgba(59, 130, 246, 0.1);
  border-radius: 2px;
}

.drag-handle {
  font-size: 0.625rem;
  color: var(--text-muted);
  cursor: grab;
  padding: 0.125rem;
  opacity: 0;
  transition: opacity 0.15s;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
}

.file-tree-folder:hover .drag-handle,
.file-tree-item:hover .drag-handle {
  opacity: 0.6;
}

.file-tree-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  position: relative;
  font-size: 0.75rem;
}

.file-tree-item.dragging {
  opacity: 0.5;
}

.file-tree-item.drag-over {
  background: rgba(59, 130, 246, 0.1);
}

.file-tree-item:hover {
  background: var(--bg-hover);
}

.file-tree-item.active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text);
}

.file-tree-item.active .file-tree-item-name {
  color: var(--text);
}

.file-tree-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.file-tree-extension {
  color: #569cd6; /* VSCode blue for extensions */
}

.file-tree-locale-badge {
  font-size: 0.7rem;
  padding: 0.125rem 0.375rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.markdown-locale-selector {
  font-size: 0.875rem;
  cursor: pointer;
}

.file-tree-empty {
  padding: 0.25rem 1rem 0.25rem 2rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.75rem;
}

.btn-delete-small {
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0.25rem;
  font-size: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

.file-tree-item:hover .btn-delete-small {
  opacity: 1;
}

.btn-delete-small:hover {
  color: var(--red);
}

.editor-main-full {
  grid-column: span 10;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 200px);
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 150, 150, 0.4) transparent;
}

.editor-main-full::-webkit-scrollbar {
  width: 8px;
}

.editor-main-full::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

.editor-main-full::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.editor-main-full::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
  .toast-container {
    right: 1rem;
    left: 1rem;
    min-width: auto;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  .markdown-editor-split {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .markdown-editor-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .markdown-resizer {
    display: none;
  }

  .markdown-editor-split.editor-fullscreen,
  .markdown-editor-split.preview-fullscreen {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
}

/* Fullscreen modes for markdown examples editor */
.markdown-editor-split.editor-fullscreen {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.markdown-editor-split.editor-fullscreen .markdown-preview-panel {
  display: none;
}

.markdown-editor-split.editor-fullscreen .markdown-resizer {
  display: none;
}

.markdown-editor-split.preview-fullscreen {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.markdown-editor-split.preview-fullscreen .markdown-editor-panel {
  display: none;
}

.markdown-editor-split.preview-fullscreen .markdown-resizer {
  display: none;
}

/* ============================================
   DEPENDS ON CONFIGURATION
   ============================================ */

.depends-on-config {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.depends-on-values-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.depends-on-values-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.depends-on-values-list label:hover {
  background: var(--bg-hover);
}

/* Editor Loading State */
.editor-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.editor-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 1rem;
}

/* ============================================
   INTEGRATION GUIDES VIEW
   ============================================ */

/* Guide Tabs Bar (Stripe style - separate line below header) */
.guide-tabs-bar {
  display: flex;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 64px; /* Adjusted to match header height exactly */
  z-index: 99;
  min-height: 48px;
  margin-top: 0; /* Ensure no gap */
  box-shadow: 0 1px 0 var(--border); /* Ensure visual separation */
}

.guide-tabs-container {
  display: flex;
  gap: 0;
  align-items: center;
  width: 100%;
}

.guide-tab-header {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  position: relative;
  margin-bottom: -1px;
}

.guide-tab-header:hover {
  color: var(--text);
}

.guide-tab-header.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.guides-container {
  width: 100%;
  margin: 0;
  padding: 0;
}

.guides-layout {
  display: grid;
  grid-template-columns: 294px 1fr;
  gap: 0;
  height: calc(100vh - 112px); /* Adjusted for new top position */
  width: 100%;
  max-width: 100%;
  /* Only hide horizontal overflow to avoid creating a clipping ancestor
     that can interfere with sticky positioning inside the content area. */
  overflow-x: hidden;
  overflow-y: visible;
  padding-left: 0; /* Remove any left padding */
  margin-left: 0; /* Remove any left margin */
}

/* Content area - Stripe style: centered, 50% width */
.guides-content-area {
  display: flex;
  flex-direction: column;
  /* Restore overflow-y: auto for proper scroll within the content area */
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  position: relative;
  z-index: 1; /* Ensure content stays behind tabs bar */
  height: 100%; /* Take full height of parent */
  overscroll-behavior: contain; /* Prevent scroll bounce within this container */
}

.guides-breadcrumbs {
  width: 100%;
  padding: 0.75rem 4rem 0.125rem 0rem;
  background: var(--bg);
  position: static !important; /* Force static to ensure breadcrumbs scroll with content */
  top: auto !important; /* Remove any top positioning */
  bottom: auto !important; /* Remove any bottom positioning */
  /* Removed position: sticky - breadcrumbs scroll with content */
}

/* Ensure no sticky positioning on breadcrumbs or any child - MORE SPECIFIC */
.guides-content-area .guides-breadcrumbs,
.guides-content-area .guides-breadcrumbs *,
.guides-breadcrumbs,
.guides-breadcrumbs *,
.guides-breadcrumbs-inner,
.guides-breadcrumbs-inner *,
.guides-breadcrumb-item,
.guides-breadcrumb-item *,
.guides-breadcrumb-separator {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
}

.guides-breadcrumbs-inner {
  max-width: 84.5%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  position: static !important; /* Ensure inner container is not sticky */
}

.guides-breadcrumb-item {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  position: static !important; /* Ensure breadcrumb items are not sticky */
}

.guides-breadcrumb-item:hover {
  color: var(--accent);
}

.guides-breadcrumb-item.guides-breadcrumb-current {
  color: var(--text-muted);
  font-weight: 500;
  position: static !important; /* Ensure current breadcrumb item is not sticky */
}

.guides-breadcrumb-separator {
  color: var(--text-muted);
  opacity: 0.5;
  position: static !important; /* Ensure separator is not sticky */
}

.guides-content-markdown-wrapper {
  display: flex;
  justify-content: center;
  padding: 0.5rem 4rem 3rem 4rem;
  width: 100%;
  position: static !important; /* Ensure wrapper is not sticky */
  overflow-y: visible !important; /* Remove overflow that might cause issues */
}

.guides-content-inner {
  max-width: 94%;
  width: 100%;
  margin: 0 auto;
  /* CRITICAL: Don't break sticky positioning */
  overflow: visible !important;
}

/* Left Sidebar - Navigation Tree (Docusaurus style) */
.guides-sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 0.25rem 0; /* Minimal top padding to move sidebar up */
  padding-left: 0; /* Remove left padding to stick to left edge */
  position: sticky;
  top: 112px; /* Header (64px) + Tabs bar (48px) - just below tabs */
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain; /* Prevent scroll bounce */
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 150, 150, 0.4) transparent;
}

/* When guides view is active (tabs bar visible), adjust sidebar position */
body.guides-view-active .guides-sidebar {
  top: 112px; /* Header (64px) + Tabs bar (48px) - just below tabs */
  max-height: calc(100vh - 112px);
}

.guides-sidebar::-webkit-scrollbar {
  width: 6px;
}

.guides-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.guides-sidebar::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 3px;
}

.guides-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

.guides-sidebar-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.guides-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.guides-empty-hint {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  color: var(--text-muted);
}

/* Navigation Tree Items */
.guide-nav-item {
  margin-bottom: 0.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.guide-nav-folder {
  margin-bottom: 0.15rem;
}

.guide-nav-folder-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem 0.875rem 0.375rem 0.875rem; /* Slightly smaller padding */
  border-radius: 0;
  user-select: none;
  font-size: 0.8125rem; /* Slightly smaller font */
  font-weight: 500;
}

.guide-nav-folder-header:hover {
  background: var(--bg-hover);
}

.guide-nav-folder-title {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  font-size: 0.8125rem; /* Match folder header size */
}

.guide-nav-folder-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  margin-right: 0.4rem;
  display: inline-block;
  transform: rotate(0deg);
  flex-shrink: 0;
}

.guide-nav-folder-header[data-expanded="true"] .guide-nav-folder-arrow {
  transform: rotate(90deg);
}

.guide-nav-folder-children {
  margin-top: 0;
  margin-left: 0;
  border-left: none;
  padding-left: 0;
  opacity: 1;
  /* Height/opacity are animated via inline styles in guides-view.js */
}

/* Section - Non-collapsible separator/header (Stripe style) */
.guide-nav-section {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.875rem 0.25rem;
  border-top: 1px solid var(--border);
}

.guide-nav-section:first-child {
  margin-top: 0.5rem;
  border-top: none;
}

.guide-nav-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
}

.guide-nav-article {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.375rem 0.875rem; /* Slightly smaller padding */
  border-radius: 0;
  color: var(--text-muted);
  transition: all 0.2s;
  font-size: 0.8125rem; /* Slightly smaller font */
  position: relative;
}

.guide-nav-article:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.guide-nav-article.active {
  background: var(--bg-selected) !important;
  color: var(--accent) !important;
  border-left: 3px solid var(--accent) !important;
  margin-left: 0;
  /* Add space between border and text: base padding + additional space */
  padding-left: calc(var(--article-padding-left, 1.5rem) + 1rem) !important;
  font-weight: 600 !important;
}

/* For root level items (level 0), ensure proper spacing */
.guide-nav-article.active[data-level="0"] {
  padding-left: calc(1.5rem) !important; /* Adjusted for reduced base padding */
}

/* Light mode active state */
:root[data-theme="light"] .guide-nav-article.active {
  background: var(--bg-selected) !important;
  color: var(--accent) !important;
  border-left-color: var(--accent) !important;
}

.guide-nav-article-title {
  flex: 1;
  font-size: 0.8125rem;
}

/* Removed duplicate .guides-content-area definition - using the one at line 4464 */

.guides-content-area::-webkit-scrollbar {
  width: 8px;
}

.guides-content-area::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

.guides-content-area::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.guides-content-area::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

.guides-content-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.guides-content-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton Loader for Guides Content */
.guides-content-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
  width: 100%;
}

.guides-content-skeleton .skeleton-line-title {
  height: 2.5rem;
  width: 60%;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.guides-content-skeleton .skeleton-line-bar {
  height: 2px;
  width: 100%;
  margin-bottom: 1.5rem;
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--bg-hover) 50%,
    var(--bg-card) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.guides-content-skeleton .skeleton-line-medium {
  width: 75%;
}

.guides-content-skeleton .skeleton-line-full {
  width: 100%;
}

.guides-content-skeleton .skeleton-line-3-4 {
  width: 80%;
}

/* Removed duplicate .guides-content-markdown-wrapper definition - using the one above */

.guides-content-markdown-wrapper::-webkit-scrollbar {
  width: 8px;
}

.guides-content-markdown-wrapper::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

.guides-content-markdown-wrapper::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.guides-content-markdown-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

.guides-content-markdown {
  color: var(--text);
  line-height: 1.5;
  padding-right: 1rem;
  /* CRITICAL: Don't break sticky positioning in child elements */
  overflow: visible !important;
}

.guides-content-markdown h1,
.guides-content-markdown h2,
.guides-content-markdown h3,
.guides-content-markdown h4 {
  color: var(--text);
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.guides-content-markdown h1 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.guides-content-markdown h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.guides-content-markdown h3 {
  font-size: 1.25rem;
}

.guides-content-markdown p {
  margin-bottom: 1rem;
}

.guides-content-markdown code {
  background: var(--bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: var(--accent);
}

.guides-content-markdown pre {
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.guides-content-markdown pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

/* JSON Copy Button */
.json-copy-button-container {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
}

.json-copy-button {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  opacity: 0.85;
}

.json-copy-button:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  opacity: 1;
}

.json-copy-button:active {
  transform: translateY(0);
}

.json-copy-button svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
}

.json-copy-button.copied {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  opacity: 1;
}

.json-copy-button.copied:hover {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  opacity: 1;
}

.json-copy-button-text {
  font-weight: 500;
  white-space: nowrap;
  font-size: 0.75rem;
}

/* Ensure pre elements with copy buttons have relative positioning */
.guides-content-markdown pre {
  position: relative;
}

.guides-content-markdown ul,
.guides-content-markdown ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

/* Markdoc Callouts - Stripe Style */
.markdoc-callout {
  margin: 1.5rem 0;
  border-left: 4px solid;
  border-radius: 0 6px 6px 0;
  /* No background - transparent */
  overflow: hidden;
}

.markdoc-callout-header {
  padding: 0 1rem 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  /* Removed text-transform: uppercase */
  letter-spacing: 0;
}

.markdoc-callout-title {
  display: inline-block;
}

.markdoc-callout-content {
  padding: 0 1rem 0 1rem;
  color: var(--text);
  line-height: 1.6;
  margin-top: -0.25rem; /* Bring content closer to title */
}

.markdoc-callout-content p {
  margin: 0.5rem 0;
}

.markdoc-callout-content p:first-child {
  margin-top: 0;
}

.markdoc-callout-content p:last-child {
  margin-bottom: 0;
}

/* Callout Types - Stripe Colors */
/* No background, only title color and left border */
.markdoc-callout.callout-caution {
  border-left-color: #f97316; /* Orange */
}

.markdoc-callout.callout-caution .markdoc-callout-header {
  color: #f97316;
}

.markdoc-callout.callout-warning {
  border-left-color: #eab308; /* Yellow */
}

.markdoc-callout.callout-warning .markdoc-callout-header {
  color: #eab308;
}

.markdoc-callout.callout-alert {
  border-left-color: #ef4444; /* Red */
}

.markdoc-callout.callout-alert .markdoc-callout-header {
  color: #ef4444;
}

.markdoc-callout.callout-info {
  border-left-color: #3b82f6; /* Blue */
}

.markdoc-callout.callout-info .markdoc-callout-header {
  color: #3b82f6;
}

.markdoc-callout.callout-success {
  border-left-color: #22c55e; /* Green */
}

.markdoc-callout.callout-success .markdoc-callout-header {
  color: #22c55e;
}

.markdoc-callout.callout-note {
  border-left-color: #6b7280; /* Gray */
}

.markdoc-callout.callout-note .markdoc-callout-header {
  color: #6b7280;
}

.markdoc-callout.callout-error {
  border-left-color: #ef4444; /* Red */
}

.markdoc-callout.callout-error .markdoc-callout-header {
  color: #ef4444;
}

.markdoc-callout.callout-check {
  border-left-color: #22c55e; /* Green */
}

.markdoc-callout.callout-check .markdoc-callout-header {
  color: #22c55e;
}

/* ============================================
   CONDITIONAL TABS - Tabs condicionales para guía
   ============================================ */

.conditional-tabs {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  /* CHANGED: Use clip instead of hidden to allow sticky to work inside */
  overflow: clip;
  background: var(--bg-card);
}

.conditional-tabs-headers {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.conditional-tab-header {
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-right: 1px solid var(--border);
}

.conditional-tab-header:last-child {
  border-right: none;
}

.conditional-tab-header:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.conditional-tab-header.active {
  color: var(--text);
  background: var(--bg-card);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}

/* Tab recomendado (coincide con las selecciones del wizard) */
/* Texto azul para identificar que es recomendada, fondo azul solo cuando está activa */
.conditional-tab-header.recommended {
  color: var(--accent);
  font-weight: 500;
  /* Borde sutil azul para indicar que es recomendada */
  border-top: 2px solid transparent;
}

.conditional-tab-header.recommended:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-top-color: var(--accent);
}

/* Tab recomendada Y activa - fondo azul completo */
.conditional-tab-header.recommended.active {
  background: var(--accent);
  color: white;
  border-top-color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.conditional-tab-header.recommended.active:hover {
  background: var(--accent-hover);
  color: white;
}

/* Badge de recomendado - visibility controlled by editor access via body class */
.conditional-tab-header.recommended::after {
  content: '✓';
  display: none; /* Hidden by default in production mode */
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Tabs no recomendados (grisados) - only apply when editor access is available */
.conditional-tab-header:not(.recommended) {
  opacity: 1; /* Full opacity by default in production */
}

body.has-editor-access .conditional-tab-header:not(.recommended) {
  opacity: 0.7; /* Reduced opacity only with editor access */
}

.conditional-tab-header:not(.recommended):hover {
  opacity: 1;
}

/* Mensaje de recomendación en el panel */
.tab-recommendation-badge {
  display: block;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-style: italic;
}

.tab-recommendation-badge.recommended {
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--blue);
  color: var(--blue);
}

.tab-recommendation-badge.not-recommended {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--red);
  color: var(--red);
}

.tab-recommendation-badge .badge-icon {
  margin-right: 0.5rem;
}

.conditional-tab-header:not(.recommended).active {
  opacity: 1;
}

/* Contenido de tabs */
.conditional-tabs-content {
  padding: 1.25rem;
  /* CRITICAL: Allow sticky to work inside content */
  overflow: visible !important;
}

.conditional-tab-panel {
  display: none;
  /* CRITICAL: Allow sticky to work inside tab panels */
  overflow: visible !important;
}

.conditional-tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
  overflow: visible !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tab standalone (si se usa fuera de conditionaltabs) */
.conditional-tab-standalone {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}

.conditional-tab-label {
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.conditional-tab-content {
  color: var(--text);
}

/* Indicador visual cuando ningún tab coincide */
/* Message to complete wizard - only show with editor access */
.conditional-tabs.no-match .conditional-tabs-headers::after {
  content: 'Completa el wizard para ver la opción recomendada';
  display: none; /* Hidden by default in production */
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-tertiary);
}

/* Show wizard completion message only with editor access */
body.has-editor-access .conditional-tabs.no-match .conditional-tabs-headers::after {
  display: block;
}

/* Hide recommendation badges in production mode (without editor access) */
.tab-recommendation-badge {
  display: none;
}

/* Show recommendation badges only with editor access */
body.has-editor-access .tab-recommendation-badge {
  display: flex;
}

/* Show recommended indicator only with editor access */
body.has-editor-access .conditional-tab-header.recommended::after {
  display: inline-block;
}

/* ============================================
   MODAL BASE STYLES
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ============================================
   CONDITIONAL TABS MODAL - Editor styles
   ============================================ */

.conditional-tabs-modal {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.conditional-tabs-modal .modal-description {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tabs-editor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tabs-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-editor-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg-secondary);
}

.tab-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.tab-editor-header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.tab-editor-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tab-editor-fields .form-row {
  margin-bottom: 0;
}

.tab-editor-fields .form-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.tab-editor-fields .form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.tab-editor-fields .form-textarea {
  min-height: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

/* Visual Rule Editor in Tab Modal */
.rule-section {
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 0.75rem;
}

.rule-section-header {
  margin-bottom: 0.75rem;
}

.rule-section-header .form-label {
  color: var(--text);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.rule-section-include {
  border-left: 3px solid var(--green);
}

.rule-section-exclude {
  border-left: 3px solid var(--red);
}

.rule-empty-message {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 1rem;
  text-align: center;
  background: var(--bg-card);
  border-radius: 4px;
  border: 1px dashed var(--border);
}

.rule-empty-message small {
  display: block;
  margin-top: 0.25rem;
  opacity: 0.7;
}

/* Include Groups in Tab Modal */
.tab-include-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tab-include-groups .include-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
}

.tab-include-groups .include-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tab-include-groups .include-group-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tab-include-groups .include-group-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tab-include-groups .include-group-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tab-include-groups .include-group-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tab-include-groups .include-option-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tab-include-groups .include-option {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tab-include-groups .include-option .form-select {
  flex: 1;
}

.tab-include-groups .include-or-separator {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  padding: 0.15rem 0;
}

.and-separator {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.25rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  margin: 0.25rem 0;
}

/* Exclude options in Tab Modal */
.tab-exclude-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tab-exclude-options .exclude-option {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tab-exclude-options .exclude-option .form-select {
  flex: 1;
}

.empty-options-message {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
  padding: 0.5rem;
  text-align: center;
}

/* Preview Edit Button */
.guide-preview-content .conditional-tabs {
  position: relative;
}

.conditional-tabs-edit-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.guide-preview-content .conditional-tabs:hover .conditional-tabs-edit-btn {
  opacity: 1;
}

/* ============================================
   DIAGRAM MODALS - Editor styles
   ============================================ */

/* Diagram Type Selection Modal */
.diagram-type-modal {
  max-width: 700px;
}

.diagram-type-modal .modal-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.diagram-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.diagram-type-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.diagram-type-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.diagram-type-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.diagram-type-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.diagram-type-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Diagram Editor Modal */
.diagram-editor-modal {
  max-width: 900px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

.diagram-editor-modal .modal-body {
  overflow-y: auto;
  flex: 1;
}

.diagram-json-editor-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.diagram-json-editor {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 250px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  color: var(--text);
}

.diagram-json-help {
  font-size: 0.85rem;
}

.diagram-json-help summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  padding: 0.5rem 0;
}

.diagram-json-help summary:hover {
  color: var(--text);
}

.diagram-help-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 0.5rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.diagram-help-content p {
  margin-bottom: 0.5rem;
}

.diagram-help-content ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.diagram-help-content li {
  margin-bottom: 0.25rem;
}

.diagram-help-content code {
  background: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--accent);
}

/* Diagram Preview Container */
.diagram-preview-container {
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.diagram-preview-placeholder,
.diagram-preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.diagram-preview-placeholder span,
.diagram-preview-error span {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.diagram-preview-error {
  background: #fff5f5;
  color: #c62828;
}

.diagram-preview-error p {
  font-family: monospace;
  font-size: 0.85rem;
  background: rgba(198, 40, 40, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* Dark theme adjustments for diagram preview */
:root[data-theme="dark"] .diagram-preview-container {
  background: #1a1a2e;
  border-color: var(--border);
}

:root[data-theme="dark"] .diagram-preview-error {
  background: rgba(198, 40, 40, 0.1);
}

/* Diagram Styles - Clean & Minimal */
.diagram-container {
  position: relative;
  background: #f6f8fa;
}

/* Larger height for diagram containers in preview */
.guide-preview-content .diagram-container,
.guide-markdown-preview-pane .diagram-container {
  min-height: 450px;
}

/* Hidden handles by default - clean look but easier to descubrir */
.react-flow__handle {
  opacity: 0;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: none;
  background: #9ca3af;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
  pointer-events: auto !important;  /* Ensure handles are always clickable even when invisible */
  z-index: 10 !important;  /* Ensure handles are above other elements */
}

/* Show handles when connecting (dragging from another node) */
.react-flow.connecting .react-flow__handle {
  opacity: 0.9;
}

/* Show handles on node hover in edit mode */
.react-flow__node:hover .react-flow__handle {
  opacity: 0.7;
}

.react-flow__handle:hover {
  opacity: 1 !important;
  transform: scale(1.4);
  background: #3b82f6;
}

/* Connection line when dragging */
.react-flow__connection-line {
  stroke: #3b82f6;
  stroke-width: 2;
}

/* Edge styling */
.react-flow__edge-path {
  stroke: #9ca3af;
  stroke-width: 1.5;
}

.react-flow__edge.selected .react-flow__edge-path {
  stroke: #3b82f6;
  stroke-width: 2;
}

/* Edge markers (arrows) - ensure they are visible */
.react-flow__edge marker {
  overflow: visible;
}

.react-flow__edge marker path {
  fill: #9ca3af;
  stroke: none;
}

.react-flow__edge.selected marker path {
  fill: #3b82f6;
}

/* SVG marker definitions */
.react-flow svg defs marker path {
  fill: currentColor;
}

/* Ensure markers in diagram containers are visible */
.diagram-container .react-flow__edge marker,
.diagram-container .react-flow svg marker {
  overflow: visible !important;
}

.diagram-container .react-flow__edge marker path,
.diagram-container .react-flow svg marker path {
  fill: #9ca3af;
  stroke: none;
}

/* Edge labels */
.react-flow__edge-textwrapper {
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.react-flow__edge-text {
  fill: #374151;
}

/* Animated edges - ensure animation works in both edit and view modes */
/* Only apply normal animation if NOT reversed */
.react-flow__edge.animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) .react-flow__edge-path,
.react-flow__edge.diagram-edge-animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) .react-flow__edge-path,
.react-flow__edge[data-animated="true"]:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) .react-flow__edge-path,
.react-flow__edge.animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) path,
.react-flow__edge.diagram-edge-animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) path,
.react-flow__edge[data-animated="true"]:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) path {
  stroke-dasharray: 5 !important;
  animation: dashdraw 0.5s linear infinite !important;
  -webkit-animation: dashdraw 0.5s linear infinite !important;
}

@keyframes dashdraw {
  to {
    stroke-dashoffset: -10;
  }
}

@-webkit-keyframes dashdraw {
  to {
    stroke-dashoffset: -10;
  }
}

/* Animation for reversed arrows - moves in opposite direction */
@keyframes dashdraw-reverse {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 10;
  }
}

@-webkit-keyframes dashdraw-reverse {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 10;
  }
}

/* Ensure animated edges work in diagram containers (guides view) */
/* Only apply normal animation if NOT reversed */
.diagram-container .react-flow__edge.animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) .react-flow__edge-path,
.diagram-container .react-flow__edge.diagram-edge-animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) .react-flow__edge-path,
.diagram-container .react-flow__edge[data-animated="true"]:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) .react-flow__edge-path,
.diagram-container .react-flow__edge.animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) path,
.diagram-container .react-flow__edge.diagram-edge-animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) path,
.diagram-container .react-flow__edge[data-animated="true"]:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) path {
  stroke-dasharray: 5 !important;
  animation: dashdraw 0.5s linear infinite !important;
  -webkit-animation: dashdraw 0.5s linear infinite !important;
}

/* Additional selectors for React Flow's internal structure */
/* Only apply normal animation if NOT reversed */
.react-flow__edge.animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) svg path,
.react-flow__edge.diagram-edge-animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) svg path,
.react-flow__edge[data-animated="true"]:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) svg path,
.diagram-container .react-flow__edge.animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) svg path,
.diagram-container .react-flow__edge.diagram-edge-animated:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) svg path,
.diagram-container .react-flow__edge[data-animated="true"]:not(.diagram-edge-anim-reversed):not([data-animation-reversed="true"]) svg path {
  stroke-dasharray: 5 !important;
  animation: dashdraw 0.5s linear infinite !important;
  -webkit-animation: dashdraw 0.5s linear infinite !important;
}

/* Keyframes for reversed stroke-dashoffset animation */
@keyframes stroke-dashoffset-reverse {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: var(--dash-array-length, 100);
  }
}

/* Invert animation direction when manually reversed via checkbox or edge class */
/* Use a different animation that moves in the opposite direction */
.react-flow__edge.diagram-edge-anim-reversed .react-flow__edge-path,
.react-flow__edge[data-animation-reversed="true"] .react-flow__edge-path,
.react-flow__edge.diagram-edge-anim-reversed path,
.react-flow__edge[data-animation-reversed="true"] path,
.react-flow__edge-path[data-animation-reversed="true"],
path[data-animation-reversed="true"],
.react-flow__edge.diagram-edge-anim-reversed svg path,
.react-flow__edge[data-animation-reversed="true"] svg path,
.react-flow__edge.diagram-edge-anim-reversed svg .react-flow__edge-path,
.react-flow__edge[data-animation-reversed="true"] svg .react-flow__edge-path,
path.animation-reversed {
  stroke-dasharray: 5 !important;
  animation: dashdraw-reverse 0.5s linear infinite !important;
  -webkit-animation: dashdraw-reverse 0.5s linear infinite !important;
}

/* Also target any element with animation property */
.react-flow__edge.diagram-edge-anim-reversed [style*="animation"],
.react-flow__edge[data-animation-reversed="true"] [style*="animation"],
.react-flow__edge.diagram-edge-anim-reversed [style*="stroke-dasharray"],
.react-flow__edge[data-animation-reversed="true"] [style*="stroke-dasharray"] {
  stroke-dasharray: 5 !important;
  animation: dashdraw-reverse 0.5s linear infinite !important;
  -webkit-animation: dashdraw-reverse 0.5s linear infinite !important;
}

/* Force reverse for stroke-dashoffset animations */
.react-flow__edge.diagram-edge-anim-reversed path[style*="stroke-dasharray"],
.react-flow__edge[data-animation-reversed="true"] path[style*="stroke-dasharray"],
path[data-animation-reversed="true"][style*="stroke-dasharray"] {
  stroke-dasharray: 5 !important;
  animation: dashdraw-reverse 0.5s linear infinite !important;
  -webkit-animation: dashdraw-reverse 0.5s linear infinite !important;
}

/* Ensure reversed animations work in diagram containers */
.diagram-container .react-flow__edge.diagram-edge-anim-reversed .react-flow__edge-path,
.diagram-container .react-flow__edge[data-animation-reversed="true"] .react-flow__edge-path,
.diagram-container .react-flow__edge.diagram-edge-anim-reversed path,
.diagram-container .react-flow__edge[data-animation-reversed="true"] path,
.diagram-container .react-flow__edge.diagram-edge-anim-reversed svg path,
.diagram-container .react-flow__edge[data-animation-reversed="true"] svg path {
  stroke-dasharray: 5 !important;
  animation: dashdraw-reverse 0.5s linear infinite !important;
  -webkit-animation: dashdraw-reverse 0.5s linear infinite !important;
}

/* Controls - compact size */
.react-flow__controls {
  box-shadow: 0 1px 2px rgba(0,0,0,0.08) !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 4px !important;
}

.react-flow__controls-button {
  border: none !important;
  background: #fff !important;
  width: 20px !important;
  height: 20px !important;
  padding: 3px !important;
}

.react-flow__controls-button:hover {
  background: #f3f4f6 !important;
}

.react-flow__controls-button svg {
  fill: #6b7280 !important;
  width: 12px !important;
  height: 12px !important;
}

/* Attribution hidden */
.react-flow__attribution {
  display: none !important;
}

/* Z-index for sequence diagrams - messages on top of everything */
.react-flow__node-sequence-actor {
  z-index: 1 !important;
}

.react-flow__node-sequence-message {
  z-index: 100 !important;
}

/* Edges between actors and messages */
.react-flow__edges {
  z-index: 50 !important;
}

/* Ensure message nodes have opaque background */
.react-flow__node-sequence-message > div {
  background: #ffffff !important;
}

/* Shape nodes styling */
.react-flow__node-shape {
  position: relative;
}

.react-flow__node-shape > div {
  position: relative;
}

/* Resize handles for shape nodes */
.react-flow__node-shape .shape-resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #3b82f6;
  border: 2px solid white;
  border-radius: 2px;
  cursor: nwse-resize;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.1s ease, background-color 0.1s ease;
  pointer-events: auto !important;
  user-select: none;
}

.react-flow__node-shape .shape-resize-handle:hover {
  transform: scale(1.2);
  background: #2563eb;
}

.react-flow__node-shape .shape-resize-handle.nw {
  top: -6px;
  left: -6px;
  cursor: nwse-resize;
}

.react-flow__node-shape .shape-resize-handle.ne {
  top: -6px;
  right: -6px;
  cursor: nesw-resize;
}

.react-flow__node-shape .shape-resize-handle.sw {
  bottom: -6px;
  left: -6px;
  cursor: nesw-resize;
}

.react-flow__node-shape .shape-resize-handle.se {
  bottom: -6px;
  right: -6px;
  cursor: nwse-resize;
}

.conditional-tabs-edit-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
}

/* Guide Markdown Section */
.guide-markdown-section {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.guide-markdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.guide-locale-tabs {
  display: flex;
  gap: 0.5rem;
}

.guide-locale-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.guide-locale-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.guide-locale-tab.active {
  background: var(--accent);
  color: white;
}

.guide-markdown-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Split Container for Editor + Preview */
.guide-markdown-split-container {
  display: flex;
  flex-direction: row;
  min-height: 500px;
}

/* Preview always visible in with-preview mode */

.guide-markdown-editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.guide-markdown-split-container.with-preview .guide-markdown-editor-pane {
  width: 50%;
  flex: none;
}

.guide-markdown-textarea {
  width: 100%;
  height: 100%;
  min-height: 500px;
  padding: 1rem;
  border: none;
  background: var(--bg-card);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: none;
  flex: 1;
}

.guide-markdown-textarea:focus {
  outline: none;
  background: var(--bg-tertiary);
}

/* Preview Pane - Always visible */
.guide-markdown-preview-pane {
  display: flex;
  flex-direction: column;
  width: 50%;
  border-left: 1px solid var(--border);
  background: var(--bg-secondary);
  overflow: hidden;
}

.guide-markdown-preview-pane.visible {
  display: flex;
}

.guide-resizer {
  width: 6px;
  cursor: col-resize;
  background: var(--bg-tertiary);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.guide-resizer:hover {
  background: var(--accent);
}

.guide-preview-fullscreen-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.guide-preview-fullscreen-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.guide-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.guide-preview-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: var(--bg-card);
}

.guide-preview-content.loading {
  opacity: 0.5;
  pointer-events: none;
}

.guide-preview-content .preview-placeholder {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

.guide-preview-content .preview-error {
  color: var(--red);
  text-align: center;
  padding: 2rem;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1024px) {
  .guide-markdown-split-container {
    flex-direction: column;
  }
  
  .guide-markdown-split-container.with-preview .guide-markdown-editor-pane {
    width: 100%;
  }
  
  .guide-markdown-preview-pane.visible {
    width: 100%;
    max-height: 400px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .guide-resizer {
    display: none;
  }
}

/* Fullscreen modes for unified guide editor */
.guide-markdown-split-container.editor-fullscreen .guide-markdown-editor-pane {
  width: 100% !important;
  flex: 1 1 auto !important;
}

.guide-markdown-split-container.editor-fullscreen .guide-markdown-preview-pane {
  display: none !important;
}

.guide-markdown-split-container.editor-fullscreen .guide-resizer {
  display: none !important;
}

.guide-markdown-split-container.preview-fullscreen .guide-markdown-preview-pane {
  width: 100% !important;
  flex: 1 1 auto !important;
}

.guide-markdown-split-container.preview-fullscreen .guide-markdown-editor-pane {
  display: none !important;
}

.guide-markdown-split-container.preview-fullscreen .guide-resizer {
  display: none !important;
}

/* ============================================
   END CONDITIONAL TABS MODAL
   ============================================ */

/* Responsive - Tabs stay horizontal with scroll (Stripe style) */
@media (max-width: 768px) {
  .conditional-tabs-headers {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .conditional-tabs-headers::-webkit-scrollbar {
    display: none;
  }
  
  .conditional-tab-header {
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }
  
  .conditional-tabs-content {
    padding: 1rem;
  }
}

/* ============================================
   END CONDITIONAL TABS
   ============================================ */

.guides-content-markdown li {
  margin-bottom: 0.5rem;
}

.guides-content-markdown blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.guides-content-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  color: var(--red);
  text-align: center;
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.error-details {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .guides-layout {
    grid-template-columns: 1fr;
  }
  
  .guides-sidebar {
    position: relative;
    top: 0;
    max-height: 400px;
  }
}

@media (max-width: 768px) {
  .guides-container {
    padding: 1rem;
  }
  
  .guides-header h1 {
    font-size: 1.5rem;
  }
  
  .guides-tabs {
    flex-direction: column;
  }
  
  .guide-tab {
    width: 100%;
  }
}


/* Unified Guides Styles */
.selection-tabs {
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.tab-headers {
  display: flex;
  flex-wrap: nowrap;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tab-headers::-webkit-scrollbar {
  display: none;
}

.tab-header-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tab-header-btn:last-child {
  border-right: none;
}

.tab-header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}

.tab-header-btn.active {
  background: var(--bg-card);
  color: var(--primary-color);
  box-shadow: 0 2px 0 0 var(--primary-color) inset;
}

.tab-header-btn.grayed-out {
  opacity: 0.5;
  font-style: italic;
}

.selection-tab {
  padding: 1.5rem;
  display: none;
  background: var(--bg-card);
}

.conditional-content {
  transition: opacity 0.3s ease;
}

/* ============================================
   MOBILE RESPONSIVE - HAMBURGER MENU & GUIDES SELECTOR
   ============================================ */

/* Hamburger button */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.2s;
}

.hamburger-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 1000;
  padding: 80px 1.5rem 2rem;
  transition: right 0.3s ease;
  overflow-y: auto;
  pointer-events: none;
}

.mobile-menu.active {
  right: 0;
  pointer-events: auto;
}

/* Mobile menu close button */
.mobile-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

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

.mobile-menu .mobile-nav-item {
  display: block;
  padding: 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.mobile-menu .mobile-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.mobile-menu .mobile-nav-item.active {
  background: var(--bg-selected);
  color: var(--text);
  border-color: var(--border-selected);
}

/* Mobile locale selector */
.mobile-menu .mobile-locale-selector {
  width: 100%;
  padding: 1rem;
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.mobile-menu .mobile-locale-selector option {
  background: var(--bg-card);
}

/* Guides mobile selector - Native select */
.guides-mobile-selector {
  display: none;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9375rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.guides-mobile-selector:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.guides-mobile-selector option {
  background: var(--bg-card);
  padding: 0.5rem;
}

.guides-mobile-selector optgroup {
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
}

/* Mobile breakpoint - 900px */
@media (max-width: 900px) {
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  .main {
    overflow-x: hidden;
    max-width: 100%;
    padding-top: 57px; /* Height of fixed header */
  }
  
  /* Show hamburger */
  .hamburger-btn {
    display: flex;
  }
  
  .mobile-menu-overlay,
  .mobile-menu {
    display: block;
  }
  
  /* Hide desktop navigation */
  .header-nav {
    display: none !important;
  }
  
  /* Hide desktop locale selector */
  .locale-selector {
    display: none !important;
  }
  
  /* Header adjustments - Fixed for mobile */
  .header {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }
  
  .header-brand {
    flex-shrink: 0;
  }
  
  .header-search-container {
    flex: 1;
    margin: 0 0.75rem;
    max-width: none;
    min-width: 0;
  }
  
  /* Search bar smaller on mobile */
  .global-search-input {
    font-size: 0.8125rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
  }
  
  /* Show guides mobile selector, hide desktop sidebar */
  .guides-mobile-selector {
    display: block;
    margin: 0;
    width: 100%;
    position: fixed;
    top: 57px; /* Height of the mobile header (padding 24px + logo 32px + border 1px) */
    left: 0;
    right: 0;
    z-index: 99;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-top: none;
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
  }
  
  /* Add padding to compensate for fixed selector */
  .guides-container {
    padding-top: 50px; /* Height of the fixed selector */
  }
  
  .guides-sidebar {
    display: none !important;
  }
  
  /* Guides layout adjustments */
  .guides-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 64px);
  }
  
  body.guides-view-active .guides-layout {
    height: auto;
    min-height: calc(100vh - 64px);
  }
  
  body.guides-view-active {
    height: auto;
    overflow-y: auto;
  }
  
  body.guides-view-active .main {
    height: auto;
    overflow: visible;
  }
  
  .guides-content-area {
    height: auto;
    min-height: 100%;
    padding-top: 0;
    overflow-y: visible;
  }
  
  /* Guide tabs bar */
  .guide-tabs-bar {
    padding: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .guide-tab-header {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
  }
  
  /* Breadcrumbs */
  .guides-breadcrumbs {
    padding: 0.5rem 1rem;
  }
  
  .guides-breadcrumbs-inner {
    max-width: 100%;
    font-size: 0.8125rem;
    flex-wrap: wrap;
  }
  
  /* Content wrapper */
  .guides-content-markdown-wrapper {
    padding: 0.5rem 1rem 2rem;
  }
  
  .guides-content-inner {
    max-width: 100%;
  }
  
  /* Code blocks */
  .guides-content-markdown pre {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  
  .guides-content-markdown pre code {
    white-space: pre-wrap;
    word-break: break-all;
  }
  
  .guides-content-markdown code {
    word-break: break-all;
  }
  
  /* Tables */
  .guides-content-markdown table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }
  
  /* Images */
  .guides-content-markdown img {
    max-width: 100%;
    height: auto;
  }
  
  /* General content overflow */
  .guides-content-markdown {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  .guides-content-markdown * {
    max-width: 100%;
  }
}

/* Tablet/Small laptop - 800px */
@media (max-width: 800px) {
  /* Content container 95% width */
  .guides-container {
    padding: 0;
    padding-top: 50px; /* Keep space for fixed selector */
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
  }
  
  .guides-layout {
    width: 100%;
  }
  
  .guides-content-area {
    width: 100%;
    margin: 0;
  }
  
  .guides-breadcrumbs {
    padding: 0.5rem 0;
  }
  
  .guides-content-markdown-wrapper {
    padding: 0.5rem 0 2rem;
  }
  
  .guides-breadcrumbs-inner,
  .guides-content-inner {
    max-width: 100%;
    width: 100%;
  }
  
  /* Main content adjustments */
  .main {
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
  }
  
  /* Wizard container */
  .wizard-progress {
    width: 100%;
  }
  
  .wizard-layout {
    width: 100%;
  }
  
  /* Wizard adjustments */
  .wizard-layout {
    flex-direction: column;
  }
  
  .wizard-main,
  .wizard-example {
    width: 100%;
    max-width: 100%;
  }
  
  .wizard-progress {
    padding: 1rem;
  }
  
  .wizard-container {
    padding: 1rem;
  }
  
  /* Step options */
  .step-options {
    grid-template-columns: 1fr;
  }
  
  .option-card {
    padding: 1rem;
  }
  
  /* API layout */
  .api-container {
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    padding: 0;
    padding-top: 50px; /* Keep space for fixed selector */
    overflow-x: clip;
  }
  
  .api-layout {
    grid-template-columns: 1fr;
    overflow-x: clip;
  }
  
  .api-sidebar {
    display: none;
  }
  
  .api-mobile-selector {
    margin: 0;
    width: 100%;
    /* position: fixed already set in 900px breakpoint */
  }
  
  .api-content {
    padding: 0;
    overflow-x: clip;
    max-width: 100%;
  }
  
  .api-row,
  .api-stripe-row {
    grid-template-columns: 1fr;
    overflow-x: clip;
  }
  
  .api-col-left,
  .api-col-right {
    padding: 1rem;
    overflow-x: clip;
    max-width: 100%;
  }
  
  /* API code blocks and pre */
  .api-col-right pre,
  .api-content pre {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  
  .api-col-right code,
  .api-content code {
    word-break: break-all;
  }
  
  /* API endpoint path */
  .api-endpoint-path,
  .api-path {
    word-break: break-all;
    overflow-wrap: break-word;
  }
  
  /* API tables */
  .api-content table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }
  
  /* Features layout */
  .features-container {
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    padding: 0;
    overflow-x: hidden;
  }
}

/* Small mobile - 480px */
@media (max-width: 480px) {
  .header {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  /* Adjust padding for smaller header */
  .main {
    padding-top: 49px; /* Smaller fixed header */
  }
  
  .header-brand .brand {
    display: none;
  }
  
  .header-search-container {
    margin: 0 0.5rem;
  }
  
  .global-search-input {
    font-size: 0.75rem;
  }
  
  .mobile-menu {
    width: 100%;
    right: -100%;
  }
  
  .guides-mobile-selector,
  .api-mobile-selector {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
    top: 49px; /* Smaller header height at 480px (padding 16px + logo 32px + border 1px) */
  }
  
  /* Adjust padding for smaller header */
  .api-container,
  .guides-container {
    padding-top: 42px; /* Smaller selector padding */
  }
  
  /* Tabs adjustments for small mobile */
  .conditional-tab-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .conditional-tabs-content {
    padding: 0.75rem;
  }
  
  /* Table adjustments for small mobile */
  .markdown-preview-content table th,
  .markdown-preview-content table td,
  .guides-content-markdown table th,
  .guides-content-markdown table td,
  .feature-modal-markdown table th,
  .feature-modal-markdown table td {
    padding: 0.5rem;
    font-size: 0.75rem;
    max-width: 150px;
    min-width: 80px;
  }
  
  .markdown-preview-content table th,
  .guides-content-markdown table th,
  .feature-modal-markdown table th {
    font-size: 0.65rem;
  }
  
  /* API adjustments for small mobile */
  .api-endpoint-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .api-endpoint-path {
    font-size: 0.75rem;
    word-break: break-all;
  }
  
  .api-method-badge {
    font-size: 0.5rem;
  }
  
  /* Typography adjustments */
  .guides-content-markdown h1 {
    font-size: 1.5rem;
  }
  
  .guides-content-markdown h2 {
    font-size: 1.25rem;
  }
  
  .guides-content-markdown h3 {
    font-size: 1.125rem;
  }
  
  .guides-content-markdown {
    font-size: 0.9375rem;
  }
  
  .guides-content-markdown pre {
    font-size: 0.8125rem;
    padding: 0.75rem;
  }
  
  .guides-content-markdown code {
    font-size: 0.8125rem;
  }
  
  /* Wizard typography */
  .step-question {
    font-size: 1.25rem;
  }
  
  .step-description {
    font-size: 0.875rem;
  }
  
  /* Plan summary */
  .plan-summary-grid {
    grid-template-columns: 1fr;
  }
  
  .plan-title {
    font-size: 1.5rem;
  }
}

/* ============================================
   LIGHT THEME ADDITIONAL ADJUSTMENTS
   ============================================ */

/* Shadows are softer in light mode */
:root[data-theme="light"] .search-results,
:root[data-theme="light"] .feature-modal-content,
:root[data-theme="light"] .toast {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Loading screen in light mode */
:root[data-theme="light"] .loading-screen {
  background: var(--bg);
}

/* Mobile menu in light mode */
:root[data-theme="light"] .mobile-menu {
  background: var(--bg-card);
}

/* Scrollbars in light mode */
:root[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 100, 0.3);
}

:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.5);
}

/* Code blocks in light mode */
:root[data-theme="light"] pre,
:root[data-theme="light"] code {
  background: var(--code-bg);
  border-color: var(--code-border);
}

/* API Reference code blocks always stay dark */
:root[data-theme="light"] .api-code-block,
:root[data-theme="light"] .api-code-section pre,
:root[data-theme="light"] .api-curl-block,
:root[data-theme="light"] #api-content pre,
:root[data-theme="light"] #api-view pre {
  background: #1a1a2e !important;
  border-color: #2d2d44 !important;
  color: #f8f8f2 !important;
}

:root[data-theme="light"] .api-code-block code,
:root[data-theme="light"] .api-code-section code,
:root[data-theme="light"] .api-curl-block code,
:root[data-theme="light"] #api-content pre code,
:root[data-theme="light"] #api-view pre code {
  background: transparent !important;
  color: #f8f8f2 !important;
}

/* Keep JSON syntax highlighting colors in light mode for API */
:root[data-theme="light"] .api-code-block .json-string,
:root[data-theme="light"] #api-view .json-string {
  color: #50fa7b !important;
}

:root[data-theme="light"] .api-code-block .json-number,
:root[data-theme="light"] #api-view .json-number {
  color: #bd93f9 !important;
}

:root[data-theme="light"] .api-code-block .json-boolean,
:root[data-theme="light"] #api-view .json-boolean {
  color: #ff79c6 !important;
}

:root[data-theme="light"] .api-code-block .json-null,
:root[data-theme="light"] #api-view .json-null {
  color: #6272a4 !important;
}

:root[data-theme="light"] .api-code-block .json-bracket,
:root[data-theme="light"] #api-view .json-bracket {
  color: #f8f8f2 !important;
}

:root[data-theme="light"] .api-code-block .json-key,
:root[data-theme="light"] #api-view .json-key {
  color: #8be9fd !important;
}

:root[data-theme="light"] .api-code-header {
  background: #12121a !important;
  border-color: #2d2d44 !important;
}

:root[data-theme="light"] .api-code-lang {
  color: #a0a0a0 !important;
}

/* Callouts in light mode */
:root[data-theme="light"] .callout.callout-warning {
  background: rgba(202, 138, 4, 0.08);
  border-color: rgba(202, 138, 4, 0.3);
}

:root[data-theme="light"] .callout.callout-info {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
}

:root[data-theme="light"] .callout.callout-error,
:root[data-theme="light"] .callout.callout-danger {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
}

:root[data-theme="light"] .callout.callout-success {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.3);
}

/* Wizard cards in light mode */
:root[data-theme="light"] .option-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .option-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .option-card.selected {
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
}

/* Feature modal in light mode */
:root[data-theme="light"] .feature-modal-container {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* API method badges - keep them visible */
:root[data-theme="light"] .method-badge.get {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

:root[data-theme="light"] .method-badge.post {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

:root[data-theme="light"] .method-badge.put {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}

:root[data-theme="light"] .method-badge.patch {
  background: rgba(168, 85, 247, 0.15);
  color: #9333ea;
}

:root[data-theme="light"] .method-badge.delete {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

/* Progress bar gradient */
:root[data-theme="light"] .progress-fill {
  background: var(--gradient);
}

/* Tabs in light mode */
:root[data-theme="light"] .conditional-tab-header.active {
  background: var(--bg-selected);
  border-color: var(--accent);
}

/* Forms in light mode */
:root[data-theme="light"] .form-input,
:root[data-theme="light"] .form-select,
:root[data-theme="light"] .form-textarea {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}

:root[data-theme="light"] .form-input:focus,
:root[data-theme="light"] .form-select:focus,
:root[data-theme="light"] .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Toast notifications */
:root[data-theme="light"] .toast {
  background: var(--bg-card);
  border-color: var(--border);
}

/* Page title color adjustment */
:root[data-theme="light"] #page-title {
  color: #2563eb !important;
}

/* Transitions for smooth theme switching */
body,
.header,
.main,
.sidebar,
.content,
.card,
.modal,
pre,
code,
.callout,
.toast,
.form-input,
.form-select,
.btn {
  transition: background-color 0.3s ease, 
              border-color 0.3s ease, 
              color 0.3s ease,
              box-shadow 0.3s ease;
}

/* ============================================
   REACT FLOW DIAGRAM EDITOR STYLES
   ============================================ */

.diagram-wrapper {
  margin: 20px 0;
  width: 100%;
}

.diagram-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--text);
}

.diagram-container {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  overflow: hidden;
}

.diagram-container .react-flow {
  background: var(--bg-card);
}

.diagram-container .react-flow__pane {
  cursor: grab;
}

.diagram-container .react-flow__pane:active {
  cursor: grabbing;
}

/* React Flow Controls - compact size */
.diagram-container .react-flow__controls {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.diagram-container .react-flow__controls-button {
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  width: 20px;
  height: 20px;
  padding: 3px;
}

.diagram-container .react-flow__controls-button:hover {
  background: var(--bg-hover);
}

.diagram-container .react-flow__controls-button:last-child {
  border-bottom: none;
}

.diagram-container .react-flow__controls-button svg {
  fill: var(--text);
  width: 12px;
  height: 12px;
}

/* React Flow Background */
.diagram-container .react-flow__background {
  background: var(--bg-card);
}

/* React Flow Edges */
.diagram-container .react-flow__edge-path {
  stroke: var(--border);
  stroke-width: 2;
}

.diagram-container .react-flow__edge.selected .react-flow__edge-path {
  stroke: var(--accent);
  stroke-width: 3;
}

.diagram-container .react-flow__edge-text {
  fill: var(--text-muted);
  font-size: 11px;
}

/* React Flow Edge Labels */
.diagram-container .react-flow__edge-textwrapper {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
}

/* React Flow Connection Line */
.diagram-container .react-flow__connection-line {
  stroke: var(--accent);
  stroke-width: 2;
}

/* Property Panel Styles */
.diagram-property-panel {
  width: 200px;
  border-left: 1px solid var(--border);
  background: var(--bg-secondary);
  overflow-y: auto;
  font-size: 13px;
}

.diagram-property-panel input[type="text"],
.diagram-property-panel input[type="color"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text);
  box-sizing: border-box;
}

.diagram-property-panel input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.diagram-property-panel label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.diagram-property-panel button {
  transition: all 0.2s ease;
}

.diagram-property-panel button:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Color Palette Swatches */
.diagram-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.diagram-color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.diagram-color-swatch.selected {
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.3);
}

/* Loading State */
.diagram-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-secondary);
  z-index: 5;
}

.diagram-loading-spinner {
  font-size: 24px;
  margin-bottom: 8px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Error State */
.diagram-error-display {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 235, 238, 0.95);
  color: #c62828;
  padding: 20px;
  text-align: center;
  z-index: 10;
}

/* Light theme adjustments */
:root[data-theme="light"] .diagram-container {
  background: #f6f8fa;
  border-color: #e0e0e0;
}

:root[data-theme="light"] .diagram-container .react-flow {
  background: #f6f8fa;
}

:root[data-theme="light"] .diagram-container .react-flow__background pattern circle {
  fill: #C0C8D2;
}

:root[data-theme="light"] .diagram-property-panel {
  background: #f5f5f5;
}

:root[data-theme="light"] .diagram-property-panel input {
  background: #ffffff;
  border-color: #e0e0e0;
}

/* Edit mode indicator */
.diagram-edit-mode-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 100;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   END REACT FLOW DIAGRAM EDITOR STYLES
   ============================================ */

/* ============================================
   MARKDOWN COLUMNS LAYOUT
   ============================================ */

/* Base columns container - DESKTOP */
.md-columns {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch !important; /* Critical for valign to work */
  gap: 1.5rem;
  margin: 1.5rem 0;
  width: 100%;
}

/* Base column - DESKTOP */
.md-column {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0;
  box-sizing: border-box;
}

/* Optional sticky column (e.g. explanation side next to a code block) */
.md-column-has-sticky {
  /* Column with sticky content needs proper alignment */
  align-items: flex-start !important;
  /* CRITICAL: Remove any overflow that breaks sticky */
  overflow: visible !important;
}

.md-column-sticky {
  /* Stripe-like sticky behavior: stays in view while scrolling the companion column */
  position: sticky !important;
  top: 80px; /* Offset from top to account for header */
  align-self: flex-start;
  /* Constrain height to viewport minus header */
  max-height: calc(100vh - 100px);
  /* ALLOW internal scroll while maintaining sticky position */
  overflow-y: auto !important;
  overflow-x: hidden !important;
  /* Re-enable touch scrolling for internal content */
  touch-action: auto;
  /* Show scrollbars for internal scroll */
  scrollbar-width: thin;
  -ms-overflow-style: auto;
}

.md-column-sticky::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.md-column-sticky::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.md-column-sticky::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

.md-column-sticky::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Stripe-like columns sync container */
.md-columns.stripe-sync-enabled {
  position: relative;
  /* CRITICAL: Allow sticky to work */
  overflow: visible !important;
}

/* Ensure parent containers don't break sticky */
.guides-content-markdown .md-columns {
  overflow: visible !important;
}

.guides-content-markdown .md-column {
  /* Don't clip content which breaks sticky */
  overflow: visible !important;
}

/* Stripe-like columns: code column (non-sticky) */
.md-columns .md-column-code-sync {
  scroll-behavior: smooth;
}

/* Reverse direction modifier */
.md-columns-reverse {
  flex-direction: row-reverse;
}

/* Vertical alignment classes - need !important to override inline styles */
.md-column-valign-top {
  justify-content: flex-start !important;
}

.md-column-valign-center {
  justify-content: center !important;
}

.md-column-valign-bottom {
  justify-content: flex-end !important;
}

.md-column-valign-stretch {
  justify-content: stretch !important;
}

.md-column-valign-stretch > * {
  flex: 1;
}

/* Reset margins for centered/bottom aligned columns */
.md-column-valign-center > *,
.md-column-valign-bottom > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  flex-shrink: 0;
}

.md-column-valign-center > pre,
.md-column-valign-center > .highlight,
.md-column-valign-bottom > pre,
.md-column-valign-bottom > .highlight {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Code blocks in columns */
.md-column pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 0;
}

/* Diagrams in columns */
.md-column .diagram-wrapper {
  margin: 0;
  height: 100%;
}

.md-column .diagram-container {
  height: 100%;
  min-height: 400px;
}

/* Code + explanation sync annotations - Stripe-like */
.code-annotation {
  margin: 0.375rem 0;
  padding: 0.5rem 1rem 0.5rem 1.25rem;
  border-left: 3px solid var(--border);
  border-radius: 0 6px 6px 0;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-size: 0.875rem;
  line-height: 1.4;
}

.code-annotation::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.code-annotation:hover {
  background: rgba(96, 175, 220, 0.06);
  border-left-color: rgba(96, 175, 220, 0.4);
}

.code-annotation:hover::before {
  transform: scaleY(1);
}

.code-annotation-active {
  background: rgba(96, 175, 220, 0.1);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(96, 175, 220, 0.15);
}

.code-annotation-active::before {
  transform: scaleY(1);
  background: var(--accent);
}

/* Stripe-like indicator dot */
.code-annotation-active::after {
  content: '';
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(96, 175, 220, 0.5);
  animation: stripe-pulse 2s ease-in-out infinite;
}

@keyframes stripe-pulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.7; transform: translateY(-50%) scale(0.9); }
}

/* Enhanced code blocks with per-line spans + line numbers - Stripe-like */
.guides-content-markdown pre[data-code-id] {
  position: relative;
  padding: 0.75rem 1rem;
  scroll-behavior: smooth;
}

.guides-content-markdown pre[data-code-id] .code-block-inner {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.guides-content-markdown pre[data-code-id] .code-line {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 4px;
}

.guides-content-markdown pre[data-code-id] .code-line:hover {
  background: rgba(96, 175, 220, 0.05);
}

.guides-content-markdown pre[data-code-id] .code-line-number {
  min-width: 2.25rem;
  text-align: right;
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
  transition: all 0.2s ease;
}

.guides-content-markdown pre[data-code-id] .code-line-content {
  flex: 1;
  white-space: pre;
  transition: all 0.2s ease;
}

/* Stripe-like highlight - SMOOTH TRANSITIONS (no animation to prevent flickering) */
.guides-content-markdown pre[data-code-id] .code-line-highlight {
  background: rgba(96, 175, 220, 0.12);
  /* Use transition instead of animation for smoother highlight changes */
  transition: background 0.15s ease-out;
}

.guides-content-markdown pre[data-code-id] .code-line-highlight .code-line-content {
  background: transparent;
}

.guides-content-markdown pre[data-code-id] .code-line-highlight .code-line-number {
  color: #60afdc;
  opacity: 1;
  font-weight: 600;
  transition: color 0.15s ease-out, opacity 0.15s ease-out;
}

/* First and last highlighted lines get rounded corners */
.guides-content-markdown pre[data-code-id] .code-line-highlight-first {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.guides-content-markdown pre[data-code-id] .code-line-highlight-last {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Stripe-like left border indicator for highlighted range - with smooth appearance */
.guides-content-markdown pre[data-code-id] .code-line-highlight::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #60afdc;
  opacity: 1;
  transition: opacity 0.15s ease-out;
}

/* Ensure non-highlighted lines have transparent "before" for smooth transitions */
.guides-content-markdown pre[data-code-id] .code-line::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #60afdc;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

/* Scrollable column variant */
.md-column-scroll {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.md-column-scroll::-webkit-scrollbar {
  width: 6px;
}

.md-column-scroll::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.md-column-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.md-column-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========== MOBILE: Stack columns vertically ========== */
@media screen and (max-width: 768px) {
  .md-columns {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 1.5rem !important;
  }
  
  .md-column {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Disable sticky on mobile where columns stack */
  .md-column-sticky {
    position: static;
    top: auto;
  }
  
  /* Reset vertical alignment on mobile */
  .md-column-valign-center,
  .md-column-valign-bottom {
    justify-content: flex-start !important;
  }
  
  /* Reverse should still work on mobile */
  .md-columns-reverse {
    flex-direction: column-reverse !important;
  }
}

/* ============================================
   END MARKDOWN COLUMNS LAYOUT
   ============================================ */

/* ============================================
   API EMBED - Embedded API Reference in Guides
   ============================================ */

.api-embed {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Integrate with guides content */
.guides-content-markdown .api-embed {
  margin: 1.5rem 0;
}

.api-embed-compact {
  border-radius: 6px;
}

.api-embed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.api-embed-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: api-embed-spin 0.8s linear infinite;
}

@keyframes api-embed-spin {
  to { transform: rotate(360deg); }
}

.api-embed-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  font-size: 0.875rem;
}

.api-embed-error code {
  background: rgba(239, 68, 68, 0.15);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.8125rem;
}

.api-embed-content {
  padding: 0;
}

/* Header with method and path */
.api-embed-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.api-embed-method {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.3125rem 0.625rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}

.api-embed-method.method-get {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.api-embed-method.method-post {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.api-embed-method.method-put {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border-color: rgba(234, 179, 8, 0.3);
}

.api-embed-method.method-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.api-embed-method.method-patch {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.3);
}

.api-embed-path {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  color: var(--text);
  background: transparent;
  flex: 1;
  min-width: 0;
  word-break: break-all;
  line-height: 1.4;
}

.api-embed-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  color: var(--text-muted);
  border-radius: 4px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.api-embed-link:hover {
  color: var(--accent);
  background: var(--bg-selected);
}

.api-embed-title {
  padding: 0.75rem 1.25rem 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

.api-embed-summary {
  padding: 0.5rem 1.25rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Section titles */
.api-embed-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.875rem 1.25rem 0.625rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

/* Parameters section */
.api-embed-params {
  padding: 0 1.25rem 1rem;
}

.api-embed-params-group {
  margin-bottom: 1rem;
}

.api-embed-params-group:last-child {
  margin-bottom: 0;
}

.api-embed-params-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

/* Parameter items */
.api-embed-param {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.api-embed-param:last-child {
  border-bottom: none;
}

.api-embed-param:hover {
  background-color: var(--bg-hover);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 4px;
}

.api-embed-param.depth-1 {
  margin-left: 0.75rem;
}

.api-embed-param.depth-2 {
  margin-left: 1.5rem;
}

.api-embed-param-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  line-height: 1.5;
}

.api-embed-param-header.expandable {
  cursor: pointer;
  user-select: none;
}

.api-embed-param-header.expandable:hover {
  opacity: 0.9;
}

.api-embed-param-header.expandable:active {
  opacity: 0.7;
}

.api-embed-expand-icon {
  font-size: 0.625rem;
  color: var(--text-muted);
  width: 0.75rem;
  display: inline-block;
  user-select: none;
}

.api-embed-param-name {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.api-embed-param-required {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  padding: 0.1875rem 0.4375rem;
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border-radius: 3px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  white-space: nowrap;
}

.api-embed-param-type {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  white-space: nowrap;
}

.api-embed-param-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  line-height: 1.5;
  padding-left: 1.5rem;
}

.api-embed-param-children {
  margin-top: 0.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
  margin-left: 0.75rem;
}

.api-embed-array-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.25rem 0;
}

/* Enum values */
.api-embed-enum {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.375rem;
  flex-wrap: wrap;
}

.api-embed-enum-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  padding-top: 0.125rem;
}

.api-embed-enum-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.api-embed-enum-value {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.6875rem;
  padding: 0.1875rem 0.4375rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 3px;
  font-weight: 500;
}

/* Body section */
.api-embed-body {
  padding-bottom: 0.5rem;
}

.api-embed-body .api-embed-param:first-of-type {
  padding-top: 0;
}

/* Array indicator */
.api-embed-array-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.api-embed-array-badge {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
  border-radius: 3px;
  letter-spacing: 0.05em;
}

/* Response section */
.api-embed-response {
  padding-bottom: 1rem;
}

.api-embed-response-code {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
}

.api-embed-response-code-badge {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

.api-embed-response-code-badge.code-2xx {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.api-embed-response-code-badge.code-4xx {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.api-embed-response-code-badge.code-5xx {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.api-embed-response-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.api-embed-empty {
  padding: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Compact mode adjustments */
.api-embed-compact .api-embed-header {
  padding: 0.75rem 1rem;
}

.api-embed-compact .api-embed-params,
.api-embed-compact .api-embed-body,
.api-embed-compact .api-embed-response {
  padding-left: 1rem;
  padding-right: 1rem;
}

.api-embed-compact .api-embed-section-title {
  padding-left: 1rem;
  padding-right: 1rem;
}

.api-embed-compact .api-embed-param {
  padding: 0.375rem 0;
}

/* Light theme adjustments */
:root[data-theme="light"] .api-embed {
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .api-embed-header {
  background: var(--bg-hover);
}

:root[data-theme="light"] .api-embed-enum-value {
  background: rgba(59, 130, 246, 0.08);
}

/* Better spacing and visual hierarchy */
.api-embed-title {
  margin-bottom: 0.25rem;
}

.api-embed-summary {
  margin-bottom: 0.5rem;
}

/* Response section improvements */
.api-embed-response-code {
  margin-bottom: 0.5rem;
}

.api-embed-response-code:not(:first-child) {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Empty state */
.api-embed-empty {
  padding: 1rem 1.25rem;
  text-align: center;
  font-style: italic;
  color: var(--text-muted);
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
  .api-embed {
    margin: 1rem 0;
    border-radius: 6px;
  }
  
  .api-embed-header {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  
  .api-embed-path {
    flex-basis: 100%;
    order: 3;
    margin-top: 0.5rem;
    word-break: break-all;
    font-size: 0.75rem;
  }
  
  .api-embed-link {
    order: 2;
  }
  
  .api-embed-params,
  .api-embed-body,
  .api-embed-response {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .api-embed-section-title {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Width options */
.api-embed-width-full {
  width: 100%;
}

.api-embed-width-auto {
  width: auto;
  display: inline-block;
  max-width: 100%;
}

/* Super compact link-only mode */
.api-embed-link-only {
  padding: 0;
}

.api-embed-link-summary-top {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.25rem 1rem 0.25rem;
  line-height: 1.4;
}

.api-embed-link-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.api-embed-link-wrapper:hover {
  background: var(--bg-hover);
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.api-embed-link-wrapper:active {
  transform: translateY(0);
}

.api-embed-link-wrapper .api-embed-method {
  flex-shrink: 0;
}

.api-embed-link-wrapper .api-embed-path {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: var(--text);
}


.api-embed-link-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all 0.2s ease;
  opacity: 0.6;
}

.api-embed-link-wrapper:hover .api-embed-link-icon {
  color: var(--accent);
  opacity: 1;
  transform: translate(2px, -2px);
}

/* Compact link-only mode adjustments */
.api-embed-link-only .api-embed-link-wrapper {
  padding: 0.625rem 0.875rem;
}

/* Mobile adjustments for link-only */
@media screen and (max-width: 768px) {
  .api-embed-link-wrapper {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .api-embed-link-wrapper .api-embed-path {
    flex-basis: 100%;
    order: 2;
    font-size: 0.75rem;
  }
  
  .api-embed-link-summary-top {
    font-size: 0.75rem;
  }
  
  .api-embed-link-icon {
    order: 1;
    margin-left: auto;
  }
}

/* ============================================
   END API EMBED STYLES
   ============================================ */
