/**
 * MafLabs Tool Design System
 * Light-theme only, pure CSS with soft ambient mesh glow, glassmorphism,
 * split-screen workspace with draggable divider, accessible forms & typography.
 */

@import url('fonts/fonts.css');

:root {
  /* Colors */
  --heading: #0f172a;
  --body: #475569;
  --muted: #64748b;
  --brand-blue: #2563eb;
  --brand-violet: #7c3aed;
  --brand-gradient: linear-gradient(90deg, #2563eb, #7c3aed);
  
  --badge-bg: #eff6ff;
  --badge-border: #bfdbfe;
  --badge-text: #1d4ed8;

  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: #e2e8f0;
  --card-surface: #ffffff;
  --card-surface-low: #f8fafc;
  --card-surface-high: #f1f5f9;

  /* Status Colors */
  --success-text: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;

  --warning-text: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --error-text: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;

  /* Elevation & Borders */
  --radius-card: 14px;
  --radius-btn: 10px;
  --radius-input: 8px;
  --radius-full: 9999px;
  --shadow-card: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-elevated: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-btn: 0 6px 16px rgba(79, 70, 229, 0.28);
  --focus-ring: 0 0 0 4px rgba(37, 99, 235, 0.15);

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #ffffff;
  background-image:
    radial-gradient(circle at 10% 15%, rgba(169, 214, 245, 0.55) 0px, transparent 55%),
    radial-gradient(circle at 90% 30%, rgba(227, 201, 243, 0.45) 0px, transparent 48%),
    linear-gradient(180deg, transparent 75%, #ffffff 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--body);
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Focus styles */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Ambient Background Blobs (Fixed across entire viewport) */
.blob-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  -webkit-filter: blur(80px);
  opacity: 0.85;
  will-change: transform;
}

.blob-1 {
  top: -12vh;
  left: -8vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.32) 0%, rgba(59, 130, 246, 0.16) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-1 20s infinite ease-in-out alternate;
}

.blob-2 {
  top: -10vh;
  right: -10vw;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.28) 0%, rgba(168, 85, 247, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-2 24s infinite ease-in-out alternate;
}

.blob-3 {
  bottom: -15vh;
  left: -10vw;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(14, 165, 233, 0.14) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-3 22s infinite ease-in-out alternate;
}

.blob-4 {
  bottom: -10vh;
  right: -8vw;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(236, 72, 153, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-4 26s infinite ease-in-out alternate;
}

@keyframes blob-float-1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5vw, 6vh) scale(1.06); }
  100% { transform: translate(-3vw, 10vh) scale(0.96); }
}

@keyframes blob-float-2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vw, 8vh) scale(1.08); }
  100% { transform: translate(4vw, 5vh) scale(0.94); }
}

@keyframes blob-float-3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, -8vh) scale(1.06); }
  100% { transform: translate(-4vw, -4vh) scale(0.95); }
}

@keyframes blob-float-4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, -6vh) scale(1.08); }
  100% { transform: translate(6vw, -10vh) scale(0.95); }
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

p {
  color: var(--body);
  line-height: 1.6;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-violet);
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
}

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  min-height: 44px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
  filter: brightness(1.04);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--card-border);
  color: var(--heading);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.btn-secondary:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: #fafcff;
}

.btn-icon {
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-btn);
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-icon:hover {
  color: var(--heading);
  border-color: #cbd5e1;
  background: var(--card-surface-low);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  line-height: 1;
}

.badge-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-blue);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Glassmorphism Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.header-container {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #f3e8ff);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
}

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

.nav-link {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--card-surface-high);
  color: var(--heading);
}

.nav-link.active {
  background: var(--badge-bg);
  color: var(--brand-blue);
  font-weight: 600;
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--heading);
  padding: 0.5rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-drawer {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 1.5rem;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 49;
  box-shadow: var(--shadow-elevated);
}

.mobile-menu-drawer.open {
  display: flex;
}

/* ==========================================================================
   COMPACT HERO (under 140px on desktop)
   ========================================================================== */
.hero-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-section h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0.375rem 0 0.25rem;
}

.hero-subtitle {
  font-size: 0.9375rem;
  color: var(--body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

/* ==========================================================================
   WORKSPACE TOOLBAR
   ========================================================================== */
.workspace-toolbar-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0.375rem 1.5rem;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.input-group {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--card-surface-low);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-input);
  padding: 0.25rem 0.5rem;
  height: 38px;
}

.input-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-input {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--heading);
  outline: none;
  width: 130px;
}

/* Toggle Switch */
.toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  padding: 0 0.25rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 20px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--brand-gradient);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* Options Popover */
.popover-container {
  position: relative;
}

.popover-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elevated);
  padding: 1rem;
  z-index: 60;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.popover-card.open {
  display: flex;
}

.popover-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  font-size: 0.8125rem;
  min-height: 32px;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--brand-blue);
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   SPLIT SCREEN WORKSPACE
   ========================================================================== */
.workspace-wrapper {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Progress bar for worker */
.progress-bar-container {
  width: 100%;
  height: 3px;
  background: transparent;
  overflow: hidden;
  position: relative;
  border-radius: 2px;
  margin-bottom: 0.25rem;
  display: none;
}

.progress-bar-container.active {
  display: block;
  background: rgba(37, 99, 235, 0.1);
}

.progress-bar-fill {
  height: 100%;
  background: var(--brand-gradient);
  width: 0%;
  transition: width 0.2s ease;
}

.workspace-split {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: calc(100dvh - 230px);
  min-height: 560px;
  position: relative;
  gap: 0;
}

.workspace-pane {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  height: 100%;
  position: relative;
}

.split-left {
  flex: 0 0 calc(50% - 6px);
  width: calc(50% - 6px);
  min-width: 25%;
}

.split-right {
  flex: 0 0 calc(50% - 6px);
  width: calc(50% - 6px);
  min-width: 25%;
}

/* Draggable divider */
.split-divider {
  width: 12px;
  cursor: col-resize;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 20;
  user-select: none;
  touch-action: none;
}

.split-divider::after {
  content: "";
  width: 4px;
  height: 36px;
  border-radius: 2px;
  background: #cbd5e1;
  transition: background 0.15s ease, height 0.15s ease;
}

.split-divider:hover::after,
.split-divider.dragging::after {
  background: var(--brand-blue);
  height: 48px;
}

/* Pane Header & Footer */
.pane-header {
  padding: 0.625rem 1rem;
  background: var(--card-surface-low);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pane-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pane-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--heading);
}

.pane-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.pane-btn {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--body);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  min-height: 32px;
  transition: all 0.15s ease;
}

.pane-btn:hover {
  background: var(--card-surface-high);
  color: var(--heading);
  border-color: #cbd5e1;
}

.pane-footer {
  padding: 0.5rem 1rem;
  background: var(--card-surface-low);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
}

.pane-footer-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Left Pane: Editor Body */
.editor-body-container {
  flex: 1 1 0;
  display: flex;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.line-gutter {
  width: 44px;
  background: var(--card-surface-low);
  border-right: 1px solid var(--card-border);
  padding: 0.875rem 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #94a3b8;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre-wrap;
}

.editor-textarea {
  flex: 1 1 0;
  border: none;
  outline: none;
  padding: 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--heading);
  background: transparent;
  resize: none;
  overflow-y: auto;
  tab-size: 2;
  white-space: pre;
}

/* Drag & Drop Overlay */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0.92);
  color: #ffffff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 30;
  backdrop-filter: blur(4px);
}

.drop-overlay.active {
  display: flex;
}

/* Error banner */
.editor-error-banner {
  padding: 0.5rem 1rem;
  background: var(--error-bg);
  border-bottom: 1px solid var(--error-border);
  color: var(--error-text);
  font-size: 0.8125rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.editor-error-banner.active {
  display: flex;
}

/* Right Pane: Format Selector Tabs */
.tabs-scroll-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: var(--card-surface-low);
  border-bottom: 1px solid var(--card-border);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.tabs-scroll-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--body);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 34px;
}

.tab-btn:hover {
  background: var(--card-surface-high);
  color: var(--heading);
}

.tab-btn.active {
  background: var(--badge-bg);
  color: var(--brand-blue);
  border-color: var(--badge-border);
  font-weight: 600;
}

/* Strict Mode Notice Banner */
.strict-notice-banner {
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 0.5rem;
}

.strict-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--brand-blue);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}

/* Output Code Surface */
.output-body-container {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.output-code {
  flex: 1 1 0;
  padding: 1rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #f1f5f9;
  background: #090d16;
  overflow: auto;
  tab-size: 2;
  white-space: pre;
}

/* Warnings list inside output pane */
.schema-warnings-box {
  padding: 0.5rem 1rem;
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-border);
  color: var(--warning-text);
  font-size: 0.8125rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.schema-warnings-box.active {
  display: flex;
}

/* Collapsible Drawers (Fields Inspector & Test Output) */
.collapsible-drawer {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  padding: 1rem;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
}

.collapsible-drawer.open {
  display: block;
}

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

.drawer-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Field Inspector Table */
.inspector-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.inspector-table th {
  text-align: left;
  padding: 0.375rem 0.5rem;
  background: var(--card-surface-low);
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--card-border);
}

.inspector-table td {
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.inspector-table input[type="text"],
.inspector-table select {
  width: 100%;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  outline: none;
}

.inspector-table input[type="text"]:focus,
.inspector-table select:focus {
  border-color: var(--brand-blue);
}

/* Validator Drawer */
.validator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.validator-input {
  width: 100%;
  height: 120px;
  padding: 0.5rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-input);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  resize: none;
  outline: none;
}

.validator-input:focus {
  border-color: var(--brand-blue);
}

.validator-results-box {
  padding: 0.75rem;
  border-radius: var(--radius-input);
  background: var(--card-surface-low);
  border: 1px solid var(--card-border);
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.8125rem;
}

.conformance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  width: 100%;
}

.conformance-badge.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.conformance-badge.error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}

/* Copied feedback state */
.btn-copied {
  background: var(--success-bg) !important;
  color: var(--success-text) !important;
  border-color: var(--success-border) !important;
}

/* Mobile Sticky Bottom Action Bar (<900px) */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  padding: 0.625rem 1rem;
  z-index: 45;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

/* Fullscreen Focus Mode */
body.focus-mode {
  overflow: hidden;
}

.workspace-split.is-focus-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #ffffff;
  padding: 1rem;
  box-sizing: border-box;
}

/* ==========================================================================
   SEO CONTENT & FAQ SECTION
   ========================================================================== */
.seo-section {
  max-width: 1100px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.seo-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}

.seo-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seo-card h3 {
  font-size: 1.125rem;
  margin: 1.25rem 0 0.5rem;
}

.seo-card p, .seo-card li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--body);
  margin-bottom: 0.875rem;
}

.seo-card ol, .seo-card ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.seo-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.step-card {
  padding: 1.25rem;
  border-radius: 10px;
  background: var(--card-surface-low);
  border: 1px solid var(--card-border);
}

.step-number {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-blue);
  margin-bottom: 0.5rem;
}

/* Before / After Code Comparison Carousel */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}

.code-snippet-box {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  overflow-x: auto;
  line-height: 1.5;
}

.snippet-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

/* FAQ Accordion (<details>) */
.faq-accordion {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  background: #ffffff;
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-accordion summary {
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

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

.faq-accordion summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--brand-blue);
  font-weight: 700;
  transition: transform 0.2s ease;
}

.faq-accordion[open] summary::after {
  content: "−";
}

.faq-accordion-body {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--body);
  line-height: 1.6;
}

/* Related Tools Grid */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.related-tool-card {
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.related-tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-blue);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}

.related-tool-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 0.25rem;
}

.related-tool-desc {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--card-border);
  padding: 2rem 1.5rem;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.footer-bottom {
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   MODALS (Shortcuts etc.)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-card);
  max-width: 480px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--card-border);
}

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

.modal-header h3 {
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--card-surface-high);
  font-size: 0.875rem;
}

kbd {
  background: var(--card-surface-low);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* ==========================================================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ========================================================================== */

/* Under 900px: Stack Panes Vertically */
@media (max-width: 899px) {
  .workspace-split {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .split-left, .split-right {
    width: 100% !important;
    flex: none !important;
    min-height: 60dvh;
    margin-bottom: 1rem;
  }

  .split-divider {
    display: none;
  }

  .mobile-sticky-bar {
    display: flex;
  }

  .workspace-wrapper {
    padding-bottom: 4.5rem;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .validator-grid {
    grid-template-columns: 1fr;
  }
}

/* Under 700px: Hamburger menu */
@media (max-width: 700px) {
  .header-nav {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .hero-section h1 {
    font-size: 1.5rem;
  }

  .seo-card {
    padding: 1.5rem;
  }
}

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